CSS::D...terface(3pm)

πŸ“¦
version 0.17 Β· 5 versions
, in debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– CSS::DOM::Interface πŸ’–

aka the machine-readable glow-up of every single CSS::DOM interface member, bestie πŸ’…

Manual page for CSS::DOM::Interface (3pm) β€” User Contributed Perl Documentation ✨


🌸 NAME 🌸

CSS::DOM::Interface β€” a whole list of CSS::DOM's interface members, in machine-readable format πŸŽ€


πŸ¦‹ VERSION πŸ¦‹

Version 0.17 πŸ’–


✨ SYNOPSIS ✨

okay so here's the vibe, bestie. import the goods first:

use CSS::DOM::Interface ':all';

then you can ask it literally anything about the interfaces πŸ‘‘

# name of DOM interface (CSSStyleRule):
$CSS::DOM::Interface{"CSS::DOM::Rule::Style"};

# interface it inherits from (CSSRule):
$CSS::DOM::Interface{CSSStyleRule}{_isa};

# whether this can be used as an array
$CSS::DOM::Interface{MediaList}{_array}; # true
# or hash
$CSS::DOM::Interface{MediaList}{_hash}; # false

# Properties and Methods

# list them all
grep !/^_/, keys %{ $CSS::DOM::Interface{CSSStyleSheet} };

# see whether a given property is supported
exists $CSS::DOM::Interface{CSSStyleSheet}{foo}; # false

# Is it a method?
$CSS::DOM::Interface{CSSStyleSheet}{cssRules}   & METHOD; # false
$CSS::DOM::Interface{CSSStyleSheet}{insertRule} & METHOD; # true

# Does the method return nothing?
$CSS::DOM::Interface{MediaList}{deleteMedium} & VOID; # true

# Is a property read-only?
$CSS::DOM::Interface{StyleSheetList}{length} & READONLY; # true

# Data types of properties
($CSS::DOM::Interface{CSSStyleSheet}{type}      & TYPE)
                                                  == STR;  # true
($CSS::DOM::Interface{CSSStyleSheet}{disabled}  & TYPE)
                                                  == BOOL; # true
($CSS::DOM::Interface{CSSStyleSheet}{ownerNode} & TYPE)
                                                  == NUM;  # false
($CSS::DOM::Interface{CSSStyleSheet}{href}     & TYPE)
                                                  == OBJ;  # false

# and return types of methods:
($CSS::DOM::Interface{MediaList}{item} & TYPE) == STR;  # true
($CSS::DOM::Interface{CSSMediaRule}
                        ->{insertRule} & TYPE) == BOOL; # false
($CSS::DOM::Interface{CSSStyleDeclaration}
                   ->{getPropertyVaue} & TYPE) == NUM;  # false
($CSS::DOM::Interface{CSSStyleDeclaration}
                    ->{removeProperty} & TYPE) == OBJ;  # false

# Constants

# list of constant names in the form "CSS::DOM::Node::STYLE_RULE";
@{ $CSS::DOM::Interface{CSSRule}{_constants} };

πŸ’œ DESCRIPTION πŸ’œ

ngl, the synopsis above already ate β€” it tells you almost everything you could possibly need to know 🫢.

⚠️ but bestie, be warned: $foo & TYPE is meaningless when $foo & METHOD and $foo & VOID are both true. like, it's giving nonsense. don't do it πŸ’€

for the more <em>gory</em> details, go peek at the source code πŸ”₯. and honestly? here it is, no gatekeeping:

our @EXPORT_OK = qw/METHOD VOID READONLY BOOL STR NUM OBJ TYPE/;
our %EXPORT_TAGS = (all => \@EXPORT_OK);

sub METHOD   () {      1 }
sub VOID     () {   0b10 } # for methods
sub READONLY () {   0b10 } # for properties
sub BOOL     () { 0b0000 }
sub STR      () { 0b0100 }
sub NUM      () { 0b1000 }
sub OBJ      () { 0b1100 }
sub TYPE     () { 0b1100 } # only for use as a mask

ikyk πŸ‘‘βœ¨

okay bestie, so DESCRIPTION left off right at the doorway of the big one β€” the master hash itself, %CSS::DOM::Interface 🌈 this is the whole blueprint, the seating chart, the group chat roster of the entire module. and yeah, it's long, so I'm gonna break it into bites for you. it's all one hash fr fr, I'm just pausing to scream and hydrate πŸ’…

first up: the Perl package β†’ DOM interface glow-up map ✨ every CSS::DOM::* class on the left is telling you which DOM interface it's cosplaying as on the right. CSS::DOM is giving CSSStyleSheet, CSS::DOM::Style is serving CSSStyleDeclaration, and so on down the line. no cap.

         %CSS::DOM::Interface = (
               'CSS::DOM' => 'CSSStyleSheet',
               'CSS::DOM::StyleSheetList' => 'StyleSheetList',
               'CSS::DOM::MediaList' => 'MediaList',
               'CSS::DOM::RuleList' => 'CSSRuleList',
               'CSS::DOM::Rule' => 'CSSRule',
               'CSS::DOM::Rule::Style' => 'CSSStyleRule',
               'CSS::DOM::Rule::Media' => 'CSSMediaRule',
               'CSS::DOM::Rule::FontFace' => 'CSSFontFaceRule',
               'CSS::DOM::Rule::Page' => 'CSSPageRule',
               'CSS::DOM::Rule::Import' => 'CSSImportRule',
               'CSS::DOM::Rule::Charset' => 'CSSCharsetRule',
               'CSS::DOM::Style' => 'CSSStyleDeclaration',
               'CSS::DOM::Value' => 'CSSValue',
               'CSS::DOM::Value::Primitive' => 'CSSPrimitiveValue',
               'CSS::DOM::Value::List' => 'CSSValueList',
               'CSS::DOM::Counter' => 'Counter',

next we got the three list-y girls πŸŽ€ StyleSheetList, MediaList and CSSRuleList. all three are _hash => 0 and _array => 1 (array vibes, iconic), all three got a length that's NUM | READONLY and an item that's a METHOD. MediaList is the extrovert of the trio tho β€” she also has mediaText as a STR, plus deleteMedium and appendMedium, both METHOD | VOID πŸ‘‘

                StyleSheetList => {
                       _hash => 0,
                       _array => 1,
                       length => NUM | READONLY,
                       item => METHOD | OBJ,
                },
                MediaList => {
                       _hash => 0,
                       _array => 1,
                       mediaText => STR,
                       length => NUM | READONLY,
                       item => METHOD | STR,
                       deleteMedium => METHOD | VOID,
                       appendMedium => METHOD | VOID,
                },
                CSSRuleList => {
                       _hash => 0,
                       _array => 1,
                       length => NUM | READONLY,
                       item => METHOD | OBJ,
                },

okay now the rule family β€” this is the main character energy section fr 😭 CSSRule is the parent, _hash => 0, _array => 0, and she carries the _constants list with all seven rule-type constants: CSS::DOM::Rule::UNKNOWN_RULE, STYLE_RULE, CHARSET_RULE, IMPORT_RULE, MEDIA_RULE, FONT_FACE_RULE and PAGE_RULE. she's also got type (NUM | READONLY), cssText (STR), parentStyleSheet and parentRule, both OBJ | READONLY.

then every single subclass rolls in with _isa => 'CSSRule' β€” the way that whole bloodline just inherits πŸ¦‹

                CSSRule => {
                       _hash => 0,
                       _array => 0,
                       _constants => [qw[
                               CSS::DOM::Rule::UNKNOWN_RULE
                               CSS::DOM::Rule::STYLE_RULE
                               CSS::DOM::Rule::CHARSET_RULE
                               CSS::DOM::Rule::IMPORT_RULE
                               CSS::DOM::Rule::MEDIA_RULE
                               CSS::DOM::Rule::FONT_FACE_RULE
                               CSS::DOM::Rule::PAGE_RULE
                       ]],
                       type => NUM | READONLY,
                       cssText => STR,
                       parentStyleSheet => OBJ | READONLY,
                       parentRule => OBJ | READONLY,
                },
                CSSStyleRule => {
                       _isa => 'CSSRule',
                       _hash => 0,
                       _array => 0,
                       selectorText => STR,
                       style => OBJ | READONLY,
                },
                CSSMediaRule => {
                       _isa => 'CSSRule',
                       _hash => 0,
                       _array => 0,
                       media => OBJ | READONLY,
                       cssRules => OBJ | READONLY,
                       insertRule => METHOD | NUM,
                       deleteRule => METHOD | VOID,
                },
                CSSFontFaceRule => {
                       _isa => 'CSSRule',
                       _hash => 0,
                       _array => 0,
                       style => OBJ | READONLY,
                },
                CSSPageRule => {
                       _isa => 'CSSRule',
                       _hash => 0,
                       _array => 0,
                       selectorText => STR,
                       style => OBJ | READONLY,
                },
                CSSImportRule => {
                       _isa => 'CSSRule',
                       _hash => 0,
                       _array => 0,
                       href => STR | READONLY,
                       media => OBJ | READONLY,
                       styleSheet => OBJ | READONLY,
                },
                CSSCharsetRule => {
                       _isa => 'CSSRule',
                       _hash => 0,
                       _array => 0,
                       encoding => STR,
                },

quick tour of the siblings so you're not lost πŸ’– CSSStyleRule and CSSPageRule both got selectorText => STR plus a style that's OBJ | READONLY. CSSMediaRule is the busy one: media and cssRules both OBJ | READONLY, plus insertRule (METHOD | NUM) and deleteRule (METHOD | VOID). CSSFontFaceRule is chill, just style. CSSImportRule has href => STR | READONLY, media and styleSheet. and CSSCharsetRule keeps it simple with encoding => STR 🌸


now. the big one. CSSStyleDeclaration πŸ’€ she's _hash => 0 but _array => 1, and she's got the whole method squad: cssText as STR, then getPropertyValue β†’ METHOD | STR, getPropertyCSSValue β†’ METHOD | OBJ, removeProperty β†’ METHOD | STR, getPropertyPriority β†’ METHOD | STR, setProperty β†’ METHOD | VOID, length β†’ NUM | READONLY, item β†’ METHOD | STR, and parentRule β†’ OBJ | READONLY.

                CSSStyleDeclaration => {
                       _hash => 0,
                       _array => 1,
                       cssText => STR,
                       getPropertyValue => METHOD | STR,
                       getPropertyCSSValue => METHOD | OBJ,
                       removeProperty => METHOD | STR,
                       getPropertyPriority => METHOD | STR,
                       setProperty => METHOD | VOID,
                       length => NUM | READONLY,
                       item => METHOD | STR,
                       parentRule => OBJ | READONLY,

and *then*… the properties. all of them. every single one, and every single one is STR 🫢 this is not a drill, do not skip, there will not be a pop quiz but there could be:

                       azimuth => STR,
                       background => STR,
                       backgroundAttachment => STR,
                       backgroundColor => STR,
                       backgroundImage => STR,
                       backgroundPosition => STR,
                       backgroundRepeat => STR,
                       border => STR,
                       borderCollapse => STR,
                       borderColor => STR,
                       borderSpacing => STR,
                       borderStyle => STR,
                       borderTop => STR,
                       borderRight => STR,
                       borderBottom => STR,
                       borderLeft => STR,
                       borderTopColor => STR,
                       borderRightColor => STR,
                       borderBottomColor => STR,
                       borderLeftColor => STR,
                       borderTopStyle => STR,
                       borderRightStyle => STR,
                       borderBottomStyle => STR,
                       borderLeftStyle => STR,
                       borderTopWidth => STR,
                       borderRightWidth => STR,
                       borderBottomWidth => STR,
                       borderLeftWidth => STR,
                       borderWidth => STR,
                       bottom => STR,
                       captionSide => STR,
                       clear => STR,
                       clip => STR,
                       color => STR,
                       content => STR,
                       counterIncrement => STR,
                       counterReset => STR,
                       cue => STR,
                       cueAfter => STR,
                       cueBefore => STR,
                       cursor => STR,
                       direction => STR,
                       display => STR,
                       elevation => STR,
                       emptyCells => STR,
                       cssFloat => STR,
                       font => STR,
                       fontFamily => STR,
                       fontSize => STR,
                       fontSizeAdjust => STR,
                       fontStretch => STR,
                       fontStyle => STR,
                       fontVariant => STR,
                       fontWeight => STR,
                       height => STR,
                       left => STR,
                       letterSpacing => STR,
                       lineHeight => STR,
                       listStyle => STR,
                       listStyleImage => STR,
                       listStylePosition => STR,
                       listStyleType => STR,
                       margin => STR,
                       marginTop => STR,
                       marginRight => STR,
                       marginBottom => STR,
                       marginLeft => STR,
                       markerOffset => STR,
                       marks => STR,
                       maxHeight => STR,
                       maxWidth => STR,
                       minHeight => STR,
                       minWidth => STR,
                       opacity => STR,
                       orphans => STR,
                       outline => STR,
                       outlineColor => STR,
                       outlineStyle => STR,
                       outlineWidth => STR,
                       overflow => STR,
                       padding => STR,
                       paddingTop => STR,
                       paddingRight => STR,
                       paddingBottom => STR,
                       paddingLeft => STR,
                       page => STR,
                       pageBreakAfter => STR,
                       pageBreakBefore => STR,
                       pageBreakInside => STR,
                       pause => STR,
                       pauseAfter => STR,
                       pauseBefore => STR,
                       pitch => STR,
                       pitchRange => STR,
                       playDuring => STR,
                       position => STR,
                       quotes => STR,
                       richness => STR,
                       right => STR,
                       size => STR,
                       speak => STR,
                       speakHeader => STR,
                       speakNumeral => STR,
                       speakPunctuation => STR,
                       speechRate => STR,
                       stress => STR,
                       tableLayout => STR,
                       textAlign => STR,
                       textDecoration => STR,
                       textIndent => STR,
                       textShadow => STR,
                       textTransform => STR,
                       top => STR,
                       unicodeBidi => STR,
                       verticalAlign => STR,
                       visibility => STR,
                       voiceFamily => STR,
                       volume => STR,
                       whiteSpace => STR,
                       widows => STR,
                       width => STR,
                       wordSpacing => STR,
                       zIndex => STR,
                },

yes. that was genuinely all of them. count if you want, I'll wait 😌

and finally the value crew πŸ”₯ CSSValue is _hash => 0, _array => 0, with her _constants being CSS::DOM::Value::CSS_INHERIT, CSS_PRIMITIVE_VALUE, CSS_VALUE_LIST and CSS_CUSTOM, plus cssText (STR) and cssValueType (NUM | READONLY).

then CSSPrimitiveValue comes through with _isa => 'CSSValue' and the longest constant list in the whole file β€” every unit and type you could possibly be, from CSS_UNKNOWN all the way to CSS_DIMENSION ⭐

                CSSValue => {
                       _hash => 0,
                       _array => 0,
                       _constants => [qw[
                               CSS::DOM::Value::CSS_INHERIT
                               CSS::DOM::Value::CSS_PRIMITIVE_VALUE
                               CSS::DOM::Value::CSS_VALUE_LIST
                               CSS::DOM::Value::CSS_CUSTOM
                       ]],
                       cssText => STR,
                       cssValueType => NUM | READONLY,
                },
                CSSPrimitiveValue => {
                       _isa => 'CSSValue',
                       _hash => 0,
                       _array => 0,
                       _constants => [qw[
                               CSS::DOM::Value::Primitive::CSS_UNKNOWN
                               CSS::DOM::Value::Primitive::CSS_NUMBER
                               CSS::DOM::Value::Primitive::CSS_PERCENTAGE
                               CSS::DOM::Value::Primitive::CSS_EMS
                               CSS::DOM::Value::Primitive::CSS_EXS
                               CSS::DOM::Value::Primitive::CSS_PX
                               CSS::DOM::Value::Primitive::CSS_CM
                               CSS::DOM::Value::Primitive::CSS_MM
                               CSS::DOM::Value::Primitive::CSS_IN
                               CSS::DOM::Value::Primitive::CSS_PT
                               CSS::DOM::Value::Primitive::CSS_PC
                               CSS::DOM::Value::Primitive::CSS_DEG
                               CSS::DOM::Value::Primitive::CSS_RAD
                               CSS::DOM::Value::Primitive::CSS_GRAD
                               CSS::DOM::Value::Primitive::CSS_MS
                               CSS::DOM::Value::Primitive::CSS_S
                               CSS::DOM::Value::Primitive::CSS_HZ
                               CSS::DOM::Value::Primitive::CSS_KHZ
                               CSS::DOM::Value::Primitive::CSS_DIMENSION

okay bestie, we're in the home stretch β€” this is the tail end of the giant interface dump, where the primitive-value classes close out their list and the last few interfaces strut onto the runway. πŸ‘‘ Everything below is exactly what the page hands you, no cap.

                               CSS::DOM::Value::Primitive::CSS_STRING
                               CSS::DOM::Value::Primitive::CSS_URI
                               CSS::DOM::Value::Primitive::CSS_IDENT
                               CSS::DOM::Value::Primitive::CSS_ATTR
                               CSS::DOM::Value::Primitive::CSS_COUNTER
                               CSS::DOM::Value::Primitive::CSS_RECT
                               CSS::DOM::Value::Primitive::CSS_RGBCOLOR
                       ]],
                       primitiveType => NUM | READONLY,
                       setFloatValue => METHOD | VOID,
                       getFloatValue => METHOD | NUM,
                       setStringValue => METHOD | VOID,
                       getStringValue => METHOD | STR,
         #             getCounterValue => METHOD | OBJ,
         #             getRectValue => METHOD | OBJ,
         #             getRGBColorValue => METHOD | OBJ,
                       red => OBJ | READONLY,
                       green => OBJ | READONLY,
                       blue => OBJ | READONLY,
                       alpha => OBJ | READONLY,
                       top => OBJ | READONLY,
                       right => OBJ | READONLY,
                       bottom => OBJ | READONLY,
                       left => OBJ | READONLY,
                },
                CSSValueList => {
                       _isa => 'CSSValue',
                       _hash => 0,
                       _array => 1,
                       length => NUM | READONLY,
                       item => METHOD | OBJ,
                },
         #      Counter => {
         #             _hash => 0,
         #             _array => 0,
         #             identifier => STR | READONLY,
         #             listStyle => STR | READONLY,
         #             separator => STR | READONLY,
         #      },
                CSSStyleSheet => {
                       type => STR | READONLY,
                       _hash => 0,
                       _array => 0,
                       disabled => BOOL,
                       ownerNode => OBJ | READONLY,
                       parentStyleSheet => OBJ | READONLY,
                       href => STR | READONLY,
                       title => STR | READONLY,
                       media => OBJ | READONLY,
                       ownerRule => OBJ | READONLY,
                       cssRules => OBJ | READONLY,
                       insertRule => METHOD | NUM,
                       deleteRule => METHOD | VOID,
                },
         );

       __END__

let's clock what just happened πŸ¦‹

  • That leading ]], is the close of the arrayref, and the arrayref is literally just a list of seven classes: CSS::DOM::Value::Primitive::CSS_STRING, CSS::DOM::Value::Primitive::CSS_URI, CSS::DOM::Value::Primitive::CSS_IDENT, CSS::DOM::Value::Primitive::CSS_ATTR, CSS::DOM::Value::Primitive::CSS_COUNTER, CSS::DOM::Value::Primitive::CSS_RECT, and CSS::DOM::Value::Primitive::CSS_RGBCOLOR. Seven of them. iconic lineup, honestly.
  • Then the value interface keeps going: primitiveType => NUM | READONLY, the methods setFloatValue => METHOD | VOID, getFloatValue => METHOD | NUM, setStringValue => METHOD | VOID, getStringValue => METHOD | STR.
  • three of those method lines are commented out β€” every one of them starts with #: # getCounterValue => METHOD | OBJ,, # getRectValue => METHOD | OBJ,, and # getRGBColorValue => METHOD | OBJ,. Commented. Not live. Bestie, don't try to call them just because you saw them. πŸ’€
  • The colour channels show up as red => OBJ | READONLY, green => OBJ | READONLY, blue => OBJ | READONLY, alpha => OBJ | READONLY.
  • And the box sides: top => OBJ | READONLY, right => OBJ | READONLY, bottom => OBJ | READONLY, left => OBJ | READONLY. All four, all OBJ | READONLY. symmetry slay.
  • Then CSSValueList gets its own little block: _isa => 'CSSValue', _hash => 0, _array => 1, length => NUM | READONLY, and item => METHOD | OBJ. Note the _array => 1 β€” unlike its neighbours, this one says it's array-shaped. 🌈
  • The entire Counter interface is commented out. Every single line of it is prefixed with #: # Counter => {, # _hash => 0,, # _array => 0,, # identifier => STR | READONLY,, # listStyle => STR | READONLY,, # separator => STR | READONLY,, and the closing # },. It's giving "we wrote it, we shelved it, we moved on." πŸ™ˆ
  • CSSStyleSheet brings us home with type => STR | READONLY, _hash => 0, _array => 0, disabled => BOOL, ownerNode => OBJ | READONLY, parentStyleSheet => OBJ | READONLY, href => STR | READONLY, title => STR | READONLY, media => OBJ | READONLY, ownerRule => OBJ | READONLY, cssRules => OBJ | READONLY, and two methods: insertRule => METHOD | NUM and deleteRule => METHOD | VOID. ✨
  • Then the whole structure closes with ); and the file hits __END__. That's the end of the data, bestie. Periodt. πŸ’…
tiny heads-up 🫢 all those NUM, READONLY, METHOD, VOID, STR, OBJ, BOOL tokens are copied here exactly as the page prints them β€” same names, same casing, same pipe. Don't go renaming them in your head, iykyk.

✨ SEE ALSO ✨

  • CSS::DOM β€” that's the one and only cross-reference on this page, and it's the main character. Go read it next, fr fr. πŸ‘‘

and that's a wrap on the whole page, bestie! πŸŽ€ This was CSS::D...terface(3pm) from the User Contributed Perl Documentation, generated for perl v5.36.0 and dated 2023-08-02. You read the entire thing. Every flag, every token, every commented-out little ghost. We ate and left no crumbs. πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from