/[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.9 by wakaba, Mon Jan 14 05:53:45 2008 UTC revision 1.10 by wakaba, Mon Jan 14 10:04:40 2008 UTC
# Line 25  sub AUTOLOAD { Line 25  sub AUTOLOAD {
25        if ($value) {        if ($value) {
26          return $prop_def->{serialize}->($self, $prop_def->{css}, $value->[0]);          return $prop_def->{serialize}->($self, $prop_def->{css}, $value->[0]);
27        } else {        } else {
28          return undef;          return "";
29        }        }
       ## TODO: null? ""? ... if not set?  
30        ## ISSUE: If one of shorthand component properties is !important?        ## ISSUE: If one of shorthand component properties is !important?
31      };      };
32      goto &{ $AUTOLOAD };      goto &{ $AUTOLOAD };
# Line 66  sub css_text ($;$) { Line 65  sub css_text ($;$) {
65      } else {      } else {
66        my $value = $$self->{$_};        my $value = $$self->{$_};
67        my $s = $prop_def->{serialize}->($self, $prop_def->{css}, $value->[0]);        my $s = $prop_def->{serialize}->($self, $prop_def->{css}, $value->[0]);
68        if (defined $s) {        if (length $s) {
69          $r .= '  ' . $prop_def->{css} . ': ' . $s;          $r .= '  ' . $prop_def->{css} . ': ' . $s;
70          $r .= ' !' . $value->[1] if defined $value->[1];          $r .= ' ! ' . $value->[1] if length $value->[1];
71          $r .= ";\n";          $r .= ";\n";
72        }        }
73      }      }
# Line 90  sub get_property_priority ($$) { Line 89  sub get_property_priority ($$) {
89    return '' unless defined $prop_def;    return '' unless defined $prop_def;
90    
91    my $v = ${$_[0]}->{$prop_def->{key}};    my $v = ${$_[0]}->{$prop_def->{key}};
92      return $v ? $v->[1] : '';
   return ((defined $v->[1] and $v->[1] eq 'important') ? 'important' : '');  
93  } # get_property_priority  } # get_property_priority
94    
95  ## TODO: Implement other methods and attributes  ## TODO: Implement other methods and attributes
# Line 125  sub AUTOLOAD { Line 123  sub AUTOLOAD {
123        if ($value) {        if ($value) {
124          return $prop_def->{serialize}->($self, $prop_def->{css}, $value);          return $prop_def->{serialize}->($self, $prop_def->{css}, $value);
125        } else {        } else {
126          return undef;          return "";
127        }        }
       ## TODO: null? ""? ... if not set?  
128      };      };
129      goto &{ $AUTOLOAD };      goto &{ $AUTOLOAD };
130    } else {    } else {
# Line 167  sub css_text ($;$) { Line 164  sub css_text ($;$) {
164        my $prop_value = $$self->{cascade}->get_computed_value        my $prop_value = $$self->{cascade}->get_computed_value
165            ($$self->{element}, $prop_def->{css});            ($$self->{element}, $prop_def->{css});
166        my $s = $prop_def->{serialize}->($self, $prop_def->{css}, $prop_value);        my $s = $prop_def->{serialize}->($self, $prop_def->{css}, $prop_value);
167        if (defined $s) {        if (length $s) {
168          $r .= '  ' . $prop_def->{css} . ': ' . $s;          $r .= '  ' . $prop_def->{css} . ': ' . $s;
169          $r .= ";\n";          $r .= ";\n";
170        } else {        } else {
# Line 184  sub css_text ($;$) { Line 181  sub css_text ($;$) {
181    
182  ## |CSSStyleDeclaration| methods  ## |CSSStyleDeclaration| methods
183    
184  sub get_property_priority ($$) {  sub get_property_priority ($$) { '' }
   return '';  
 } # get_property_priority  
185    
186  ## TODO: members  ## TODO: members
187    

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24