-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
HTML: Extend Test Coverage for _parent named browsing context (7.1.5) #5150
HTML: Extend Test Coverage for _parent named browsing context (7.1.5) #5150
Conversation
Firefox (nightly channel)Testing web-platform-tests at revision 2f87ce3501be9c9e4dd48ba18f655065d40ea41b All results7 tests ran/html/browsers/windows/browsing-context-names/browsing-context-choose-existing.html
/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-001.html
/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-002.html
/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-003.html
/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-004.html
/html/browsers/windows/browsing-context-names/browsing-context-choose-self-1.html
/html/browsers/windows/browsing-context-names/browsing-context-choose-self-2.html
|
Chrome (unstable channel)Testing web-platform-tests at revision 2f87ce3501be9c9e4dd48ba18f655065d40ea41b All results7 tests ran/html/browsers/windows/browsing-context-names/browsing-context-choose-existing.html
/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-001.html
/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-002.html
/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-003.html
/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-004.html
/html/browsers/windows/browsing-context-names/browsing-context-choose-self-1.html
/html/browsers/windows/browsing-context-names/browsing-context-choose-self-2.html
|
window.addEventListener('message', t.step_func_done(e => { | ||
assert_equals(e.data.name, 'parentWin'); | ||
})); | ||
window.frames['embedded'].src = 'resources/parent-iframe-1.html'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get confused about the intent here, if it's trying to set src
on the iframe or on its WindowProxy
. In Safari, if the iframe happens to not have a name
attribute, this would return the WindowProxy
. I think that is a bug per https://html.spec.whatwg.org/#named-access-on-the-window-object - but testing that should be separate.
Here it would be clearer to just use document.getElementById('embedded')
.
Are the TIMEOUT/NOTRUN results in /html/browsers/windows/browsing-context-names/browsing-context-choose-parent-004.html and /html/browsers/windows/browsing-context-names/browsing-context-choose-self-2.html expected? |
For For |
As promised, bugs opened on case-sensitive |
These tests are now available on w3c-test.org |
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<div id="log"></div> | ||
<iframe id="embedded" src="resources/parent-iframe-1.html" name="parentWin" style="display:none"></iframe> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be moved to after the script. In principle there is a race condition otherwise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hah! That's the reason I had the hard-to-read assignment of src
to that iframe
in the script and not in the markup initially. OK, I'll rectify.
So in Gecko for /html/browsers/windows/browsing-context-names/browsing-context-choose-parent-003.html I get a TIMEOUT, that is because of the behavior you describe in the OP, correct? |
@zcorpan Yep! I had to go remind myself by re-reading my original opening comment. Yes, this looks potentially buggy in Gecko. |
769fecc
to
f125f12
Compare
Not sure why 39948b2 is now in this PR. I suppose "squash and merge" does the right thing, but leaving this open if you want to clean up this branch before landing @lyzadanger |
- Add tests for reused `parent` context - Add tests for case-sensitivity - Organize supporting files
f125f12
to
070a1f4
Compare
Do they? Simple testcase:
Click the "check opener" button, observe null, click the "do open" button, click the "check opener" button, observe non-null. In both Safari and Chrome. |
I filed whatwg/html#2636 to get this sorted out in the spec. Given the behavior on the testcases there, I have no idea how Blink or WebKit pass html/browsers/windows/browsing-context-names/browsing-context-choose-parent-003.html from this PR, unless they somehow special-case the "opener would be one of our descendants" case or something. |
This PR extends some existing tests for the
_parent
named browsing context and adds some new ones.The Webkit/Chrome case-sensitivity bug noted in #5145 is indeed manifest here, again, as expected. I will be opening bugs shortly and will link back.
There's also an interesting difference in browser behavior WRT
choose-browsing-context-parent-003.html
.According to the spec:
(emphasis mine)
Safari and Chrome are both steadfastly retaining a browsing context's original
opener
, even if another browsing context later opens a different document into that context/window. FireFox, however, will replace thewindow.opener
of the_parent
context with the window that invokes.open
(assuming theopener
isn't disowned, etc.).I have two hunches here: Firefox's behavior is the errant one and this is likely going to affect more than just the named
_parent
context. But I'm not 100% certain on the former.Supporting files have been lightly organized but there is still more work to do in this section as I proceed.