Skip to content

Commit 79e96da

Browse files
Rik Cabaniersvgeesus
authored andcommitted
merge trees
1 parent 5c1ecd8 commit 79e96da

3 files changed

Lines changed: 101 additions & 18 deletions

File tree

css-masking-1/Overview.src.html

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ <h1>CSS Masking Module Level 1</h1>
77
Previous Version: http://www.w3.org/TR/2013/WD-css-masking-20130620/
88
Previous Version: http://www.w3.org/TR/2012/WD-css-masking-20121115/
99
Shortname: css-masking
10-
Link Defaults: css-shapes-1 (property) shape-outside, css-backgrounds-3 (type) <position>, svg (property) color-interpolation/fill-rule/fill/stroke/stroke-width, filters-1 (property) filter, css-display-3 (property) display, css-transforms-1 (property) transform, css-backgrounds-3 (type) <box>
10+
Link Defaults: css-shapes-1 (property) shape-outside, css-backgrounds-3 (type) <position>, svg (property) color-interpolation/fill-rule/fill/stroke/stroke-width, filters-1 (property) filter, css-display-3 (property) display, css-transforms-1 (property) transform, css-backgrounds-3 (type) <box>, css-backgrounds-3 (property) box-decoration-break
1111
Level: 1
1212
Group: fxtf
1313
Editor: Dirk Schulze, Adobe Systems Inc., dschulze@adobe.com
@@ -23,20 +23,25 @@ <h1>CSS Masking Module Level 1</h1>
2323

2424
<h2 id='intro'>Introduction</h2>
2525

26-
With CSS Masking it is possible to specify another graphics element, shape or image file to be used as clipping region or an luminance or alpha mask for compositing the current object into the background.
26+
This specification defines two different graphical operations which both fully or partly hide portions of an object.
2727

28-
The effect of applying a mask is as if the mask images or <i>mask sources</i> are rendered into an off-screen image which has been initialized to transparent black. The graphical object to which the mask is applied will be painted onto the background through the mask, thus completely or partially masking out parts of the graphical object.
29-
30-
Masks are applied using the 'mask-image' or 'mask-box-image-source' properties.
28+
The <b>first operation</b> is called clipping.
3129

32-
The 'mask-image' property may reference a <a>'mask element'</a> as the mask source. Alternatively, for many simple uses, the 'mask-image' property may refer directly to images to be used as mask, forgoing the need for an explicit <a>'mask element'</a> element. The 'mask' property serves as a shorthand property for 'mask-box-image', 'mask-image' and other characterizing properties.
33-
34-
The 'mask-box-image-source' property splits a mask image into 9 pieces. The pieces may be sliced, scaled and stretched in various ways to fit the size of the <i>mask box image area</i>. The 'mask-box-image' property serves as a shorthand property for 'mask-box-image-source' and other characterizing properties.
30+
<div class="example">
31+
<div class=figure>
32+
<img src="images/clipping-path.svg" width="655" height="260" alt="Example Mask">
33+
<p class=caption>
34+
A clipping path (middle) is applied on a polygon shaded with different colors (left). This results in a "clipped out" shape (right).
35+
</p>
36+
</div>
37+
</div>
3538

36-
A <dfn export>clipping path</dfn> defines an outline (in the absence of anti-aliasing) of a visual element where everything on the "inside" of the outline is allowed to show through but everything on the outside is masked out. A clipping path is specified by vector paths or shapes.
39+
A closed vector path, shape or polygon defines a so called <dfn export>clipping path</dfn>. This clipping path is a region (in the absence of anti-aliasing) where everything on the "inside" of this region is allowed to show through but everything on the outside is "clipped out" and does not appear on the canvas.
3740

3841
The 'clip-path' property can reference SVG <a>graphics element</a> or use specified basic shapes as clipping path.
3942

43+
The <b>second operation</b> is called masking.
44+
4045
<div class="example">
4146
<div class=figure>
4247
<img src="images/luminance-mask.svg" width="655" height="260" alt="Example Mask">
@@ -46,6 +51,16 @@ <h2 id='intro'>Introduction</h2>
4651
</div>
4752
</div>
4853

54+
The effect of applying a mask is as if the mask images or <i>mask sources</i> are rendered into an off-screen image which has been initialized to transparent black. The graphical object to which the mask is applied will be painted onto the background through the mask, thus completely or partially masking out parts of the graphical object.
55+
56+
Masks are applied using the 'mask-image' or 'mask-box-image-source' properties.
57+
58+
The 'mask-image' property may reference a <a>'mask element'</a> as the mask source. Alternatively, for many simple uses, the 'mask-image' property may refer directly to images to be used as mask, forgoing the need for an explicit <a>'mask element'</a> element. The 'mask' property serves as a shorthand property for 'mask-box-image', 'mask-image' and other characterizing properties.
59+
60+
The 'mask-box-image-source' property splits a mask image into 9 pieces. The pieces may be sliced, scaled and stretched in various ways to fit the size of the <i>mask box image area</i>. The 'mask-box-image' property serves as a shorthand property for 'mask-box-image-source' and other characterizing properties.
61+
62+
Note: While masking gives many possibilities for enhanced graphical effects and in general provides more control over the "visible portions" of the content, clipping paths can be more performant and are easier to interpolate.
63+
4964
<h2 id="placement">Module interactions</h2>
5065

5166
This specification defines a set of CSS properties that affect the visual rendering of elements to which those properties are applied. These effects are applied after elements have been sized and positioned according to the <a href="http://www.w3.org/TR/CSS2/visuren.html" title="Visual formatting model">Visual formatting model</a> from [[!CSS21]]. Some values of these properties result in the creation of a <a spec="css21">stacking context</a>. Furthermore, this specification replaces the section <a href="http://www.w3.org/TR/CSS2/visufx.html#clipping">Clipping: the clip property</a> from [[!CSS21]].
Lines changed: 53 additions & 0 deletions
Loading

css-masking-1/index.html

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
</p>
1616
<h1 class="p-name no-ref" id=title>CSS Masking Module Level 1</h1>
1717
<h2 class="no-num no-toc no-ref heading settled heading" id=subtitle><span class=content>Editor’s Draft,
18-
<span class=dt-updated><span class=value-title title=20131212>12 December 2013</span></span></span></h2>
18+
<span class=dt-updated><span class=value-title title=20131216>16 December 2013</span></span></span></h2>
1919
<div data-fill-with=spec-metadata><dl><dt>This version:<dd><a class=u-url href=http://dev.w3.org/fxtf/css-masking-1/>http://dev.w3.org/fxtf/css-masking-1/</a><dt>Latest version:<dd><a href=http://www.w3.org/TR/css-masking-1/>http://www.w3.org/TR/css-masking-1/</a><dt>Editor’s Draft:<dd><a href=http://dev.w3.org/fxtf/css-masking-1/>http://dev.w3.org/fxtf/css-masking-1/</a><dt>Previous Versions:<dd><a href=http://www.w3.org/TR/2013/WD-css-masking-20130620/ rel=previous>http://www.w3.org/TR/2013/WD-css-masking-20130620/</a><dd><a href=http://www.w3.org/TR/2012/WD-css-masking-20121115/ rel=previous>http://www.w3.org/TR/2012/WD-css-masking-20121115/</a>
2020
<dt>Feedback:</dt>
2121
<dd><a href="mailto:public-fx@w3.org?subject=%5Bcss-masking%5D%20feedback">public-fx@w3.org</a>
@@ -85,20 +85,25 @@ <h2 class="no-num no-toc no-ref heading settled heading" id=contents><span class
8585

8686
<h2 class="heading settled heading" data-level=1 id=intro><span class=secno>1 </span><span class=content>Introduction</span><a class=self-link href=#intro></a></h2>
8787

88-
<p>With CSS Masking it is possible to specify another graphics element, shape or image file to be used as clipping region or an luminance or alpha mask for compositing the current object into the background.
88+
<p>This specification defines two different graphical operations which both fully or partly hide portions of an object.
8989

90-
<p>The effect of applying a mask is as if the mask images or <a data-link-type=dfn href=#mask-source title="mask sources">mask sources</a> are rendered into an off-screen image which has been initialized to transparent black. The graphical object to which the mask is applied will be painted onto the background through the mask, thus completely or partially masking out parts of the graphical object.
91-
92-
<p>Masks are applied using the <a class=property data-link-type=propdesc href=#propdef-mask-image title=mask-image>mask-image</a> or <a class=property data-link-type=propdesc href=#propdef-mask-box-image-source title=mask-box-image-source>mask-box-image-source</a> properties.
90+
<p>The <b>first operation</b> is called clipping.
9391

94-
<p>The <a class=property data-link-type=propdesc href=#propdef-mask-image title=mask-image>mask-image</a> property may reference a <a href=#MaskElement><code class=element-name>&lt;mask&gt;</code></a> as the mask source. Alternatively, for many simple uses, the <a class=property data-link-type=propdesc href=#propdef-mask-image title=mask-image>mask-image</a> property may refer directly to images to be used as mask, forgoing the need for an explicit <a href=#MaskElement><code class=element-name>&lt;mask&gt;</code></a> element. The <a class=property data-link-type=propdesc href=#propdef-mask title=mask>mask</a> property serves as a shorthand property for <a class=property data-link-type=propdesc href=#propdef-mask-box-image title=mask-box-image>mask-box-image</a>, <a class=property data-link-type=propdesc href=#propdef-mask-image title=mask-image>mask-image</a> and other characterizing properties.
95-
96-
<p>The <a class=property data-link-type=propdesc href=#propdef-mask-box-image-source title=mask-box-image-source>mask-box-image-source</a> property splits a mask image into 9 pieces. The pieces may be sliced, scaled and stretched in various ways to fit the size of the <a data-link-type=dfn href=#mask-box-image-area title="mask box image area">mask box image area</a>. The <a class=property data-link-type=propdesc href=#propdef-mask-box-image title=mask-box-image>mask-box-image</a> property serves as a shorthand property for <a class=property data-link-type=propdesc href=#propdef-mask-box-image-source title=mask-box-image-source>mask-box-image-source</a> and other characterizing properties.
92+
<div class=example>
93+
<div class=figure>
94+
<img alt="Example Mask" height=260 src=images/clipping-path.svg width=655>
95+
<p class=caption>
96+
A clipping path (middle) is applied on a polygon shaded with different colors (left). This results in a "clipped out" shape (right).
97+
</p>
98+
</div>
99+
</div>
97100

98-
<p>A <dfn data-dfn-type=dfn data-export="" id=clipping-path>clipping path<a class=self-link href=#clipping-path></a></dfn> defines an outline (in the absence of anti-aliasing) of a visual element where everything on the "inside" of the outline is allowed to show through but everything on the outside is masked out. A clipping path is specified by vector paths or shapes.
101+
<p>A closed vector path, shape or polygon defines a so called <dfn data-dfn-type=dfn data-export="" id=clipping-path>clipping path<a class=self-link href=#clipping-path></a></dfn>. This clipping path is a region (in the absence of anti-aliasing) where everything on the "inside" of this region is allowed to show through but everything on the outside is "clipped out" and does not appear on the canvas.
99102

100103
<p>The <a class=property data-link-type=propdesc href=#propdef-clip-path title=clip-path>clip-path</a> property can reference SVG <a href=http://www.w3.org/TR/2011/REC-SVG11-20110816/intro.html#TermGraphicsElement>graphics element</a> or use specified basic shapes as clipping path.
101104

105+
<p>The <b>second operation</b> is called masking.
106+
102107
<div class=example>
103108
<div class=figure>
104109
<img alt="Example Mask" height=260 src=images/luminance-mask.svg width=655>
@@ -108,6 +113,16 @@ <h2 class="heading settled heading" data-level=1 id=intro><span class=secno>1 </
108113
</div>
109114
</div>
110115

116+
<p>The effect of applying a mask is as if the mask images or <a data-link-type=dfn href=#mask-source title="mask sources">mask sources</a> are rendered into an off-screen image which has been initialized to transparent black. The graphical object to which the mask is applied will be painted onto the background through the mask, thus completely or partially masking out parts of the graphical object.
117+
118+
<p>Masks are applied using the <a class=property data-link-type=propdesc href=#propdef-mask-image title=mask-image>mask-image</a> or <a class=property data-link-type=propdesc href=#propdef-mask-box-image-source title=mask-box-image-source>mask-box-image-source</a> properties.
119+
120+
<p>The <a class=property data-link-type=propdesc href=#propdef-mask-image title=mask-image>mask-image</a> property may reference a <a href=#MaskElement><code class=element-name>&lt;mask&gt;</code></a> as the mask source. Alternatively, for many simple uses, the <a class=property data-link-type=propdesc href=#propdef-mask-image title=mask-image>mask-image</a> property may refer directly to images to be used as mask, forgoing the need for an explicit <a href=#MaskElement><code class=element-name>&lt;mask&gt;</code></a> element. The <a class=property data-link-type=propdesc href=#propdef-mask title=mask>mask</a> property serves as a shorthand property for <a class=property data-link-type=propdesc href=#propdef-mask-box-image title=mask-box-image>mask-box-image</a>, <a class=property data-link-type=propdesc href=#propdef-mask-image title=mask-image>mask-image</a> and other characterizing properties.
121+
122+
<p>The <a class=property data-link-type=propdesc href=#propdef-mask-box-image-source title=mask-box-image-source>mask-box-image-source</a> property splits a mask image into 9 pieces. The pieces may be sliced, scaled and stretched in various ways to fit the size of the <a data-link-type=dfn href=#mask-box-image-area title="mask box image area">mask box image area</a>. The <a class=property data-link-type=propdesc href=#propdef-mask-box-image title=mask-box-image>mask-box-image</a> property serves as a shorthand property for <a class=property data-link-type=propdesc href=#propdef-mask-box-image-source title=mask-box-image-source>mask-box-image-source</a> and other characterizing properties.
123+
124+
<p class=note>Note: While masking gives many possibilities for enhanced graphical effects and in general provides more control over the "visible portions" of the content, clipping paths can be more performant and are easier to interpolate.
125+
111126
<h2 class="heading settled heading" data-level=2 id=placement><span class=secno>2 </span><span class=content>Module interactions</span><a class=self-link href=#placement></a></h2>
112127

113128
<p>This specification defines a set of CSS properties that affect the visual rendering of elements to which those properties are applied. These effects are applied after elements have been sized and positioned according to the <a href=http://www.w3.org/TR/CSS2/visuren.html title="Visual formatting model">Visual formatting model</a> from <a data-biblio-type=normative data-link-type=biblio href=#css21 title=css21>[CSS21]</a>. Some values of these properties result in the creation of a <a data-link-spec=css21 data-link-type=dfn href=http://www.w3.org/TR/CSS21/visuren.html#x43 title="stacking context">stacking context</a>. Furthermore, this specification replaces the section <a href=http://www.w3.org/TR/CSS2/visufx.html#clipping>Clipping: the clip property</a> from <a data-biblio-type=normative data-link-type=biblio href=#css21 title=css21>[CSS21]</a>.

0 commit comments

Comments
 (0)