CSS::DOM::Value::Primitive(3pm) | User Contributed Perl Documentation | CSS::DOM::Value::Primitive(3pm) |
CSS::DOM::Value::Primitive - CSSPrimitiveValue class for CSS::DOM
Version 0.17
# ...
This module implements objects that represent CSS primitive property values (as opposed to lists). It implements the DOM CSSPrimitiveValue, Rect, and RGBColor interfaces.
If you need the constructor, it's below the object methods. Normally you would get an object via CSS::DOM::Style's "getPropertyCSSValue" method.
The rest have still to be implemented.
The four methods "top", "right", "bottom" and "left" each return another value object representing the individual value.
The four methods "red", "green", "blue" and "alpha" each return another value object representing the individual value.
You probably don't need to call this, but here it is anyway:
$val = new CSS::DOM::Value::Primitive:: %args;
The hash-style arguments are as follows. Only "type" and "value" are required.
Here are the formats for the "value" argument, which depend on the type:
This applies to "CSS_EMS", "CSS_EXS", "CSS_PX", "CSS_CM", "CSS_MM", "CSS_IN", "CSS_PT", "CSS_PC", "CSS_DEG", "CSS_RAD", "CSS_GRAD", "CSS_MS", "CSS_S", "CSS_HZ" and "CSS_KHZ".
$separator and $style may each be "undef". If $separator is "undef", the object represents a "counter(...)". Otherwise it represents "counters(...)".
The four elements are either CSSValue objects or array refs of arguments to be passed to the constructor. E.g.:
[ [type => CSS_PX, value => 20], [type => CSS_PERCENTAGE, value => 50], [type => CSS_PERCENTAGE, value => 50], [type => CSS_PX, value => 50], ]
When these array refs are converted to objects, the "format" argument is supplied automatically, so you do not need to include it here.
[$r, $g, $b] [$r, $g, $b, $alpha]
The elements are either CSSValue objects or array refs of argument lists, as with "CSS_RECT".
The following constants can be imported with "use CSS::DOM::Value::Primitive ':all'". They represent the type of primitive value.
CSS::DOM
CSS::DOM::Value
CSS::DOM::Value::List
CSS::DOM::Style
2023-08-02 | perl v5.36.0 |