60 |
sub css_text ($;$) { |
sub css_text ($;$) { |
61 |
## TODO: setter |
## TODO: setter |
62 |
|
|
63 |
## TODO: Browser compatibility |
## NOTE: Where and how white space characters are inserted are |
64 |
|
## intentionally changed from those in browsers so that properties are |
65 |
|
## more prettily printed. |
66 |
|
## See <http://suika.fam.cx/gate/2005/sw/cssText> for what browsers do. |
67 |
local $Error::Depth = $Error::Depth + 1; |
local $Error::Depth = $Error::Depth + 1; |
68 |
return $_[0]->selector_text . " {\n" . $_[0]->style->css_text . "}\n"; |
return $_[0]->selector_text . " {\n" . $_[0]->style->css_text . '}'; |
69 |
} # css_text |
} # css_text |
70 |
|
|
71 |
sub type ($) { Message::DOM::CSSRule::STYLE_RULE } |
sub type ($) { Message::DOM::CSSRule::STYLE_RULE } |
76 |
## TODO: setter |
## TODO: setter |
77 |
|
|
78 |
## TODO: Browser-compatible serializer |
## TODO: Browser-compatible serializer |
79 |
|
## TODO: This code does not work for cases where default namespace |
80 |
|
## has no namespace prefix declared. |
81 |
|
my $self = $_[0]; |
82 |
require Whatpm::CSS::SelectorsSerializer; |
require Whatpm::CSS::SelectorsSerializer; |
83 |
return Whatpm::CSS::SelectorsSerializer->serialize_test |
return Whatpm::CSS::SelectorsSerializer->serialize_selector_text |
84 |
(${$_[0]}->{_selectors}); |
($$self->{_selectors}, ${$self->parent_style_sheet}->{_nsmap}); |
85 |
} # selector_text |
} # selector_text |
86 |
|
|
87 |
sub style ($) { |
sub style ($) { |
233 |
|
|
234 |
## |CSSRule| attributes |
## |CSSRule| attributes |
235 |
|
|
236 |
## TODO: |css_text| |
sub css_text ($;$) { |
237 |
|
## TODO: Setter |
238 |
|
|
239 |
|
## NOTE: Sometimes ugly, but this is what Firefox does. |
240 |
|
my $prefix = ${$_[0]}->{prefix}; |
241 |
|
return '@namespace '.($prefix ne '' ? $prefix.' ' : ''). |
242 |
|
'url('.${$_[0]}->{namespace_uri}.');'; |
243 |
|
} # css_text |
244 |
|
|
245 |
sub type ($) { Message::DOM::CSSRule::NAMESPACE_RULE } |
sub type ($) { Message::DOM::CSSRule::NAMESPACE_RULE } |
246 |
|
|