The manakai project

Web::DOM::CSSStyleDeclaration

The DOM CSSStyleDeclaration object

DESCRIPTION

The Web::DOM::CSSStyleDeclaration class implements the DOM CSSStyleDeclaration interface.

METHODS

Following methods are available:

$string = $style->css_text
$style->css_text ($string)

Return or set the list of declarations contained by the CSSStyleDeclaration object. [CSSOM]

$string = $style->get_property_priorty ($prop_name)

Return the string important if the declaration for the specified property contains the !important keyword. [CSSOM]

$string = $style->get_property_value ($prop_name)

Return the character string serialization of the property value with the specified name, if any. [CSSOM]

$prop_name = $style->[$index]
$prop_name = $style->item ($index)

Return the property name at the specified index, if any. [CSSOM] [DOMPERL]

Use of the item method is discouraged as it doesn't support Perl-ish ways to access items, such as negative indexing, while $style->[-1] works as intended.

$length = $style->length
$length = scalar @$style

Return the number of declarations. [CSSOM] [DOMPERL]

$style = $style->parent_rule

Return the parent rule, if any. [CSSOM]

$old_value = $style->remove_property ($prop_name)

Remove the specified property and return the old value. [CSSOM]

$style->set_property ($prop_name, $value, $priority)

Set the specified property's value and priority ("important" or undef). [CSSOM]

In addition, there are methods reflecting CSS properties. For example, the display method reflects the display CSS property. The list_style_type method reflects the list-style-type CSS property. Note that both float and css_float methods reflect the float CSS property.

  $style->display ('block');
  $string = $style->display; # 'block'

For the list of CSS properties, see Web::CSS::Props in the web-css package.

DEPENDENCY

See "DEPENDENCY" in Web::DOM.

SPECIFICATIONS

CSSOM

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

The item method MUST return the empty string if there is no item at the specified index.

DOMPERL

manakai's DOM Perl Binding <http://suika.suikawiki.org/~wakaba/wiki/sw/n/manakai%27s%20DOM%20Perl%20Binding#anchor-86>.

SEE ALSO

Web::DOM::CSSStyleRule.

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.