116 |
package Message::DOM::CSSImportRule; |
package Message::DOM::CSSImportRule; |
117 |
push our @ISA, 'Message::DOM::CSSRule', 'Message::IF::CSSImportRule'; |
push our @ISA, 'Message::DOM::CSSRule', 'Message::IF::CSSImportRule'; |
118 |
|
|
119 |
sub ____new ($$$$) { |
sub ____new ($$$$$) { |
120 |
my $self = bless \{href => $_[1], media => \$_[2], |
my $self = bless \{href => $_[1], |
121 |
style_sheet => $_[3]}, $_[0]; |
base_uri => $_[2], ## Ref to base URI |
122 |
|
media => \$_[3], |
123 |
|
style_sheet => $_[4]}, $_[0]; |
124 |
require Message::DOM::MediaList; |
require Message::DOM::MediaList; |
125 |
bless $$self->{media}, 'Message::DOM::MediaList'; |
bless $$self->{media}, 'Message::DOM::MediaList'; |
126 |
${$_[3]}->{owner_rule} = $self; |
${$_[4]}->{owner_rule} = $self; |
127 |
Scalar::Util::weaken (${$_[3]}->{owner_rule}); |
Scalar::Util::weaken (${$_[4]}->{owner_rule}); |
128 |
return $self; |
return $self; |
129 |
} # ____new |
} # ____new |
130 |
|
|
131 |
## |CSSRule| attributes |
## |CSSRule| attributes |
132 |
|
|
133 |
## TODO: |css_text| |
sub css_text ($;$) { |
134 |
|
## TODO: setter |
135 |
|
|
136 |
|
my $self = shift; |
137 |
|
my $r = '@import url(' . $self->href . ')'; |
138 |
|
my $media = ''.$self->media; |
139 |
|
if ($media) { |
140 |
|
$r .= ' ' . $media; |
141 |
|
} |
142 |
|
$r .= ';'; |
143 |
|
return $r; |
144 |
|
} # css_text |
145 |
|
|
146 |
sub type ($) { Message::DOM::CSSRule::IMPORT_RULE } |
sub type ($) { Message::DOM::CSSRule::IMPORT_RULE } |
147 |
|
|