Ok; I think I get this now (note the genesis of this whole question was making SVG written against Adobe work within Batik).
"Interface CSSStyleDeclaration (introduced in DOM Level 2) The CSSStyleDeclaration interface represents a single CSS declaration block. This interface may be used to determine the style properties currently set in a block or to set style properties explicitly within the block. While an implementation may not recognize all CSS properties within a CSS declaration block, it is expected to provide access to all specified properties in the style sheet through the CSSStyleDeclaration interface. Furthermore, implementations that support a specific level of CSS should correctly handle CSS shorthand properties for that level. For a further discussion of shorthand properties, see the CSS2Properties interface. This interface is also used to provide a read-only access to the computed values of an element. See also the ViewCSS interface." ... "Interface ViewCSS (introduced in DOM Level 2) This interface represents a CSS view. The getComputedStyle method provides a read only access to the computed values of an element. Return Value: CSSStyleDeclaration The computed style. The CSSStyleDeclaration is read-only and contains only absolute values." So theoretically the .style attribute of the DOM element is not supposed to return the computed style properties; rather just the properties as defined within the "style" attribute of the element. -----Original Message----- From: Graham Sanderson [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 12, 2005 10:12 AM To: [email protected] Subject: RE: Custom elements and the "style" attribute >From a literal reading of the two (though the CSS2 is a bit vague in the unknown properties section), it seems that the two are not necessarily contradictory: a) CSSStyleDeclaration says all unknown properties must be exposed via CSSStyleDeclaration b) CSS2 states that illegal (not unknown) parts of the style sheet must be ignored. c) CSS2 states that to allow for future properties the user agent must act as if the style had not contained the unknown attribute. Presumably this implies that the unknown attribute must have no visible effect on the user agent (in the absence of additional user script/java which interprets the style settings). The question is, what effect would adding a real style with the same name as some custom style later have on the custom code; which seems like a lesser issue. Of course my interpretation in c) could be entirely wrong, and the CSS2 may mean that the unknown declaration really must be ignored. In this case (or the case in c) above) this certainly implies that the style is not inherited. The question then becomes, should the CSSStyleDeclaration interface perhaps allow you to get the "declared" properties instead. Which is of course just a convenience method to parse the single element level "style" attribute, and as such perhaps isn't super useful. -----Original Message----- From: Cameron McCormack [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 12, 2005 5:21 AM To: [email protected] Subject: Re: Custom elements and the "style" attribute Graham Sanderson: > From the CSSStyleDeclaration documentation: > > > > "While an implementation may not recognize all CSS properties within a > CSS declaration block, it is expected to provide access to all specified > properties in the style sheet through the CSSStyleDeclaration > interface." That's interesting, since CSS 2 states[1]: In some cases, user agents must ignore part of an illegal style sheet. This specification defines ignore to mean that the user agent parses the illegal part (in order to find its beginning and end), but otherwise acts as if it had not been there. To ensure that new properties and new values for existing properties can be added in the future, user agents are required to obey the following rules when they encounter the following scenarios: * Unknown properties. User agents must ignore a declaration with an unknown property. For example, if the style sheet is: H1 { color: red; rotation: 70minutes } the user agent will treat this as if the style sheet had been H1 { color: red } This seems to contradict what's said in DOM 2 Style. Certainly Batik's CSS engine currently doesn't store any non-SVG CSS properties at the moment. Cameron [1] http://www.w3.org/TR/CSS2/syndata.html#parsing-errors -- e-mail : cam (at) mcc.id.au icq : 26955922 web : http://mcc.id.au/ msn : cam-msn (at) aka.mcc.id.au office : +61399055779 jabber : heycam (at) jabber.org --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
