mozilla

Revision 47281 of Content type

  • Revision slug: SVG/Content_type
  • Revision title: Content type
  • Revision id: 47281
  • Created:
  • Creator: Jeremie
  • Is current revision? No
  • Comment 574 words added

Revision Content

Angle

<angle>

Angles are specified in one of two ways. When used in the value of a property in a stylesheet, an <angle> is defined as follows:

angle ::= number (~"deg" | ~"grad" | ~"rad")?

where deg indicates degrees, grad indicates grads and rad indicates radians.

For properties defined in CSS2, an angle unit identifier must be provided. For angle values in SVG-specific properties and their corresponding presentation attributes, the angle unit identifier is optional. If not provided, the angle value is assumed to be in degrees. In presentation attributes for all properties, whether defined in SVG1.1 or in CSS2, the angle identifier, if specified, must be in lower case.

When angles are used in an SVG attribute, <angle> is instead defined as follows:

angle ::= number ("deg" | "grad" | "rad")?

The unit identifiers in such <angle> values must be in lower case.

In the SVG DOM, <angle> values are represented using {{ domxref("SVGAngle") }} or {{ domxref("SVGAnimatedAngle objects") }}.

Anything

<anything>

The basic type <anything> is a sequence of zero or more characters. Specifically:

anything ::= Char*

where Char is the production for a character, as defined in XML 1.0 , section 2.2).

Color

<color>

The basic type <color> is a CSS2 compatible specification for a color in the sRGB color space. <color> applies to SVG's use of the {{ SVGAttr("color") }} attribute and is a component of the definitions of attributes {{ SVGAttr("fill") }}, {{ SVGAttr("stroke") }}, {{ SVGAttr("stop-color") }}, {{ SVGAttr("flood-color") }} and {{ SVGAttr("lighting-color") }}, which also offer optional ICC-based color specifications.

SVG supports all of the syntax alternatives for <color> defined in CSS2 syntax and basic data types, and (depend on the implementation) in the future CSS Color Module Level 3.

A <color> is either a keyword or a numerical RGB specification.

In addition to these color keywords, users may specify keywords that correspond to the colors used by objects in the user's environment. The normative definition of these keywords is found in User preferences for colors (CSS2, section 18.2).

The format of an RGB value in hexadecimal notation is a "#" immediately followed by either three or six hexadecimal characters. The three-digit RGB notation (#rgb) is converted into six-digit form (#rrggbb) by replicating digits, not by adding zeros. For example, #fb0 expands to #ffbb00. This ensures that white (#ffffff) can be specified with the short notation (#fff) and removes any dependencies on the color depth of the display. The format of an RGB value in the functional notation is an RGB start-function followed by a comma-separated list of three numerical values (either three integer values or three percentage values) followed by ")". An RGB start-function is the case-insensitive string "rgb(", for example "RGB(" or "rGb(". For compatibility, the all-lowercase form "rgb(" is preferred. The integer value 255 corresponds to 100%, and to F or FF in the hexadecimal notation: rgb(255,255,255) = rgb(100%,100%,100%) = #FFF. White space characters are allowed around the numerical values. All RGB colors are specified in the sRGB color space. Using sRGB provides an unambiguous and objectively measurable definition of the color, which can be related to international standards.

color    ::= "#" hexdigit hexdigit hexdigit (hexdigit hexdigit hexdigit)?
             | "rgb("integer, integer, integer")"
             | "rgb("integer "%", integer "%", integer "%)"
             | color-keyword
hexdigit ::= [0-9A-Fa-f]
    

where color-keyword matches (case insensitively) one of the color keywords listed in CSS Color Module Level 3, or one of the system color keywords listed in User preferences for colors (CSS2, section 18.2).

The corresponding SVG DOM interface definitions for <color> are defined the one defined by CSS. SVG's extension to color, including the ability to specify ICC-based colors, are represented using DOM interface {{ domxref("SVGColor") }}.

Coordinate

<coordinate>

A <coordinate> is a length in the user coordinate system that is the given distance from the origin of the user coordinate system along the relevant axis (the x-axis for X coordinates, the y-axis for Y coordinates). Its syntax is the same as that for <length>.

Within the SVG DOM, a <coordinate> is represented as an {{ domxref("SVGLength") }} or an {{ domxref("SVGAnimatedLength") }}.

Frequency

<frequency>

Frequency values are used with aural properties. As defined in CSS2, a frequency value is a <number> immediately followed by a frequency unit identifier. The frequency unit identifiers are:

  • Hz: Hertz
  • kHz: kilo Hertz

Frequency values may not be negative.

Revision Source

<h3>Angle</h3>
<dl> <dt>&lt;angle&gt;</dt> <dt> </dt><dd> <p>Angles are specified in one of two ways. When used in the value of a property in a stylesheet, an &lt;angle&gt; is defined as follows:</p> <pre>angle ::= number (~"deg" | ~"grad" | ~"rad")?</pre> <p>where deg indicates degrees, grad indicates grads and rad indicates radians.</p> <p>For properties defined in CSS2, an angle unit identifier must be provided. For angle values in SVG-specific properties and their corresponding presentation attributes, the angle unit identifier is optional. If not provided, the angle value is assumed to be in degrees. In presentation attributes for all properties, whether defined in SVG1.1 or in CSS2, the angle identifier, if specified, must be in lower case.</p> <p>When angles are used in an SVG attribute, &lt;angle&gt; is instead defined as follows:</p> <pre>angle ::= number ("deg" | "grad" | "rad")?</pre> <p>The unit identifiers in such &lt;angle&gt; values must be in lower case.</p> <p>In the SVG DOM, &lt;angle&gt; values are represented using {{ domxref("SVGAngle") }} or {{ domxref("SVGAnimatedAngle objects") }}.</p> </dd>
</dl>
<h3>Anything</h3>
<dl class="definitions"> <dt id="DataTypeAnything"><span class="SVG-Term">&lt;anything&gt;</span></dt> <dd> <p>The basic type &lt;anything&gt; is a sequence of zero or more characters. Specifically:</p> <pre>anything ::= Char*</pre> <p>where <a class="external" href="http://www.w3.org/TR/2008/REC-xml-20081126/#NT-Char" title="http://www.w3.org/TR/2008/REC-xml-20081126/#NT-Char">Char</a> is the production for a character, as defined in XML 1.0 , section 2.2).</p> </dd>
</dl>
<h3>Color</h3>
<dl class="definitions"> <dt>&lt;color&gt;</dt> <dd> <p>The basic type &lt;color&gt; is a CSS2 compatible specification for a color in the sRGB color space. &lt;color&gt; applies to SVG's use of the {{ SVGAttr("color") }} attribute and is a component of the definitions of attributes {{ SVGAttr("fill") }}, {{ SVGAttr("stroke") }}, {{ SVGAttr("stop-color") }}, {{ SVGAttr("flood-color") }} and {{ SVGAttr("lighting-color") }}, which also offer optional ICC-based color specifications.</p> <p>SVG supports all of the syntax alternatives for &lt;color&gt; defined in <a class="external" href="http://www.w3.org/TR/2008/REC-CSS2-20080411/syndata.html#value-def-color" title="http://www.w3.org/TR/2008/REC-CSS2-20080411/syndata.html#value-def-color">CSS2 syntax and basic data types</a>, and (depend on the implementation) in the future <a class="external" href="http://www.w3.org/TR/css3-color/" title="http://www.w3.org/TR/css3-color/">CSS Color Module Level 3</a>.</p> <p>A &lt;color&gt; is either a keyword or a numerical RGB specification.</p> <p>In addition to these color keywords, users may specify keywords that correspond to the colors used by objects in the user's environment. The normative definition of these keywords is found in <a class="external" href="http://www.w3.org/TR/2008/REC-CSS2-20080411/ui.html#system-colors" title="http://www.w3.org/TR/2008/REC-CSS2-20080411/ui.html#system-colors">User preferences for colors</a> (CSS2, section 18.2).</p> <p>The format of an RGB value in hexadecimal notation is a "#" immediately followed by either three or six hexadecimal characters. The three-digit RGB notation (#rgb) is converted into six-digit form (#rrggbb) by replicating digits, not by adding zeros. For example, <code>#fb0</code> expands to <code>#ffbb00</code>. This ensures that white (<code>#ffffff</code>) can be specified with the short notation (<code>#fff</code>) and removes any dependencies on the color depth of the display. The format of an RGB value in the functional notation is an RGB start-function followed by a comma-separated list of three numerical values (either three integer values or three percentage values) followed by ")". An RGB start-function is the case-insensitive string "rgb(", for example "RGB(" or "rGb(". For compatibility, the all-lowercase form "rgb(" is preferred. The integer value 255 corresponds to 100%, and to F or FF in the hexadecimal notation: <code>rgb(255,255,255)</code> = <code>rgb(100%,100%,100%)</code> = <code>#FFF</code>. White space characters are allowed around the numerical values. All RGB colors are specified in the sRGB color space. Using sRGB provides an unambiguous and objectively measurable definition of the color, which can be related to international standards.</p> <pre>color    ::= "#" hexdigit hexdigit hexdigit (hexdigit hexdigit hexdigit)?
             | "rgb("integer, integer, integer")"
             | "rgb("integer "%", integer "%", integer "%)"
             | color-keyword
hexdigit ::= [0-9A-Fa-f]
    </pre> <p>where <code>color-keyword</code> matches (case insensitively) one of the color keywords listed in <a class="external" href="http://www.w3.org/TR/css3-color/" title="http://www.w3.org/TR/css3-color/">CSS Color Module Level 3</a>, or one of the system color keywords listed in <a class="external" href="http://www.w3.org/TR/2008/REC-CSS2-20080411/ui.html#system-colors" title="http://www.w3.org/TR/2008/REC-CSS2-20080411/ui.html#system-colors">User preferences for colors</a> (CSS2, section 18.2).</p> <p>The corresponding SVG DOM interface definitions for &lt;color&gt; are defined the one defined by CSS. SVG's extension to color, including the ability to specify ICC-based colors, are represented using DOM interface {{ domxref("SVGColor") }}.</p> </dd>
</dl><h3>Coordinate</h3>
<dl> <dt>&lt;coordinate&gt;</dt> <dd> <p>A &lt;coordinate&gt; is a length in the user coordinate system that is the given distance from the origin of the user coordinate system along the relevant axis (the x-axis for X coordinates, the y-axis for Y coordinates). Its syntax is the same as that for <a href="/en/SVG/Content_type#length" title="https://developer.mozilla.org/en/SVG/Content_type#length">&lt;length&gt;</a>.</p> <p>Within the SVG DOM, a &lt;coordinate&gt; is represented as an {{ domxref("SVGLength") }} or an {{ domxref("SVGAnimatedLength") }}.</p> </dd>
</dl>
<h3>Frequency</h3>
<dl class="definitions"> <dt>&lt;frequency&gt;</dt> <dd> <p>Frequency values are used with aural properties. As defined in CSS2, a frequency value is a <a href="/en/SVG/Content_type#Number" title="https://developer.mozilla.org/en/SVG/Content_type#Number">&lt;number&gt;</a> immediately followed by a frequency unit identifier. The frequency unit identifiers are:</p> <ul> <li><code>Hz</code>: Hertz</li> <li><code>kHz</code>: kilo Hertz</li> </ul> <p>Frequency values may not be negative.</p> </dd>
</dl>
Revert to this revision