-
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
Should target=_blank and window.open('...', '_blank') be case sensitive? #2443
Comments
More tests: web-platform-tests/wpt#5150. Bugs filed thus far by @lyzadanger:
@bzbarsky what do you think, should we just change this in Firefox to be case-sensitive? |
I guess we could do that. Gecko has been case-insensitive here since at least 2000; I expect Netscape was too. But it does look at first glance like everyone else (including IE11) is case-sensitive. I just checked, and a lot of Firefox addons use "_BLANK" as either a target or in selectors like The catch, of course, is that a non-lowercase spelling will seem to work just like the lowercase spelling in a simple test in all browsers. It's when you click a second link (or do window.open, or whatever) with that the behavior difference appears. It might be worth looking at uses of _BLANK in httparchive or something and seeing what behavior sites expect at those use points... |
1424 rows. https://gist.github.com/zcorpan/871ce08164fb5078e434cb1b9b88dc4a I think the _SELF/_PARENT/_TOP ones are probably more interesting than _BLANK, since they give different results on the first click of such a link. I have not yet analyzed these. |
I tried the more simplified |
This seems like it indeed intended _parent and so works better in Firefox.
The tabbed pages at the top, I would say works better in Firefox.
This is the Facebook badge, though seems OK to open in a new tab usability-wise for this page... but would be confusing if a page has several different _TOP links and they keep overwriting each other.
Top-left logo, seems like it indeed should be a _self link.
Also Facebook badge.
This page has several _SELF links, which seem to be intended to be _self.
Intends _parent. Well, that is probably enough to give a good enough insight into what website expectations looks like. As far as I can tell they expect case-insensitive and the user experience is a bit better with case-insensitive. |
|
OK, but the reason the addon had it like that is that the site involved has "_BLANK" as the target. |
So given the analysis above I think these should be case-insensitive like in Gecko. @cdumez @tkent-google WDYT? |
I agree with zcorpan, I think we should make these case-insensitive given the analysis. It is also safer for us to align with Gecko than the other way around here. |
+1 for case-insensitive. |
What about only making it case insensitive in quirks mode? At least some of those examples are rendered in quirks mode, as far as I can see. |
There's no reason to add more quirks to the platform. |
If it allows more customizability, I am not sure I agree. But I certainly do not feel strongly about it anyway, it was just a suggestion. |
…-insensitive https://bugs.webkit.org/show_bug.cgi?id=169747 Reviewed by Alex Christensen. LayoutTests/imported/w3c: Import test coverage from upstream web-platform-tests. * resources/import-expectations.json: * web-platform-tests/html/browsers/windows/browsing-context-names/001.html: * web-platform-tests/html/browsers/windows/browsing-context-names/002.html: * web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-_blank-expected.txt: Added. * web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-_blank.html: Added. * web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-existing.html: * web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-001-expected.txt: Added. * web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-001.html: Added. * web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-002-expected.txt: Added. * web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-002.html: Added. * web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-003-expected.txt: Added. * web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-003.html: Added. * web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-004-expected.txt: Added. * web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-004.html: Added. * web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-self-1.html: * web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-self-2.html: * web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-default-name-expected.txt: * web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-default-name.html: * web-platform-tests/html/browsers/windows/browsing-context-names/existing.html: * web-platform-tests/html/browsers/windows/browsing-context-names/resources/parent-iframe-1.html: Added. * web-platform-tests/html/browsers/windows/browsing-context-names/resources/parent-iframe-2.html: Copied from LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/existing.html. * web-platform-tests/html/browsers/windows/browsing-context-names/resources/parent-iframe-3.html: Added. * web-platform-tests/html/browsers/windows/browsing-context-names/resources/parent-iframe-insensitive-1.html: Added. * web-platform-tests/html/browsers/windows/browsing-context-names/resources/parent-iframe-insensitive-2.html: Added. * web-platform-tests/html/browsers/windows/browsing-context-names/resources/parent-top-nested.html: Added. * web-platform-tests/html/browsers/windows/browsing-context-names/resources/parent-top-replace.html: Added. * web-platform-tests/html/browsers/windows/browsing-context-names/resources/parent-top.html: Added. * web-platform-tests/html/browsers/windows/browsing-context-names/resources/post-to-opener.html: Added. * web-platform-tests/html/browsers/windows/browsing-context-names/resources/post-to-top-or-close.html: Added. * web-platform-tests/html/browsers/windows/browsing-context-names/resources/post-to-top.html: Added. * web-platform-tests/html/browsers/windows/browsing-context-names/resources/w3c-import.log: Copied from LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/w3c-import.log. * web-platform-tests/html/browsers/windows/browsing-context-names/self1.html: * web-platform-tests/html/browsers/windows/browsing-context-names/self2.html: * web-platform-tests/html/browsers/windows/browsing-context-names/w3c-import.log: Source/WebCore: _blank / _self / _parent / _top browsing context names should be case-insensitive as per the HTML specification: - https://html.spec.whatwg.org/#browsing-context-names This aligns our behavior with Firefox as well. See discussion at: - whatwg/html#2443 Tests: imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-_blank.html imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-001.html imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-002.html imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-003.html imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-004.html * loader/FrameLoader.cpp: (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy): (WebCore::createWindow): * page/DOMWindow.cpp: (WebCore::DOMWindow::open): * page/FrameTree.cpp: (WebCore::FrameTree::uniqueChildName): (WebCore::FrameTree::find): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@214944 268f45cc-cd09-0410-ab3c-d52691b4dbfc
This also requires changes to "The rules for choosing a browsing context given a browsing context name". I'm hoping to have a PR ready today. |
This makes several changes: * Stop throwing an exception in <a> and <area> activation behavior as a result of popup blocking as it doesn’t match implementations. Fixes #2616. Formal testing is not possible and tracked by web-platform-tests/wpt#3867. * Make matching for special names ASCII case-insensitive. Fixes #2443. * Centralize all user-configurable behavior instead of having it duplicated in various ways in all the caller algorithms. * Call out a known issue with browsing context name matching: #2126. It also modernizes the writing style and makes variables and what is returned much more explicit, including no longer relying on some out-of-band channel for communicating whether a new browsing context got created.
This makes several changes: * Stop throwing an exception in <a> and <area> activation behavior as a result of popup blocking as it doesn’t match implementations. Fixes web-platform-tests/wpt#3867. * Make matching for special names ASCII case-insensitive. Fixes #2443. * Centralize all user-configurable behavior instead of having it duplicated in various ways in all the caller algorithms. * Call out a known issue with browsing context name matching: #2126. It also modernizes the writing style and makes variables and what is returned much more explicit, including no longer relying on some out-of-band channel for communicating whether a new browsing context got created.
This makes several changes: * Stop throwing an exception in <a> and <area> activation behavior as a result of popup blocking as it doesn’t match implementations. Fixes web-platform-tests/wpt#3867. * Make matching for special names ASCII case-insensitive. Fixes #2443. * Centralize all user-configurable behavior instead of having it duplicated in various ways in all the caller algorithms. * Call out a known issue with browsing context name matching: #2126. It also modernizes the writing style and makes variables and what is returned much more explicit, including no longer relying on some out-of-band channel for communicating whether a new browsing context got created.
This makes several changes: * Stop throwing an exception in `<a>` and `<area>` activation behavior as a result of popup blocking as it doesn’t match implementations. Fixes #2616. Formal testing is not possible and tracked by web-platform-tests/wpt#3867. * Make matching for special names ASCII case-insensitive. Fixes #2443. * Centralize all user-configurable behavior instead of having it duplicated in various ways in all the caller algorithms. * Call out a known issue with browsing context name matching: #1440. It also modernizes the writing style and makes variables and what is returned much more explicit, including no longer relying on some out-of-band channel for communicating whether a new browsing context got created.
This makes several changes: * Stop throwing an exception in `<a>` and `<area>` activation behavior as a result of popup blocking as it doesn’t match implementations. Fixes whatwg#2616. Formal testing is not possible and tracked by web-platform-tests/wpt#3867. * Make matching for special names ASCII case-insensitive. Fixes whatwg#2443. * Centralize all user-configurable behavior instead of having it duplicated in various ways in all the caller algorithms. * Call out a known issue with browsing context name matching: whatwg#1440. It also modernizes the writing style and makes variables and what is returned much more explicit, including no longer relying on some out-of-band channel for communicating whether a new browsing context got created.
This makes several changes: * Stop throwing an exception in `<a>` and `<area>` activation behavior as a result of popup blocking as it doesn’t match implementations. Fixes whatwg#2616. Formal testing is not possible and tracked by web-platform-tests/wpt#3867. * Make matching for special names ASCII case-insensitive. Fixes whatwg#2443. * Centralize all user-configurable behavior instead of having it duplicated in various ways in all the caller algorithms. * Call out a known issue with browsing context name matching: whatwg#1440. It also modernizes the writing style and makes variables and what is returned much more explicit, including no longer relying on some out-of-band channel for communicating whether a new browsing context got created.
This makes several changes: * Stop throwing an exception in `<a>` and `<area>` activation behavior as a result of popup blocking as it doesn’t match implementations. Fixes whatwg#2616. Formal testing is not possible and tracked by web-platform-tests/wpt#3867. * Make matching for special names ASCII case-insensitive. Fixes whatwg#2443. * Centralize all user-configurable behavior instead of having it duplicated in various ways in all the caller algorithms. * Call out a known issue with browsing context name matching: whatwg#1440. It also modernizes the writing style and makes variables and what is returned much more explicit, including no longer relying on some out-of-band channel for communicating whether a new browsing context got created.
…-insensitive https://bugs.webkit.org/show_bug.cgi?id=169747 Reviewed by Alex Christensen. LayoutTests/imported/w3c: Import test coverage from upstream web-platform-tests. * resources/import-expectations.json: * web-platform-tests/html/browsers/windows/browsing-context-names/001.html: * web-platform-tests/html/browsers/windows/browsing-context-names/002.html: * web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-_blank-expected.txt: Added. * web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-_blank.html: Added. * web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-existing.html: * web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-001-expected.txt: Added. * web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-001.html: Added. * web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-002-expected.txt: Added. * web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-002.html: Added. * web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-003-expected.txt: Added. * web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-003.html: Added. * web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-004-expected.txt: Added. * web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-004.html: Added. * web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-self-1.html: * web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-self-2.html: * web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-default-name-expected.txt: * web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-default-name.html: * web-platform-tests/html/browsers/windows/browsing-context-names/existing.html: * web-platform-tests/html/browsers/windows/browsing-context-names/resources/parent-iframe-1.html: Added. * web-platform-tests/html/browsers/windows/browsing-context-names/resources/parent-iframe-2.html: Copied from LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/existing.html. * web-platform-tests/html/browsers/windows/browsing-context-names/resources/parent-iframe-3.html: Added. * web-platform-tests/html/browsers/windows/browsing-context-names/resources/parent-iframe-insensitive-1.html: Added. * web-platform-tests/html/browsers/windows/browsing-context-names/resources/parent-iframe-insensitive-2.html: Added. * web-platform-tests/html/browsers/windows/browsing-context-names/resources/parent-top-nested.html: Added. * web-platform-tests/html/browsers/windows/browsing-context-names/resources/parent-top-replace.html: Added. * web-platform-tests/html/browsers/windows/browsing-context-names/resources/parent-top.html: Added. * web-platform-tests/html/browsers/windows/browsing-context-names/resources/post-to-opener.html: Added. * web-platform-tests/html/browsers/windows/browsing-context-names/resources/post-to-top-or-close.html: Added. * web-platform-tests/html/browsers/windows/browsing-context-names/resources/post-to-top.html: Added. * web-platform-tests/html/browsers/windows/browsing-context-names/resources/w3c-import.log: Copied from LayoutTests/imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/w3c-import.log. * web-platform-tests/html/browsers/windows/browsing-context-names/self1.html: * web-platform-tests/html/browsers/windows/browsing-context-names/self2.html: * web-platform-tests/html/browsers/windows/browsing-context-names/w3c-import.log: Source/WebCore: _blank / _self / _parent / _top browsing context names should be case-insensitive as per the HTML specification: - https://html.spec.whatwg.org/#browsing-context-names This aligns our behavior with Firefox as well. See discussion at: - whatwg/html#2443 Tests: imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-_blank.html imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-001.html imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-002.html imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-003.html imported/w3c/web-platform-tests/html/browsers/windows/browsing-context-names/browsing-context-choose-parent-004.html * loader/FrameLoader.cpp: (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy): (WebCore::createWindow): * page/DOMWindow.cpp: (WebCore::DOMWindow::open): * page/FrameTree.cpp: (WebCore::FrameTree::uniqueChildName): (WebCore::FrameTree::find): Canonical link: https://commits.webkit.org/187426@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214944 268f45cc-cd09-0410-ab3c-d52691b4dbfc
It is case insensitive only in Firefox (since at most version 3, if not since forever).
JSFiddle -
https://jsfiddle.net/8v7ots9x/
Is this web compatible?
It is always good to have case sensitivity, anyway. ;)
The new tests triggered this -
web-platform-tests/wpt#5145
The text was updated successfully, but these errors were encountered: