-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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: Fix incorrect test for U+000C in window.open() features #5715
Conversation
Found by cdumez in #5306 (comment)
Notifying @jdm, @jgraham, and @zqzhang. (Learn how reviewing works.) |
LintPassed |
Firefox (nightly channel)Testing web-platform-tests at revision 725d1f0 All results1 test ran/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-tokenization-noopener.html
|
Chrome (unstable channel)Testing web-platform-tests at revision 725d1f0 All results1 test ran/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-tokenization-noopener.html
|
Hmm, I get: |
@@ -140,6 +140,7 @@ | |||
'no,opener', // => ('no', ''), ('opener', '') | |||
'\0noopener', // => ('\0noopener', '') | |||
'noopener\u0000=yes' // => ('noopener\0', 'yes') |
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.
Missing a comma at the end here.
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.
Sigh, sorry!
Fixing via #5721 |
…and Edge https://bugs.webkit.org/show_bug.cgi?id=170548 Reviewed by Geoffrey Garen. LayoutTests/imported/w3c: * web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-tokenization-noopener-expected.txt: Rebaseline test now that more checks are passing. The remaining failures are because the test currently expects "noopener=0" / "noopener=false" to activate the 'noopener' feature. The test matches the specification which currently says that if the 'noopener' key is present, then the 'noopener' feature should be activated, no matter its value. However, I am intentionally not making this change yet because: - This behavior would be inconsistent with other Window features - There is upstream discussion on this (whatwg/html#2600) and the current feedback is that the specification should likely change to treat 'noopener' more consistently with other features. I will follow-up once the specification / test settles. * web-platform-tests/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-tokenization-noopener.html: Re-sync test from upstream after web-platform-tests/wpt#5715. Source/WebCore: Update window.open() features argument tokenizer to match HTML standard: - https://html.spec.whatwg.org/#concept-window-open-features-tokenize Also update window.open() to return null instead of the window when the 'noopener' feature is activated, as per: - https://html.spec.whatwg.org/#dom-open (Step 10) No new tests, rebaselined existing test. * page/DOMWindow.cpp: (WebCore::DOMWindow::createWindow): Update window.open() to return null instead of the window when the 'noopener' feature is activated, as per: - https://html.spec.whatwg.org/#dom-open (Step 10) * page/WindowFeatures.cpp: (WebCore::isSeparator): Treat all ASCII spaces as feature separators, as per: - https://html.spec.whatwg.org/#feature-separator This has the effect of adding U+000C (FormFeed) as a separator. (WebCore::processFeaturesString): Align tokenizing code with the specification: - https://html.spec.whatwg.org/#concept-window-open-features-tokenize In particular, the following changes were made: - After the key, skip to first '=', but don't skip past a ',' or a non-separator. The "or a non-separator" part is new in the spec (step 3.6.1) and is now implemented. - After looking for the '=', only treat what follows as a value if the current character is a separator. This is as per step 7 in the spec. These changes now cause us to parse 'foo noopener=1' as ('foo', ''), ('noopener', '1'). git-svn-id: http://svn.webkit.org/repository/webkit/trunk@215945 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Found by cdumez in #5306 (comment)
This change is