/[suikacvs]/messaging/manakai/lib/Message/DOM/CSSRule.pm
Suika

Diff of /messaging/manakai/lib/Message/DOM/CSSRule.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.7 by wakaba, Mon Jan 14 05:53:44 2008 UTC revision 1.8 by wakaba, Fri Feb 8 15:08:04 2008 UTC
# Line 117  package Message::DOM::CSSImportRule; Line 117  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], style_sheet => $_[3]}, $_[0];    my $self = bless \{href => $_[1], media => \$_[2],
121                         style_sheet => $_[3]}, $_[0];
122      require Message::DOM::MediaList;
123      bless $$self->{media}, 'Message::DOM::MediaList';
124    ${$_[3]}->{owner_rule} = $self;    ${$_[3]}->{owner_rule} = $self;
125    Scalar::Util::weaken (${$_[3]}->{owner_rule});    Scalar::Util::weaken (${$_[3]}->{owner_rule});
126    return $self;    return $self;
# Line 147  package Message::DOM::CSSMediaRule; Line 150  package Message::DOM::CSSMediaRule;
150  push our @ISA, 'Message::DOM::CSSRule', 'Message::IF::CSSMediaRule';  push our @ISA, 'Message::DOM::CSSRule', 'Message::IF::CSSMediaRule';
151    
152  sub ____new ($$$) {  sub ____new ($$$) {
153    my $self = bless \{media => $_[1], css_rules => $_[2]}, $_[0];    my $self = bless \{media => \$_[1], css_rules => $_[2]}, $_[0];
154      require Message::DOM::MediaList;
155      bless $$self->{media}, 'Message::DOM::MediaList';
156    for (@{$_[2]}) {    for (@{$_[2]}) {
157      ${$_}->{parent_rule} = $self;      ${$_}->{parent_rule} = $self;
158      Scalar::Util::weaken (${$_}->{parent_rule});      Scalar::Util::weaken (${$_}->{parent_rule});
# Line 157  sub ____new ($$$) { Line 162  sub ____new ($$$) {
162    
163  ## |CSSRule| attributes  ## |CSSRule| attributes
164    
165  ## TODO: |css_text|  sub css_text ($;$) {
166      ## TODO: setter
167      my $v = '@media ' . $_[0]->media . " {\n";
168      for (@{${$_[0]}->{css_rules}}) {
169        $v .= $_->css_text . "\n";
170        ## BUG: Browsers do indent.
171      }
172      $v .= "}";
173      return $v;
174    } # css_text
175    
176  sub type ($) { Message::DOM::CSSRule::MEDIA_RULE }  sub type ($) { Message::DOM::CSSRule::MEDIA_RULE }
177    

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24