# CSS Object Model (CSSOM)

## Editor’s Draft, 1 January 1970

Specification Metadata

This version:
  https://drafts.csswg.org/cssom/
Latest published version:
  https://www.w3.org/TR/cssom-1/
Previous Versions:
  https://www.w3.org/TR/2016/WD-cssom-1-20160317/
  https://www.w3.org/TR/2013/WD-cssom-20131205/
  https://www.w3.org/TR/2011/WD-cssom-20110712/
  https://www.w3.org/TR/2000/REC-DOM-Level-2-Style-20001113/
Test Suite:
  http://test.csswg.org/suites/cssom-1_dev/nightly-unstable
Editors:
  Daniel Glazman (Disruptive Innovations)
  Emilio Cobos Álvarez (Mozilla)
Former Editors:
  Simon Pieters (Opera Software AS)
  Glenn Adams (Cox Communications, Inc.) glenn.adams@cos.com
  Anne van Kesteren (Opera Software ASA) annevk@annevk.nl
Issue Tracking:
  GitHub Issues
Suggest an Edit for this Spec:
  GitHub Editor
Legacy issues list:
  Bugzilla

Copyright © 1970 W3C® (MIT, ERCIM, Keio, Beihang). W3C liability, trademark and permissive document license rules apply.

## Abstract

CSSOM defines APIs (including generic parsing and serialization rules) for Media Queries, Selectors, and of course CSS itself.

CSS is a language for describing the rendering of structured documents (such as HTML and XML) on screen, on paper, etc.

## Status of this document

This is a public copy of the editors’ draft. It is provided for discussion only and may change at any moment. Its publication here does not imply endorsement of its contents by W3C. Don’t cite this document other than as work in progress.

GitHub Issues are preferred for discussion of this specification. When filing an issue, please put the text “cssom” in the title, preferably like this: “[cssom] …summary of comment…”. All issues and comments are archived, and there is also a historical archive.

This document was produced by the CSS Working Group.

This document was produced by a group operating under the W3C Patent Policy. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.

This document is governed by the 1 March 2019 W3C Process Document.

## 1. Introduction

This document formally specifies the core features of the CSS Object Model (CSSOM). Other documents in the CSSOM family of specifications as well as other CSS related specifications define extensions to these core features.

The core features of the CSSOM are oriented towards providing basic capabilities to author-defined scripts to permit access to and manipulation of style related state information and processes.

The features defined below are fundamentally based on prior specifications of the W3C DOM Working Group, primarily [DOM-LEVEL-2-STYLE]. The purposes of the present document are (1) to improve on that prior work by providing more technical specificity (so as to improve testability and interoperability), (2) to deprecate or remove certain less-widely implemented features no longer considered to be essential in this context, and (3) to newly specify certain extensions that have been or expected to be widely implemented.

## 2. Terminology

This specification employs certain terminology from the following documents: DOM, HTML, CSS Syntax, Encoding, URL, Fetch, Associating Style Sheets with XML documents and XML. [DOM] [HTML] [CSS3SYN] [ENCODING] [URL] [FETCH] [XML-STYLESHEET] [XML]

When this specification talks about object `A` where `A` is actually an interface, it generally means an object implementing interface `A`.

The terms set and unset to refer to the true and false values of binary flags or variables, respectively. These terms are also used as verbs in which case they refer to mutating some value to make it true or false, respectively.

The term supported styling language refers to CSS.

Note: If another styling language becomes supported in user agents, this specification is expected to be updated as necessary.

The term supported CSS property refers to a CSS property that the user agent implements, including any vendor-prefixed properties, but excluding custom properties. A supported CSS property must be in its lowercase form for the purpose of comparisons in this specification.

In this specification the ::before and ::after pseudo-elements are assumed to exist for all elements even if no box is generated for them.

When a method or an attribute is said to call another method or attribute, the user agent must invoke its internal API for that attribute or method so that e.g. the author can’t change the behavior by overriding attributes or methods with custom properties or functions in ECMAScript.

Unless otherwise stated, string comparisons are done in a case-sensitive manner.

### 2.1. Common Serializing Idioms

To escape a character means to create a string of "`\`" (U+005C), followed by the character.

To escape a character as code point means to create a string of "`\`" (U+005C), followed by the Unicode code point as the smallest possible number of hexadecimal digits in the range 0-9 a-f (U+0030 to U+0039 and U+0061 to U+0066) to represent the code point in base 16, followed by a single SPACE (U+0020).

To serialize an identifier means to create a string represented by the concatenation of, for each character of the identifier:

- If the character is NULL (U+0000), then the REPLACEMENT CHARACTER (U+FFFD).
- If the character is in the range [\1-\1f] (U+0001 to U+001F) or is U+007F, then the character escaped as code point.
- If the character is the first character and is in the range [0-9] (U+0030 to U+0039), then the character escaped as code point.
- If the character is the second character and is in the range [0-9] (U+0030 to U+0039) and the first character is a "`-`" (U+002D), then the character escaped as code point.
- If the character is the first character and is a "`-`" (U+002D), and there is no second character, then the escaped character.
- If the character is not handled by one of the above rules and is greater than or equal to U+0080, is "`-`" (U+002D) or "`_`" (U+005F), or is in one of the ranges [0-9] (U+0030 to U+0039), [A-Z] (U+0041 to U+005A), or \[a-z] (U+0061 to U+007A), then the character itself.
- Otherwise, the escaped character.

To serialize a string means to create a string represented by '"' (U+0022), followed by the result of applying the rules below to each character of the given string, followed by '"' (U+0022):

- If the character is NULL (U+0000), then the REPLACEMENT CHARACTER (U+FFFD).
- If the character is in the range [\1-\1f] (U+0001 to U+001F) or is U+007F, the character escaped as code point.
- If the character is '"' (U+0022) or "`\`" (U+005C), the escaped character.
- Otherwise, the character itself.

Note: "`'`" (U+0027) is not escaped because strings are always serialized with '"' (U+0022).

To serialize a URL means to create a string represented by "`url(`", followed by the serialization of the URL as a string, followed by "`)`".

To serialize a LOCAL means to create a string represented by "`local(`", followed by the serialization of the LOCAL as a string, followed by "`)`".

To serialize a comma-separated list concatenate all items of the list in list order while separating them by "`,` ", i.e., COMMA (U+002C) followed by a single SPACE (U+0020).

To serialize a whitespace-separated list concatenate all items of the list in list order while separating them by "`` ", i.e., a single SPACE (U+0020).

Note: When serializing a list according to the above rules, extraneous whitespace is not inserted prior to the first item or subsequent to the last item. Unless otherwise specified, an empty list is serialized as the empty string.

## 3. CSSOMString

Most strings in CSSOM interfaces use the `CSSOMString` type. Each implementation chooses to define it as either `USVString` or `DOMString`:

    typedef USVString CSSOMString;

Or, alternatively:

    typedef DOMString CSSOMString;

The difference is only observable from web content when surrogate code units are involved. `DOMString` would preserve them, whereas `USVString` would replace them with U+FFFD REPLACEMENT CHARACTER.

This choice effectively allows implementations to do this replacement, but does not require it.

Using `USVString` enables an implementation to use UTF-8 internally to represent strings in memory. Since well-formed UTF-8 specifically disallows surrogate code points, it effectively requires this replacement.

On the other hand, implementations that internally represent strings as 16-bit code units might prefer to avoid the cost of doing this replacement.

## 4. Media Queries

Media queries are defined by [MEDIAQUERIES]. This section defines various concepts around media queries, including their API and serialization form.

### 4.1. Parsing Media Queries

To parse a media query list for a given string s into a media query list is defined in the Media Queries specification. Return the list of media queries that the algorithm defined there gives.

Note: A media query that ends up being "ignored" will turn into "`not all`".

To parse a media query for a given string s means to follow the parse a media query list steps and return null if more than one media query is returned or a media query if a single media query is returned.

Note: Again, a media query that ends up being "ignored" will turn into "`not all`".

### 4.2. Serializing Media Queries

To serialize a media query list run these steps:

1. If the media query list is empty, then return the empty string.
2. Serialize each media query in the list of media queries, in the same order as they appear in the media query list, and then serialize the list.

To serialize a media query let s be the empty string, run the steps below:

1. If the media query is negated append "`not`", followed by a single SPACE (U+0020), to s.
2. Let type be the serialization as an identifier of the media type of the media query, converted to ASCII lowercase.
3. If the media query does not contain media features append type, to s, then return s.
4. If type is not "`all`" or if the media query is negated append type, followed by a single SPACE (U+0020), followed by "`and`", followed by a single SPACE (U+0020), to s.
5. Sort the media features in lexicographical order.
6. Then, for each media feature:
   1. Append a "`(`" (U+0028), followed by the media feature name, converted to ASCII lowercase, to s.
   2. If a value is given append a "`:`" (U+003A), followed by a single SPACE (U+0020), followed by the serialized media feature value, to s.
   3. Append a "`)`" (U+0029) to s.
   4. If this is not the last media feature append a single SPACE (U+0020), followed by "`and`", followed by a single SPACE (U+0020), to s.
7. Return s.

Here are some examples of input (first column) and output (second column):

Input | Output
--- | ---
    not screen and (min-WIDTH:5px) AND (max-width:40px)
    not screen and (max-width: 40px) and (min-width: 5px)
    all and (color) and (color)
    (color)

#### 4.2.1. Serializing Media Feature Values

This should probably be done in terms of mapping it to serializing CSS values as media features are defined in terms of CSS values after all.

To serialize a media feature value named v locate v in the first column of the table below and use the serialization format described in the second column:

Media Feature | Serialization
--- | ---
width | ...
height | ...
device-width | ...
device-height | ...
orientation | If the value is portrait: "`portrait`". If the value is landscape: "`landscape`".
aspect-ratio | ...
device-aspect-ratio | ...
color | ...
color-index | ...
monochrome | ...
resolution | ...
scan | If the value is progressive: "`progressive`". If the value is interlace: "`interlace`".
grid | ...

Other specifications can extend this table and vendor-prefixed media features can have custom serialization formats as well.

### 4.3. Comparing Media Queries

To compare media queries m1 and m2 means to serialize them both and return true if they are a case-sensitive match and false if they are not.

### 4.4. The `MediaList` Interface

An object that implements the `MediaList` interface has an associated collection of media queries.

    [Exposed=Window]
    interface MediaList {
      stringifier attribute [TreatNullAs=EmptyString] CSSOMString mediaText;
      readonly attribute unsigned long length;
      getter CSSOMString? item(unsigned long index);
      void appendMedium(CSSOMString medium);
      void deleteMedium(CSSOMString medium);
    };

The object’s supported property indices are the numbers in the range zero to one less than the number of media queries in the collection of media queries represented by the collection. If there are no such media queries, then there are no supported property indices.

To create a `MediaList` object with a string text, run the following steps:

1. Create a new `MediaList` object.
2. Set its `mediaText` attribute to text.
3. Return the newly created `MediaList` object.

The `mediaText` attribute, on getting, must return a serialization of the collection of media queries. Setting the `mediaText` attribute must run these steps:

1. Empty the collection of media queries.
2. If the given value is the empty string, then return.
3. Append all the media queries as a result of parsing the given value to the collection of media queries.

The `item(index)` method must return a serialization of the media query in the collection of media queries given by index, or null, if index is greater than or equal to the number of media queries in the collection of media queries.

The `length` attribute must return the number of media queries in the collection of media queries.

The `appendMedium(medium)` method must run these steps:

1. Let m be the result of parsing the given value.
2. If m is null, then return.
3. If comparing m with any of the media queries in the collection of media queries returns true, then return.
4. Append m to the collection of media queries.

The `deleteMedium(medium)` method must run these steps:

1. Let m be the result of parsing the given value.
2. If m is null, then return.
3. Remove any media query from the collection of media queries for which comparing the media query with m returns true. If nothing was removed, then throw a `NotFoundError` exception.

## 5. Selectors

Selectors are defined in the Selectors specification. This section mainly defines how to serialize them.

### 5.1. Parsing Selectors

To parse a group of selectors means to parse the value using the `selectors_group` production defined in the Selectors specification and return either a group of selectors if parsing did not fail or null if parsing did fail.

### 5.2. Serializing Selectors

To serialize a group of selectors serialize each selector in the group of selectors and then serialize a comma-separated list of these serializations.

To serialize a selector let s be the empty string, run the steps below for each part of the chain of the selector, and finally return s:

1. If there is only one simple selector in the compound selectors which is a universal selector, append the result of serializing the universal selector to s.
2. Otherwise, for each simple selector in the compound selectors that is not a universal selector of which the namespace prefix maps to a namespace that is not the default namespace serialize the simple selector and append the result to s.
3. If this is not the last part of the chain of the selector append a single SPACE (U+0020), followed by the combinator "`>`", "`+`", "`~`", "`>>`", "`||`", as appropriate, followed by another single SPACE (U+0020) if the combinator was not whitespace, to s.
4. If this is the last part of the chain of the selector and there is a pseudo-element, append "`::`" followed by the name of the pseudo-element, to s.

To serialize a simple selector let s be the empty string, run the steps below, and finally return s:

type selector
universal selector
  1. If the namespace prefix maps to a namespace that is not the default namespace and is not the null namespace (not in a namespace) append the serialization of the namespace prefix as an identifier, followed by a "`|`" (U+007C) to s.
  2. If the namespace prefix maps to a namespace that is the null namespace (not in a namespace) append "`|`" (U+007C) to s.
  3. If this is a type selector append the serialization of the element name as an identifier to s.
  4. If this is a universal selector append "`*`" (U+002A) to s.
attribute selector
  1. Append "`[`" (U+005B) to s.
  2. If the namespace prefix maps to a namespace that is not the null namespace (not in a namespace) append the serialization of the namespace prefix as an identifier, followed by a "`|`" (U+007C) to s.
  3. Append the serialization of the attribute name as an identifier to s.
  4. If there is an attribute value specified, append "`=`", "`~=`", "`|=`", "`^=`", "`$=`", or "`*=`" as appropriate (depending on the type of attribute selector), followed by the serialization of the attribute value as a string, to s.
  5. If the attribute selector has the case-sensitivity flag present, append "`i`" (U+0020 U+0069) to s.
  6. Append "`]`" (U+005D) to s.
class selector
  Append a "`.`" (U+002E), followed by the serialization of the class name as an identifier to s.
ID selector
  Append a "`#`" (U+0023), followed by the serialization of the ID as an identifier to s.
pseudo-class
  If the pseudo-class does not accept arguments append "`:`" (U+003A), followed by the name of the pseudo-class, to s.

  Otherwise, append "`:`" (U+003A), followed by the name of the pseudo-class, followed by "`(`" (U+0028), followed by the value of the pseudo-class argument(s) determined as per below, followed by "`)`" (U+0029), to s.

  `:lang()`
    The serialization of a comma-separated list of each argument’s serialization as a string, preserving relative order.
  `:nth-child()`
  `:nth-last-child()`
  `:nth-of-type()`
  `:nth-last-of-type()`
    The result of serializing the value using the rules to serialize an <an+b> value.
  `:not()`
    The result of serializing the value using the rules for serializing a group of selectors.

## 6. CSS

### 6.1. CSS Style Sheets

A CSS style sheet is an abstract concept that represents a style sheet as defined by the CSS specification. In the CSSOM a CSS style sheet is represented as a `CSSStyleSheet` object. A CSS style sheet has a number of associated state items:

type
  The literal string "`text/css`".
location
  Specified when created. The absolute-URL string of the first request of the CSS style sheet or null if the CSS style sheet was embedded. Does not change during the lifetime of the CSS style sheet.
parent CSS style sheet
  Specified when created. The CSS style sheet that is the parent of the CSS style sheet or null if there is no associated parent.
owner node
  Specified when created. The DOM node associated with the CSS style sheet or null if there is no associated DOM node.
owner CSS rule
  Specified when created. The CSS rule in the parent CSS style sheet that caused the inclusion of the CSS style sheet or null if there is no associated rule.
media
  Specified when created. The `MediaList` object associated with the CSS style sheet.

  If this property is specified to a string, the media must be set to the return value of invoking create a `MediaList` object steps for that string.

  If this property is specified to an attribute of the owner node, the media must be set to the return value of invoking create a `MediaList` object steps for the value of that attribute. Whenever the attribute is set, changed or removed, the media’s `mediaText` attribute must be set to the new value of the attribute, or to null if the attribute is absent.

  Note: Changing the media’s `mediaText` attribute does not change the corresponding attribute on the owner node.

  Note: The owner node of a CSS style sheet, if non-null, is the node whose associated CSS style sheet is the CSS style sheet in question, when the CSS style sheet is added.

title
  Specified when created. The title of the CSS style sheet, which can be the empty string.
  In the following, the title is non-empty for the first style sheet, but is empty for the second and third style sheets.

      <style title="papaya whip">
        body { background: #ffefd5; }
      </style>

      <style title="">
        body { background: orange; }
      </style>

      <style>
        body { background: brown; }
      </style>

  If this property is specified to an attribute of the owner node, the title must be set to the value of that attribute. Whenever the attribute is set, changed or removed, the title must be set to the new value of the attribute, or to the empty string if the attribute is absent.

  Note: HTML only specifies title to be an attribute of the owner node if the node is in in a document tree.

alternate flag
  Specified when created. Either set or unset. Unset by default.
  The following CSS style sheets have their alternate flag set:

      <?xml-stylesheet alternate="yes" title="x" href="data:text/css,…"?>

      <link rel="alternate stylesheet" title="x" href="data:text/css,…">

disabled flag
  Either set or unset. Unset by default.

  Note: Even when unset it does not necessarily mean that the CSS style sheet is actually used for rendering.

CSS rules
  The CSS rules associated with the CSS style sheet.
origin-clean flag
  Specified when created. Either set or unset. If it is set, the API allows reading and modifying of the CSS rules.

#### 6.1.1. The `StyleSheet` Interface

The `StyleSheet` interface represents an abstract, base style sheet.

    [Exposed=Window]
    interface StyleSheet {
      readonly attribute CSSOMString type;
      readonly attribute USVString? href;
      readonly attribute (Element or ProcessingInstruction)? ownerNode;
      readonly attribute CSSStyleSheet? parentStyleSheet;
      readonly attribute DOMString? title;
      [SameObject, PutForwards=mediaText] readonly attribute MediaList media;
      attribute boolean disabled;
    };

The `type` attribute must return the type.

The `href` attribute must return the location.

The `ownerNode` attribute must return the owner node.

The `parentStyleSheet` attribute must return the parent CSS style sheet.

The `title` attribute must return the title or null if title is the empty string.

The `media` attribute must return the media.

The `disabled` attribute, on getting, must return true if the disabled flag is set, or false otherwise. On setting, the `disabled` attribute must set the disabled flag if the new value is true, or unset the disabled flag otherwise.

#### 6.1.2. The `CSSStyleSheet` Interface

The `CSSStyleSheet` interface represents a CSS style sheet.

    [Exposed=Window]
    interface CSSStyleSheet : StyleSheet {
      readonly attribute CSSRule? ownerRule;
      [SameObject] readonly attribute CSSRuleList cssRules;
      unsigned long insertRule(CSSOMString rule, optional unsigned long index = 0);
      void deleteRule(unsigned long index);
    };

The `ownerRule` attribute must return the owner CSS rule. If a value other than null is ever returned, then that same value must always be returned on each get access.

The `cssRules` attribute must follow these steps:

1. If the origin-clean flag is unset, throw a `SecurityError` exception.
2. Return a read-only, live `CSSRuleList` object representing the CSS rules.

   Note: Even though the returned `CSSRuleList` object is read-only (from the perspective of client-authored script), it can nevertheless change over time due to its liveness status. For example, invoking the `insertRule()` or `deleteRule()` methods can result in mutations reflected in the returned object.

The `insertRule(rule, index)` method must run the following steps:

1. If the origin-clean flag is unset, throw a `SecurityError` exception.
2. Return the result of invoking insert a CSS rule rule in the CSS rules at index.

The `deleteRule(index)` method must run the following steps:

1. If the origin-clean flag is unset, throw a `SecurityError` exception.
2. Remove a CSS rule in the CSS rules at index.

##### 6.1.2.1. Deprecated CSSStyleSheet members

Note: These members are required for compatibility with existing sites.

    partial interface CSSStyleSheet {
      [SameObject] readonly attribute CSSRuleList rules;
      long addRule(optional DOMString selector = "undefined", optional DOMString style = "undefined", optional unsigned long index);
      void removeRule(optional unsigned long index = 0);
    };

The `rules` attribute must follow the same steps as `cssRules`, and return the same object `cssRules` would return.

The `removeRule(index)` method must run the same steps as `deleteRule()`.

The `addRule(selector, block, optionalIndex)` method must run the following steps:

1. Let rule be an empty string.
2. Append selector to rule.
3. Append `" { "` to rule.
4. If block is not empty, append block, followed by a space, to rule.
5. Append `"}"` to rule
6. Let index be optionalIndex if provided, or the number of CSS rules in the stylesheet otherwise.
7. Call `insertRule()`, with rule and index as arguments.
8. Return `-1`.

Authors should not use these members and should instead use and teach the standard `CSSStyleSheet` interface defined earlier, which is consistent with `CSSGroupingRule`.

### 6.2. CSS Style Sheet Collections

Below various new concepts are defined that are associated with each `DocumentOrShadowRoot` object.

Each `DocumentOrShadowRoot` has an associated list of zero or more CSS style sheets, named the document or shadow root CSS style sheets. This is an ordered list that contains all CSS style sheets associated with the `DocumentOrShadowRoot`, in tree order, with CSS style sheets created from HTTP `Link` headers first, if any, in header order.

To create a CSS style sheet, run these steps:

1. Create a new CSS style sheet object and set its properties as specified.
2. Then run the add a CSS style sheet steps for the newly created CSS style sheet.

   If the origin-clean flag is unset, this can expose information from the user’s intranet.

To add a CSS style sheet, run these steps:

1. Add the CSS style sheet to the list of document or shadow root CSS style sheets at the appropriate location. The remainder of these steps deal with the disabled flag.
2. If the disabled flag is set, then return.
3. If the title is not the empty string, the alternate flag is unset, and preferred CSS style sheet set name is the empty string change the preferred CSS style sheet set name to the title.
4. If any of the following is true, then unset the disabled flag and return:
   - The title is the empty string.
   - The last CSS style sheet set name is null and the title is a case-sensitive match for the preferred CSS style sheet set name.
   - The title is a case-sensitive match for the last CSS style sheet set name.
5. Set the disabled flag.

To remove a CSS style sheet, run these steps:

1. Remove the CSS style sheet from the list of document or shadow root CSS style sheets.
2. Set the CSS style sheet’s parent CSS style sheet, owner node and owner CSS rule to null.

A persistent CSS style sheet is a CSS style sheet from the document or shadow root CSS style sheets whose title is the empty string and whose alternate flag is unset.

A CSS style sheet set is an ordered collection of one or more CSS style sheets from the document or shadow root CSS style sheets which have an identical title that is not the empty string.

A CSS style sheet set name is the title the CSS style sheet set has in common.

An enabled CSS style sheet set is a CSS style sheet set of which each CSS style sheet has its disabled flag unset.

To enable a CSS style sheet set with name name, run these steps:

1. If name is the empty string, set the disabled flag for each CSS style sheet that is in a CSS style sheet set and return.
2. Unset the disabled flag for each CSS style sheet in a CSS style sheet set whose CSS style sheet set name is a case-sensitive match for name and set it for all other CSS style sheets in a CSS style sheet set.

To select a CSS style sheet set with name name, run these steps:

1. enable a CSS style sheet set with name name.
2. Set last CSS style sheet set name to name.

A last CSS style sheet set name is a concept to determine what CSS style sheet set was last selected. Initially its value is null.

A preferred CSS style sheet set name is a concept to determine which CSS style sheets need to have their disabled flag unset. Initially its value is the empty string.

To change the preferred CSS style sheet set name with name name, run these steps:

1. Let current be the preferred CSS style sheet set name.
2. Set preferred CSS style sheet set name to name.
3. If name is not a case-sensitive match for current and last CSS style sheet set name is null enable a CSS style sheet set with name name.

#### 6.2.1. The HTTP Default-Style Header

The HTTP Default-Style header can be used to set the preferred CSS style sheet set name influencing which CSS style sheet set is (initially) the enabled CSS style sheet set.

For each HTTP Default-Style header, in header order, the user agent must change the preferred CSS style sheet set name with name being the value of the header.

#### 6.2.2. The `StyleSheetList` Interface

The `StyleSheetList` interface represents an ordered collection of CSS style sheets.

    [Exposed=Window]
    interface StyleSheetList {
      getter CSSStyleSheet? item(unsigned long index);
      readonly attribute unsigned long length;
    };

The object’s supported property indices are the numbers in the range zero to one less than the number of CSS style sheets represented by the collection. If there are no such CSS style sheets, then there are no supported property indices.

The `item(index)` method must return the indexth CSS style sheet in the collection. If there is no indexth object in the collection, then the method must return null.

The `length` attribute must return the number of CSS style sheets represented by the collection.

#### 6.2.3. Extensions to the `DocumentOrShadowRoot` Interface Mixin

    partial interface mixin DocumentOrShadowRoot {
      [SameObject] readonly attribute StyleSheetList styleSheets;
    };

The `styleSheets` attribute must return a `StyleSheetList` collection representing the document or shadow root CSS style sheets.

### 6.3. Style Sheet Association

This section defines the interface an owner node of a CSS style sheet has to implement and defines the requirements for xml-stylesheet processing instructions and HTTP `Link` headers when the link relation type is an ASCII case-insensitive match for "`stylesheet`".

#### 6.3.1. Fetching CSS style sheets

To fetch a CSS style sheet with parsed URL parsed URL, referrer referrer, document document, optionally a set of parameters parameters (used as input to creating a request), follow these steps:

1. Let origin be document’s origin.
2. Let request be a new request, with the url parsed URL, origin origin, referrer referrer, and if specified the set of parameters parameters.
3. Let response be the result of fetching request.
4. Wait until response is available.
5. If response is a network error, return an error.
6. If document is in quirks mode, response is CORS-same-origin and the Content-Type metadata of response is not a supported styling language change the Content-Type metadata of response to `text/css`.
7. If response is not in a supported styling language return an error.
8. Return response.

#### 6.3.2. The `LinkStyle` Interface

The associated CSS style sheet of a node is the CSS style sheet in the list of document or shadow root CSS style sheets of which the owner node is said node. This node must also implement the `LinkStyle` interface.

    interface mixin LinkStyle {
      readonly attribute CSSStyleSheet? sheet;
    };

The `sheet` attribute must return the associated CSS style sheet for the node or null if there is no associated CSS style sheet.

In the following fragment, the first `style` element has a `sheet` attribute that returns a `StyleSheet` object representing the style sheet, but for the second `style` element, the `sheet` attribute returns null, assuming the user agent supports CSS (`text/css`), but does not support the (hypothetical) ExampleSheets (`text/example-sheets`).

    <style type="text/css">
      body { background:lime }
    </style>

    <style type="text/example-sheets">
      $(body).background := lime
    </style>

Note: Whether or not the node refers to a style sheet is defined by the specification that defines the semantics of said node.

#### 6.3.3. Requirements on specifications

Specifications introducing new ways of associating style sheets through the DOM should define which nodes implement the `LinkStyle` interface. When doing so, they must also define when a CSS style sheet is created.

#### 6.3.4. Requirements on User Agents Implementing the xml-stylesheet processing instruction

    ProcessingInstruction includes LinkStyle;

The prolog refers to nodes that are children of the document and are not following the `Element` child of the document, if any.

When a `ProcessingInstruction` node node becomes part of the prolog, is no longer part of the prolog, or has its data changed, these steps must be run:

1. If an instance of this algorithm is currently running for node, abort that instance, and stop the associated fetching if applicable.
2. If node has an associated CSS style sheet, remove it.
3. If node is not an xml-stylesheet processing instruction, then return.
4. If node does not have an `href` pseudo-attribute, then return.
5. Let title be the value of the `title` pseudo-attribute or the empty string if the `title` pseudo-attribute is not specified.
6. If there is an `alternate` pseudo-attribute whose value is a case-sensitive match for "`yes`" and title is the empty string, then return.
7. If there is a `type` pseudo-attribute whose value is not a supported styling language the user agent may return.
8. Let input URL be the value specified by the `href` pseudo-attribute.
9. Let document be node’s node document
10. Let base URL be document’s document base URL.
11. Let referrer be document’s address.
12. Let parsed URL be the return value of invoking the URL parser with the string input URL and the base URL base URL.
13. If parsed URL is failure, then return.
14. Let response be the result of fetching a CSS style sheet with parsed URL parsed URL, referrer referrer and document document.
15. If response is an error, then return.
16. Create a CSS style sheet with the following properties:
    location
      The result of invoking the URL serializer with parsed URL.
    parent CSS style sheet
      null.
    owner node
      node.
    owner CSS rule
      null.
    media
      The value of the `media` pseudo-attribute if any, or the empty string otherwise.
    title
      title.
    alternate flag
      Set if the `alternate` pseudo-attribute value is a case-sensitive match for "`yes`", or unset otherwise.
    origin-clean flag
      Set if response is CORS-same-origin, or unset otherwise.

    The CSS environment encoding is the result of running the following steps:

    1. If the element has a `charset` pseudo-attribute, get an encoding from that pseudo-attribute’s value. If that succeeds, return the resulting encoding and abort these steps.
    2. Otherwise, return the document’s character encoding. [DOM]

A style sheet referenced by an xml-stylesheet processing instruction using the rules in this section, in the context of the `Document` of an XML parser is said to be a style sheet that is blocking scripts if the `ProcessingInstruction` node was created by that `Document`'s parser, and the style sheet was enabled when the node was created by the parser, and the style sheet ready flag is not yet set, and, the last time the event loop reached step 1, the node was in that Document, and the user agent hasn’t given up on that particular style sheet yet. A user agent may give up on such a style sheet at any time.

#### 6.3.5. Requirements on User Agents Implementing the HTTP Link Header

For each HTTP `Link` header of which one of the link relation types is an ASCII case-insensitive match for "`stylesheet`" these steps must be run:

1. Let title be the value of the first of all the `title` parameters. If there are no such parameters it is the empty string.
2. If one of the (other) link relation types is an ASCII case-insensitive match for "`alternate`" and title is the empty string, then return.
3. Let input URL be the value specified.

   Be more specific

4. Let base URL be the document’s document base URL.

   Is there a document at this point?

5. Let referrer be the document’s address.
6. Let origin be the document’s origin.
7. Let parsed URL be the return value of invoking the URL parser with the string input URL and the base URL base URL.
8. If parsed URL is failure, then return.
9. Let response be the result of fetching a CSS style sheet with parsed URL parsed URL, referrer referrer and document being the document.

   What if the HTML parser hasn’t decided on quirks/non-quirks yet?

10. Create a CSS style sheet with the following properties:
    location
      The result of invoking the URL serializer with parsed URL.
    owner node
      null.
    parent CSS style sheet
      null.
    owner CSS rule
      null.
    media
      The value of the first `media` parameter.
    title
      title.
    alternate flag
      Set if one of the specified link relation type for this HTTP `Link` header is an ASCII case-insensitive match for "`alternate`", or false otherwise.
    origin-clean flag
      Set if response is CORS-same-origin, or unset otherwise.

A style sheet referenced by a HTTP `Link` header using the rules in this section is said to be a style sheet that is blocking scripts if the style sheet was enabled when created, and the style sheet ready flag is not yet set, and the user agent hasn’t given up on that particular style sheet yet. A user agent may give up on such a style sheet at any time.

### 6.4. CSS Rules

A CSS rule is an abstract concept that denotes a rule as defined by the CSS specification. A CSS rule is represented as an object that implements a subclass of the `CSSRule` interface, and which has the following associated state items:

type
  A non-negative integer associated with a particular type of rule. This item is initialized when a rule is created and cannot change.
text
  A text representation of the rule suitable for direct use in a style sheet. This item is initialized when a rule is created and can be changed.
parent CSS rule
  A reference to an enclosing CSS rule or null. If the rule has an enclosing rule when it is created, then this item is initialized to the enclosing rule; otherwise it is null. It can be changed to null.
parent CSS style sheet
  A reference to a parent CSS style sheet or null. This item is initialized to reference an associated style sheet when the rule is created. It can be changed to null.
child CSS rules
  A list of child CSS rules. The list can be mutated.

In addition to the above state, each CSS rule may be associated with other state in accordance with its type.

To parse a CSS rule from a string string, run the following steps:

1. Let rule be the return value of invoking parse a rule with string.
2. If rule is a syntax error, return rule.
3. Let parsed rule be the result of parsing rule according to the appropriate CSS specifications, dropping parts that are said to be ignored. If the whole style rule is dropped, return a syntax error.
4. Return parsed rule.

To serialize a CSS rule, perform one of the following in accordance with the CSS rule’s type:

`CSSStyleRule`
  The result of concatenating the following:
  1. The result of performing serialize a group of selectors on the rule’s associated selectors.
  2. The string "`{` ", i.e., a single SPACE (U+0020), followed by LEFT CURLY BRACKET (U+007B), followed by a single SPACE (U+0020).
  3. The result of performing serialize a CSS declaration block on the rule’s associated declarations.
  4. If the rule is associated with one or more declarations, the string "`` ", i.e., a single SPACE (U+0020).
  5. The string "`}`", RIGHT CURLY BRACKET (U+007D).
`CSSImportRule`
  The result of concatenating the following:
  1. The string "`@import`" followed by a single SPACE (U+0020).
  2. The result of performing serialize a URL on the rule’s location.
  3. If the rule’s associated media list is not empty, a single SPACE (U+0020) followed by the result of performing serialize a media query list on the media list.
  4. The string "`;`", i.e., SEMICOLON (U+003B).

      @import url("import.css");

      @import url("print.css") print;

`CSSMediaRule`
  The result of concatenating the following:
  1. The string "`@media`", followed by a single SPACE (U+0020).
  2. The result of performing serialize a media query list on rule’s media query list.
  3. A single SPACE (U+0020), followed by the string "{", i.e., LEFT CURLY BRACKET (U+007B), followed by a newline.
  4. The result of performing serialize a CSS rule on each rule, separated by a newline and indented by two spaces, in rule’s CSSRules list.
  5. A newline, followed by the string "}", i.e., RIGHT CURLY BRACKET (U+007D)
`CSSFontFaceRule`
  The result of concatenating the following:
  1. The string "`@font-face {`", followed by a single SPACE (U+0020).
  2. The string "`font-family:`", followed by a single SPACE (U+0020).
  3. The result of performing serialize a string on the rule’s font family name.
  4. The string "`;`", i.e., SEMICOLON (U+003B).
  5. If the rule’s associated source list is not empty, follow these substeps:
     1. A single SPACE (U+0020), followed by the string "`src:`", followed by a single SPACE (U+0020).
     2. The result of invoking serialize a comma-separated list on performing serialize a URL or serialize a LOCAL for each source on the source list.
     3. The string "`;`", i.e., SEMICOLON (U+003B).
  6. If rule’s associated unicode-range descriptor is present, a single SPACE (U+0020), followed by the string "`unicode-range:`", followed by a single SPACE (U+0020), followed by the result of performing serialize a <'unicode-range'>, followed by the string "`;`", i.e., SEMICOLON (U+003B).
  7. If rule’s associated font-variant descriptor is present, a single SPACE (U+0020), followed by the string "`font-variant:`", followed by a single SPACE (U+0020), followed by the result of performing serialize a <'font-variant'>, followed by the string "`;`", i.e., SEMICOLON (U+003B).
  8. If rule’s associated font-feature-settings descriptor is present, a single SPACE (U+0020), followed by the string "`font-feature-settings:`", followed by a single SPACE (U+0020), followed by the result of performing serialize a <'font-feature-settings'>, followed by the string "`;`", i.e., SEMICOLON (U+003B).
  9. If rule’s associated font-stretch descriptor is present, a single SPACE (U+0020), followed by the string "`font-stretch:`", followed by a single SPACE (U+0020), followed by the result of performing serialize a <'font-stretch'>, followed by the string "`;`", i.e., SEMICOLON (U+003B).
  10. If rule’s associated font-weight descriptor is present, a single SPACE (U+0020), followed by the string "`font-weight:`", followed by a single SPACE (U+0020), followed by the result of performing serialize a <'font-weight'>, followed by the string "`;`", i.e., SEMICOLON (U+003B).
  11. If rule’s associated font-style descriptor is present, a single SPACE (U+0020), followed by the string "`font-style:`", followed by a single SPACE (U+0020), followed by the result of performing serialize a <'font-style'>, followed by the string "`;`", i.e., SEMICOLON (U+003B).
  12. A single SPACE (U+0020), followed by the string "}", i.e., RIGHT CURLY BRACKET (U+007D).

  Need to define how the `CSSFontFaceRule` descriptors' values are serialized.

`CSSPageRule`

  Need to define how `CSSPageRule` is serialized.

`CSSNamespaceRule`
  The literal string "`@namespace`", followed by a single SPACE (U+0020), followed by the serialization as an identifier of the `prefix` attribute (if any), followed by a single SPACE (U+0020) if there is a prefix, followed by the serialization as URL of the `namespaceURI` attribute, followed the character "`;`" (U+003B).

To insert a CSS rule rule in a CSS rule list list at index index, follow these steps:

1. Set length to the number of items in list.
2. If index is greater than length, then throw an `IndexSizeError` exception.
3. Set new rule to the results of performing parse a CSS rule on argument rule.
4. If new rule is a syntax error, throw a `SyntaxError` exception.
5. If new rule cannot be inserted into list at the zero-index position index due to constraints specified by CSS, then throw a `HierarchyRequestError` exception. [CSS21]

   Note: For example, a CSS style sheet cannot contain an `@import` at-rule after a style rule.

6. If new rule is an `@namespace` at-rule, and list contains anything other than `@import` at-rules, and `@namespace` at-rules, throw an `InvalidStateError` exception.
7. Insert new rule into list at the zero-indexed position index.
8. Return index.

To remove a CSS rule from a CSS rule list list at index index, follow these steps:

1. Set length to the number of items in list.
2. If index is greater than or equal to length, then throw an `IndexSizeError` exception.
3. Set old rule to the indexth item in list.
4. If old rule is an `@namespace` at-rule, and list contains anything other than `@import` at-rules, and `@namespace` at-rules, throw an `InvalidStateError` exception.
5. Remove rule old rule from list at the zero-indexed position index.
6. Set old rule’s parent CSS rule and parent CSS style sheet to null.

#### 6.4.1. The `CSSRuleList` Interface

The `CSSRuleList` interface represents an ordered collection of CSS style rules.

    [Exposed=Window]
    interface CSSRuleList {
      getter CSSRule? item(unsigned long index);
      readonly attribute unsigned long length;
    };

The object’s supported property indices are the numbers in the range zero to one less than the number of `CSSRule` objects represented by the collection. If there are no such `CSSRule` objects, then there are no supported property indices.

The `item(index)` method must return the indexth `CSSRule` object in the collection. If there is no indexth object in the collection, then the method must return null.

The `length` attribute must return the number of `CSSRule` objects represented by the collection.

#### 6.4.2. The `CSSRule` Interface

The `CSSRule` interface represents an abstract, base CSS style rule. Each distinct CSS style rule type is represented by a distinct interface that inherits from this interface.

    [Exposed=Window]
    interface CSSRule {
      attribute CSSOMString cssText;
      readonly attribute CSSRule? parentRule;
      readonly attribute CSSStyleSheet? parentStyleSheet;

      // the following attribute and constants are historial
      readonly attribute unsigned short type;
      const unsigned short STYLE_RULE = 1;
      const unsigned short CHARSET_RULE = 2;
      const unsigned short IMPORT_RULE = 3;
      const unsigned short MEDIA_RULE = 4;
      const unsigned short FONT_FACE_RULE = 5;
      const unsigned short PAGE_RULE = 6;
      const unsigned short MARGIN_RULE = 9;
      const unsigned short NAMESPACE_RULE = 10;
    };

The `cssText` attribute must return a serialization of the CSS rule. On setting the `cssText` attribute must do nothing.

The `parentRule` attribute must return the parent CSS rule.

Note: For example, `@media` can enclose a rule, in which case `parentRule` would be non-null; in cases where there is no enclosing rule, `parentRule` will be null.

The `parentStyleSheet` attribute must return the parent CSS style sheet.

Note: The only circumstance where null is returned when a rule has been removed.

Note: Removing a `Node` that implements the `LinkStyle` interface from a `Document` instance does not (by itself) cause the `CSSStyleSheet` referenced by a `CSSRule` to be unreachable.

The `type` attribute is deprecated. It must return an integer, as follows:

If the object is a `CSSStyleRule`
  Return 1.
If the object is a `CSSImportRule`
  Return 3.
If the object is a `CSSMediaRule`
  Return 4.
If the object is a `CSSFontFaceRule`
  Return 5.
If the object is a `CSSPageRule`
  Return 6.
If the object is a `CSSKeyframesRule`
  Return 7.
If the object is a `CSSKeyframeRule`
  Return 8.
If the object is a `CSSMarginRule`
  Return 9.
If the object is a `CSSNamespaceRule`
  Return 10.
If the object is a `CSSCounterStyleRule`
  Return 11.
If the object is a `CSSSupportsRule`
  Return 12.
If the object is a `CSSFontFeatureValuesRule`
  Return 14.
If the object is a `CSSViewportRule`
  Return 15.
Otherwise
  Return 0.

Note: The practice of using an integer enumeration and several constants to identify the integers is a legacy design practice that is no longer used in Web APIs. Instead, to tell what type of rule a given object is, it is recommended to check `rule.constructor.name`, which will return a string like `"CSSStyleRule"`.

#### 6.4.3. The `CSSStyleRule` Interface

The `CSSStyleRule` interface represents a style rule.

    [Exposed=Window]
    interface CSSStyleRule : CSSRule {
      attribute CSSOMString selectorText;
      [SameObject, PutForwards=cssText] readonly attribute CSSStyleDeclaration style;
    };

The `selectorText` attribute, on getting, must return the result of serializing the associated group of selectors. On setting the `selectorText` attribute these steps must be run:

1. Run the parse a group of selectors algorithm on the given value.
2. If the algorithm returns a non-null value replace the associated group of selectors with the returned value.
3. Otherwise, if the algorithm returns a null value, do nothing.

The `style` attribute must return a `CSSStyleDeclaration` object for the style rule, with the following properties:

readonly flag
  Unset.
declarations
  The declared declarations in the rule, in specified order.
parent CSS rule
  The context object.
owner node
  Null.

The specified order for declarations is the same as specified, but with shorthand properties expanded into their longhand properties, in canonical order. If a property is specified more than once (after shorthand expansion), only the one with greatest cascading order must be represented, at the same relative position as it was specified. [CSS3CASCADE]

#### 6.4.4. The `CSSImportRule` Interface

The `CSSImportRule` interface represents an `@import` at-rule.

    [Exposed=Window]
    interface CSSImportRule : CSSRule {
      readonly attribute USVString href;
      [SameObject, PutForwards=mediaText] readonly attribute MediaList media;
      [SameObject] readonly attribute CSSStyleSheet styleSheet;
    };

The `href` attribute must return the URL specified by the `@import` at-rule.

Note: To get the resolved URL use the `href` attribute of the associated CSS style sheet.

The `media` attribute must return the value of the `media` attribute of the associated CSS style sheet.

The `styleSheet` attribute must return the associated CSS style sheet.

Note: An `@import` at-rule always has an associated CSS style sheet.

#### 6.4.5. The `CSSGroupingRule` Interface

The `CSSGroupingRule` interface represents an at-rule that contains other rules nested inside itself.

    [Exposed=Window]
    interface CSSGroupingRule : CSSRule {
      [SameObject] readonly attribute CSSRuleList cssRules;
      unsigned long insertRule(CSSOMString rule, optional unsigned long index = 0);
      void deleteRule(unsigned long index);
    };

The `cssRules` attribute must return a `CSSRuleList` object for the child CSS rules.

The `insertRule(rule, index)` method must return the result of invoking insert a CSS rule rule into the child CSS rules at index.

The `deleteRule(index)` method must remove a CSS rule from the child CSS rules at index.

#### 6.4.6. The `CSSMediaRule` Interface

The `CSSMediaRule` interface is defined in CSS Conditional Rules. [CSS3-CONDITIONAL]

#### 6.4.7. The `CSSPageRule` Interface

The `CSSPageRule` interface represents an `@page` at-rule.

Need to define the rules for parse a list of CSS page selectors and serialize a list of CSS page selectors.

    [Exposed=Window]
    interface CSSPageRule : CSSGroupingRule {
               attribute CSSOMString selectorText;
      [SameObject, PutForwards=cssText] readonly attribute CSSStyleDeclaration style;
    };

The `selectorText` attribute, on getting, must return the result of serializing the associated list of CSS page selectors. On setting the `selectorText` attribute these steps must be run:

1. Run the parse a list of CSS page selectors algorithm on the given value.
2. If the algorithm returns a non-null value replace the associated list of CSS page selectors with the returned value.
3. Otherwise, if the algorithm returns a null value, do nothing.

The `style` attribute must return a `CSSStyleDeclaration` object for the `@page` at-rule, with the following properties:

readonly flag
  Unset.
declarations
  The declared declarations in the rule, in specified order.
parent CSS rule
  The context object.
owner node
  Null.

#### 6.4.8. The `CSSMarginRule` Interface

The `CSSMarginRule` interface represents a margin at-rule (e.g. `@top-left`) in an `@page` at-rule. [CSS3PAGE]

    [Exposed=Window]
    interface CSSMarginRule : CSSRule {
      readonly attribute CSSOMString name;
      [SameObject, PutForwards=cssText] readonly attribute CSSStyleDeclaration style;
    };

The `name` attribute must return the name of the margin at-rule. The `@` character is not included in the name. [CSS3SYN]

The `style` attribute must return a `CSSStyleDeclaration` object for the margin at-rule, with the following properties:

readonly flag
  Unset.
declarations
  The declared declarations in the rule, in specified order.
parent CSS rule
  The context object.
owner node
  Null.

#### 6.4.9. The `CSSNamespaceRule` Interface

The `CSSNamespaceRule` interface represents an `@namespace` at-rule.

    [Exposed=Window]
    interface CSSNamespaceRule : CSSRule {
      readonly attribute CSSOMString namespaceURI;
      readonly attribute CSSOMString prefix;
    };

The `namespaceURI` attribute must return the namespace of the `@namespace` at-rule.

The `prefix` attribute must return the prefix of the `@namespace` at-rule or the empty string if there is no prefix.

### 6.5. CSS Declarations

A CSS declaration is an abstract concept that is not exposed as an object in the DOM. A CSS declaration has the following associated properties:

property name
  The property name of the declaration.
value
  The value of the declaration represented as a list of component values.
important flag
  Either set or unset. Can be changed.
case-sensitive flag
  Set if the property name is defined to be case-sensitive according to its specification, otherwise unset.

### 6.6. CSS Declaration Blocks

A CSS declaration block is an ordered collection of CSS properties with their associated values, also named CSS declarations. In the DOM a CSS declaration block is a `CSSStyleDeclaration` object. A CSS declaration block has the following associated properties:

readonly flag
  Unset if the object can be manipulated. Set if it can not be manipulated. Unless otherwise stated it is unset.
declarations
  The CSS declarations associated with the object.
parent CSS rule
  The CSS rule that the CSS declaration block is associated with, if any, or null otherwise.
owner node
  The `Element` that the CSS declaration block is associated with, if any, or null otherwise.
updating flag
  Unset by default. Set when the CSS declaration block is updating the owner node’s `style` attribute.

To parse a CSS declaration block from a string string, follow these steps:

1. Let declarations be the return value of invoking parse a list of declarations with string.
2. Let parsed declarations be a new empty list.
3. For each item declaration in declarations, follow these substeps:
   1. Let parsed declaration be the result of parsing declaration according to the appropriate CSS specifications, dropping parts that are said to be ignored. If the whole declaration is dropped, let parsed declaration be null.
   2. If parsed declaration is not null, append it to parsed declarations.
4. Return parsed declarations.

To serialize a CSS declaration with property name property, value value and optionally an important flag set, follow these steps:

1. Let s be the empty string.
2. Append property to s.
3. Append "`:` " (U+003A U+0020) to s.
4. Append value to s.
5. If the important flag is set, append "`!important`" (U+0020 U+0021 U+0069 U+006D U+0070 U+006F U+0072 U+0074 U+0061 U+006E U+0074) to s.
6. Append "`;`" (U+003B) to s.
7. Return s.

To serialize a CSS declaration block declaration block means to run the steps below:

1. Let list be an empty array.
2. Let already serialized be an empty array.
3. Declaration loop: For each CSS declaration declaration in declaration block’s declarations, follow these substeps:
   1. Let property be declaration’s property name.
   2. If property is in already serialized, continue with the steps labeled declaration loop.
   3. If property maps to one or more shorthand properties, let shorthands be an array of those shorthand properties, in preferred order, and follow these substeps:
      1. Let longhands be an array consisting of all CSS declarations in declaration block’s declarations that that are not in already serialized and have a property name that maps to one of the shorthand properties in shorthands.
      2. Shorthand loop: For each shorthand in shorthands, follow these substeps:
         1. If all properties that map to shorthand are not present in longhands, continue with the steps labeled shorthand loop.
         2. Let current longhands be an empty array.
         3. Append all CSS declarations in longhands have a property name that maps to shorthand to current longhands.
         4. If there is one or more CSS declarations in current longhands have their important flag set and one or more with it unset, continue with the steps labeled shorthand loop.
         5. Let value be the result of invoking serialize a CSS value of current longhands.
         6. If value is the empty string, continue with the steps labeled shorthand loop.
         7. Let serialized declaration be the result of invoking serialize a CSS declaration with property name shorthand, value value, and the important flag set if the CSS declarations in current longhands have their important flag set.
         8. Append serialized declaration to list.
         9. Append the property names of all items of current longhands to already serialized.
         10. Remove the items present in current longhands from longhands.
   4. If property is in already serialized, continue with the steps labeled declaration loop.
   5. Let value be the result of invoking serialize a CSS value of declaration.
   6. Let serialized declaration be the result of invoking serialize a CSS declaration with property name property, value value, and the important flag set if declaration has its important flag set.
   7. Append serialized declaration to list.
   8. Append property to already serialized.
4. Return list joined with "`` " (U+0020).

Note: The serialization of an empty CSS declaration block is the empty string.

Note: The serialization of a non-empty CSS declaration block does not include any surrounding whitespace, i.e., no whitespace appears before the first property name and no whitespace appears after the final semicolon delimiter that follows the last property value.

A CSS declaration block has these attribute change steps for its owner node with localName, value, and namespace:

1. If the readonly flag is set, then return.
2. If the updating flag is set, then return.
3. If localName is not "`style`", or namespace is not null, then return.
4. If value is null, empty the declarations.
5. Otherwise, let the declarations be the result of parse a CSS declaration block from a string value.

When a CSS declaration block object is created, then:

1. Let owner node be the owner node.
2. If owner node is null, or the readonly flag is set, then return.
3. Let value be the result of getting an attribute given null, "`style`", and owner node.
4. If value is not null, let the declarations be the result of parse a CSS declaration block from a string value.

To update style attribute for declaration block means to run the steps below:

1. Assert: declaration block’s readonly flag is unset.
2. Let owner node be declaration block’s owner node.
3. If owner node is null, then return.
4. Set declaration block’s updating flag.
5. Set an attribute value for owner node using "`style`" and the result of serializing declaration block.
6. Unset declaration block’s updating flag.

The preferred order of a list of shorthand properties shorthands is as follows:

1. Order shorthands lexicographically.
2. Move all items in shorthands that begin with "`-`" (U+002D) last in the list, retaining their relative order.
3. Move all items in shorthands that begin with "`-`" (U+002D) but do not begin with "`-webkit-`" last in the list, retaining their relative order.
4. Order shorthands by the number of longhand properties that map to it, with the greatest number first.

#### 6.6.1. The `CSSStyleDeclaration` Interface

The `CSSStyleDeclaration` interface represents a CSS declaration block, including its underlying state, where this underlying state depends upon the source of the `CSSStyleDeclaration` instance.

    [Exposed=Window]
    interface CSSStyleDeclaration {
      [CEReactions] attribute CSSOMString cssText;
      readonly attribute unsigned long length;
      getter CSSOMString item(unsigned long index);
      CSSOMString getPropertyValue(CSSOMString property);
      CSSOMString getPropertyPriority(CSSOMString property);
      [CEReactions] void setProperty(CSSOMString property, [TreatNullAs=EmptyString] CSSOMString value, optional [TreatNullAs=EmptyString] CSSOMString priority = "");
      [CEReactions] CSSOMString removeProperty(CSSOMString property);
      readonly attribute CSSRule? parentRule;
      [CEReactions] attribute [TreatNullAs=EmptyString] CSSOMString cssFloat;
    };

The object’s supported property indices are the numbers in the range zero to one less than the number of CSS declarations in the declarations. If there are no such CSS declarations, then there are no supported property indices.

The `cssText` attribute must return the result of serializing the declarations. Setting the `cssText` attribute must run these steps:

1. If the readonly flag is set, then throw a `NoModificationAllowedError` exception.
2. Empty the declarations.
3. Parse the given value and, if the return value is not the empty list, insert the items in the list into the declarations, in specified order.
4. Update style attribute for the CSS declaration block.

The `length` attribute must return the number of CSS declarations in the declarations.

The `item(index)` method must return the property name of the CSS declaration at position index.

The `getPropertyValue(property)` method must run these steps:

1. If property is not a custom property, follow these substeps:
   1. Let property be property converted to ASCII lowercase.
   2. If property is a shorthand property, then follow these substeps:
      1. Let list be a new empty array.
      2. For each longhand property longhand that property maps to, in canonical order, follow these substeps:
         1. If longhand is a case-sensitive match for a property name of a CSS declaration in the declarations, let declaration be that CSS declaration, or null otherwise.
         2. If declaration is null, then return the empty string.
         3. Append the declaration to list.
      3. If important flags of all declarations in list are same, then return the serialization of list.
      4. Return the empty string.
2. If property is a case-sensitive match for a property name of a CSS declaration in the declarations, then return the result of invoking serialize a CSS value of that declaration.
3. Return the empty string.

The `getPropertyPriority(property)` method must run these steps:

1. If property is not a custom property, follow these substeps:
   1. Let property be property converted to ASCII lowercase.
   2. If property is a shorthand property, follow these substeps:
      1. Let list be a new array.
      2. For each longhand property longhand that property maps to, append the result of invoking `getPropertyPriority()` with longhand as argument to list.
      3. If all items in list are the string "`important`", then return the string "`important`".
2. If property is a case-sensitive match for a property name of a CSS declaration in the declarations that has the important flag set, return the string "`important`".
3. Return the empty string.

E.g. for `background-color:lime !IMPORTANT` the return value would be "`important`".

The `setProperty(property, value, priority)` method must run these steps:

1. If the readonly flag is set, then throw a `NoModificationAllowedError` exception.
2. If property is not a custom property, follow these substeps:
   1. Let property be property converted to ASCII lowercase.
   2. If property is not a case-sensitive match for a supported CSS property, then return.
3. If value is the empty string, invoke `removeProperty()` with property as argument and return.
4. If priority is not the empty string and is not an ASCII case-insensitive match for the string "`important`", then return.
5. Let component value list be the result of parsing value for property property.

   Note: value can not include "`!important`".

6. If component value list is null, then return.
7. Let updated be false.
8. If property is a shorthand property, then for each longhand property longhand that property maps to, in canonical order, follow these substeps:
   1. Let longhand result be the result of set the CSS declaration longhand with the appropriate value(s) from component value list, with the important flag set if priority is not the empty string, and unset otherwise, and with the list of declarations being the declarations.
   2. If longhand result is true, let updated be true.
9. Otherwise, let updated be the result of set the CSS declaration property with value component value list, with the important flag set if priority is not the empty string, and unset otherwise, and with the list of declarations being the declarations.
10. If updated is true, update style attribute for the CSS declaration block.

To set a CSS declaration property with a value component value list and optionally with an important flag set, in a list of declarations declarations, the user agent must ensure the following constraints hold after its steps:

- Exactly one CSS declaration whose property name is a case-sensitive match of property must exist in declarations. Such declaration is referenced as the target declaration below.
- The target declaration must have value being component value list, and target declaration’s important flag must be set if important flag is set, and unset otherwise.
- Any CSS declaration which is not the target declaration must not be changed, inserted, or removed from declarations.
- If there are CSS declarations in declarations whose property name is in the same logical property group as property, but has a different mapping logic, target declaration must be at an index after all of those CSS declarations.
- The steps must return true if the serialization of declarations was changed as result of the steps. It may return false otherwise.

Should we add something like "Any observable side effect must not be made outside declarations"? The current constraints sound like a hole for undefined behavior.

Note: The steps of set a CSS declaration are not defined in this level of CSSOM. User agents may use different algorithms as long as the constraints above hold.

The simplest way to conform with the constraints would be to always remove any existing declaration matching property, and append the new declaration to the end. But based on implementation feedback, this approach would likely regress performance.

Another possible algorithm is:

1. If property is a case-sensitive match for a property name of a CSS declaration in declarations, follow these substeps:
   1. Let target declaration be such CSS declaration.
   2. Let needs append be false.
   3. For each declaration in declarations after target declaration:
      1. If declaration’s property name is not in the same logical property group as property, then continue.
      2. If declaration’ property name has the same mapping logic as property, then continue.
      3. Let needs append be true.
      4. Break.
   4. If needs append is false, then:
      1. Let needs update be false.
      2. If target declaration’s value is not equal to component value list, then let needs update be true.
      3. If target declaration’s important flag is not equal to whether important flag is set, then let needs update be true.
      4. If needs update is false, then return false.
      5. Set target declaration’s value to component value list.
      6. If important flag is set, then set target declaration’s important flag, otherwise unset it.
      7. Return true.
   5. Otherwise, remove target declaration from declarations.
2. Append a new CSS declaration with property name property, value component value list, and important flag set if important flag is set to declarations.
3. Return true.

The `removeProperty(property)` method must run these steps:

1. If the readonly flag is set, then throw a `NoModificationAllowedError` exception.
2. If property is not a custom property, let property be property converted to ASCII lowercase.
3. Let value be the return value of invoking `getPropertyValue()` with property as argument.
4. Let removed be false.
5. If property is a shorthand property, for each longhand property longhand that property maps to:
   1. If longhand is not a property name of a CSS declaration in the declarations, continue.
   2. Remove that CSS declaration and let removed be true.
6. Otherwise, if property is a case-sensitive match for a property name of a CSS declaration in the declarations, remove that CSS declaration and let removed be true.
7. If removed is true, Update style attribute for the CSS declaration block.
8. Return value.

The `parentRule` attribute must return the parent CSS rule.

The `cssFloat` attribute, on getting, must return the result of invoking `getPropertyValue()` with `float` as argument. On setting, the attribute must invoke `setProperty()` with `float` as first argument, as second argument the given value, and no third argument. Any exceptions thrown must be re-thrown.

For each CSS property property that is a supported CSS property, the following partial interface applies where camel-cased attribute is obtained by running the CSS property to IDL attribute algorithm for property.

    partial interface CSSStyleDeclaration {
      [CEReactions] attribute [TreatNullAs=EmptyString] CSSOMString _camel_cased_attribute;
    };

The `camel-cased attribute` attribute, on getting, must return the result of invoking `getPropertyValue()` with the argument being the result of running the IDL attribute to CSS property algorithm for camel-cased attribute.

Setting the camel-cased attribute attribute must invoke `setProperty()` with the first argument being the result of running the IDL attribute to CSS property algorithm for camel-cased attribute, as second argument the given value, and no third argument. Any exceptions thrown must be re-thrown.

For example, for the font-size property there would be a `fontSize` IDL attribute.

For each CSS property property that is a supported CSS property and that begins with the string `-webkit-`, the following partial interface applies where webkit-cased attribute is obtained by running the CSS property to IDL attribute algorithm for property, with the lowercase first flag set.

    partial interface CSSStyleDeclaration {
      [CEReactions] attribute [TreatNullAs=EmptyString] CSSOMString _webkit_cased_attribute;
    };

The `webkit-cased attribute` attribute, on getting, must return the result of invoking `getPropertyValue()` with the argument being the result of running the IDL attribute to CSS property algorithm for webkit-cased attribute, with the dash prefix flag set.

Setting the webkit-cased attribute attribute must invoke `setProperty()` with the first argument being the result of running the IDL attribute to CSS property algorithm for webkit-cased attribute, with the dash prefix flag set, as second argument the given value, and no third argument. Any exceptions thrown must be re-thrown.

For example, if the user agent supports the -webkit-transform property, there would be a `webkitTransform` IDL attribute. There would also be a `WebkitTransform` IDL attribute because of the rules for camel-cased attributes.

For each CSS property property that is a supported CSS property, except for properties that have no "`-`" (U+002D) in the property name, the following partial interface applies where dashed attribute is property.

    partial interface CSSStyleDeclaration {
      [CEReactions] attribute [TreatNullAs=EmptyString] CSSOMString _dashed_attribute;
    };

The `dashed attribute` attribute, on getting, must return the result of invoking `getPropertyValue()` with the argument being dashed attribute.

Setting the dashed attribute attribute must invoke `setProperty()` with the first argument being dashed attribute, as second argument the given value, and no third argument. Any exceptions thrown must be re-thrown.

For example, for the font-size property there would be a `font-size` IDL attribute. In JavaScript, the property can be accessed as follows, assuming element is an HTML element:

    element.style['font-size'];

The CSS property to IDL attribute algorithm for property, optionally with a lowercase first flag set, is as follows:

1. Let output be the empty string.
2. Let uppercase next be unset.
3. If the lowercase first flag is set, remove the first character from property.
4. For each character c in property:
   1. If c is "`-`" (U+002D), let uppercase next be set.
   2. Otherwise, if uppercase next is set, let uppercase next be unset and append c converted to ASCII uppercase to output.
   3. Otherwise, append c to output.
5. Return output.

The IDL attribute to CSS property algorithm for attribute, optionally with a dash prefix flag set, is as follows:

1. Let output be the empty string.
2. If the dash prefix flag is set, append "`-`" (U+002D) to output.
3. For each character c in attribute:
   1. If c is in the range U+0041 to U+005A (ASCII uppercase), append "`-`" (U+002D) followed by c converted to ASCII lowercase to output.
   2. Otherwise, append c to output.
4. Return output.

### 6.7. CSS Values

#### 6.7.1. Parsing CSS Values

To parse a CSS value value for a given property means to follow these steps:

1. Let list be the value returned by invoking parse a list of component values from value.
2. Match list against the grammar for the property property in the CSS specification.
3. If the above step failed, return null.
4. Return list.

Note: "`!important`" declarations are not part of the property value space and will therefore cause parse a CSS value to return null.

#### 6.7.2. Serializing CSS Values

To serialize a CSS value of a CSS declaration declaration or a list of longhand CSS declarations list, follow these rules:

1. If this algorithm is invoked with a list list:

   1. Let shorthand be the first shorthand property, in preferred order, that exactly maps to all of the longhand properties in list.

   2. If there is no such shorthand or shorthand cannot exactly represent the values of all the properties in list, return the empty string.

   3. Otherwise, serialize a CSS value from a hypothetical declaration of the property shorthand with its value representing the combined values of the declarations in list.

2. Represent the value of the declaration as a list of CSS component values components that, when parsed according to the property’s grammar, would represent that value. Additionally:

   - If certain component values can appear in any order without changing the meaning of the value (a pattern typically represented by a double bar || in the value syntax), reorder the component values to use the canonical order of component values as given in the property definition table.

   - If component values can be omitted or replaced with a shorter representation without changing the meaning of the value, omit/replace them.

   - If either of the above syntactic translations would be less backwards-compatible, do not perform them.

   Note: The rules described here outlines the general principles of serialization. For legacy reasons, some properties serialize in a different manner, which is intentionally undefined here due to lack of resources. Please consult your local reverse-engineer for details.

3. Remove any <whitespace-token>s from components.

4. Replace each component value in components with the result of invoking serialize a CSS component value.

5. Join the items of components into a single string, inserting " " (U+0020 SPACE) between each pair of items unless the second item is a "," (U+002C COMMA) Return the result.

To serialize a CSS component value depends on the component, as follows:

keyword
  The keyword converted to ASCII lowercase.
<angle>
  The <number> component serialized as per <number> followed by the unit in canonical form as defined in its respective specification.

  Probably should distinguish between specified and computed / resolved values.

<color>
  If <color> is a component of a resolved or computed value, then return the color using the `rgb()` or `rgba()` functional notation as follows:
  1. If the alpha component of the color is equal to one, then return the serialization of the `rgb()` functional equivalent of the opaque color.
  2. If the alpha component of the color is not equal to one, then return the serialization of the `rgba()` functional equivalent of the non-opaque color.
  The serialization of the `rgb()` functional equivalent is the concatenation of the following:
  1. The string "`rgb(`".
  2. The shortest base-ten integer serialization of the color’s red component.
  3. The string "`,` ".
  4. The shortest base-ten serialization of the color’s green component.
  5. The string "`,` ".
  6. The shortest base-ten serialization of the color’s blue component.
  7. The string "`)`".
  The serialization of the `rgba()` functional equivalent is the concatenation of the following:
  1. The string "`rgba(`".
  2. The shortest base-ten serialization of the color’s red component.
  3. The string "`,` ".
  4. The shortest base-ten serialization of the color’s green component.
  5. The string "`,` ".
  6. The shortest base-ten serialization of the color’s blue component.
  7. The string "`,` ".
  8. The serialization of the color’s alpha component as an <alphavalue>.
  9. The string "`)`".

  In the above rules, the string "`,` " denotes a COMMA (U+002C) followed by a single SPACE (U+0020).

  If <color> is a component of a specified value, then return the color as follows:

  1. If the color was explicitly specified by the author, then return the original, author specified color value.
  2. Otherwise, return the value that would be returned if the color were a component of a computed value.

  Should author specified values be normalized for case? Or should original case be preserved?

<alphavalue>
  If the value is internally represented as an integer between 0 and 255 inclusive (i.e. 8-bit unsigned integer), follow these steps:
  1. Let alpha be the given integer.
  2. If there exists an integer between 0 and 100 inclusive that, when multiplied with 2.55 and rounded to the closest integer (rounding up if two values are equally close), equals alpha, let rounded be that integer divided by 100.
  3. Otherwise, let rounded be alpha divided by 0.255 and rounded to the closest integer (rounding up if two values are equally close), divided by 1000.
  4. Return the result of serializing rounded as a <number>.

  Otherwise, return the result of serializing the given value as a <number>.

<counter>
  The return value of the following algorithm:
  1. Let s be the empty string.
  2. If <counter> has three CSS component values append the string "`counters(`" to s.
  3. If <counter> has two CSS component values append the string "`counter(`" to s.
  4. Let list be a list of CSS component values belonging to <counter>, omitting the last CSS component value if it is "decimal".
  5. Let each item in list be the result of invoking serialize a CSS component value on that item.
  6. Append the result of invoking serialize a comma-separated list on list to s.
  7. Append "`)`" (U+0029) to s.
  8. Return s.
<frequency>
  The <number> component serialized as per <number> followed by the unit in its canonical form as defined in its respective specification.

  Probably should distinguish between specified and computed / resolved values.

<identifier>
  The identifier serialized as an identifier.
<integer>
  A base-ten integer using digits 0-9 (U+0030 to U+0039) in the shortest form possible, preceded by "`-`" (U+002D) if it is negative.
<length>
  The <number> component serialized as per <number> followed by the unit in its canonical form as defined in its respective specification.

  Probably should distinguish between specified and computed / resolved values.

<number>
  A base-ten number using digits 0-9 (U+0030 to U+0039) in the shortest form possible, using "`.`" to separate decimals (if any), rounding the value if necessary to not produce more than 6 decimals, preceded by "`-`" (U+002D) if it is negative.

  Note: scientific notation is not used.

<percentage>
  The <number> component serialized as per <number> followed by the literal string "`%`" (U+0025).
<resolution>
  The resolution in dots per CSS pixel serialized as per <number> followed by the literal string "`dppx`".
<ratio>
  The numerator serialized as per <number> followed by the literal string "`/` ", followed by the denominator serialized as per <number>.
<shape>
  The return value of the following algorithm:
  1. Let s be the string "`rect(`".
  2. Let list be a list of the CSS component values belonging to <shape>.
  3. Let each item in list be the result of invoking serialize a CSS component value of that item.
  4. Append the result of invoking serialize a comma-separated list on list to s.
  5. Append "`)`" (U+0029) to s.
  6. Return s.
<string>
<family-name>
<specific-voice>
  The string serialized as a string.
<time>
  The time in seconds serialized as per <number> followed by the literal string "`s`".
<url>
  The absolute-URL string serialized as URL.

  This should differentiate specified and computed <url> values, see #3195.

<absolute-size>, <border-width>, <border-style>, <bottom>, <generic-family>, <generic-voice>, <left>, <margin-width>, <padding-width>, <relative-size>, <right>, and <top>, are considered macros by this specification. They all represent instances of components outlined above.

One idea is that we can remove this section somewhere in the CSS3/CSS4 timeline by moving the above definitions to the drafts that define the CSS components.

##### 6.7.2.1. Examples

Here are some examples of before and after results on specified values. The before column could be what the author wrote in a style sheet, while the after column shows what querying the DOM would return.

Before | After
--- | ---
`background: none` | `background: rgba(0, 0, 0, 0)`
`outline: none` | `outline: invert`
`border: none` | `border: medium`
`list-style: none` | `list-style: disc`
`margin: 0 1px 1px 1px` | `margin: 0px 1px 1px`
`azimuth: behind left` | `azimuth: 220deg`
`font-family: a, 'b"', serif` | `font-family: "a", "b\"", serif`
`content: url('h)i') '\[\]'` | `content: url("h)i") "[]"`
`azimuth: leftwards` | `azimuth: leftwards`
`color: rgb(18, 52, 86)` | `color: #123456`
`color: rgba(000001, 0, 0, 1)` | `color: #000000`

Some of these need to be updated per the new rules.

## 7. DOM Access to CSS Declaration Blocks

### 7.1. The `ElementCSSInlineStyle` Mixin

The `ElementCSSInlineStyle` mixin provides access to inline style properties of an element.

    interface mixin ElementCSSInlineStyle {
      [SameObject, PutForwards=cssText] readonly attribute CSSStyleDeclaration style;
    };

The `style` attribute must return a CSS declaration block object whose readonly flag is unset, whose parent CSS rule is null, and whose owner node is the context object.

If the user agent supports HTML, the following IDL applies: [HTML]

    HTMLElement includes ElementCSSInlineStyle;

If the user agent supports SVG, the following IDL applies: [SVG11]

    SVGElement includes ElementCSSInlineStyle;

### 7.2. Extensions to the `Window` Interface

    partial interface Window {
      [NewObject] CSSStyleDeclaration getComputedStyle(Element elt, optional CSSOMString? pseudoElt);
    };

The `getComputedStyle(elt, pseudoElt)` method must run these steps:

1. Let doc be elt’s node document.
2. Let obj be elt.
3. If pseudoElt is provided, and it’s not the empty string, then:
   1. Parse pseudoElt as a <pseudo-element-selector>, and let type be the result.
   2. If type is failure, or is an ::slotted() or ::part() pseudo-element, throw a `TypeError` exception.
   3. Otherwise let obj be the given pseudo-element of elt.

   Note: CSS2 pseudo-elements should match both the double and single-colon versions. That is, both `:before` and `::before` should match above.

4. Let decls be an empty list of CSS declarations.
5. If elt is connected, part of the flat tree, and its shadow-including root has a browsing context which either doesn’t have a browsing context container, or whose browsing context container is being rendered, set decls to a list of all longhand properties that are supported CSS properties, in lexicographical order, with the value being the resolved value computed for obj using the style rules associated with doc.

   There are UAs that handle shorthands, and all UAs handle shorthands that used to be longhands like overflow, see #2529.

6. Return a live CSS declaration block with the following properties:
   readonly flag
     Set.
   declarations
     decls.
   parent CSS rule
     Null.
   owner node
     obj.

The `getComputedStyle()` method exposes information from CSS style sheets with the origin-clean flag unset.

Should getComputedStyle() provide a useful serialization? See #1033

## 8. Utility APIs

### 8.1. The `CSS.escape()` Method

The `CSS` namespace holds useful CSS-related functions that do not belong elsewhere.

    [Exposed=Window]
    namespace CSS {
      CSSOMString escape(CSSOMString ident);
    };

This was previously specified as an IDL interface that only held static methods. Switching to an IDL namespace is *nearly* identical, so it’s expected that there won’t be any compat concerns. If any are discovered, please report so we can consider reverting this change.

The `escape(ident)` operation must return the result of invoking serialize an identifier of ident.

For example, to serialize a string for use as part of a selector, the `escape()` method can be used:

    var element = document.querySelector('#' + CSS.escape(id) + ' > img');

The `escape()` method can also be used for escaping strings, although it escapes characters that don’t strictly need to be escaped:

    var element = document.querySelector('a[href="#' + CSS.escape(fragment) + '"]');

Specifications that define operations on the `CSS` namespace and want to store some state should store the state on the current global object’s associated `Document`.

## 9. Resolved Values

`getComputedStyle()` was historically defined to return the "computed value" of an element or pseudo-element. However, the concept of "computed value" changed between revisions of CSS while the implementation of `getComputedStyle()` had to remain the same for compatibility with deployed scripts. To address this issue this specification introduces the concept of a resolved value.

The resolved value for a given longhand property can be determined as follows:

background-color
border-block-end-color
border-block-start-color
border-bottom-color
border-inline-end-color
border-inline-start-color
border-left-color
border-right-color
border-top-color
box-shadow
caret-color
color
line-height
outline-color
A resolved value special case property like color defined in another specification
  The resolved value is the used value.
block-size
height
inline-size
margin-block-end
margin-block-start
margin-bottom
margin-inline-end
margin-inline-start
margin-left
margin-right
margin-top
padding-block-end
padding-block-start
padding-bottom
padding-inline-end
padding-inline-start
padding-left
padding-right
padding-top
width
A resolved value special case property like height defined in another specification
  If the property applies to the element or pseudo-element and the resolved value of the display property is not none or contents, then the resolved value is the used value. Otherwise the resolved value is the computed value.
bottom
left
inset-block-end
inset-block-start
inset-inline-end
inset-inline-start
right
top
A resolved value special case property like top defined in another specification
  If the property applies to a positioned element and the resolved value of the display property is not none or contents, and the property is not over-constrained, then the resolved value is the used value. Otherwise the resolved value is the computed value.
A resolved value special case property defined in another specification
  As defined in the relevant specification.
Any other property
  The resolved value is the computed value.

## 10. IANA Considerations

### 10.1. Default-Style

This section describes a header field for registration in the Permanent Message Header Field Registry.

Header field name
  Default-Style
Applicable protocol
  http
Status
  standard
Author/Change controller
  W3C
Specification document(s)
  This document is the relevant specification.
Related information
  None.

## 11. Change History

This section documents some of the changes between publications of this specification. This section is not exhaustive. Bug fixes and editorial changes are generally not listed.

### 11.1. Changes From 5 December 2013

- The `styleSheets` IDL attribute is moved from `Document` to `DocumentOrShadowRoot`.

- API for alternative stylesheets is removed: `selectedStyleSheetSet`, `lastStyleSheetSet`, `preferredStyleSheetSet`, `styleSheetSets`, `enableStyleSheetsForSet()` on `Document`.

- The `pseudo()` method on `Element` and the `PseudoElement` interface is removed.

- The `cascadedStyle`, `defaultStyle`, `rawComputedStyle` and `usedStyle` IDL attributes on `Element` are removed.

- The `cssText` IDL attribute’s setter on `CSSRule` is changed to do nothing.

- IDL attributes of the form `webkitFoo` (with lowercase `w`) on `CSSStyleDeclaration` are added.

- `CSSNamespaceRule` is changed back to readonly.

- Handling of `@charset` in `insertRule()` is removed.

- `CSSCharsetRule` is removed again.

- Serialization of identifiers and strings is changed.

- Serialization of selectors now supports combinators ">>" and "||" and the "i" flag in attribute selectors.

- Serialization of :lang() is changed.

- Serialization of <color> and <number> is changed.

- `setProperty()` on `CSSStyleDeclaration` is changed.

- `setPropertyValue` and `setPropertyPriority` are removed from `CSSStyleDeclaration` due to lack of interest from implementations.

### 11.2. Changes From 12 July 2011 To 5 December 2013

- Cross-origin stylesheets are not allowed to be read or changed.
- `CSSCharsetRule` is re-introduced.
- `CSSGroupingRule` and `CSSMarginRule` are introduced.
- `CSSNamespaceRule` is now mutable.
- Parse and serialize a CSS declaration block is now defined.
- Shorthands are now supported in `setProperty()`, `getPropertyValue()`, et al.
- `setPropertyValue` and `setPropertyPriority` are added to `CSSStyleDeclaration`.
- The `style` and `media` attributes of various interfaces are annotated with the `[PutForwards]` WebIDL extended attribute.
- The `pseudo()` method on `Element` is introduced.
- The `PseudoElement` interface is introduced.
- The `cascadedStyle`, `rawComputedStyle` and `usedStyle` attributes on `Element` and `PseudoElement` are introduced.
- The CSS.escape() static method is introduced.

## 12. Acknowledgments

The editors would like to thank Alexey Feldgendler, Benjamin Poulain, Björn Höhrmann, Boris Zbasky, Brian Kardell, Chris Dumez, Christian Krebs, Daniel Glazman, David Baron, Domenic Denicola, Dominique Hazael-Massieux, fantasai, Hallvord R. M. Steen, Ian Hickson, John Daggett, Lachlan Hunt, Mike Sherov, Myles C. Maxfield, Morten Stenshorne, Ms2ger, Nazım Can Altınova, Øyvind Stenhaug, Peter Sloetjes, Philip Jägenstedt, Philip Taylor, Richard Gibson, Robert O’Callahan, Simon Sapin, Sjoerd Visscher, Sylvain Galineau, Tarquin Wilton-Jones, Xidorn Quan, and Zack Weinberg for contributing to this specification.

Additional thanks to Ian Hickson for writing the initial version of the alternative style sheets API and canonicalization (now serialization) rules for CSS values.

## Conformance

### Document conventions

Conformance requirements are expressed with a combination of descriptive assertions and RFC 2119 terminology. The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in the normative parts of this document are to be interpreted as described in RFC 2119. However, for readability, these words do not appear in all uppercase letters in this specification.

All of the text of this specification is normative except sections explicitly marked as non-normative, examples, and notes. [RFC2119]

Examples in this specification are introduced with the words “for example” or are set apart from the normative text with `class="example"`, like this:

This is an example of an informative example.

Informative notes begin with the word “Note” and are set apart from the normative text with `class="note"`, like this:

Note, this is an informative note.

Advisements are normative sections styled to evoke special attention and are set apart from other normative text with `<strong class="advisement">`, like this: UAs MUST provide an accessible alternative.

### Conformance classes

Conformance to this specification is defined for three conformance classes:

style sheet
  A CSS style sheet.
renderer
  A UA that interprets the semantics of a style sheet and renders documents that use them.
authoring tool
  A UA that writes a style sheet.

A style sheet is conformant to this specification if all of its statements that use syntax defined in this module are valid according to the generic CSS grammar and the individual grammars of each feature defined in this module.

A renderer is conformant to this specification if, in addition to interpreting the style sheet as defined by the appropriate specifications, it supports all the features defined by this specification by parsing them correctly and rendering the document accordingly. However, the inability of a UA to correctly render a document due to limitations of the device does not make the UA non-conformant. (For example, a UA is not required to render color on a monochrome monitor.)

An authoring tool is conformant to this specification if it writes style sheets that are syntactically correct according to the generic CSS grammar and the individual grammars of each feature in this module, and meet all other conformance requirements of style sheets as described in this module.

### Requirements for Responsible Implementation of CSS

The following sections define several conformance requirements for implementing CSS responsibly, in a way that promotes interoperability in the present and future.

#### Partial Implementations

So that authors can exploit the forward-compatible parsing rules to assign fallback values, CSS renderers must treat as invalid (and ignore as appropriate) any at-rules, properties, property values, keywords, and other syntactic constructs for which they have no usable level of support. In particular, user agents must not selectively ignore unsupported property values and honor supported values in a single multi-value property declaration: if any value is considered invalid (as unsupported values must be), CSS requires that the entire declaration be ignored.

#### Implementations of Unstable and Proprietary Features

To avoid clashes with future stable CSS features, the CSSWG recommends following best practices for the implementation of unstable features and proprietary extensions to CSS.

#### Implementations of CR-level Features

Once a specification reaches the Candidate Recommendation stage, implementers should release an unprefixed implementation of any CR-level feature they can demonstrate to be correctly implemented according to spec, and should avoid exposing a prefixed variant of that feature.

To establish and maintain the interoperability of CSS across implementations, the CSS Working Group requests that non-experimental CSS renderers submit an implementation report (and, if necessary, the testcases used for that implementation report) to the W3C before releasing an unprefixed implementation of any CSS features. Testcases submitted to W3C are subject to review and correction by the CSS Working Group.

Further information on submitting testcases and implementation reports can be found from on the CSS Working Group’s website at http://www.w3.org/Style/CSS/Test/. Questions should be directed to the public-css-testsuite@w3.org mailing list.

## Index

### Terms defined by this specification

- add a CSS style sheet, in §6.2
- addRule(), in §6.1.2.1
- addRule(selector), in §6.1.2.1
- addRule(selector, block, optionalIndex), in §6.1.2.1
- addRule(selector, style), in §6.1.2.1
- addRule(selector, style, index), in §6.1.2.1
- alternate flag, in §6.1
- appendMedium(medium), in §4.4
- associated CSS style sheet, in §6.3.2
- camel-cased attribute, in §6.6.1
- camel_cased_attribute, in §6.6.1
- case-sensitive flag, in §6.5
- change the preferred CSS style sheet set name, in §6.2
- CHARSET_RULE, in §6.4.2
- child CSS rules, in §6.4
- collection of media queries, in §4.4
- compare media queries, in §4.3
- create a CSS style sheet, in §6.2
- create a MediaList object, in §4.4
- CSS, in §8.1
- CSS declaration, in §6.5
- CSS declaration block, in §6.6
- cssFloat, in §6.6.1
- CSSGroupingRule, in §6.4.5
- CSSImportRule, in §6.4.4
- CSSMarginRule, in §6.4.8
- CSSNamespaceRule, in §6.4.9
- CSSOMString, in §3
- CSSPageRule, in §6.4.7
- CSS property to IDL attribute, in §6.6.1
- CSS rule, in §6.4
- CSSRule, in §6.4.2
- CSSRuleList, in §6.4.1
- CSS rules, in §6.1
- cssRules
  - attribute for CSSGroupingRule, in §6.4.5
  - attribute for CSSStyleSheet, in §6.1.2
- CSSStyleDeclaration, in §6.6.1
- CSSStyleRule, in §6.4.3
- CSS style sheet, in §6.1
- CSSStyleSheet, in §6.1.2
- CSS style sheet set, in §6.2
- CSS style sheet set name, in §6.2
- cssText
  - attribute for CSSRule, in §6.4.2
  - attribute for CSSStyleDeclaration, in §6.6.1
- dashed attribute, in §6.6.1
- dashed_attribute, in §6.6.1
- declarations, in §6.6
- deleteMedium(medium), in §4.4
- deleteRule(index)
  - method for CSSGroupingRule, in §6.4.5
  - method for CSSStyleSheet, in §6.1.2
- disabled, in §6.1.1
- disabled flag, in §6.1
- document or shadow root CSS style sheets, in §6.2
- ElementCSSInlineStyle, in §7.1
- enable a CSS style sheet set, in §6.2
- enabled CSS style sheet set, in §6.2
- escape a character, in §2.1
- escape a character as code point, in §2.1
- escaped as code point, in §2.1
- escape(ident), in §8.1
- fetch a CSS style sheet, in §6.3.1
- FONT_FACE_RULE, in §6.4.2
- getComputedStyle(elt), in §7.2
- getComputedStyle(elt, pseudoElt), in §7.2
- getPropertyPriority(property), in §6.6.1
- getPropertyValue(property), in §6.6.1
- href
  - attribute for CSSImportRule, in §6.4.4
  - attribute for StyleSheet, in §6.1.1
- http-default-style, in §10.1
- IDL attribute to CSS property, in §6.6.1
- important flag, in §6.5
- IMPORT_RULE, in §6.4.2
- insert a CSS rule, in §6.4
- insertRule(rule)
  - method for CSSGroupingRule, in §6.4.5
  - method for CSSStyleSheet, in §6.1.2
- insertRule(rule, index)
  - method for CSSGroupingRule, in §6.4.5
  - method for CSSStyleSheet, in §6.1.2
- item(index)
  - method for CSSRuleList, in §6.4.1
  - method for CSSStyleDeclaration, in §6.6.1
  - method for MediaList, in §4.4
  - method for StyleSheetList, in §6.2.2
- last CSS style sheet set name, in §6.2
- length
  - attribute for CSSRuleList, in §6.4.1
  - attribute for CSSStyleDeclaration, in §6.6.1
  - attribute for MediaList, in §4.4
  - attribute for StyleSheetList, in §6.2.2
- LinkStyle, in §6.3.2
- location, in §6.1
- MARGIN_RULE, in §6.4.2
- media
  - attribute for CSSImportRule, in §6.4.4
  - attribute for StyleSheet, in §6.1.1
  - dfn for CSSStyleSheet, in §6.1
- MediaList, in §4.4
- MEDIA_RULE, in §6.4.2
- mediaText, in §4.4
- name, in §6.4.8
- NAMESPACE_RULE, in §6.4.2
- namespaceURI, in §6.4.9
- origin-clean flag, in §6.1
- owner CSS rule, in §6.1
- owner node
  - dfn for CSSStyleDeclaration, in §6.6
  - dfn for CSSStyleSheet, in §6.1
- ownerNode, in §6.1.1
- ownerRule, in §6.1.2
- PAGE_RULE, in §6.4.2
- parent CSS rule
  - dfn for CSSRule, in §6.4
  - dfn for CSSStyleDeclaration, in §6.6
- parent CSS style sheet
  - dfn for CSSRule, in §6.4
  - dfn for CSSStyleSheet, in §6.1
- parentRule
  - attribute for CSSRule, in §6.4.2
  - attribute for CSSStyleDeclaration, in §6.6.1
- parentStyleSheet
  - attribute for CSSRule, in §6.4.2
  - attribute for StyleSheet, in §6.1.1
- parse a CSS declaration block, in §6.6
- parse a CSS rule, in §6.4
- parse a CSS value, in §6.7.1
- parse a group of selectors, in §5.1
- parse a list of CSS page selectors, in §6.4.7
- parse a media query, in §4.1
- parse a media query list, in §4.1
- persistent CSS style sheet, in §6.2
- preferred CSS style sheet set name, in §6.2
- preferred order, in §6.6
- prefix, in §6.4.9
- prolog, in §6.3.4
- property name, in §6.5
- readonly flag, in §6.6
- remove a CSS rule, in §6.4
- remove a CSS style sheet, in §6.2
- removeProperty(property), in §6.6.1
- removeRule(), in §6.1.2.1
- removeRule(index), in §6.1.2.1
- resolved value, in §9
- resolved value special case property, in §9
- resolved value special case property like color, in §9
- resolved value special case property like height, in §9
- resolved value special case property like top, in §9
- rules, in §6.1.2.1
- select a CSS style sheet set, in §6.2
- selectorText
  - attribute for CSSGroupingRule, in §6.4.7
  - attribute for CSSPageRule, in §6.4.7
  - attribute for CSSStyleRule, in §6.4.3
- serialize a comma-separated list, in §2.1
- serialize a CSS component value, in §6.7.2
- serialize a CSS declaration, in §6.6
- serialize a CSS declaration block, in §6.6
- serialize a CSS rule, in §6.4
- serialize a CSS value, in §6.7.2
- serialize a group of selectors, in §5.2
- serialize a list of CSS page selectors, in §6.4.7
- serialize a LOCAL, in §2.1
- serialize a media feature value, in §4.2.1
- serialize a media query, in §4.2
- serialize a media query list, in §4.2
- serialize an identifier, in §2.1
- serialize a selector, in §5.2
- serialize a simple selector, in §5.2
- serialize a string, in §2.1
- serialize a URL, in §2.1
- serialize a whitespace-separated list, in §2.1
- set, in §2
- set a CSS declaration, in §6.6.1
- setProperty(property, value), in §6.6.1
- setProperty(property, value, priority), in §6.6.1
- sheet, in §6.3.2
- specified order, in §6.4.3
- stringification behavior, in §4.4
- style
  - attribute for CSSGroupingRule, in §6.4.7
  - attribute for CSSMarginRule, in §6.4.8
  - attribute for CSSPageRule, in §6.4.7
  - attribute for CSSStyleRule, in §6.4.3
  - attribute for ElementCSSInlineStyle, in §7.1
- STYLE_RULE, in §6.4.2
- StyleSheet, in §6.1.1
- styleSheet, in §6.4.4
- StyleSheetList, in §6.2.2
- styleSheets, in §6.2.3
- supported CSS property, in §2
- supported styling language, in §2
- text, in §6.4
- title
  - attribute for StyleSheet, in §6.1.1
  - dfn for CSSStyleSheet, in §6.1
- type
  - attribute for CSSRule, in §6.4.2
  - attribute for StyleSheet, in §6.1.1
  - dfn for CSSRule, in §6.4
  - dfn for CSSStyleSheet, in §6.1
- unset, in §2
- update style attribute for, in §6.6
- updating flag, in §6.6
- value, in §6.5
- webkit-cased attribute, in §6.6.1
- webkit_cased_attribute, in §6.6.1

https://drafts.csswg.org/css-animations-1/#csskeyframerule Referenced in:

- 6.4.2. The CSSRule Interface

https://drafts.csswg.org/css-animations-1/#csskeyframesrule Referenced in:

- 6.4.2. The CSSRule Interface

https://drafts.csswg.org/css-backgrounds-3/#propdef-background-color Referenced in:

- 9. Resolved Values

https://drafts.csswg.org/css-backgrounds-3/#propdef-border-bottom-color Referenced in:

- 9. Resolved Values

https://drafts.csswg.org/css-backgrounds-3/#propdef-border-left-color Referenced in:

- 9. Resolved Values

https://drafts.csswg.org/css-backgrounds-3/#propdef-border-right-color Referenced in:

- 9. Resolved Values

https://drafts.csswg.org/css-backgrounds-3/#propdef-border-top-color Referenced in:

- 9. Resolved Values

https://drafts.csswg.org/css-backgrounds-3/#propdef-box-shadow Referenced in:

- 9. Resolved Values

https://drafts.csswg.org/css-box-3/#propdef-margin-bottom Referenced in:

- 9. Resolved Values

https://drafts.csswg.org/css-box-3/#propdef-margin-left Referenced in:

- 9. Resolved Values

https://drafts.csswg.org/css-box-3/#propdef-margin-right Referenced in:

- 9. Resolved Values

https://drafts.csswg.org/css-box-3/#propdef-margin-top Referenced in:

- 9. Resolved Values

https://drafts.csswg.org/css-box-3/#propdef-padding-bottom Referenced in:

- 9. Resolved Values

https://drafts.csswg.org/css-box-3/#propdef-padding-left Referenced in:

- 9. Resolved Values

https://drafts.csswg.org/css-box-3/#propdef-padding-right Referenced in:

- 9. Resolved Values

https://drafts.csswg.org/css-box-3/#propdef-padding-top Referenced in:

- 9. Resolved Values

https://drafts.csswg.org/css-cascade-4/#computed-value Referenced in:

- 9. Resolved Values (2) (3)

https://drafts.csswg.org/css-cascade-4/#used-value Referenced in:

- 9. Resolved Values (2) (3)

https://drafts.csswg.org/css-color-3/#alphavalue-def Referenced in:

- 6.7.2. Serializing CSS Values

https://drafts.csswg.org/css-color-3/#valuea-def-color Referenced in:

- 6.7.2. Serializing CSS Values (2)
- 11.1. Changes From 5 December 2013

https://drafts.csswg.org/css-color-4/#propdef-color Referenced in:

- 9. Resolved Values (2)

https://drafts.csswg.org/css-counter-styles-3/#csscounterstylerule Referenced in:

- 6.4.2. The CSSRule Interface

https://drafts.csswg.org/css-device-adapt-1/#cssviewportrule Referenced in:

- 6.4.2. The CSSRule Interface

https://drafts.csswg.org/css-display-3/#valdef-display-contents Referenced in:

- 9. Resolved Values (2)

https://drafts.csswg.org/css-display-3/#propdef-display Referenced in:

- 9. Resolved Values (2)

https://drafts.csswg.org/css-display-3/#valdef-display-none Referenced in:

- 9. Resolved Values (2)

https://drafts.csswg.org/css-fonts-3/#propdef-font-size Referenced in:

- 6.6.1. The CSSStyleDeclaration Interface (2)

https://drafts.csswg.org/css-fonts-4/#family-name-value Referenced in:

- 6.7.2. Serializing CSS Values

https://drafts.csswg.org/css-fonts-4/#cssfontfacerule Referenced in:

- 6.4. CSS Rules (2)
- 6.4.2. The CSSRule Interface

https://drafts.csswg.org/css-fonts-4/#cssfontfeaturevaluesrule① Referenced in:

- 6.4.2. The CSSRule Interface

https://drafts.csswg.org/css-fonts-4/#descdef-font-face-font-feature-settings Referenced in:

- 6.4. CSS Rules (2)

https://drafts.csswg.org/css-fonts-4/#descdef-font-face-font-stretch Referenced in:

- 6.4. CSS Rules (2)

https://drafts.csswg.org/css-fonts-4/#descdef-font-face-font-style Referenced in:

- 6.4. CSS Rules (2)

https://drafts.csswg.org/css-fonts-4/#descdef-font-face-font-variant Referenced in:

- 6.4. CSS Rules (2)

https://drafts.csswg.org/css-fonts-4/#descdef-font-face-font-weight Referenced in:

- 6.4. CSS Rules (2)

https://drafts.csswg.org/css-fonts-4/#descdef-font-face-unicode-range Referenced in:

- 6.4. CSS Rules (2)

https://drafts.csswg.org/css-lists-3/#typedef-counter Referenced in:

- 6.7.2. Serializing CSS Values

https://drafts.csswg.org/css-logical-1/#propdef-block-size Referenced in:

- 9. Resolved Values

https://drafts.csswg.org/css-logical-1/#propdef-border-block-end-color Referenced in:

- 9. Resolved Values

https://drafts.csswg.org/css-logical-1/#propdef-border-block-start-color Referenced in:

- 9. Resolved Values

https://drafts.csswg.org/css-logical-1/#propdef-border-inline-end-color Referenced in:

- 9. Resolved Values

https://drafts.csswg.org/css-logical-1/#propdef-border-inline-start-color Referenced in:

- 9. Resolved Values

https://drafts.csswg.org/css-logical-1/#propdef-inline-size Referenced in:

- 9. Resolved Values

https://drafts.csswg.org/css-logical-1/#propdef-inset-block-end Referenced in:

- 9. Resolved Values

https://drafts.csswg.org/css-logical-1/#propdef-inset-block-start Referenced in:

- 9. Resolved Values

https://drafts.csswg.org/css-logical-1/#propdef-inset-inline-end Referenced in:

- 9. Resolved Values

https://drafts.csswg.org/css-logical-1/#propdef-inset-inline-start Referenced in:

- 9. Resolved Values

https://drafts.csswg.org/css-logical-1/#logical-property-group Referenced in:

- 6.6.1. The CSSStyleDeclaration Interface (2)

https://drafts.csswg.org/css-logical-1/#mapping-logic Referenced in:

- 6.6.1. The CSSStyleDeclaration Interface (2)

https://drafts.csswg.org/css-logical-1/#propdef-margin-block-end Referenced in:

- 9. Resolved Values

https://drafts.csswg.org/css-logical-1/#propdef-margin-block-start Referenced in:

- 9. Resolved Values

https://drafts.csswg.org/css-logical-1/#propdef-margin-inline-end Referenced in:

- 9. Resolved Values

https://drafts.csswg.org/css-logical-1/#propdef-margin-inline-start Referenced in:

- 9. Resolved Values

https://drafts.csswg.org/css-logical-1/#propdef-padding-block-end Referenced in:

- 9. Resolved Values

https://drafts.csswg.org/css-logical-1/#propdef-padding-block-start Referenced in:

- 9. Resolved Values

https://drafts.csswg.org/css-logical-1/#propdef-padding-inline-end Referenced in:

- 9. Resolved Values

https://drafts.csswg.org/css-logical-1/#propdef-padding-inline-start Referenced in:

- 9. Resolved Values

https://drafts.csswg.org/css-namespaces-3/#default-namespace Referenced in:

- 5.2. Serializing Selectors (2)

https://drafts.csswg.org/css-namespaces-3/#namespace-prefix Referenced in:

- 5.2. Serializing Selectors (2) (3) (4) (5) (6)

https://drafts.csswg.org/css-overflow-3/#propdef-overflow Referenced in:

- 7.2. Extensions to the Window Interface

https://drafts.csswg.org/css-position-3/#propdef-bottom Referenced in:

- 9. Resolved Values

https://drafts.csswg.org/css-position-3/#propdef-left Referenced in:

- 9. Resolved Values

https://drafts.csswg.org/css-position-3/#propdef-right Referenced in:

- 9. Resolved Values

https://drafts.csswg.org/css-position-3/#propdef-top Referenced in:

- 9. Resolved Values (2)

https://drafts.csswg.org/css-scoping-1/#selectordef-slotted Referenced in:

- 7.2. Extensions to the Window Interface

https://drafts.csswg.org/css-scoping-1/#flat-tree Referenced in:

- 7.2. Extensions to the Window Interface

https://drafts.csswg.org/css-shadow-parts-1/#selectordef-part Referenced in:

- 7.2. Extensions to the Window Interface

https://drafts.csswg.org/css-ui-4/#propdef-caret-color Referenced in:

- 9. Resolved Values

https://drafts.csswg.org/css-ui-4/#propdef-outline-color Referenced in:

- 9. Resolved Values

https://drafts.csswg.org/css-values-3/#angle-value Referenced in:

- 6.7.2. Serializing CSS Values

https://drafts.csswg.org/css-values-3/#integer-value Referenced in:

- 6.7.2. Serializing CSS Values

https://drafts.csswg.org/css-values-3/#length-value Referenced in:

- 6.7.2. Serializing CSS Values

https://drafts.csswg.org/css-values-3/#number-value Referenced in:

- 6.7.2. Serializing CSS Values
- 11.1. Changes From 5 December 2013

https://drafts.csswg.org/css-values-3/#percentage-value Referenced in:

- 6.7.2. Serializing CSS Values

https://drafts.csswg.org/css-values-3/#resolution-value Referenced in:

- 6.7.2. Serializing CSS Values

https://drafts.csswg.org/css-values-3/#string-value Referenced in:

- 6.7.2. Serializing CSS Values

https://drafts.csswg.org/css-values-3/#url-value Referenced in:

- 6.7.2. Serializing CSS Values (2)

https://drafts.csswg.org/css-values-4/#frequency-value Referenced in:

- 6.7.2. Serializing CSS Values

https://drafts.csswg.org/css-values-4/#time-value Referenced in:

- 6.7.2. Serializing CSS Values

https://drafts.csswg.org/css-values-4/#px Referenced in:

- 6.7.2. Serializing CSS Values

https://drafts.csswg.org/css-values-4/#comb-any Referenced in:

- 6.7.2. Serializing CSS Values

https://drafts.csswg.org/css-variables-1/#custom-property Referenced in:

- 2. Terminology
- 6.6.1. The CSSStyleDeclaration Interface (2) (3) (4)

https://drafts.csswg.org/css2/visufx.html#value-def-shape Referenced in:

- 6.7.2. Serializing CSS Values

https://drafts.csswg.org/css2/aural.html#value-def-specific-voice Referenced in:

- 6.7.2. Serializing CSS Values

https://drafts.csswg.org/css2/visudet.html#propdef-height Referenced in:

- 9. Resolved Values (2)

https://drafts.csswg.org/css2/visudet.html#propdef-line-height Referenced in:

- 9. Resolved Values

https://drafts.csswg.org/css2/visudet.html#propdef-width Referenced in:

- 9. Resolved Values

https://drafts.csswg.org/css-conditional-3/#cssmediarule Referenced in:

- 6.4. CSS Rules
- 6.4.2. The CSSRule Interface
- 6.4.6. The CSSMediaRule Interface (2)

https://drafts.csswg.org/css-conditional-3/#csssupportsrule Referenced in:

- 6.4.2. The CSSRule Interface

https://drafts.csswg.org/css-syntax-3/#typedef-whitespace-token Referenced in:

- 6.7.2. Serializing CSS Values

https://drafts.csswg.org/css-syntax-3/#environment-encoding Referenced in:

- 6.3.4. Requirements on User Agents Implementing the xml-stylesheet processing instruction

https://drafts.csswg.org/css-syntax-3/#css-parse-something-according-to-a-css-grammar Referenced in:

- 6.7.2. Serializing CSS Values
- 7.2. Extensions to the Window Interface

https://drafts.csswg.org/css-syntax-3/#parse-a-list-of-component-values Referenced in:

- 6.7.1. Parsing CSS Values

https://drafts.csswg.org/css-syntax-3/#parse-a-list-of-declarations Referenced in:

- 6.6. CSS Declaration Blocks

https://drafts.csswg.org/css-syntax-3/#parse-a-rule Referenced in:

- 6.4. CSS Rules

https://drafts.csswg.org/css-syntax-3/#serialize-an-anb-value Referenced in:

- 5.2. Serializing Selectors

https://dom.spec.whatwg.org/#document Referenced in:

- 6.3.4. Requirements on User Agents Implementing the xml-stylesheet processing instruction (2)
- 6.4.2. The CSSRule Interface
- 11.1. Changes From 5 December 2013 (2)

https://dom.spec.whatwg.org/#documentorshadowroot Referenced in:

- 6.2. CSS Style Sheet Collections (2) (3)
- 6.2.3. Extensions to the DocumentOrShadowRoot Interface Mixin (2)
- 11.1. Changes From 5 December 2013

https://dom.spec.whatwg.org/#element Referenced in:

- 6.1.1. The StyleSheet Interface
- 6.3.4. Requirements on User Agents Implementing the xml-stylesheet processing instruction
- 6.6. CSS Declaration Blocks
- 7.2. Extensions to the Window Interface
- 11.1. Changes From 5 December 2013 (2)

https://dom.spec.whatwg.org/#processinginstruction Referenced in:

- 6.1.1. The StyleSheet Interface
- 6.3.4. Requirements on User Agents Implementing the xml-stylesheet processing instruction

https://dom.spec.whatwg.org/#concept-element-attributes-change-ext Referenced in:

- 6.6. CSS Declaration Blocks

https://dom.spec.whatwg.org/#connected Referenced in:

- 7.2. Extensions to the Window Interface

https://dom.spec.whatwg.org/#context-object Referenced in:

- 6.4.3. The CSSStyleRule Interface
- 6.4.7. The CSSPageRule Interface
- 6.4.8. The CSSMarginRule Interface
- 7.1. The ElementCSSInlineStyle Mixin

https://dom.spec.whatwg.org/#concept-cd-data Referenced in:

- 6.3.4. Requirements on User Agents Implementing the xml-stylesheet processing instruction

https://dom.spec.whatwg.org/#concept-document Referenced in:

- 6.3.4. Requirements on User Agents Implementing the xml-stylesheet processing instruction (2)

https://dom.spec.whatwg.org/#concept-document-encoding Referenced in:

- 6.3.4. Requirements on User Agents Implementing the xml-stylesheet processing instruction

https://dom.spec.whatwg.org/#concept-tree-following Referenced in:

- 6.3.4. Requirements on User Agents Implementing the xml-stylesheet processing instruction

https://dom.spec.whatwg.org/#concept-element-attributes-get-by-namespace Referenced in:

- 6.6. CSS Declaration Blocks

https://dom.spec.whatwg.org/#in-a-document-tree Referenced in:

- 6.1. CSS Style Sheets

https://dom.spec.whatwg.org/#boundary-point-node Referenced in:

- 6.3.4. Requirements on User Agents Implementing the xml-stylesheet processing instruction (2)

https://dom.spec.whatwg.org/#concept-node Referenced in:

- 6.3.4. Requirements on User Agents Implementing the xml-stylesheet processing instruction

https://dom.spec.whatwg.org/#concept-element-attributes-set-value Referenced in:

- 6.6. CSS Declaration Blocks

https://dom.spec.whatwg.org/#concept-shadow-including-root Referenced in:

- 7.2. Extensions to the Window Interface

https://encoding.spec.whatwg.org/#concept-encoding-get Referenced in:

- 6.3.4. Requirements on User Agents Implementing the xml-stylesheet processing instruction

https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions Referenced in:

- 6.6.1. The CSSStyleDeclaration Interface (2) (3) (4) (5) (6) (7)

https://html.spec.whatwg.org/multipage/dom.html#htmlelement Referenced in:

- 7.1. The ElementCSSInlineStyle Mixin

https://html.spec.whatwg.org/multipage/window-object.html#window Referenced in:

- 7.2. Extensions to the Window Interface (2)

https://html.spec.whatwg.org/multipage/infrastructure.html#ascii-case-insensitive Referenced in:

- 6.3. Style Sheet Association
- 6.3.5. Requirements on User Agents Implementing the HTTP Link Header (2) (3)
- 6.6.1. The CSSStyleDeclaration Interface

https://html.spec.whatwg.org/multipage/window-object.html#concept-document-window Referenced in:

- 8.1. The CSS.escape() Method

https://html.spec.whatwg.org/multipage/browsers.html#browsing-context-container Referenced in:

- 7.2. Extensions to the Window Interface (2)

https://html.spec.whatwg.org/multipage/infrastructure.html#case-sensitive Referenced in:

- 2. Terminology
- 4.3. Comparing Media Queries
- 6.2. CSS Style Sheet Collections (2) (3) (4)
- 6.3.4. Requirements on User Agents Implementing the xml-stylesheet processing instruction (2)
- 6.6.1. The CSSStyleDeclaration Interface (2) (3) (4) (5) (6) (7)

https://html.spec.whatwg.org/multipage/urls-and-fetching.html#cors-same-origin Referenced in:

- 6.3.1. Fetching CSS style sheets
- 6.3.4. Requirements on User Agents Implementing the xml-stylesheet processing instruction
- 6.3.5. Requirements on User Agents Implementing the HTTP Link Header

https://html.spec.whatwg.org/multipage/webappapis.html#current-global-object Referenced in:

- 8.1. The CSS.escape() Method

https://html.spec.whatwg.org/multipage/origin.html#concept-origin Referenced in:

- 6.3.1. Fetching CSS style sheets
- 6.3.5. Requirements on User Agents Implementing the HTTP Link Header

https://html.spec.whatwg.org/multipage/semantics.html#the-style-element Referenced in:

- 6.3.2. The LinkStyle Interface (2)

https://infra.spec.whatwg.org/#ascii-lowercase Referenced in:

- 4.2. Serializing Media Queries (2)
- 6.6.1. The CSSStyleDeclaration Interface (2) (3) (4) (5)
- 6.7.2. Serializing CSS Values

https://infra.spec.whatwg.org/#ascii-uppercase Referenced in:

- 6.6.1. The CSSStyleDeclaration Interface

https://infra.spec.whatwg.org/#iteration-break Referenced in:

- 6.6.1. The CSSStyleDeclaration Interface

https://infra.spec.whatwg.org/#code-unit Referenced in:

- 3. CSSOMString

https://infra.spec.whatwg.org/#iteration-continue Referenced in:

- 6.6.1. The CSSStyleDeclaration Interface (2) (3)

https://infra.spec.whatwg.org/#list-iterate Referenced in:

- 6.6.1. The CSSStyleDeclaration Interface

https://infra.spec.whatwg.org/#list Referenced in:

- 6.7.2. Serializing CSS Values (2)

https://infra.spec.whatwg.org/#surrogate Referenced in:

- 3. CSSOMString (2)

https://drafts.csswg.org/mediaqueries-4/#typedef-ratio Referenced in:

- 6.7.2. Serializing CSS Values

https://drafts.csswg.org/mediaqueries-4/#descdef-media-aspect-ratio Referenced in:

- 4.2.1. Serializing Media Feature Values

https://drafts.csswg.org/mediaqueries-4/#descdef-media-color-index Referenced in:

- 4.2.1. Serializing Media Feature Values

https://drafts.csswg.org/mediaqueries-4/#descdef-media-device-aspect-ratio Referenced in:

- 4.2.1. Serializing Media Feature Values

https://drafts.csswg.org/mediaqueries-4/#descdef-media-device-height Referenced in:

- 4.2.1. Serializing Media Feature Values

https://drafts.csswg.org/mediaqueries-4/#descdef-media-device-width Referenced in:

- 4.2.1. Serializing Media Feature Values

https://drafts.csswg.org/mediaqueries-4/#descdef-media-grid Referenced in:

- 4.2.1. Serializing Media Feature Values

https://drafts.csswg.org/mediaqueries-4/#valdef-media-scan-interlace Referenced in:

- 4.2.1. Serializing Media Feature Values

https://drafts.csswg.org/mediaqueries-4/#valdef-media-orientation-landscape Referenced in:

- 4.2.1. Serializing Media Feature Values

https://drafts.csswg.org/mediaqueries-4/#media-feature Referenced in:

- 4.2. Serializing Media Queries (2) (3) (4) (5)

https://drafts.csswg.org/mediaqueries-4/#media-query Referenced in:

- 4. Media Queries (2)
- 4.2. Serializing Media Queries (2) (3)

https://drafts.csswg.org/mediaqueries-4/#media-query-list Referenced in:

- 4.1. Parsing Media Queries
- 4.2. Serializing Media Queries (2)

https://drafts.csswg.org/mediaqueries-4/#media-type Referenced in:

- 4.2. Serializing Media Queries

https://drafts.csswg.org/mediaqueries-4/#descdef-media-monochrome Referenced in:

- 4.2.1. Serializing Media Feature Values

https://drafts.csswg.org/mediaqueries-4/#descdef-media-orientation Referenced in:

- 4.2.1. Serializing Media Feature Values

https://drafts.csswg.org/mediaqueries-4/#valdef-media-orientation-portrait Referenced in:

- 4.2.1. Serializing Media Feature Values

https://drafts.csswg.org/mediaqueries-4/#valdef-media-scan-progressive Referenced in:

- 4.2.1. Serializing Media Feature Values

https://drafts.csswg.org/mediaqueries-4/#descdef-media-resolution Referenced in:

- 4.2.1. Serializing Media Feature Values

https://drafts.csswg.org/mediaqueries-4/#descdef-media-scan Referenced in:

- 4.2.1. Serializing Media Feature Values

https://drafts.csswg.org/selectors-3/#sel-after Referenced in:

- 2. Terminology

https://drafts.csswg.org/selectors-3/#sel-before Referenced in:

- 2. Terminology

https://drafts.csswg.org/selectors-4/#typedef-pseudo-element-selector Referenced in:

- 7.2. Extensions to the Window Interface

https://drafts.csswg.org/selectors-4/#compound Referenced in:

- 5.2. Serializing Selectors (2)

https://drafts.csswg.org/selectors-4/#simple Referenced in:

- 5.2. Serializing Selectors (2) (3)

https://drafts.csswg.org/selectors-4/#universal-selector Referenced in:

- 5.2. Serializing Selectors (2)

https://svgwg.org/svg2-draft/types.html#InterfaceSVGElement Referenced in:

- 7.1. The ElementCSSInlineStyle Mixin

https://url.spec.whatwg.org/#absolute-url-string Referenced in:

- 6.1. CSS Style Sheets
- 6.7.2. Serializing CSS Values

https://heycam.github.io/webidl/#idl-DOMString Referenced in:

- 3. CSSOMString (2)
- 6.1.1. The StyleSheet Interface
- 6.1.2.1. Deprecated CSSStyleSheet members (2)

https://heycam.github.io/webidl/#Exposed Referenced in:

- 4.4. The MediaList Interface
- 6.1.1. The StyleSheet Interface
- 6.1.2. The CSSStyleSheet Interface
- 6.2.2. The StyleSheetList Interface
- 6.4.1. The CSSRuleList Interface
- 6.4.2. The CSSRule Interface
- 6.4.3. The CSSStyleRule Interface
- 6.4.4. The CSSImportRule Interface
- 6.4.5. The CSSGroupingRule Interface
- 6.4.7. The CSSPageRule Interface
- 6.4.8. The CSSMarginRule Interface
- 6.4.9. The CSSNamespaceRule Interface
- 6.6.1. The CSSStyleDeclaration Interface
- 8.1. The CSS.escape() Method

https://heycam.github.io/webidl/#hierarchyrequesterror Referenced in:

- 6.4. CSS Rules

https://heycam.github.io/webidl/#indexsizeerror Referenced in:

- 6.4. CSS Rules (2)

https://heycam.github.io/webidl/#invalidstateerror Referenced in:

- 6.4. CSS Rules (2)

https://heycam.github.io/webidl/#NewObject Referenced in:

- 7.2. Extensions to the Window Interface

https://heycam.github.io/webidl/#nomodificationallowederror Referenced in:

- 6.6.1. The CSSStyleDeclaration Interface (2) (3)

https://heycam.github.io/webidl/#notfounderror Referenced in:

- 4.4. The MediaList Interface

https://heycam.github.io/webidl/#PutForwards Referenced in:

- 6.1.1. The StyleSheet Interface
- 6.4.3. The CSSStyleRule Interface
- 6.4.4. The CSSImportRule Interface
- 6.4.7. The CSSPageRule Interface
- 6.4.8. The CSSMarginRule Interface
- 7.1. The ElementCSSInlineStyle Mixin

https://heycam.github.io/webidl/#SameObject Referenced in:

- 6.1.1. The StyleSheet Interface
- 6.1.2. The CSSStyleSheet Interface
- 6.1.2.1. Deprecated CSSStyleSheet members
- 6.2.3. Extensions to the DocumentOrShadowRoot Interface Mixin
- 6.4.3. The CSSStyleRule Interface
- 6.4.4. The CSSImportRule Interface (2)
- 6.4.5. The CSSGroupingRule Interface
- 6.4.7. The CSSPageRule Interface
- 6.4.8. The CSSMarginRule Interface
- 7.1. The ElementCSSInlineStyle Mixin

https://heycam.github.io/webidl/#securityerror Referenced in:

- 6.1.2. The CSSStyleSheet Interface (2) (3)

https://heycam.github.io/webidl/#syntaxerror Referenced in:

- 6.4. CSS Rules

https://heycam.github.io/webidl/#TreatNullAs Referenced in:

- 4.4. The MediaList Interface
- 6.6.1. The CSSStyleDeclaration Interface (2) (3) (4) (5) (6)

https://heycam.github.io/webidl/#exceptiondef-typeerror Referenced in:

- 7.2. Extensions to the Window Interface

https://heycam.github.io/webidl/#idl-USVString Referenced in:

- 3. CSSOMString (2) (3)
- 6.1.1. The StyleSheet Interface
- 6.4.4. The CSSImportRule Interface

https://heycam.github.io/webidl/#idl-boolean Referenced in:

- 6.1.1. The StyleSheet Interface

https://heycam.github.io/webidl/#idl-unsigned-long Referenced in:

- 4.4. The MediaList Interface (2)
- 6.1.2. The CSSStyleSheet Interface (2) (3)
- 6.1.2.1. Deprecated CSSStyleSheet members (2)
- 6.2.2. The StyleSheetList Interface (2)
- 6.4.1. The CSSRuleList Interface (2)
- 6.4.5. The CSSGroupingRule Interface (2) (3)
- 6.6.1. The CSSStyleDeclaration Interface (2)

https://heycam.github.io/webidl/#idl-unsigned-short Referenced in:

- 6.4.2. The CSSRule Interface (2) (3) (4) (5) (6) (7) (8) (9)

### Terms defined by reference

- [css-animations-1] defines the following terms:
  - CSSKeyframeRule
  - CSSKeyframesRule
- [css-backgrounds-3] defines the following terms:
  - background-color
  - border-bottom-color
  - border-left-color
  - border-right-color
  - border-top-color
  - box-shadow
- [css-box-3] defines the following terms:
  - margin-bottom
  - margin-left
  - margin-right
  - margin-top
  - padding-bottom
  - padding-left
  - padding-right
  - padding-top
- [css-cascade-4] defines the following terms:
  - computed value
  - used value
- [css-color-3] defines the following terms:
  - <alphavalue>
  - <color>
- [css-color-4] defines the following terms:
  - color
- [css-counter-styles-3] defines the following terms:
  - CSSCounterStyleRule
- [css-device-adapt-1] defines the following terms:
  - CSSViewportRule
- [css-display-3] defines the following terms:
  - contents
  - display
  - none
- [css-fonts-3] defines the following terms:
  - font-size
- [css-fonts-4] defines the following terms:
  - <family-name>
  - CSSFontFaceRule
  - CSSFontFeatureValuesRule
  - font-feature-settings
  - font-stretch
  - font-style
  - font-variant
  - font-weight
  - unicode-range
- [css-lists-3] defines the following terms:
  - <counter>
- [css-logical-1] defines the following terms:
  - block-size
  - border-block-end-color
  - border-block-start-color
  - border-inline-end-color
  - border-inline-start-color
  - inline-size
  - inset-block-end
  - inset-block-start
  - inset-inline-end
  - inset-inline-start
  - logical property group
  - mapping logic
  - margin-block-end
  - margin-block-start
  - margin-inline-end
  - margin-inline-start
  - padding-block-end
  - padding-block-start
  - padding-inline-end
  - padding-inline-start
- [css-namespaces-3] defines the following terms:
  - default namespace
  - namespace prefix
- [css-overflow-3] defines the following terms:
  - overflow
- [css-position-3] defines the following terms:
  - bottom
  - left
  - right
  - top
- [css-scoping-1] defines the following terms:
  - ::slotted()
  - flat tree
- [css-shadow-parts-1] defines the following terms:
  - ::part()
- [css-ui-4] defines the following terms:
  - caret-color
  - outline-color
- [css-values-3] defines the following terms:
  - <angle>
  - <integer>
  - <length>
  - <number>
  - <percentage>
  - <resolution>
  - <string>
  - <url>
- [css-values-4] defines the following terms:
  - <frequency>
  - <time>
  - px
  - ||
- [css-variables-1] defines the following terms:
  - custom property
- [CSS21] defines the following terms:
  - <shape>
  - <specific-voice>
  - height
  - line-height
  - width
- [CSS3-CONDITIONAL] defines the following terms:
  - CSSMediaRule
  - CSSSupportsRule
- [CSS3SYN] defines the following terms:
  - <whitespace-token>
  - environment encoding
  - parse
  - parse a list of component values
  - parse a list of declarations
  - parse a rule
  - serialize an <an+b> value
- [DOM] defines the following terms:
  - Document
  - DocumentOrShadowRoot
  - Element
  - ProcessingInstruction
  - attribute change steps
  - connected
  - context object
  - data
  - document
  - encoding
  - following
  - get an attribute by namespace and local name
  - in a document tree
  - node
  - nodes
  - set an attribute value
  - shadow-including root
- [ENCODING] defines the following terms:
  - get an encoding
- [HTML] defines the following terms:
  - CEReactions
  - HTMLElement
  - Window
  - ascii case-insensitive
  - associated document
  - browsing context container
  - case-sensitive
  - cors-same-origin
  - current global object
  - origin
  - style
- [INFRA] defines the following terms:
  - ascii lowercase
  - ascii uppercase
  - break
  - code unit
  - continue
  - for each
  - list
  - surrogate
- [MEDIAQUERIES] defines the following terms:
  - <ratio>
  - aspect-ratio
  - color-index
  - device-aspect-ratio
  - device-height
  - device-width
  - grid
  - interlace
  - landscape
  - media feature
  - media query
  - media query list
  - media type
  - monochrome
  - orientation
  - portrait
  - progressive
  - resolution
  - scan
- [selectors-3] defines the following terms:
  - ::after
  - ::before
- [selectors-4] defines the following terms:
  - <pseudo-element-selector>
  - compound selector
  - simple selector
  - universal selector
- [SVG2] defines the following terms:
  - SVGElement
- [URL] defines the following terms:
  - absolute-url string
- [WebIDL] defines the following terms:
  - DOMString
  - Exposed
  - HierarchyRequestError
  - IndexSizeError
  - InvalidStateError
  - NewObject
  - NoModificationAllowedError
  - NotFoundError
  - PutForwards
  - SameObject
  - SecurityError
  - SyntaxError
  - TreatNullAs
  - TypeError
  - USVString
  - boolean
  - unsigned long
  - unsigned short

## References

### Normative References

[CSS-ANIMATIONS-1]
  Dean Jackson; et al. CSS Animations Level 1. 11 October 2018. WD. URL: https://www.w3.org/TR/css-animations-1/
[CSS-BACKGROUNDS-3]
  Bert Bos; Elika Etemad; Brad Kemper. CSS Backgrounds and Borders Module Level 3. 17 October 2017. CR. URL: https://www.w3.org/TR/css-backgrounds-3/
[CSS-BOX-3]
  Elika Etemad. CSS Box Model Module Level 3. 18 December 2018. WD. URL: https://www.w3.org/TR/css-box-3/
[CSS-CASCADE-4]
  Elika Etemad; Tab Atkins Jr.. CSS Cascading and Inheritance Level 4. 28 August 2018. CR. URL: https://www.w3.org/TR/css-cascade-4/
[CSS-COLOR-3]
  Tantek Çelik; Chris Lilley; David Baron. CSS Color Module Level 3. 19 June 2018. REC. URL: https://www.w3.org/TR/css-color-3/
[CSS-COLOR-4]
  Tab Atkins Jr.; Chris Lilley. CSS Color Module Level 4. 5 March 2019. WD. URL: https://www.w3.org/TR/css-color-4/
[CSS-COUNTER-STYLES-3]
  Tab Atkins Jr.. CSS Counter Styles Level 3. 14 December 2017. CR. URL: https://www.w3.org/TR/css-counter-styles-3/
[CSS-DEVICE-ADAPT-1]
  Rune Lillesveen; Florian Rivoal; Matt Rakow. CSS Device Adaptation Module Level 1. 29 March 2016. WD. URL: https://www.w3.org/TR/css-device-adapt-1/
[CSS-DISPLAY-3]
  Tab Atkins Jr.; Elika Etemad. CSS Display Module Level 3. 28 August 2018. CR. URL: https://www.w3.org/TR/css-display-3/
[CSS-FONTS-4]
  John Daggett; Myles Maxfield; Chris Lilley. CSS Fonts Module Level 4. 20 September 2018. WD. URL: https://www.w3.org/TR/css-fonts-4/
[CSS-LISTS-3]
  Elika Etemad; Tab Atkins Jr.. CSS Lists Module Level 3. 25 April 2019. WD. URL: https://www.w3.org/TR/css-lists-3/
[CSS-LOGICAL-1]
  Rossen Atanassov; Elika Etemad. CSS Logical Properties and Values Level 1. 27 August 2018. WD. URL: https://www.w3.org/TR/css-logical-1/
[CSS-NAMESPACES-3]
  Elika Etemad. CSS Namespaces Module Level 3. 20 March 2014. REC. URL: https://www.w3.org/TR/css-namespaces-3/
[CSS-OVERFLOW-3]
  David Baron; Elika Etemad; Florian Rivoal. CSS Overflow Module Level 3. 31 July 2018. WD. URL: https://www.w3.org/TR/css-overflow-3/
[CSS-POSITION-3]
  Rossen Atanassov; Arron Eicholz. CSS Positioned Layout Module Level 3. 17 May 2016. WD. URL: https://www.w3.org/TR/css-position-3/
[CSS-SCOPING-1]
  Tab Atkins Jr.; Elika Etemad. CSS Scoping Module Level 1. 3 April 2014. WD. URL: https://www.w3.org/TR/css-scoping-1/
[CSS-SHADOW-PARTS-1]
  Tab Atkins Jr.; Fergal Daly. CSS Shadow Parts. 15 November 2018. WD. URL: https://www.w3.org/TR/css-shadow-parts-1/
[CSS-UI-4]
  Florian Rivoal. CSS Basic User Interface Module Level 4. 22 December 2017. WD. URL: https://www.w3.org/TR/css-ui-4/
[CSS-VALUES-3]
  Tab Atkins Jr.; Elika Etemad. CSS Values and Units Module Level 3. 31 January 2019. CR. URL: https://www.w3.org/TR/css-values-3/
[CSS-VALUES-4]
  Tab Atkins Jr.; Elika Etemad. CSS Values and Units Module Level 4. 31 January 2019. WD. URL: https://www.w3.org/TR/css-values-4/
[CSS-VARIABLES-1]
  Tab Atkins Jr.. CSS Custom Properties for Cascading Variables Module Level 1. 3 December 2015. CR. URL: https://www.w3.org/TR/css-variables-1/
[CSS21]
  Bert Bos; et al. Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification. 7 June 2011. REC. URL: https://www.w3.org/TR/CSS2/
[CSS3-CONDITIONAL]
  David Baron. CSS Conditional Rules Module Level 3. 4 April 2013. CR. URL: https://www.w3.org/TR/css3-conditional/
[CSS3CASCADE]
  Elika Etemad; Tab Atkins Jr.. CSS Cascading and Inheritance Level 3. 28 August 2018. CR. URL: https://www.w3.org/TR/css-cascade-3/
[CSS3PAGE]
  Elika Etemad; Simon Sapin. CSS Paged Media Module Level 3. 18 October 2018. WD. URL: https://www.w3.org/TR/css-page-3/
[CSS3SYN]
  Tab Atkins Jr.; Simon Sapin. CSS Syntax Module Level 3. 20 February 2014. CR. URL: https://www.w3.org/TR/css-syntax-3/
[DOM]
  Anne van Kesteren. DOM Standard. Living Standard. URL: https://dom.spec.whatwg.org/
[ENCODING]
  Anne van Kesteren. Encoding Standard. Living Standard. URL: https://encoding.spec.whatwg.org/
[FETCH]
  Anne van Kesteren. Fetch Standard. Living Standard. URL: https://fetch.spec.whatwg.org/
[HTML]
  Anne van Kesteren; et al. HTML Standard. Living Standard. URL: https://html.spec.whatwg.org/multipage/
[INFRA]
  Anne van Kesteren; Domenic Denicola. Infra Standard. Living Standard. URL: https://infra.spec.whatwg.org/
[MEDIAQUERIES]
  Florian Rivoal; Tab Atkins Jr.. Media Queries Level 4. 5 September 2017. CR. URL: https://www.w3.org/TR/mediaqueries-4/
[RFC2119]
  S. Bradner. Key words for use in RFCs to Indicate Requirement Levels. March 1997. Best Current Practice. URL: https://tools.ietf.org/html/rfc2119
[SELECTORS-3]
  Tantek Çelik; et al. Selectors Level 3. 6 November 2018. REC. URL: https://www.w3.org/TR/selectors-3/
[SELECTORS-4]
  Elika Etemad; Tab Atkins Jr.. Selectors Level 4. 21 November 2018. WD. URL: https://www.w3.org/TR/selectors-4/
[SVG2]
  Amelia Bellamy-Royds; et al. Scalable Vector Graphics (SVG) 2. 4 October 2018. CR. URL: https://www.w3.org/TR/SVG2/
[URL]
  Anne van Kesteren. URL Standard. Living Standard. URL: https://url.spec.whatwg.org/
[WebIDL]
  Boris Zbarsky. Web IDL. 15 December 2016. ED. URL: https://heycam.github.io/webidl/
[XML]
  Tim Bray; et al. Extensible Markup Language (XML) 1.0 (Fifth Edition). 26 November 2008. REC. URL: https://www.w3.org/TR/xml/
[XML-STYLESHEET]
  James Clark; Simon Pieters; Henry Thompson. Associating Style Sheets with XML documents 1.0 (Second Edition). 28 October 2010. REC. URL: https://www.w3.org/TR/xml-stylesheet/

### Informative References

[CSS-FONTS-3]
  John Daggett; Myles Maxfield; Chris Lilley. CSS Fonts Module Level 3. 20 September 2018. REC. URL: https://www.w3.org/TR/css-fonts-3/
[DOM-LEVEL-2-STYLE]
  Chris Wilson; Philippe Le Hégaret. Document Object Model (DOM) Level 2 Style Specification. 13 November 2000. REC. URL: https://www.w3.org/TR/DOM-Level-2-Style/
[SVG11]
  Erik Dahlström; et al. Scalable Vector Graphics (SVG) 1.1 (Second Edition). 16 August 2011. REC. URL: https://www.w3.org/TR/SVG11/

## IDL Index

    [Exposed=Window]
    interface MediaList {
      stringifier attribute [TreatNullAs=EmptyString] CSSOMString mediaText;
      readonly attribute unsigned long length;
      getter CSSOMString? item(unsigned long index);
      void appendMedium(CSSOMString medium);
      void deleteMedium(CSSOMString medium);
    };

    [Exposed=Window]
    interface StyleSheet {
      readonly attribute CSSOMString type;
      readonly attribute USVString? href;
      readonly attribute (Element or ProcessingInstruction)? ownerNode;
      readonly attribute CSSStyleSheet? parentStyleSheet;
      readonly attribute DOMString? title;
      [SameObject, PutForwards=mediaText] readonly attribute MediaList media;
      attribute boolean disabled;
    };

    [Exposed=Window]
    interface CSSStyleSheet : StyleSheet {
      readonly attribute CSSRule? ownerRule;
      [SameObject] readonly attribute CSSRuleList cssRules;
      unsigned long insertRule(CSSOMString rule, optional unsigned long index = 0);
      void deleteRule(unsigned long index);
    };

    partial interface CSSStyleSheet {
      [SameObject] readonly attribute CSSRuleList rules;
      long addRule(optional DOMString selector = "undefined", optional DOMString style = "undefined", optional unsigned long index);
      void removeRule(optional unsigned long index = 0);
    };

    [Exposed=Window]
    interface StyleSheetList {
      getter CSSStyleSheet? item(unsigned long index);
      readonly attribute unsigned long length;
    };

    partial interface mixin DocumentOrShadowRoot {
      [SameObject] readonly attribute StyleSheetList styleSheets;
    };

    interface mixin LinkStyle {
      readonly attribute CSSStyleSheet? sheet;
    };

    ProcessingInstruction includes LinkStyle;
    [Exposed=Window]
    interface CSSRuleList {
      getter CSSRule? item(unsigned long index);
      readonly attribute unsigned long length;
    };

    [Exposed=Window]
    interface CSSRule {
      attribute CSSOMString cssText;
      readonly attribute CSSRule? parentRule;
      readonly attribute CSSStyleSheet? parentStyleSheet;

      // the following attribute and constants are historial
      readonly attribute unsigned short type;
      const unsigned short STYLE_RULE = 1;
      const unsigned short CHARSET_RULE = 2;
      const unsigned short IMPORT_RULE = 3;
      const unsigned short MEDIA_RULE = 4;
      const unsigned short FONT_FACE_RULE = 5;
      const unsigned short PAGE_RULE = 6;
      const unsigned short MARGIN_RULE = 9;
      const unsigned short NAMESPACE_RULE = 10;
    };

    [Exposed=Window]
    interface CSSStyleRule : CSSRule {
      attribute CSSOMString selectorText;
      [SameObject, PutForwards=cssText] readonly attribute CSSStyleDeclaration style;
    };

    [Exposed=Window]
    interface CSSImportRule : CSSRule {
      readonly attribute USVString href;
      [SameObject, PutForwards=mediaText] readonly attribute MediaList media;
      [SameObject] readonly attribute CSSStyleSheet styleSheet;
    };

    [Exposed=Window]
    interface CSSGroupingRule : CSSRule {
      [SameObject] readonly attribute CSSRuleList cssRules;
      unsigned long insertRule(CSSOMString rule, optional unsigned long index = 0);
      void deleteRule(unsigned long index);
    };

    [Exposed=Window]
    interface CSSPageRule : CSSGroupingRule {
               attribute CSSOMString selectorText;
      [SameObject, PutForwards=cssText] readonly attribute CSSStyleDeclaration style;
    };

    [Exposed=Window]
    interface CSSMarginRule : CSSRule {
      readonly attribute CSSOMString name;
      [SameObject, PutForwards=cssText] readonly attribute CSSStyleDeclaration style;
    };

    [Exposed=Window]
    interface CSSNamespaceRule : CSSRule {
      readonly attribute CSSOMString namespaceURI;
      readonly attribute CSSOMString prefix;
    };

    [Exposed=Window]
    interface CSSStyleDeclaration {
      [CEReactions] attribute CSSOMString cssText;
      readonly attribute unsigned long length;
      getter CSSOMString item(unsigned long index);
      CSSOMString getPropertyValue(CSSOMString property);
      CSSOMString getPropertyPriority(CSSOMString property);
      [CEReactions] void setProperty(CSSOMString property, [TreatNullAs=EmptyString] CSSOMString value, optional [TreatNullAs=EmptyString] CSSOMString priority = "");
      [CEReactions] CSSOMString removeProperty(CSSOMString property);
      readonly attribute CSSRule? parentRule;
      [CEReactions] attribute [TreatNullAs=EmptyString] CSSOMString cssFloat;
    };

    interface mixin ElementCSSInlineStyle {
      [SameObject, PutForwards=cssText] readonly attribute CSSStyleDeclaration style;
    };

    HTMLElement includes ElementCSSInlineStyle;

    SVGElement includes ElementCSSInlineStyle;

    partial interface Window {
      [NewObject] CSSStyleDeclaration getComputedStyle(Element elt, optional CSSOMString? pseudoElt);
    };

    [Exposed=Window]
    namespace CSS {
      CSSOMString escape(CSSOMString ident);
    };

## Issues Index

This should probably be done in terms of mapping it to serializing CSS values as media features are defined in terms of CSS values after all. ↵
Be more specific ↵
Is there a document at this point? ↵
What if the HTML parser hasn’t decided on quirks/non-quirks yet? ↵
Need to define how the `CSSFontFaceRule` descriptors' values are serialized. ↵
Need to define how `CSSPageRule` is serialized. ↵
Need to define the rules for parse a list of CSS page selectors and serialize a list of CSS page selectors. ↵
Should we add something like "Any observable side effect must not be made outside declarations"? The current constraints sound like a hole for undefined behavior. ↵
Probably should distinguish between specified and computed / resolved values. ↵
Should author specified values be normalized for case? Or should original case be preserved? ↵
Probably should distinguish between specified and computed / resolved values. ↵
Probably should distinguish between specified and computed / resolved values. ↵
This should differentiate specified and computed <url> values, see #3195. ↵
One idea is that we can remove this section somewhere in the CSS3/CSS4 timeline by moving the above definitions to the drafts that define the CSS components. ↵
Some of these need to be updated per the new rules. ↵
There are UAs that handle shorthands, and all UAs handle shorthands that used to be longhands like overflow, see #2529. ↵
Should getComputedStyle() provide a useful serialization? See #1033 ↵
This was previously specified as an IDL interface that only held static methods. Switching to an IDL namespace is *nearly* identical, so it’s expected that there won’t be any compat concerns. If any are discovered, please report so we can consider reverting this change. ↵
#set Referenced in:

- 6.6.1. The CSSStyleDeclaration Interface

#unset Referenced in:

- 6.6.1. The CSSStyleDeclaration Interface

#supported-styling-language Referenced in:

- 6.3.1. Fetching CSS style sheets (2)
- 6.3.4. Requirements on User Agents Implementing the xml-stylesheet processing instruction

#supported-css-property Referenced in:

- 2. Terminology
- 6.6.1. The CSSStyleDeclaration Interface (2) (3) (4)
- 7.2. Extensions to the Window Interface

#escape-a-character Referenced in:

- 2.1. Common Serializing Idioms (2) (3)

#escape-a-character-as-code-point Referenced in:

- 2.1. Common Serializing Idioms (2) (3) (4)

#serialize-an-identifier Referenced in:

- 4.2. Serializing Media Queries
- 5.2. Serializing Selectors (2) (3) (4) (5) (6)
- 6.4. CSS Rules
- 6.7.2. Serializing CSS Values
- 8.1. The CSS.escape() Method

#serialize-a-string Referenced in:

- 2.1. Common Serializing Idioms (2)
- 5.2. Serializing Selectors (2)
- 6.4. CSS Rules
- 6.7.2. Serializing CSS Values

#serialize-a-url Referenced in:

- 6.4. CSS Rules (2) (3)
- 6.7.2. Serializing CSS Values

#serialize-a-local Referenced in:

- 6.4. CSS Rules

#serialize-a-comma-separated-list Referenced in:

- 4.2. Serializing Media Queries
- 5.2. Serializing Selectors (2)
- 6.4. CSS Rules
- 6.7.2. Serializing CSS Values (2)

#cssomstring Referenced in:

- 4.4. The MediaList Interface (2) (3) (4)
- 6.1.1. The StyleSheet Interface
- 6.1.2. The CSSStyleSheet Interface
- 6.4.2. The CSSRule Interface
- 6.4.3. The CSSStyleRule Interface
- 6.4.5. The CSSGroupingRule Interface
- 6.4.7. The CSSPageRule Interface
- 6.4.8. The CSSMarginRule Interface
- 6.4.9. The CSSNamespaceRule Interface (2)
- 6.6.1. The CSSStyleDeclaration Interface (2) (3) (4) (5) (6) (7) (8) (9) (10) (11) (12) (13) (14) (15)
- 7.2. Extensions to the Window Interface
- 8.1. The CSS.escape() Method (2)

#parse-a-media-query-list Referenced in:

- 4.1. Parsing Media Queries
- 4.4. The MediaList Interface

#parse-a-media-query Referenced in:

- 4.4. The MediaList Interface (2)

#serialize-a-media-query-list Referenced in:

- 4.4. The MediaList Interface
- 6.4. CSS Rules (2)

#serialize-a-media-query Referenced in:

- 4.2. Serializing Media Queries
- 4.3. Comparing Media Queries
- 4.4. The MediaList Interface

#serialize-a-media-feature-value Referenced in:

- 4.2. Serializing Media Queries

#compare-media-queries Referenced in:

- 4.4. The MediaList Interface (2)

#medialist-collection-of-media-queries Referenced in:

- 4.4. The MediaList Interface (2) (3) (4) (5) (6) (7) (8) (9) (10)

#medialist Referenced in:

- 4.4. The MediaList Interface
- 6.1. CSS Style Sheets
- 6.1.1. The StyleSheet Interface
- 6.4.4. The CSSImportRule Interface

#create-a-medialist-object Referenced in:

- 6.1. CSS Style Sheets (2)

#dom-medialist-mediatext Referenced in:

- 4.4. The MediaList Interface (2) (3)
- 6.1. CSS Style Sheets (2)
- 6.1.1. The StyleSheet Interface
- 6.4.4. The CSSImportRule Interface

#dom-medialist-item Referenced in:

- 4.4. The MediaList Interface

#dom-medialist-length Referenced in:

- 4.4. The MediaList Interface

#dom-medialist-appendmedium Referenced in:

- 4.4. The MediaList Interface

#dom-medialist-deletemedium Referenced in:

- 4.4. The MediaList Interface

#parse-a-group-of-selectors Referenced in:

- 6.4.3. The CSSStyleRule Interface

#serialize-a-group-of-selectors Referenced in:

- 5.2. Serializing Selectors
- 6.4. CSS Rules
- 6.4.3. The CSSStyleRule Interface

#serialize-a-selector Referenced in:

- 5.2. Serializing Selectors

#serialize-a-simple-selector Referenced in:

- 5.2. Serializing Selectors (2)

#css-style-sheet Referenced in:

- 6.1. CSS Style Sheets (2) (3) (4) (5) (6) (7) (8) (9) (10) (11) (12) (13) (14) (15) (16) (17)
- 6.1.2. The CSSStyleSheet Interface
- 6.2. CSS Style Sheet Collections (2) (3) (4) (5) (6) (7) (8) (9) (10) (11) (12) (13) (14) (15)
- 6.2.2. The StyleSheetList Interface (2) (3) (4) (5)
- 6.3. Style Sheet Association
- 6.3.2. The LinkStyle Interface
- 6.3.3. Requirements on specifications
- 6.4. CSS Rules
- 6.4.4. The CSSImportRule Interface (2) (3) (4)
- 7.2. Extensions to the Window Interface

#concept-css-style-sheet-type Referenced in:

- 6.1.1. The StyleSheet Interface

#concept-css-style-sheet-location Referenced in:

- 6.1.1. The StyleSheet Interface
- 6.3.4. Requirements on User Agents Implementing the xml-stylesheet processing instruction
- 6.3.5. Requirements on User Agents Implementing the HTTP Link Header

#concept-css-style-sheet-parent-css-style-sheet Referenced in:

- 6.1. CSS Style Sheets
- 6.1.1. The StyleSheet Interface
- 6.2. CSS Style Sheet Collections
- 6.3.4. Requirements on User Agents Implementing the xml-stylesheet processing instruction
- 6.3.5. Requirements on User Agents Implementing the HTTP Link Header

#concept-css-style-sheet-owner-node Referenced in:

- 6.1. CSS Style Sheets (2) (3) (4) (5)
- 6.1.1. The StyleSheet Interface
- 6.2. CSS Style Sheet Collections
- 6.3. Style Sheet Association
- 6.3.2. The LinkStyle Interface
- 6.3.4. Requirements on User Agents Implementing the xml-stylesheet processing instruction
- 6.3.5. Requirements on User Agents Implementing the HTTP Link Header

#concept-css-style-sheet-owner-css-rule Referenced in:

- 6.1.2. The CSSStyleSheet Interface
- 6.2. CSS Style Sheet Collections
- 6.3.4. Requirements on User Agents Implementing the xml-stylesheet processing instruction
- 6.3.5. Requirements on User Agents Implementing the HTTP Link Header

#concept-css-style-sheet-media Referenced in:

- 6.1. CSS Style Sheets (2) (3) (4)
- 6.1.1. The StyleSheet Interface
- 6.3.4. Requirements on User Agents Implementing the xml-stylesheet processing instruction
- 6.3.5. Requirements on User Agents Implementing the HTTP Link Header

#concept-css-style-sheet-title Referenced in:

- 6.1. CSS Style Sheets (2) (3) (4)
- 6.1.1. The StyleSheet Interface (2)
- 6.2. CSS Style Sheet Collections (2) (3) (4) (5) (6) (7) (8)
- 6.3.4. Requirements on User Agents Implementing the xml-stylesheet processing instruction
- 6.3.5. Requirements on User Agents Implementing the HTTP Link Header

#concept-css-style-sheet-alternate-flag Referenced in:

- 6.1. CSS Style Sheets
- 6.2. CSS Style Sheet Collections (2)
- 6.3.4. Requirements on User Agents Implementing the xml-stylesheet processing instruction
- 6.3.5. Requirements on User Agents Implementing the HTTP Link Header

#concept-css-style-sheet-disabled-flag Referenced in:

- 6.1.1. The StyleSheet Interface (2) (3)
- 6.2. CSS Style Sheet Collections (2) (3) (4) (5) (6) (7) (8)

#concept-css-style-sheet-css-rules Referenced in:

- 6.1. CSS Style Sheets
- 6.1.2. The CSSStyleSheet Interface (2) (3)
- 6.1.2.1. Deprecated CSSStyleSheet members

#concept-css-style-sheet-origin-clean-flag Referenced in:

- 6.1.2. The CSSStyleSheet Interface (2) (3)
- 6.2. CSS Style Sheet Collections
- 6.3.4. Requirements on User Agents Implementing the xml-stylesheet processing instruction
- 6.3.5. Requirements on User Agents Implementing the HTTP Link Header
- 7.2. Extensions to the Window Interface

#stylesheet Referenced in:

- 6.1.1. The StyleSheet Interface (2)
- 6.1.2. The CSSStyleSheet Interface
- 6.3.2. The LinkStyle Interface

#dom-stylesheet-type Referenced in:

- 6.1.1. The StyleSheet Interface

#dom-stylesheet-href Referenced in:

- 6.1.1. The StyleSheet Interface
- 6.4.4. The CSSImportRule Interface

#dom-stylesheet-ownernode Referenced in:

- 6.1.1. The StyleSheet Interface

#dom-stylesheet-parentstylesheet Referenced in:

- 6.1.1. The StyleSheet Interface

#dom-stylesheet-title Referenced in:

- 6.1.1. The StyleSheet Interface

#dom-stylesheet-media Referenced in:

- 6.1.1. The StyleSheet Interface
- 6.4.4. The CSSImportRule Interface

#dom-stylesheet-disabled Referenced in:

- 6.1.1. The StyleSheet Interface (2)

#cssstylesheet Referenced in:

- 6.1. CSS Style Sheets
- 6.1.1. The StyleSheet Interface
- 6.1.2. The CSSStyleSheet Interface (2)
- 6.1.2.1. Deprecated CSSStyleSheet members (2)
- 6.2.2. The StyleSheetList Interface
- 6.3.2. The LinkStyle Interface
- 6.4.2. The CSSRule Interface
- 6.4.4. The CSSImportRule Interface

#dom-cssstylesheet-ownerrule Referenced in:

- 6.1.2. The CSSStyleSheet Interface

#dom-cssstylesheet-cssrules Referenced in:

- 6.1.2. The CSSStyleSheet Interface
- 6.1.2.1. Deprecated CSSStyleSheet members (2)

#dom-cssstylesheet-insertrule Referenced in:

- 6.1.2. The CSSStyleSheet Interface (2)
- 6.1.2.1. Deprecated CSSStyleSheet members
- 11.1. Changes From 5 December 2013

#dom-cssstylesheet-deleterule Referenced in:

- 6.1.2. The CSSStyleSheet Interface (2)
- 6.1.2.1. Deprecated CSSStyleSheet members

#dom-cssstylesheet-rules Referenced in:

- 6.1.2.1. Deprecated CSSStyleSheet members

#dom-cssstylesheet-removerule Referenced in:

- 6.1.2.1. Deprecated CSSStyleSheet members

#dom-cssstylesheet-addrule Referenced in:

- 6.1.2.1. Deprecated CSSStyleSheet members

#documentorshadowroot-document-or-shadow-root-css-style-sheets Referenced in:

- 6.2. CSS Style Sheet Collections (2) (3) (4)
- 6.2.3. Extensions to the DocumentOrShadowRoot Interface Mixin
- 6.3.2. The LinkStyle Interface

#create-a-css-style-sheet Referenced in:

- 6.3.3. Requirements on specifications
- 6.3.4. Requirements on User Agents Implementing the xml-stylesheet processing instruction
- 6.3.5. Requirements on User Agents Implementing the HTTP Link Header

#add-a-css-style-sheet Referenced in:

- 6.1. CSS Style Sheets
- 6.2. CSS Style Sheet Collections

#remove-a-css-style-sheet Referenced in:

- 6.3.4. Requirements on User Agents Implementing the xml-stylesheet processing instruction

#css-style-sheet-set Referenced in:

- 6.2. CSS Style Sheet Collections (2) (3) (4) (5) (6)
- 6.2.1. The HTTP Default-Style Header

#css-style-sheet-set-name Referenced in:

- 6.2. CSS Style Sheet Collections

#enabled-css-style-sheet-set Referenced in:

- 6.2.1. The HTTP Default-Style Header

#enable-a-css-style-sheet-set Referenced in:

- 6.2. CSS Style Sheet Collections (2)

#select-a-css-style-sheet-set Referenced in:

- 6.2. CSS Style Sheet Collections

#last-css-style-sheet-set-name Referenced in:

- 6.2. CSS Style Sheet Collections (2) (3) (4)

#preferred-css-style-sheet-set-name Referenced in:

- 6.2. CSS Style Sheet Collections (2) (3) (4)
- 6.2.1. The HTTP Default-Style Header

#change-the-preferred-css-style-sheet-set-name Referenced in:

- 6.2. CSS Style Sheet Collections
- 6.2.1. The HTTP Default-Style Header

#stylesheetlist Referenced in:

- 6.2.2. The StyleSheetList Interface (2)
- 6.2.3. Extensions to the DocumentOrShadowRoot Interface Mixin (2)

#dom-stylesheetlist-item Referenced in:

- 6.2.2. The StyleSheetList Interface

#dom-stylesheetlist-length Referenced in:

- 6.2.2. The StyleSheetList Interface

#dom-documentorshadowroot-stylesheets Referenced in:

- 6.2.3. Extensions to the DocumentOrShadowRoot Interface Mixin

#fetch-a-css-style-sheet Referenced in:

- 6.3.4. Requirements on User Agents Implementing the xml-stylesheet processing instruction
- 6.3.5. Requirements on User Agents Implementing the HTTP Link Header

#associated-css-style-sheet Referenced in:

- 6.1. CSS Style Sheets
- 6.3.2. The LinkStyle Interface (2)
- 6.3.4. Requirements on User Agents Implementing the xml-stylesheet processing instruction

#linkstyle Referenced in:

- 6.3.2. The LinkStyle Interface (2)
- 6.3.3. Requirements on specifications
- 6.3.4. Requirements on User Agents Implementing the xml-stylesheet processing instruction

#dom-linkstyle-sheet Referenced in:

- 6.3.2. The LinkStyle Interface (2) (3)

#prolog Referenced in:

- 6.3.4. Requirements on User Agents Implementing the xml-stylesheet processing instruction (2)

#css-rule Referenced in:

- 6.1. CSS Style Sheets
- 6.4. CSS Rules (2) (3) (4) (5)
- 6.4.2. The CSSRule Interface
- 6.6. CSS Declaration Blocks

#concept-css-rule-type Referenced in:

- 6.4. CSS Rules (2)

#concept-css-rule-parent-css-rule Referenced in:

- 6.4. CSS Rules
- 6.4.2. The CSSRule Interface

#concept-css-rule-parent-css-style-sheet Referenced in:

- 6.4. CSS Rules
- 6.4.2. The CSSRule Interface

#concept-css-rule-child-css-rules Referenced in:

- 6.4.5. The CSSGroupingRule Interface (2) (3)

#parse-a-css-rule Referenced in:

- 6.4. CSS Rules

#serialize-a-css-rule Referenced in:

- 6.4. CSS Rules
- 6.4.2. The CSSRule Interface

#insert-a-css-rule Referenced in:

- 6.1.2. The CSSStyleSheet Interface
- 6.4.5. The CSSGroupingRule Interface

#remove-a-css-rule Referenced in:

- 6.1.2. The CSSStyleSheet Interface
- 6.4.2. The CSSRule Interface
- 6.4.5. The CSSGroupingRule Interface

#cssrulelist Referenced in:

- 6.1.2. The CSSStyleSheet Interface (2) (3)
- 6.1.2.1. Deprecated CSSStyleSheet members
- 6.4.1. The CSSRuleList Interface (2)
- 6.4.5. The CSSGroupingRule Interface

#dom-cssrulelist-item Referenced in:

- 6.4.1. The CSSRuleList Interface

#dom-cssrulelist-length Referenced in:

- 6.4.1. The CSSRuleList Interface

#cssrule Referenced in:

- 6.1.2. The CSSStyleSheet Interface
- 6.4. CSS Rules
- 6.4.1. The CSSRuleList Interface (2) (3) (4) (5)
- 6.4.2. The CSSRule Interface (2) (3)
- 6.4.3. The CSSStyleRule Interface
- 6.4.4. The CSSImportRule Interface
- 6.4.5. The CSSGroupingRule Interface
- 6.4.8. The CSSMarginRule Interface
- 6.4.9. The CSSNamespaceRule Interface
- 6.6.1. The CSSStyleDeclaration Interface
- 11.1. Changes From 5 December 2013

#dom-cssrule-csstext Referenced in:

- 6.4.2. The CSSRule Interface (2)
- 11.1. Changes From 5 December 2013

#dom-cssrule-parentrule Referenced in:

- 6.4.2. The CSSRule Interface (2) (3)

#dom-cssrule-parentstylesheet Referenced in:

- 6.4.2. The CSSRule Interface

#dom-cssrule-type Referenced in:

- 6.4.2. The CSSRule Interface

#cssstylerule Referenced in:

- 6.4. CSS Rules
- 6.4.2. The CSSRule Interface
- 6.4.3. The CSSStyleRule Interface

#dom-cssstylerule-selectortext Referenced in:

- 6.4.3. The CSSStyleRule Interface (2)

#dom-cssstylerule-style Referenced in:

- 6.4.3. The CSSStyleRule Interface

#concept-declarations-specified-order Referenced in:

- 6.4.3. The CSSStyleRule Interface
- 6.4.7. The CSSPageRule Interface
- 6.4.8. The CSSMarginRule Interface
- 6.6.1. The CSSStyleDeclaration Interface

#cssimportrule Referenced in:

- 6.4. CSS Rules
- 6.4.2. The CSSRule Interface
- 6.4.4. The CSSImportRule Interface

#dom-cssimportrule-href Referenced in:

- 6.4.4. The CSSImportRule Interface

#dom-cssimportrule-media Referenced in:

- 6.4.4. The CSSImportRule Interface

#dom-cssimportrule-stylesheet Referenced in:

- 6.4.4. The CSSImportRule Interface

#cssgroupingrule Referenced in:

- 6.1.2.1. Deprecated CSSStyleSheet members
- 6.4.5. The CSSGroupingRule Interface
- 6.4.7. The CSSPageRule Interface

#dom-cssgroupingrule-cssrules Referenced in:

- 6.4.5. The CSSGroupingRule Interface

#dom-cssgroupingrule-insertrule Referenced in:

- 6.4.5. The CSSGroupingRule Interface

#dom-cssgroupingrule-deleterule Referenced in:

- 6.4.5. The CSSGroupingRule Interface

#parse-a-list-of-css-page-selectors Referenced in:

- 6.4.7. The CSSPageRule Interface

#serialize-a-list-of-css-page-selectors Referenced in:

- 6.4.7. The CSSPageRule Interface

#csspagerule Referenced in:

- 6.4. CSS Rules (2)
- 6.4.2. The CSSRule Interface
- 6.4.7. The CSSPageRule Interface

#dom-csspagerule-selectortext Referenced in:

- 6.4.7. The CSSPageRule Interface

#cssmarginrule Referenced in:

- 6.4.2. The CSSRule Interface
- 6.4.8. The CSSMarginRule Interface

#dom-cssmarginrule-name Referenced in:

- 6.4.8. The CSSMarginRule Interface

#dom-cssmarginrule-style Referenced in:

- 6.4.8. The CSSMarginRule Interface

#cssnamespacerule Referenced in:

- 6.4. CSS Rules
- 6.4.2. The CSSRule Interface
- 6.4.9. The CSSNamespaceRule Interface
- 11.1. Changes From 5 December 2013

#dom-cssnamespacerule-namespaceuri Referenced in:

- 6.4. CSS Rules
- 6.4.9. The CSSNamespaceRule Interface

#dom-cssnamespacerule-prefix Referenced in:

- 6.4. CSS Rules
- 6.4.9. The CSSNamespaceRule Interface

#css-declaration Referenced in:

- 6.5. CSS Declarations
- 6.6. CSS Declaration Blocks (2) (3) (4) (5) (6) (7)
- 6.6.1. The CSSStyleDeclaration Interface (2) (3) (4) (5) (6) (7) (8) (9) (10) (11) (12) (13) (14) (15) (16) (17) (18) (19)
- 6.7.2. Serializing CSS Values (2)
- 7.2. Extensions to the Window Interface

#css-declaration-property-name Referenced in:

- 6.5. CSS Declarations
- 6.6. CSS Declaration Blocks (2) (3)
- 6.6.1. The CSSStyleDeclaration Interface (2) (3) (4) (5) (6) (7) (8) (9) (10) (11) (12)

#css-declaration-value Referenced in:

- 6.6.1. The CSSStyleDeclaration Interface (2) (3)

#css-declaration-important-flag Referenced in:

- 6.6. CSS Declaration Blocks (2) (3)
- 6.6.1. The CSSStyleDeclaration Interface (2) (3) (4) (5) (6)

#css-declaration-block Referenced in:

- 6.6. CSS Declaration Blocks (2) (3) (4) (5) (6) (7)
- 6.6.1. The CSSStyleDeclaration Interface (2) (3) (4)
- 7.1. The ElementCSSInlineStyle Mixin
- 7.2. Extensions to the Window Interface

#cssstyledeclaration-readonly-flag Referenced in:

- 6.4.3. The CSSStyleRule Interface
- 6.4.7. The CSSPageRule Interface
- 6.4.8. The CSSMarginRule Interface
- 6.6. CSS Declaration Blocks (2) (3)
- 6.6.1. The CSSStyleDeclaration Interface (2) (3)
- 7.1. The ElementCSSInlineStyle Mixin
- 7.2. Extensions to the Window Interface

#cssstyledeclaration-declarations Referenced in:

- 6.4.3. The CSSStyleRule Interface
- 6.4.7. The CSSPageRule Interface
- 6.4.8. The CSSMarginRule Interface
- 6.6. CSS Declaration Blocks (2) (3) (4) (5)
- 6.6.1. The CSSStyleDeclaration Interface (2) (3) (4) (5) (6) (7) (8) (9) (10) (11) (12)
- 7.2. Extensions to the Window Interface

#cssstyledeclaration-parent-css-rule Referenced in:

- 6.4.3. The CSSStyleRule Interface
- 6.4.7. The CSSPageRule Interface
- 6.4.8. The CSSMarginRule Interface
- 6.6.1. The CSSStyleDeclaration Interface
- 7.1. The ElementCSSInlineStyle Mixin
- 7.2. Extensions to the Window Interface

#cssstyledeclaration-owner-node Referenced in:

- 6.4.3. The CSSStyleRule Interface
- 6.4.7. The CSSPageRule Interface
- 6.4.8. The CSSMarginRule Interface
- 6.6. CSS Declaration Blocks (2) (3) (4)
- 7.1. The ElementCSSInlineStyle Mixin
- 7.2. Extensions to the Window Interface

#cssstyledeclaration-updating-flag Referenced in:

- 6.6. CSS Declaration Blocks (2) (3)

#parse-a-css-declaration-block Referenced in:

- 6.6. CSS Declaration Blocks (2)
- 6.6.1. The CSSStyleDeclaration Interface
- 11.2. Changes From 12 July 2011 To 5 December 2013

#serialize-a-css-declaration Referenced in:

- 6.6. CSS Declaration Blocks (2)

#serialize-a-css-declaration-block Referenced in:

- 6.4. CSS Rules
- 6.6. CSS Declaration Blocks
- 6.6.1. The CSSStyleDeclaration Interface
- 11.2. Changes From 12 July 2011 To 5 December 2013

#update-style-attribute-for Referenced in:

- 6.6.1. The CSSStyleDeclaration Interface (2) (3)

#concept-shorthands-preferred-order Referenced in:

- 6.6. CSS Declaration Blocks
- 6.7.2. Serializing CSS Values

#cssstyledeclaration Referenced in:

- 6.4.3. The CSSStyleRule Interface
- 6.4.7. The CSSPageRule Interface
- 6.4.8. The CSSMarginRule Interface
- 6.6.1. The CSSStyleDeclaration Interface (2) (3) (4)
- 7.1. The ElementCSSInlineStyle Mixin
- 7.2. Extensions to the Window Interface
- 11.1. Changes From 5 December 2013 (2) (3)
- 11.2. Changes From 12 July 2011 To 5 December 2013

#dom-cssstyledeclaration-csstext Referenced in:

- 6.4.3. The CSSStyleRule Interface
- 6.4.7. The CSSPageRule Interface
- 6.4.8. The CSSMarginRule Interface
- 6.6.1. The CSSStyleDeclaration Interface (2)
- 7.1. The ElementCSSInlineStyle Mixin

#dom-cssstyledeclaration-length Referenced in:

- 6.6.1. The CSSStyleDeclaration Interface

#dom-cssstyledeclaration-item Referenced in:

- 6.6.1. The CSSStyleDeclaration Interface

#dom-cssstyledeclaration-getpropertyvalue Referenced in:

- 6.6.1. The CSSStyleDeclaration Interface (2) (3) (4) (5) (6)
- 11.2. Changes From 12 July 2011 To 5 December 2013

#dom-cssstyledeclaration-getpropertypriority Referenced in:

- 6.6.1. The CSSStyleDeclaration Interface (2)

#dom-cssstyledeclaration-setproperty Referenced in:

- 6.6.1. The CSSStyleDeclaration Interface (2) (3) (4) (5)
- 11.1. Changes From 5 December 2013
- 11.2. Changes From 12 July 2011 To 5 December 2013

#set-a-css-declaration Referenced in:

- 6.6.1. The CSSStyleDeclaration Interface (2) (3)

#dom-cssstyledeclaration-removeproperty Referenced in:

- 6.6.1. The CSSStyleDeclaration Interface (2)

#dom-cssstyledeclaration-parentrule Referenced in:

- 6.6.1. The CSSStyleDeclaration Interface

#dom-cssstyledeclaration-cssfloat Referenced in:

- 6.6.1. The CSSStyleDeclaration Interface

#dom-cssstyledeclaration-camel-cased-attribute Referenced in:

- 6.6.1. The CSSStyleDeclaration Interface

#dom-cssstyledeclaration-webkit-cased-attribute Referenced in:

- 6.6.1. The CSSStyleDeclaration Interface

#dom-cssstyledeclaration-dashed-attribute Referenced in:

- 6.6.1. The CSSStyleDeclaration Interface

#css-property-to-idl-attribute Referenced in:

- 6.6.1. The CSSStyleDeclaration Interface (2)

#idl-attribute-to-css-property Referenced in:

- 6.6.1. The CSSStyleDeclaration Interface (2) (3) (4)

#parse-a-css-value Referenced in:

- 6.6.1. The CSSStyleDeclaration Interface
- 6.7.1. Parsing CSS Values

#serialize-a-css-value Referenced in:

- 6.6. CSS Declaration Blocks (2)
- 6.6.1. The CSSStyleDeclaration Interface (2)
- 6.7.2. Serializing CSS Values

#serialize-a-css-component-value Referenced in:

- 6.7.2. Serializing CSS Values (2) (3)

#elementcssinlinestyle Referenced in:

- 7.1. The ElementCSSInlineStyle Mixin (2) (3)

#dom-elementcssinlinestyle-style Referenced in:

- 7.1. The ElementCSSInlineStyle Mixin

#dom-window-getcomputedstyle Referenced in:

- 7.2. Extensions to the Window Interface (2)
- 9. Resolved Values (2)

#namespacedef-css Referenced in:

- 8.1. The CSS.escape() Method

#dom-css-escape Referenced in:

- 8.1. The CSS.escape() Method (2) (3)
- 11.2. Changes From 12 July 2011 To 5 December 2013

#resolved-value Referenced in:

- 7.2. Extensions to the Window Interface
- 9. Resolved Values (2) (3) (4) (5) (6) (7) (8) (9)

#http-default-style Referenced in:

- 6.2.1. The HTTP Default-Style Header (2)