The manakai project

Web::DOM::CSSRule

The DOM CSSRule object

DESCRIPTION

The Web::DOM::CSSRule class implements the DOM CSSRule interface. The Web::DOM::CSSRule class is an abstract class. It is used as subclasses such as Web::DOM::CSSStyleRule and Web::DOM::CSSMediaRule.

METHODS

Following methods are available:

$string = $rule->css_text

Return the serialized rule. [CSSOM]

$rule = $rule->parent_rule

Return the parent rule, if any. [CSSOM]

$rule = $rule->parent_style_sheet

Return the owner style sheet, if any. [CSSOM]

$type = $rule->type

Return the type of the rule, as one of the "CONSTANTS" exported by the module. [CSSOM]

Any CSSRule object is an instance of one of its subclasses. For example, a CSSRule object whose type is STYLE_RULE is an instance of Web::DOM::CSSStyleRule. There are following subclasses:

Web::DOM::CSSStyleRule, Web::DOM::CSSCharsetRule, Web::DOM::CSSImportRule, Web::DOM::CSSMediaRule, Web::DOM::CSSFontFaceRule, Web::DOM::CSSPageRule, and Web::DOM::CSSNamespaceRule.

In addition, there is Web::DOM::CSSUnknownRule subclass, which implements the obsolete CSSUnknownRule interface [DOM2CSS]. The subclass has no additional method.

CONSTANTS

Constants are exported from the Web::DOM::CSSRule module by default. In addition, they are accessible as methods of CSSRule objects.

Following constants are defined for the type attribute [CSSOM]:

STYLE_RULE CHARSET_RULE IMPORT_RULE MEDIA_RULE FONT_FACE_RULE PAGE_RULE NAMESPACE_RULE

In addition, obsolete constant UNKNOWN_RULE [DOM2CSS] is also defined.

DEPENDENCY

See "DEPENDENCY" in Web::DOM.

SPECIFICATIONS

CSSOM

CSSOM <http://dev.w3.org/csswg/cssom/>.

The insertRule method and the selectorText attribute MUST use the @namespace at-rules in the parent style sheet to resolve namespaces, if necessary. If there is no parent style sheet, there is no @namespace at-rule applicable.

DOM2CSS

Document Object Model CSS <http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSRule>.

SEE ALSO

Web::DOM::CSSStyleSheet.

AUTHOR

Wakaba <wakaba@suikawiki.org>.

LICENSE

Copyright 2012-2013 Wakaba <wakaba@suikawiki.org>.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.