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

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

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

revision 1.1 by wakaba, Sat Dec 22 06:29:32 2007 UTC revision 1.2 by wakaba, Sat Dec 22 06:57:46 2007 UTC
# Line 2  package Message::DOM::CSSStyleSheet; Line 2  package Message::DOM::CSSStyleSheet;
2  use strict;  use strict;
3  our $VERSION=do{my @r=(q$Revision$=~/\d+/g);sprintf "%d."."%02d" x $#r,@r};  our $VERSION=do{my @r=(q$Revision$=~/\d+/g);sprintf "%d."."%02d" x $#r,@r};
4  push our @ISA, 'Message::IF::CSSStyleSheet';  push our @ISA, 'Message::IF::CSSStyleSheet';
5    require Message::DOM::DOMException;
6    require Scalar::Util;
7    
8  sub new ($) {  sub new ($;%) {
9    return bless \{css_rules => []}, shift;    my $class = shift;
10      my $self = bless \{@_}, $class;
11      for (@{$$self->{css_rules}}) {
12        ${$_}->{parent_style_sheet} = $self;
13        Scalar::Util::weaken (${$_}->{parent_style_sheet});
14      }
15      return $self;
16  } # new  } # new
17    
18  sub AUTOLOAD {  sub AUTOLOAD {
# Line 48  sub disabled ($;$) { Line 56  sub disabled ($;$) {
56    
57  sub href ($);  sub href ($);
58    
59  ## TODO: media  sub media ($;$) {
60      if (@_ > 1) {
61        local $Error::Depth = $Error::Depth + 1;
62        ${+shift}->{media}->media_text (@_);
63      }
64      return ${$_[0]}->{media};
65    } # media
66    
67  sub owner_node ($);  sub owner_node ($);
68    
# Line 78  sub owner_rule ($); Line 92  sub owner_rule ($);
92    
93  ## |CSSStyleSheet| methods  ## |CSSStyleSheet| methods
94    
95  ## TODO: delete_rule  sub delete_rule ($$) {
96      if ($_[1] < 0 or $_[1] > @{${$_[0]}->{css_rules}}) {
97        report Message::DOM::DOMException
98            -object => $_[0],
99            -type => 'INDEX_SIZE_ERR',
100            -subtype => 'INDEX_OUT_OF_BOUND_ERR';
101      } else {
102        my $rule = ${$_[0]}->{css_rules}->[$_[1]];
103        delete $rule->{parent_rule};
104        delete ${$_[0]}->{css_rules}->[$_[1]];
105      }
106    } # delete_rule
107    
108  ## TODO: insert_rule  ## TODO: insert_rule
109    

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24