Re: getComputedStyle - Why window member function?
Boris Zbarsky <[email protected]> Wed, 09 Feb 2011 21:59:36 -0500
| Newsgroups | gmane.comp.mozilla.devel.dom |
|---|---|
| Message-ID | <[email protected]> |
On 2/9/11 5:45 PM, Axel Dahmen wrote: > At "http://www.howtocreate.co.uk/tutorials/javascript/domcss" I just > read that the getComputedStyle() DOM Level 2 Style member function of > the ViewCSS interface is a member of the window object. > > I wonder how it works on a frames based webpage. Each frame has its own Window object, for what it's worth. > Why isn't this interface being applied to the Document object? Why would it be? How is that better than the Window? In any case, the DOM spec doesn't define which object the defaultView is for a Document. It also doesn't define anything about Window objects at all. The fact that the defaultView is the Window is a historical accident, but at this point it's a de-facto standard, probably going to be documented de-jure in HTML5. -Boris _______________________________________________ dev-tech-dom mailing list [email protected] https://lists.mozilla.org/listinfo/dev-tech-dom