[Bug 28488] An element might not have a window to call scrollY on


Boris Zbarsky <bzbarsky@mit.edu> changed:

           What    |Removed                     |Added
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |---

--- Comment #2 from Boris Zbarsky <bzbarsky@mit.edu> ---
I don't think that's reasonable, for several reasons:

1)  It's ambiguous about whether the canonical defaultView getter is invoked or
whether the current defaultView value is gotten.  The latter may have been
munged by JS.  This needs to be clarified somehow (and this is a general
problem in specs, really...).

2)  If the node document is not the active document in its browsing context,
the defaultView will still return, per spec "the Document's browsing context's
WindowProxy object".  So as the spec is written right now, you could grab an
element from a document, navigate the browsing context, then set scrollTop on
that element to scroll the new document in the browsing context or get
scrollTop to get its scroll position .  That's clearly undesirable.  So you
need to bail out if the node document is not the current document in the
browsing context if you want to use the defaultView (but see below).

3)  The various accesses on the windowproxy (scrollY, etc) have a problem
similar to #1.

#2 is critical to solve.  Ideally we would solve it by just getting the
Document's current Window, but I see nothing obvious in the HTML spec that
defines such a concept.  Failing that, we can make do with a check for being
the active document and then working with the windowproxy.  But that might
actually give different behavior in cases when a presentation is cached (e.g.
operating directly on a window might allow scrolling a cached presentation
while operating on the windowproxy but restricting to the active document case
makes attempts to do so no-op).  So we should decide what we actually want here
for that case.

For #1 and #3 if there's a simple fix of some sort that would be great; might
want to check with Anne whether there's an existing convention for it.

You are receiving this mail because:
You are the QA Contact for the bug.

Received on Thursday, 16 April 2015 14:57:28 UTC