maskContentUnits

  • Revision slug: SVG/Attribute/maskContentUnits
  • Revision title: maskContentUnits
  • Revision id: 52017
  • Created:
  • Creator: Jeremie
  • Is current revision? No
  • Comment 1 words added, 1 words removed

Revision Content

« SVG Attribute reference home

The maskContentUnits attribute defines the coordinate system for the contents of the {{ SVGElement("mask") }}.

If attribute maskContentUnits is not specified, then the effect is as if a value of userSpaceOnUse were specified.

Note that values defined with percentage inside the content of the {{ SVGElement("mask") }} are not affected by this attribute. It means that even if you set objectBoundingBox as the value of maskContentUnits, percentage values will be calculated as if the value of the attribute were userSpaceOnUse.

Usage context

Categories None
Value userSpaceOnUse | objectBoundingBox
Animatable Yes
Normative document SVG 1.1 (2nd Edition)
userSpaceOnUse
The user coordinate system for the contents of the {{ SVGElement("mask") }} element is the current user coordinate system in place at the time when the {{ SVGElement("mask") }} element is referenced (i.e., the user coordinate system for the element referencing the {{ SVGElement("mask") }} element via the {{ SVGAttr("mask") }} property).
objectBoundingBox
the user coordinate system for the contents of the {{ SVGElement("mask") }} is established using the bounding box of the element to which the mask is applied. A bounding box could be considered the same as if the content of the {{ SVGElement("mask") }} were bound to a "0 0 1 1" {{ SVGAttr("viewbox") }}.

Examples

Elements

The following elements can use the maskContentUnits attribute

  • {{ SVGElement("mask") }}

Revision Source

<p>« <a href="/en/SVG/Attribute" title="en/SVG/Attribute">SVG Attribute reference home</a></p>
<p>The <code>maskContentUnits</code> attribute defines the coordinate system for the contents of the {{ SVGElement("mask") }}.</p>
<p>If attribute <code>maskContentUnits</code> is not specified, then the effect is as if a value of <code>userSpaceOnUse</code> were specified.</p>
<p>Note that values defined with percentage inside the content of the {{ SVGElement("mask") }} are not affected by this attribute. It means that even if you set <code>objectBoundingBox</code> as the value of <code>maskContentUnits</code>, percentage values will be calculated as if the value of the attribute were <code>userSpaceOnUse</code>.</p>
<h2>Usage context</h2>
<table class="standard-table"> <tbody> <tr> <th scope="row">Categories</th> <td><em>None</em></td> </tr> <tr> <th scope="row">Value</th> <td>userSpaceOnUse | <strong>objectBoundingBox</strong></td> </tr> <tr> <th scope="row">Animatable</th> <td>Yes</td> </tr> <tr> <th scope="row">Normative document</th> <td><a class="external" href="http://www.w3.org/TR/SVG11/masking.html#MaskElementMaskContentUnitsAttribute" title="http://www.w3.org/TR/SVG11/masking.html#MaskElementMaskContentUnitsAttribute">SVG 1.1 (2nd Edition)</a></td> </tr> </tbody>
</table>
<dl> <dt>userSpaceOnUse</dt> <dd>The user coordinate system for the contents of the {{ SVGElement("mask") }} element is the current user coordinate system in place at the time when the {{ SVGElement("mask") }} element is referenced (i.e., the user coordinate system for the element referencing the {{ SVGElement("mask") }} element via the {{ SVGAttr("mask") }} property).</dd> <dt>objectBoundingBox</dt> <dd>the user coordinate system for the contents of the {{ SVGElement("mask") }} is established using the bounding box of the element to which the mask is applied. A bounding box could be considered the same as if the content of the {{ SVGElement("mask") }} were bound to a "<code>0 0 1 1</code>" {{ SVGAttr("viewbox") }}.</dd>
</dl><h2>Examples</h2>
<h2>Elements</h2>
<p>The following elements can use the <code>maskContentUnits</code> attribute</p>
<ul> <li>{{ SVGElement("mask") }}</li>
</ul>
Revert to this revision