Skip to content
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

Merged
merged 1 commit into from
Apr 27, 2017

Conversation

zcorpan
Copy link
Member

@zcorpan zcorpan commented Apr 27, 2017

Found by cdumez in #5306 (comment)


This change is Reviewable

@zcorpan zcorpan requested a review from cdumez April 27, 2017 08:32
@wpt-pr-bot
Copy link
Collaborator

Notifying @jdm, @jgraham, and @zqzhang. (Learn how reviewing works.)

@ghost
Copy link

ghost commented Apr 27, 2017

View the complete job log.

Lint

Passed

@ghost
Copy link

ghost commented Apr 27, 2017

View the complete job log.

Firefox (nightly channel)

Testing web-platform-tests at revision 725d1f0
Using browser at version BuildID 20170426100344; SourceStamp 0f5ba06c4c5959030a05cb852656d854065e2226
Starting 10 test iterations
All results were stable

All results

1 test ran
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-tokenization-noopener.html
Subtest Results Messages
OK
HTML: window.open features: tokenization -- noopener FAIL SyntaxError: missing ] after element list

@ghost
Copy link

ghost commented Apr 27, 2017

View the complete job log.

Chrome (unstable channel)

Testing web-platform-tests at revision 725d1f0
Using browser at version 59.0.3071.25 dev
Starting 10 test iterations
All results were stable

All results

1 test ran
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-tokenization-noopener.html
Subtest Results Messages
OK
HTML: window.open features: tokenization -- noopener FAIL Uncaught SyntaxError: Unexpected string

@annevk annevk merged commit bb6db50 into master Apr 27, 2017
@annevk annevk deleted the zcorpan/window-open-tokenize-form-feed branch April 27, 2017 09:03
@zcorpan zcorpan restored the zcorpan/window-open-tokenize-form-feed branch April 27, 2017 13:11
@zcorpan zcorpan deleted the zcorpan/window-open-tokenize-form-feed branch April 27, 2017 13:40
@cdumez
Copy link
Contributor

cdumez commented Apr 27, 2017

Hmm, I get:
SyntaxError: Unexpected string literal 'foo=\u000Cnoopener'. Expected either a closing ']' or a ',' following an array element.

@@ -140,6 +140,7 @@
'no,opener', // => ('no', ''), ('opener', '')
'\0noopener', // => ('\0noopener', '')
'noopener\u0000=yes' // => ('noopener\0', 'yes')
Copy link
Contributor

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sigh, sorry!

@cdumez
Copy link
Contributor

cdumez commented Apr 27, 2017

Fixing via #5721

hubot pushed a commit to WebKit/WebKit-http that referenced this pull request Apr 28, 2017
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants