-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unclear what location.href of iframe should be after frame becomes disconnected #3959
Comments
It seems weird that loc and win.location would be different objects. You didn't test that explicitly, but I think they should remain 1:1 per the standard. It does seem to me that the active document pointer should remain on the browsing context. But we should account for the browsing context not being there and haven't. I like using "about:blank" as URL in that case for the getters (matches the default URL we use in a number of places) and have the setters throw. Given the wide disagreement between implementations that's hopefully web compatible. @bzbarsky might want to comment on this when he's back from a break. |
It would really be great if we could align browsers here indeed. I am happy to help on the WebKit side. |
So at least in Firefox, the There's a tension here between keeping everything alive forever and cleaning things up when pages are torn down due to browsing context destruction or navigation... I really don't know the best thing to do here spec-wise that all browsers might agree on. :(
The browsing context goes away in this specific
which links to https://html.spec.whatwg.org/multipage/window-object.html#a-browsing-context-is-discarded which as far as I can tell drops references to the browsing context. And that explicitly calls out
Yeah.
I'd like to see a test of what setters do right now. I do think Firefox already throws some weird non-spec exception in this case, which makes me pretty hopeful that throwing is web-compatible. If so, then this plan seems OK to me. |
Getters and settersIn Safari In Firefox Given these results, it seems we need early exits for both setters and getters dealing with the browsing context being missing. No-ops for setters and values matching up with Methods
Making these all no-ops as well seems safest to me. Misc(General lifetime issues of these globalish objects is being tracked by #2545, #2566, and #3267.)
FWIW, the reason I mentioned this is because I briefly considered whether |
I created web-platform-tests/wpt#13435 to encode the aforementioned expected results in wpt. I'll also work on a patch for the HTML Standard. Unfortunately, it seems that each affected algorithm will gain one additional branch at the beginning. If anyone has better ideas please let me know. |
Note that I created a proposal for this as well at #4076. It basically is awaiting review and some amount of implementer buy-in. |
Previously, the various pieces of spec text here assumed that a browsing context always existed. Tests: web-platform-tests/wpt#13435. Fixes #3959.
In Firefox, Chrome and Safari, if you go to "about:blank" and print location.pathname, it will be "blank". Not sure it this is expected or not but I thought I'd point it out, especially considering the new WPT expect the the pathname to be "" when the location's browsing context is gone, even though it's href is "about:blank". |
I asked Alex (who is our URL expert) and he seems to agree that "blank" should be the expected path name when the URL is "about:blank". If so, I think the WPT test that was added for this spec change needs to be updated to expect the pathname to be "blank" when the Location's browsing context is gone. |
Thanks, sorry for that! |
…estonly Automatic update from web-platform-testsTest Location sans browsing context For whatwg/html#3959 and whatwg/html#4076. -- wpt-commits: fce65ebd7656136f5f8452378146f1b7af30bf79 wpt-pr: 13435
…estonly Automatic update from web-platform-testsTest Location sans browsing context For whatwg/html#3959 and whatwg/html#4076. -- wpt-commits: fce65ebd7656136f5f8452378146f1b7af30bf79 wpt-pr: 13435
Previously, the various pieces of spec text here assumed that a browsing context always existed. Tests: web-platform-tests/wpt#13435. Fixes whatwg#3959.
Previously, the various pieces of spec text here assumed that a browsing context always existed. Tests: web-platform-tests/wpt#13435. Fixes whatwg#3959.
…estonly Automatic update from web-platform-testsTest Location sans browsing context For whatwg/html#3959 and whatwg/html#4076. -- wpt-commits: fce65ebd7656136f5f8452378146f1b7af30bf79 wpt-pr: 13435 UltraBlame original commit: 21440047222db956d995cb518b57b2b3272126e0
…estonly Automatic update from web-platform-testsTest Location sans browsing context For whatwg/html#3959 and whatwg/html#4076. -- wpt-commits: fce65ebd7656136f5f8452378146f1b7af30bf79 wpt-pr: 13435 UltraBlame original commit: 21440047222db956d995cb518b57b2b3272126e0
…estonly Automatic update from web-platform-testsTest Location sans browsing context For whatwg/html#3959 and whatwg/html#4076. -- wpt-commits: fce65ebd7656136f5f8452378146f1b7af30bf79 wpt-pr: 13435 UltraBlame original commit: 21440047222db956d995cb518b57b2b3272126e0
In table form:
String(loc)
loc.href
Type(win.location)
win.location.href
TypeError
undefined
"object"
undefined
"about:blank"
"about:blank"
TypeError
TypeError
""
""
"object"
""
TypeError
undefined
"null"
TypeError
"object"
This issue amazes even me in its number of ways browsers find to disagree with each other. I am also not entirely sure what the spec currently says, and what I put in that row is my best understanding. The ?? refers to the fact that the definition of
Location
object's relevantDocument
seems to be broken for aLocation
associated with aDocument
object that no longer has a browsing context.The text was updated successfully, but these errors were encountered: