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

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

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

revision 1.3 by wakaba, Mon Dec 31 03:02:29 2007 UTC revision 1.4 by wakaba, Tue Jan 1 07:06:04 2008 UTC
# Line 65  sub parent_rule ($) { Line 65  sub parent_rule ($) {
65    
66  ## TODO: Implement other methods and attributes  ## TODO: Implement other methods and attributes
67    
68    package Message::DOM::CSSComputedStyleDeclaration;
69    push our @ISA, 'Message::IF::CSSStyleDeclaration';
70    
71    sub ____new ($$$) {
72      my $self = bless \{}, shift;
73      $$self->{cascade} = shift; # Whatpm::CSS::Cascade object.
74      $$self->{element} = shift; ## TODO: This link should be weaken?
75      return $self;
76    } # ____new
77    
78    sub css_text ($;$) {
79      ## TODO: error if modified
80    
81      my $self = shift;
82      require Whatpm::CSS::Parser;
83    
84      ## TODO: ordering
85      ## TODO: any spec?
86      my $r = '';
87      for my $prop_def (grep {$_->{compute}} values %$Whatpm::CSS::Parser::Prop) {
88        my $prop_value = $$self->{cascade}->get_computed_value
89            ($$self->{element}, $prop_def->{css});
90        my $s = $prop_def->{serialize}->($self, $prop_def->{css}, $prop_value);
91        if (defined $s) {
92          $r .= '  ' . $prop_def->{css} . ': ' . $s;
93          $r .= ";\n";
94        }
95      }
96      return $r;
97    } # css_text
98    
99    ## TODO: members
100    
101  package Message::IF::CSSStyleDeclaration;  package Message::IF::CSSStyleDeclaration;
102    
103  1;  1;

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24