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 -- L. David Baron <URL: http://dbaron.org/ >
