On 1/13/12 12:18 PM, Aryeh Gregor wrote:
Actually, defaultView is defined to return the Document's browsing
context's WindowProxy object, if it has one, and null otherwise.

Hmm. I guess the spec doesn't really define what happens to the association between a document and its browsing context in the interesting cases (window close, navigation away from document, removal of an iframe from the DOM, etc). In practice, UAs are all over the map in terms of nulling out defaultView for some but not others of the above.

For now I'm inclined to go with defaultView being null, just because
that's at least readily testable.  If defaultView isn't defined well
enough, that should be fixed in the HTML spec.

I would prefer a definition that doesn't involve defaultView, actually. I don't expect browsers to converge defaultView behavior any time in the near or medium future, so the testability would be illusory: tests would just depend on whether browsers implement defaultView "correctly"...

-Boris

Reply via email to