| Package | dom.style.css |
| Class | public class CSSCharsetRule |
| Inheritance | CSSCharsetRule CSSRule Object |
| Introduced in: | DOM 2 Core |
The value of the encoding attribute does not affect the encoding of text data in the DOM objects; this encoding is always UTF-16. After a stylesheet is loaded, the value of the encoding attribute is the value found in the @charset rule. If there was no @charset in the original document, then no CSSCharsetRule is created. The value of the encoding attribute may also be used as a hint for the encoding used on serialization of the style sheet.
The value of the @charset rule (and therefore of the CSSCharsetRule) may not correspond to the encoding the document actually came in; character encoding information e.g. in an HTTP header, has priority but this is not reflected in the CSSCharsetRule.
See also
| Property | Defined By | ||
|---|---|---|---|
![]() | DOM 2 Style cssText : DOMString [read-only]
The parsable textual representation of the rule. | CSSRule | |
| DOM 2 Style encoding : DOMString [read-only]
The encoding information used in this @charset rule. | CSSCharsetRule | ||
![]() | DOM 2 Style parentRule : CSSRule [read-only]
If this rule is contained inside another rule (e.g. | CSSRule | |
![]() | DOM 2 Style parentStyleSheet : CSSStyleSheet [read-only]
The style sheet that contains this rule. | CSSRule | |
![]() | DOM 2 Style type : Number [read-only]
The type of the rule, as defined above. | CSSRule | |
| DOM 2 Style encoding | property |
encoding:DOMString [read-only] | Introduced in: | DOM 2 Core |
The encoding information used in this @charset rule.
public function get encoding():DOMStringDOMException — SYNTAX_ERR: Raised if the specified CSS string
value has a syntax error and is unparsable.
| |
DOMException — NO_MODIFICATION_ALLOWED_ERR: Raised if this
declaration is readonly or a property is readonly.
|
See also