17 |
## |CSSRule| attributes |
## |CSSRule| attributes |
18 |
|
|
19 |
sub css_text ($) { |
sub css_text ($) { |
20 |
die "$0: ".(ref $self)."->css_text: Not implemented"; |
die "$0: ".(ref $_[0])."->css_text: Not implemented"; |
21 |
} # css_text |
} # css_text |
22 |
|
|
23 |
sub parent_rule ($) { |
sub parent_rule ($) { |
42 |
} # parent_style_sheet |
} # parent_style_sheet |
43 |
|
|
44 |
sub type ($) { |
sub type ($) { |
45 |
die "$0: ".(ref $self)."->type: Not implemented"; |
die "$0: ".(ref $_[0])."->type: Not implemented"; |
46 |
} # type |
} # type |
47 |
|
|
48 |
package Message::DOM::CSSStyleRule; |
package Message::DOM::CSSStyleRule; |
49 |
push our @ISA, 'Message::DOM::CSSRule', 'Message::IF::CSSStyleRule'; |
push our @ISA, 'Message::DOM::CSSRule', 'Message::IF::CSSStyleRule'; |
50 |
|
|
51 |
sub ____new ($$$) { |
sub ____new ($$$) { |
52 |
my $self = bless \{_selector => $_[1], style => $_[2]}, $_[0]; |
my $self = bless \{_selectors => $_[1], style => $_[2]}, $_[0]; |
53 |
${$_[2]}->{parent_rule} = $self; |
${$_[2]}->{parent_rule} = $self; |
54 |
Scalar::Util::weaken (${$_[2]}->{parent_rule}); |
Scalar::Util::weaken (${$_[2]}->{parent_rule}); |
55 |
return $self; |
return $self; |
57 |
|
|
58 |
## |CSSRule| attributes |
## |CSSRule| attributes |
59 |
|
|
60 |
## TODO: |css_text| |
sub css_text ($;$) { |
61 |
|
## TODO: setter |
62 |
|
|
63 |
|
## TODO: Browser compatibility |
64 |
|
local $Error::Depth = $Error::Depth + 1; |
65 |
|
return $_[0]->selector_text . " {\n" . $_[0]->style->css_text . "}\n"; |
66 |
|
} # css_text |
67 |
|
|
68 |
sub type ($) { Message::DOM::CSSRule::STYLE_RULE } |
sub type ($) { Message::DOM::CSSRule::STYLE_RULE } |
69 |
|
|
70 |
## |CSSStyleRule| attributes |
## |CSSStyleRule| attributes |
71 |
|
|
72 |
## TODO: |selector_text| |
sub selector_text ($;$) { |
73 |
|
## TODO: setter |
74 |
|
|
75 |
|
## TODO: Browser-compatible serializer |
76 |
|
require Whatpm::CSS::SelectorsSerializer; |
77 |
|
return Whatpm::CSS::SelectorsSerializer->serialize_test |
78 |
|
(${$_[0]}->{_selectors}); |
79 |
|
} # selector_text |
80 |
|
|
81 |
sub style ($) { |
sub style ($) { |
82 |
return ${$_[0]}->{style}; |
return ${$_[0]}->{style}; |
186 |
push our @ISA, 'Message::DOM::CSSRule', 'Message::IF::CSSPageRule'; |
push our @ISA, 'Message::DOM::CSSRule', 'Message::IF::CSSPageRule'; |
187 |
|
|
188 |
sub ____new ($$$) { |
sub ____new ($$$) { |
189 |
my $self = bless \{_selector => $_[1], style => $_[2]}, $_[0]; |
my $self = bless \{_selectors => $_[1], style => $_[2]}, $_[0]; |
190 |
${$_[2]}->{parent_rule} = $self; |
${$_[2]}->{parent_rule} = $self; |
191 |
Scalar::Util::weaken (${$_[2]}->{parent_rule}); |
Scalar::Util::weaken (${$_[2]}->{parent_rule}); |
192 |
return $self; |
return $self; |
200 |
|
|
201 |
## |CSSPageRule| attributes |
## |CSSPageRule| attributes |
202 |
|
|
203 |
## TODO: |selector_text| |
sub selector_text ($;$) { |
204 |
|
## TODO: setter |
205 |
|
|
206 |
|
## TODO: Browser-compatible serializer |
207 |
|
require Whatpm::CSS::SelectorsSerializer; |
208 |
|
return Whatpm::CSS::SelectorsSerializer->serialize_test (${$_[0]}->{_selectors}); |
209 |
|
} # selector_text |
210 |
|
|
211 |
sub style ($) { |
sub style ($) { |
212 |
return ${$_[0]}->{style}; |
return ${$_[0]}->{style}; |