Thank you for your reply. From your comments, I know the difference between style attributes and computed style attributes.

I think Mozilla should clarify the sematics about these concepts. This document must answer the following questions:

1. Why: Assigning to the 'height' attribute of a XUL element causes change of the 'height' style attribute, but not vice versa.

2. Why: Assigning to the 'height' attribute of a XUL element causes change of the computed 'height' style, while assigning to the 'maxHeight' does not, and the actual 'effective' 'maxHeight' changed.
(How about 'effective' style? Should it be same semantics as 'computed' style? If it is, this is a bug.)


-Phnix

L. David Baron wrote:

On Wednesday 2003-08-20 10:50 +0800, Wang Xianzhu wrote:

2. Why XULElement.style not implemented? I think that linking XULElement.style to document.defaultView.getComputedStyle(XULElement ele) is simple implementation. (NOTE B)


Such an implementation would be incorrect, since element.style should be
a representation of that element's style attribute, not the computed
style for the element.

It probably wouldn't be too hard to fix, though.  nsXULElement::GetStyle
probably would need to look a bit like nsGenericHTMLElement::GetStyle,
except it would need to deal with storing the DOM CSS Declaration
differently.

A simple testcase is:

data:application/vnd.mozilla.xul+xml;charset=utf-8,%3Cwindow%20xmlns%3D%22http%3A%2F%2Fwww.mozilla.org%2Fkeymaster%2Fgatekeeper%2Fthere.is.only.xul%22%20style%3D%22color%3A%20red%3B%22%20onclick%3D%22alert(document.documentElement.style.color)%22%2F%3E

-David





Reply via email to