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: Add tests for optional window.open position, size features #5390

Merged

Conversation

lyzadanger
Copy link
Contributor

@lyzadanger lyzadanger commented Apr 5, 2017

Attn @zcorpan

First, I'll say that I'm not entirely confident that these tests accomplish useful things, so I will not be miserable if the consensus is to not land this.

These tests are for the left, top, width, height (and legacy equivalents screenx, screeny, innerheight, innerwidth) window features used in window.open, as per HTML 7.3.1 and related to new changes in spec around tokenization of features. All of these tests are optional, as browsers are not required to pay attention to any of those position or size features. Results are strongly affected by test-runner environments, etc. And obviously size/position for opened windows isn't relevant or has different constraints on many platforms (e.g. mobile).

To annotate this optional nature, I dropped a meta tag in each per documentation about CSS tests. I recognize that this is not a flag typically used in JSharness tests.

To support these tests, I whipped up a quick little tool to make it easier to have multiple tests in a test file that depend on window.postMessage to get info from opened windows. It's modeled after what I did with LocalStorage. Hope that wasn't too presumptuous!


This change is Reviewable

@wpt-pr-bot
Copy link
Collaborator

@w3c-bots
Copy link

w3c-bots commented Apr 5, 2017

View the complete job log.

Firefox (nightly channel)

Testing web-platform-tests at revision 4c1570c
Using browser at version BuildID 20170412100254; SourceStamp f40e24f40b4c4556944c762d4764eace261297f5
Starting 10 test iterations
All results were stable

All results

17 tests ran
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-negative-innerwidth-innerheight.html
Subtest Results Messages
OK
features "innerwidth=-404" should NOT set "width=404" PASS
features "innerwidth=-404.5" should NOT set "width=404" PASS
features "innerwidth=-404e1" should NOT set "width=404" PASS
features "innerheight=-404" should NOT set "height=404" PASS
features "innerheight=-404.5" should NOT set "height=404" PASS
features "innerheight=-404e1" should NOT set "height=404" PASS
Subtest Results Messages
OK
features "top=-204" should NOT set "top=204" PASS
features "top=-204.5" should NOT set "top=204" PASS
features "top=-0" should NOT set "top=204" PASS
features "left=-204" should NOT set "left=204" PASS
features "left=-204.5" should NOT set "left=204" PASS
features "left=-0" should NOT set "left=204" PASS
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-negative-width-height.html
Subtest Results Messages
OK
features "width=-404" should NOT set "width=404" PASS
features "width=-404.5" should NOT set "width=404" PASS
features "width=-404e1" should NOT set "width=404" PASS
features "height=-404" should NOT set "height=404" PASS
features "height=-404.5" should NOT set "height=404" PASS
features "height=-404e1" should NOT set "height=404" PASS
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-non-integer-height.html
Subtest Results Messages
OK
top=0,left=0,width=401,: absence of feature "height" should be treated same as "height=0" PASS
top=0,left=0: absence of feature "height" should be treated same as "height=0" FAIL assert_equals: expected 401 but got 921
features "height=/404" should NOT set "height=404" PASS
features "height=_404" should NOT set "height=404" PASS
features "height=L404" should NOT set "height=404" PASS
features "height=405.5" should set "height=405" PASS
features "height=405.32" should set "height=405" PASS
features "height=405LLl" should set "height=405" PASS
features "height=405^4" should set "height=405" PASS
features "height=405*3" should set "height=405" PASS
features "height=405/5" should set "height=405" PASS
features "height=405 " should set "height=405" PASS
features "height=405e1" should set "height=405" PASS
features "height=405e-1" should set "height=405" PASS
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-non-integer-innerheight.html
Subtest Results Messages
OK
features "innerheight=/404" should NOT set "height=404" PASS
features "innerheight=_404" should NOT set "height=404" PASS
features "innerheight=L404" should NOT set "height=404" PASS
features "innerheight=405.5" should set "height=405" PASS
features "innerheight=405.32" should set "height=405" PASS
features "innerheight=405LLl" should set "height=405" PASS
features "innerheight=405^4" should set "height=405" PASS
features "innerheight=405*3" should set "height=405" PASS
features "innerheight=405/5" should set "height=405" PASS
features "innerheight=405 " should set "height=405" PASS
features "innerheight=405e1" should set "height=405" PASS
features "innerheight=405e-1" should set "height=405" PASS
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-non-integer-innerwidth.html
Subtest Results Messages
OK
features "left=/104" should NOT set "left=104" PASS
features "left=_104" should NOT set "left=104" PASS
features "left=L104" should NOT set "left=104" PASS
features "left=105.5" should set "left=105" PASS
features "left=105.32" should set "left=105" PASS
features "left=105LLl" should set "left=105" PASS
features "left=105^4" should set "left=105" PASS
features "left=105*3" should set "left=105" PASS
features "left=105/5" should set "left=105" PASS
features "left=105 " should set "left=105" PASS
features "left=105e1" should set "left=105" PASS
features "left=105e-1" should set "left=105" PASS
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-non-integer-screenx.html
Subtest Results Messages
OK
features "screenx=/104" should NOT set "left=104" PASS
features "screenx=_104" should NOT set "left=104" PASS
features "screenx=L104" should NOT set "left=104" PASS
features "screenx=105.5" should set "left=105" PASS
features "screenx=105.32" should set "left=105" PASS
features "screenx=105LLl" should set "left=105" PASS
features "screenx=105^4" should set "left=105" PASS
features "screenx=105*3" should set "left=105" PASS
features "screenx=105/5" should set "left=105" PASS
features "screenx=105 " should set "left=105" PASS
features "screenx=105e1" should set "left=105" PASS
features "screenx=105e-1" should set "left=105" PASS
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-non-integer-screeny.html
Subtest Results Messages
OK
features "screeny=/404" should NOT set "height=404" PASS ASS
features "width=405/5" should set "width=405" PASS
features "width=405 " should set "width=405" PASS
features "width=405e1" should set "width=405" PASS
features "width=405e-1" should set "width=405" PASS
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-tokenization-innerheight-innerwidth.html
Subtest Results Messages
OK
"innerwidth=401" should set width of opened window PASS
" innerwidth = 401" should set width of opened window PASS
"innerwidth==401" should set width of opened window FAIL assert_equals: expected 401 but got 921
"\ninnerwidth= 401" should set width of opened window PASS
",innerwidth=401,," should set width of opened window PASS
"INNERWIDTH=401" should set width of opened window PASS
"innerWidth=401" should set width of opened window PASS
"innerheight=402" should set height of opened window PASS
" innerheight = 402" should set height of opened window PASS
"innerheight==402" should set height of opened window FAIL assert_equals: expected 402 but got 662
"\ninnerheight= 402" should set height of opened window PASS
",innerheight=402,," should set height of opened window PASS
"INNERHEIGHT=402" should set height of opened window PASS
`"innerHeight=402" sh FAIL assert_equals: "NOOPENER" should activate feature "noopener" expected null but got object "[object Window]"
after name, tokenization should skip window features separators that are not "=" or "," FAIL assert_equals: "noopener\n =" should activate feature "noopener" expected null but got object "[object Window]"
Tokenizing should ignore window feature separators except "," after initial "=" and before value FAIL assert_equals: "noopener= yes" should activate feature "noopener" expected null but got object "[object Window]"
Tokenizing should read characters until first window feature separator as value FAIL assert_equals: "noopener=noopener" should set "noopener" expected null but got object "[object Window]"
"noopener" should be based on name (key), not value FAIL assert_equals: "noopener=false" should activate feature "noopener" expected null but got object "[object Window]"
invalid feature names should not tokenize as "noopener" PASS
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-tokenization-top-left.html

| Subtest | Results | Messages |
|----------------------------------------------------------------------------|-----------------------------------------------------------------------|---------|-------------------------------------------|
| | OK | |
| "width=401" should set width of opened window | PASS | |
| " width = 401" should set width of opened window | PASS | |
| "width==401" should set width of opened window | FAIL | assert_equals: expected 401 but got 921 |
| "\nwidth= 401" should set width of opened window | PASS | |
| ",width=401,," should set width of opened window | PASS | |
| "WIDTH=401" should set width of opened window | PASS | |
| "height=402" should set height of opened window | PASS | |
| " height = 402" should set height of opened window | PASS | |
| "height==402" should set height of opened window | FAIL | assert_equals: expected 402 but got 662 |
| "\nheight= 402" should set height of opened window | PASS | |
| ",height=402,," should set height of opened window | PASS | |
| "HEIGHT=402" should set height of opened window | PASS | |
| "height=402,width=401" should set height and width of opened window | PASS | |
| " height = 402 , width = 401 ," should set height and width of opened window | PASS | |
| "height==402 width = 401" should set height and width of opened window | FAIL | assert_equals: expected 402 but got 662 |
| "\nheight= 402,,width=\n401" should set height and width of opened window | PASS | |
| ",height=402,,width==401" should set height and width of opened window | FAIL | assert_equals: expected 401 but got 921 |
| "HEIGHT=402, WIDTH=401" should set height and width of opened window | PASS | |

@w3c-bots
Copy link

w3c-bots commented Apr 5, 2017

*This report has been truncated because the total content is 91534 characters in length, which is in excess of GitHub.com's limit for comments (65536 characters).

View the complete job log.

Chrome (unstable channel)

Testing web-platform-tests at revision 4c1570c

Chrome (unstable channel)

Testing web-platform-tests at revision 4c1570c
Using browser at version 59.0.3067.0 dev
Using browser at version 59.0.3067.0 dev
Starting 10 test iterations
Starting 10 test iterations

Unstable results

Test Subtest Results Messages
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-non-integer-height.html features "height=405.32" should set "height=405" FAIL: 9/10, PASS: 1/10 assert_equals: "top=0,left=0,width=401,height=405.32 value after first non-digit will be ignored" expected 405 but got 366
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-non-integer-height.html features "height=405LLl" should set "height=405" travis_fold:end:running_tests

Unstable results

Test Subtest Results Messages
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-non-integer-height.html features "height=405*3" should set "height=405" FAIL: 9/10, PASS: 1/10 assert_equals: "top=0,left=0,width=401,height=405*3 value after first non-digit will be ignored" expected 405 but got 366
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-non-integer-height.html features "height=405/5" should set "height=405" FAIL: 8/10, PASS: 2/10 `assert_equals: "top=0,left=0,width=401,height=405/5 value after first non-digit will be ignored" expected 405 but got
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-non-integer-height.html features "height=405^4" should set "height=405" FAIL: 7/10, PASS: 3/10 assert_equals: "top=0,left=0,width=401,height=405^4 value after first non-digit will be ignored" expected 405 but got 366
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-non-integer-height.html features "height=405*3" should set "height=405" FAIL: 8/10, PASS: 2/10 assert_equals: "top=0,left=0,width=401,height=405*3 value after first non-digit will be ignored" expected 405 but got 366
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-non-integer-height.html features "height=405/5" should set "height=405" FAIL: 8/10, PASS: 2/10 assert_equals: "top=0,left=0,width=401,height=405/5 value after first non-digit will be ignored" expected 405 but got 366
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-non-integer-height.html features "height=405 " should set "height=366
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-non-integer-height.html features "height=405 " should set "height=405" FAIL: 7/10, PASS: 3/10 assert_equals: "top=0,left=0,width=401,height=405 value after first non-digit will be ignored" expected 405 but got 366
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-non-integer-height.html features "height=405e1" should set "height=405" FAIL: 8/10, PASS: 2/10 assert_equals: "top=0,left=0,width=401,height=405e1 value after first non-digit will be ignored" expected 405 but got 366
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-non-integer-height.html features "height=405e-1" should set "height=405" FAIL: 9/10, PASS: 1/10 assert_equals: "top=0,left=0,width=401,height=405e-1 value after first non-digit will be ignored" expected 405 but got 366
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-non-integer-innerheight.html features "innerheight=405.32" should set "height=405" FAIL: 8/10, PASS: 2/10 assert_equals: "top=0,left=0,width=401,innerheight=405.32 value after first non-digit will be ignored" expected 405 but got 366
/html/browsers/the-window-405" FAIL: 8/10, PASS: 2/10 assert_equals: "top=0,left=0,width=401,height=405 value after first non-digit will be ignored" expected 405 but got 366
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-non-integer-height.html features "height=405e1" should set "height=405" FAIL: 8/10, PASS: 2/10 assert_equals: "top=0,left=0,width=401,height=405e1 value after first non-digit will be ignored" expected 405 but got 366
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-non-integer-innerheight.html features "innerheight=405^4" should set "height=405" FAIL: 7/10, PASS: 3/10 assert_equals: "top=0,left=0,width=401,innerheight=405^4 value after first non-digit will be ignored" expected 405 but got 366
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-non-integer-innerheight.html features "innerheight=405*3" should set "height=405" FAIL: 7/10, PASS: 3/10 assert_equals: "top=0,left=0,width=401,innerheight=405*3 value after first non-digit will be ignored" expected 405 but got 366
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-non-integer-innerheight.html features "innerheight=405/5"object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-non-integer-innerheight.html features "innerheight=405LLl" should set "height=405" FAIL: 9/10, PASS: 1/10
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-non-integer-innerheight.html features "innerheight=405*3" should set "height=405" FAIL: 9/10, PASS: 1/10 assert_equals: "top=0,left=0,width=401,innerheight=405*3 value after first non-digit will be ignored" expected 405 but got 366
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-tokenization-innerheight-innerwidth.html " innerheight = 402" should set height of opened window FAIL: 8/10, PASS: 2/10 assert_equals: expected 402 but got 363
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-tokenization-innerheight-innerwidth.html "innerheight==402" should set height of opened window FAIL: 9/10, PASS: 1/10 assert_equals: expected 402 but got 363
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name should set "height=405" FAIL: 8/10, PASS: 2/10 assert_equals: "top=0,left=0,width=401,innerheight=405/5 value after first non-digit will be ignored" expected 405 but got 366
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-non-integer-innerheight.html features "innerheight=405 " should set "height=405" FAIL: 9/10, PASS: 1/10 assert_equals: "top=0,left=0,width=401,innerheight=405 value after first non-digit will be ignored" expected 405 but got 366
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-tokenization-innerheight-innerwidth.html "innerheight=402" should set height of opened window FAIL: 9/10, PASS: 1/10 assert_equals: expected 402 but got 363
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-tokenization-innerheight-innerwidth.html " innerheight = 402" should set height of opened window FAIL: 9/10, PASS: 1/10 assert_equals: expected 402 but got 363
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-tokenization-innerheight-innerwidth.html "innerheight=/open-features-tokenization-innerheight-innerwidth.html "\ninnerheight= 402" should set height of opened window FAIL: 6/10, PASS: 4/10
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-tokenization-width-height.html "height=402" should set height of opened window FAIL: 7/10, PASS: 3/10 assert_equals: expected 402 but got 363
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-tokenization-width-height.html " height = 402" should set height of opened window FAIL: 8/10, PASS: 2/10 assert_equals: expected 402 but got 363
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-tokenization-width-height.html "height==402" should set height of opened window FAIL: 6/10, PASS: 4/10 assert_equals: expected 402 but got 363
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-tokenization-width-height.html "\nhe=402" should set height of opened window FAIL: 9/10, PASS: 1/10 assert_equals: expected 402 but got 363
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-tokenization-innerheight-innerwidth.html "\ninnerheight= 402" should set height of opened window FAIL: 8/10, PASS: 2/10 assert_equals: expected 402 but got 363
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-tokenization-innerheight-innerwidth.html "innerHeight=402" should set height of opened window FAIL: 9/10, PASS: 1/10 assert_equals: expected 402 but got 363
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-tokenization-width-height.html "height=402" should set height of opened window FAIL: 7/10, PASS: 3/10 assert_equals: expected 402 but got 363
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-tokenization-width-height.html ight= 402" should set height of opened window` FAIL: 4/10, PASS: 6/10 assert_equals: expected 402 but got 363
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-tokenization-width-height.html ",height=402,," should set height of opened window FAIL: 5/10, PASS: 5/10 assert_equals: expected 402 but got 363
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-tokenization-width-height.html "HEIGHT=402" should set height of opened window FAIL: 9/10, PASS: 1/10 assert_equals: expected 402 but got 363

All results

17 tests ran
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-negative-innerwidth-innerheight.html | `" height = 402" should set height of opened window` | **FAIL: 6/10, PASS: 4/10** | `assert_equals: expected 402 but got 363` | | `/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-tokenization-width-height.html` | `"height==402" should set height of opened window` | **FAIL: 6/10, PASS: 4/10** | `assert_equals: expected 402 but got 363` | | `/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-tokenization-width-height.html` | `"\nheight= 402" should set height of opened window` | **FAIL: 8/10, PASS: 2/10** | `assert_equals: expected 402 but got 363` | | `/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-tokenization-width-height.html` | `",height=402,," should set height of opened window` | **FAIL: 8/10, PASS: 2/10** | `assert_equals: expected 402 but got 363` |
`/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-tokenization-width-height.ht Subtest Results Messages
OK
features "innerwidth=-404" should NOT set "width=404" PASS
features "innerwidth=-404.5" should NOT set "width=404" PASS
features "innerwidth=-404e1" should NOT set "width=404" PASS
features "innerheight=-404" should NOT set "height=404" PASS
features "innerheight=-404.5" should NOT set "height=404" PASS
features "innerheight=-404e1" should NOT set "height=404" PASS
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-negative-screenx-screeny.html
Subtest Results Messages
ml` "HEIGHT=402" should set height of opened window FAIL: 9/10, PASS: 1/10
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-tokenization-width-height.html "height=402,width=401" should set height and width of opened window FAIL: 9/10, PASS: 1/10
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-tokenization-width-height.html " height = 402 , width = 401 ," should set height and width of opened window FAIL: 9/10, PASS: 1/10

All results

17 tests ran
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-negative-inn | OK | | | `features "screeny=-204" should NOT set "top=204"` | PASS | | | `features "screeny=-204.5" should NOT set "top=204"` | PASS | | | `features "screeny=-0" should NOT set "top=204"` | PASS | | | `features "screenx=-204" should NOT set "left=204"` | PASS | | | `features "screenx=-204.5" should NOT set "left=204"` | PASS | | | `features "screenx=-0" should NOT set "left=204"` | PASS | |
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-negative-top-left.html
Subtest Results Messages
OK
features "top=-204" should NOT set "top=204" PASS
features "top=-204.5" should NOT set "top=204" PASS
features "top=-0" should NOT set "top=204" PAerwidth-innerheight.html
Subtest Results Messages
OK
features "innerwidth=-404" should NOT set "width=404" PASS
features "innerwidth=-404.5" should NOT set "width=404" PASS
features "innerwidth=-404e1" should NOT set "width=404" PASS
features "innerheight=-404" should NOT set "height=404" PASS
features "innerheight=-404.5" should NOT set "height=404" PASS
features "innerheight=-404e1" should NOT set "height=404" PASS
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-negative-screenx-screeny.html

| Subtest | Results | Messages |
|-------------------------------------------------------|--------SS | |
| features "left=-204" should NOT set "left=204" | PASS | |
| features "left=-204.5" should NOT set "left=204" | PASS | |
| features "left=-0" should NOT set "left=204" | PASS | |

/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-negative-width-height.html
Subtest Results Messages
OK
features "width=-404" should NOT set "width=404" PASS
features "width=-404.5" should NOT set "width=404" PASS
features "width=-404e1" should NOT set "width=404" PASS
features "height=-404" should NOT set "height=404" PASS
features "height=-404.5" should NOT set "height=404" PASS
`features "height=-404e1" should NOT set "heigh- ----------
OK
features "screeny=-204" should NOT set "top=204" PASS
features "screeny=-204.5" should NOT set "top=204" PASS
features "screeny=-0" should NOT set "top=204" PASS
features "screenx=-204" should NOT set "left=204" PASS
features "screenx=-204.5" should NOT set "left=204" PASS
features "screenx=-0" should NOT set "left=204" PASS
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-negative-top-left.html
Subtest Results Messages
OK
features "top=-204" should NOT set "top=204" PASS
features "top=-204.5" should NOT set "top=204" PASS t=404"`
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-non-integer-height.html
Subtest Results Messages
OK
top=0,left=0,width=401,: absence of feature "height" should be treated same as "height=0" PASS
`top=0,left=0: absence of feature "height" should be tr
features "top=-0" should NOT set "top=204" PASS
features "left=-204" should NOT set "left=204" PASS
features "left=-204.5" should NOT set "left=204" PASS
features "left=-0" should NOT set "left=204" PASS
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-negative-width-height.html
Subtest Results Messages
OK
features "width=-404" should NOT set "width=404" PASS
features "width=-404.5" should NOT set "width=404" PASS
features "width=-404e1" should NOT set "width=404" PASS
features "height=-404" should NOT set "height=404" PASS
features "height=-404.5" should NOT set "height=404" PASS eated same as "height=0"`
features "height=/404" should NOT set "height=404" PASS
features "height=_404" should NOT set "height=404" PASS
features "height=L404" should NOT set "height=404" PASS
features "height=405.5" should set "height=405" FAIL assert_equals: "top=0,left=0,width=401,height=405.5 value after first non-digit will be ignored" expected 405 but got 366
features "height=405.32" should set "height=405" FAIL assert_equals: "top=0,left=0,width=401,height=405.32 value after first non-digit will be ignored" expected 405 but got 366
features "height=405LLl" should set "height=405"
features "height=-404e1" should NOT set "height=404" PASS
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-non-integer-height.html
Subtest Results Messages
OK
top=0,left=0,width=401,: absence of feature "height" should be treated same as "height=0" PASS
features "height=405^4" should set "height=405" FAIL assert_equals: "top=0,left=0,width=401,height=405^4 value after first non-digit will be ignored" expected 405 but got 366
features "height=405*3" should set "height=405" FAIL: 9/10, PASS: 1/10 assert_equals: "top=0,left=0,width=401,height=405*3 value after first non-digit will be ignored" expected 405 but got 366
features "height=405/5" should set "height=405" FAIL: 8/10, PASS: 2/10 assert_equals: "top=0,left=0,width=401,height=405/5 value after first non-digit will be ignored" expected 405 but got 366
features "height=405 " should set "height=405" FAIL: 7/10, PASS: 3/10 assert_equals: "top=0,left=0,width=401,height=405 value after first non-digit will be ignored" expected 405 but got 366
features "height=405e1" should set "height=405" FAIL: 8/10, PASS: 2/10 assert_equals: "top=0,left=0,width=401,height=405e1 value after first non-digit will be ignored" expected 405 but got 366
features "height=405e-1" should set "height=405"
top=0,left=0: absence of feature "height" should be treated same as "height=0" PASS
features "height=/404" should NOT set "height=404" PASS
features "height=_404" should NOT set "height=404" PASS
features "height=L404" should NOT set "height=404" PASS
features "height=405.5" should set "height=405" FAIL assert_equals: "top=0,left=0,width=401,height=405.5 value after first non-digit will be ignored" expected 405 but got 366
features "height=405.32" should set "height=405" FAIL: 9/10, PASS: 1/10 assert_equals: "top=0,left=0,width=401,height=405.32 value after first non-digit will be ignored" expected 405 but got 366
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-non-integer-innerheight.html
Subtest Results Messages
OK
features "innerheight=/404" should NOT set "height=404" PASS
`features "innecheck_stability: features "height=405LLl" should set "height=405" FAIL: 8/10, PASS: 2/10
features "height=405^4" should set "height=405" FAIL: 7/10, PASS: 3/10 assert_equals: "top=0,left=0,width=401,height=405^4 value after first non-digit will be ignored" expected 405 but got 366
features "height=405*3" should set "height=405" FAIL: 8/10, PASS: 2/10 assert_equals: "top=0,left=0,width=401,height=405*3 value after first non-digit will be ignored" expected 405 but got 366
features "height=405/5" should set "height=405" FAIL: 8/10, PASS: 2/10 assert_equals: "top=0,left=0,width=401,height=405/5 value after first non-digit will be ignored" expected 405 but got 366
features "height=405 " should set "height=405" FAIL: 8/10, PASS: 2/10 assert_equals: "top=0,left=0,width=401,height=405 value after first non-digit will be ignored" expected 405 but got 366
features "height=405e1" should set "height=405" FAIL: 8/10, PASS: 2/10 assert_equals: "top=0,left=0,width=401,height=405e1 value after first non-digit will be ignored" expected 405 but got 366
features "innerheight=L404" should NOT set "height=404" PASS
features "innerheight=405.5" should set "height=405" FAIL assert_equals: "top=0,left=0,width=401,innerheight=405.5 value after first non-digit will be ignored" expected 405 but got 366
features "innerheight=405.32" should set "height=405" FAIL: 8/10, PASS: 2/10 assert_equals: "top=0,left=0,width=401,innerheight=405.32 value after first non-digit will be ignored" expected 405 but got 366
features "innerheight=405LLl" should set "height=405" FAIL: 9/10, PASS: 1/10 assert_equals: "top=0,left=0,width=401,innerheight=405LLl value after first non-digit will be ignored" expected 405 but got 366
features "innerheight=405^4" should set "height=405" FAIL assert_equals: "top=0,left=0,width=401,innerheight=405^4 value after first non-digit will be ignored" expected 405 but got 366
features "innerheight=405*3" should set "height=405" FAIL: 9/10, PASS: 1/10 `assert_equals: "top=0,left=0,width=401,innerheight=405*3 value after first non-digit will be ignored" expectbility:
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-non-integer-innerheight.html
Subtest Results Messages
OK
features "innerheight=/404" should NOT set "height=404" PASS ed 405 but got 366`
features "innerheight=405/5" should set "height=405" FAIL assert_equals: "top=0,left=0,width=401,innerheight=405/5 value after first non-digit will be ignored" expected 405 but got 366
features "innerheight=405 " should set "height=405" FAIL assert_equals: "top=0,left=0,width=401,innerheight=405 value after first non-digit will be ignored" expected 405 but got 366
features "innerheight=405e1" should set "height=405" FAIL assert_equals: "top=0,left=0,width=401,innerheight=405e1 value after first non-digit will be ignored" expected 405 but got 366
features "innerheight=405e-1" should set "height=405" FAIL assert_equals: "top=0,left=0,width=401,innerheight=405e-1 value after first non-digit will be ignored" expected 405 but got 366
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-non-integer-innerwidth.html
Subtest Results Messages
features "innerheight=_404" should NOT set "height=404" PASS
features "innerheight=L404" should NOT set "height=404" PASS
features "innerheight=405.5" should set "height=405" FAIL assert_equals: "top=0,left=0,width=401,innerheight=405.5 value after first non-digit will be ignored" expected 405 but got 366
features "innerheight=405.32" should set "height=405" FAIL assert_equals: "top=0,left=0,width=401,innerheight=405.32 value after first non-digit will be ignored" expected 405 but got 366
features "innerheight=405LLl" should set "height=405" FAIL assert_equals: "top=0,left=0,width=401,innerheight=405LLl value after first non-digit will be ignored" expected 405 but got 366
features "innerheight=405^4" should set "height=405" FAIL: 7/10, PASS: 3/10 assert_equals: "top=0,left=0,width=401,innerheight=405^4 value after first non-digit will be ignored" expected 405 but got 366
features "innerheight=405*3" should set "height=405" FAIL: 7/10, PASS: 3/10 `assert_equals: "top=0,left---------
OK
features "innerwidth=/404" should NOT set "width=404" PASS
features "innerwidth=_404" should NOT set "width=404" PASS
features "innerwidth=L404" should NOT set "width=404" PASS
features "innerwidth=405.5" should set "width=405" PASS
features "innerwidth=405.32" should set "width=405" PASS
features "innerwidth=405LLl" should set "width=405" PASS
features "innerwidth=405^4" should set "width=405" PASS
features "innerwidth=405*3" should set "width=405" PASS
features "innerwidth=405/5" should set "width=405" PASS
features "innerwidth=405 " should set "width=405" PASS
features "innerwidth=405e1" should set "width=405" PASS
features "innerwidth=405e-1" should set "width=405" PASS
/html/=0,width=401,innerheight=405*3 value after first non-digit will be ignored" expected 405 but got 366` | | `features "innerheight=405/5" should set "height=405"` | **FAIL: 8/10, PASS: 2/10** | `assert_equals: "top=0,left=0,width=401,innerheight=405/5 value after first non-digit will be ignored" expected 405 but got 366` | | `features "innerheight=405 " should set "height=405"` | **FAIL: 9/10, PASS: 1/10** | `assert_equals: "top=0,left=0,width=401,innerheight=405 value after first non-digit will be ignored" expected 405 but got 366` | | `features "innerheight=405e1" should set "height=405"` | FAIL | `assert_equals: "top=0,left=0,width=401,innerheight=405e1 value after first non-digit will be ignored" expected 405 but got 366` | | `features "innerheight=405e-1" should set "height=405"` | FAIL | `assert_equals: "top=0,left=0,width=401,innerheight=405e-1 value after first non-digit will be ignored" expected 405 but got 366` |
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-non-integer-innerwidth.html

| Subtest | Results | Messages |

Subtest Results Messages
OK
features "left=/104" should NOT set "left=104" PASS
features "left=_104" should NOT set "left=104" PASS
features "left=L104" should NOT set "left=104" PASS
features "left=105.5" should set "left=105" PASS
features "left=105.32" should set "left=105" PASS
features "left=105LLl" should set "left=105" PASS
features "left=105^4" should set "left=105" PASS
features "left=105*3" should set "left=105" PASS
features "left=105/5" should set "left=105" PASS
features "left=105 " should set "left=105" PASS
features "left=105e1" should set "left=105" PASS
features "left=105e-1" should set "left=105" PASS
| | OK | | | `features "innerwidth=/404" should NOT set "width=404"` | PASS | | | `features "innerwidth=_404" should NOT set "width=404"` | PASS | | | `features "innerwidth=L404" should NOT set "width=404"` | PASS | | | `features "innerwidth=405.5" should set "width=405"` | PASS | | | `features "innerwidth=405.32" should set "width=405"` | PASS | | | `features "innerwidth=405LLl" should set "width=405"` | PASS | | | `features "innerwidth=405^4" should set "width=405"` | PASS | | | `features "innerwidth=405*3" should set "width=405"` | PASS | | | `features "innerwidth=405/5" should set "width=405"` | PASS | | | `features "innerwidth=405 " should set "width=405"` | PASS | | | `features "innerwidth=405e1" should set "width=405"` | PASS | | | `features "innerwidth=405e-1" should set "width=405"` | PASS | |
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-non-integer-screenx.html
Subtest Results Messages
OK
features "screenx=/104" should NOT set "left=104" PASS
features "screenx=_104" should NOT set "left=104" PASS
features "screenx=L104" should NOT set "left=104" PASS
features "screenx=105.5" should set "left=105" PASS
features "screenx=105.32" should set "left=105" PASS
features "screenx=105LLl" should set "left=105" PASS
features "screenx=105^4" should set "left=105" PASS
features "screenx=105*3" should set "left=105" PASS
features "screenx=105/5" should set "left=105" PASS
features "screenx=105 " should set "left=105" PASS d-navigating-browsing-contexts-by-name/open-features-non-integer-left.html">/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-non-integer-left.html
Subtest Results Messages
OK
features "left=/104" should NOT set "left=104" PASS
features "left=_104" should NOT set "left=104" PASS
features "left=L104" should NOT set "left=104" PASS
features "left=105.5" should set "left=105" PASS
features "left=105.32" should set "left=105" PASS
features "left=105LLl" should set "left=105" PASS
features "left=105^4" should set "left=105" PASS
features "left=105*3" should set "left=105" PASS
features "left=105/5" should set "left=105" PASS
features "left=105 " should set "left=105" PASS
features "left=105e1" should set "left=105" PASS
features "left=105e-1" should set "left=105" PASS
features "screenx=105e1" should set "left=105" PASS
features "screenx=105e-1" should set "left=105" PASS
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-non-integer-screeny.html
Subtest Results Messages
OK
features "screeny=/404" should NOT set "height=404" PASS
features "screeny=_404" should NOT set "height=404" PASS
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-non-integer-screenx.html
Subtest Results Messages
OK
features "screenx=/104" should NOT set "left=104" PASS
features "screenx=_104" should NOT set "left=104" PASS
features "screenx=L104" should NOT set "left=104" PASS
features "screenx=105.5" should set "left=105" PASS
features "screenx=105.32" should set "left=105" PASS
features "screenx=105LLl" should set "left=105" PASS
features "screenx=105^4" should set "left=105" PASS
features "screenx=105*3" should set "left=105" PASS
features "screenx=105/5" should set "left=105" PASS
features "screeny=L404" should NOT set "height=404" PASS
features "screeny=405.5" should set "height=405" FAIL assert_equals: "height=401,width=402,left=0,screeny=405.5 value after first non-digit will be ignored" expected 405 but got 367
features "screeny=405.32" should set "height=405" FAIL assert_equals: "height=401,width=402,left=0,screeny=405.32 value after first non-digit will be ignored" expected 405 but got 367
features "screeny=405LLl" should set "height=405" FAIL assert_equals: "height=401,width=402,left=0,screeny=405LLl value after first non-digit will be ignored" expected 405 but got 367
features "screeny=405^4" should set "height=405" FAIL assert_equals: "height=401,width=402,left=0,screeny=405^4 value after first non-digit will be ignored" expected 405 but got 367
features "screeny=405*3" should set "height=405" FAIL assert_equals: "height=401,width=402,left=0,screeny=405*3 value after first non-digit will be ignored" expected 405 but got 367
features "screeny=405/5" should set "height=405" FAIL `assert_equals: "height=401,width=402,left=0,screeny=405/5 value after first non-digit will be ignored" exheck_stability:
features "screenx=105e1" should set "left=105" PASS
features "screenx=105e-1" should set "left=105" PASS
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-non-integer-screeny.html
Subtest Results Messages
OK
features "screeny=/404" should NOT set "height=404" PASS
pected 405 but got 367`
features "screeny=405 " should set "height=405" FAIL assert_equals: "height=401,width=402,left=0,screeny=405 value after first non-digit will be ignored" expected 405 but got 367
features "screeny=405e1" should set "height=405" FAIL assert_equals: "height=401,width=402,left=0,screeny=405e1 value after first non-digit will be ignored" expected 405 but got 367
features "screeny=405e-1" should set "height=405" FAIL assert_equals: "height=401,width=402,left=0,screeny=405e-1 value after first non-digit will be ignored" expected 405 but got 367
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-non-integer-top.html
Subtest Results Messages
OK
features "top=/104" should NOT set "top=104" PASS
features "top=_104" should NOT set "top=104" PASS
`features "top=L104" s features "screeny=_404" should NOT set "height=404" PASS
features "screeny=L404" should NOT set "height=404" PASS
features "screeny=405.5" should set "height=405" FAIL assert_equals: "height=401,width=402,left=0,screeny=405.5 value after first non-digit will be ignored" expected 405 but got 367
features "screeny=405.32" should set "height=405" FAIL assert_equals: "height=401,width=402,left=0,screeny=405.32 value after first non-digit will be ignored" expected 405 but got 367
features "screeny=405LLl" should set "height=405" FAIL assert_equals: "height=401,width=402,left=0,screeny=405LLl value after first non-digit will be ignored" expected 405 but got 367
features "screeny=405^4" should set "height=405" FAIL assert_equals: "height=401,width=402,left=0,screeny=405^4 value after first non-digit will be ignored" expected 405 but got 367
features "screeny=405*3" should set "height=405" FAIL assert_equals: "height=401,width=402,left=0,screeny=405*3 value after first non-digit will be ignored" expected 405 but got 367
features "screeny=405/5" should set "height=405" FAIL assert_equals: "height=hould NOT set "top=104"
features "top=105.5" should set "top=105" PASS
features "top=105.32" should set "top=105" PASS
features "top=105LLl" should set "top=105" PASS
features "top=105^4" should set "top=105" PASS
features "top=105*3" should set "top=105" PASS
features "top=105/5" should set "top=105" PASS
features "top=105 " should set "top=105" PASS
features "top=105e1" should set "top=105" PASS
features "top=105e-1" should set "top=105" PASS
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-non-integer-width.html
Subtest Results Messages
401,width=402,left=0,screeny=405/5 value after first non-digit will be ignored" expected 405 but got 367`
features "screeny=405 " should set "height=405" FAIL assert_equals: "height=401,width=402,left=0,screeny=405 value after first non-digit will be ignored" expected 405 but got 367
features "screeny=405e1" should set "height=405" FAIL assert_equals: "height=401,width=402,left=0,screeny=405e1 value after first non-digit will be ignored" expected 405 but got 367
features "screeny=405e-1" should set "height=405" FAIL assert_equals: "height=401,width=402,left=0,screeny=405e-1 value after first non-digit will be ignored" expected 405 but got 367
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-non-integer-top.html
Subtest Results Messages
OK
features "top=/104" should NOT set "top=104" PASS
`features "top=_104" should NOT se OK
top=0,left=0,height=401,: absence of feature "width" should be treated same as "width=0" PASS
top=0,left=0: absence of feature "width" should be treated same as "width=0" PASS
features "width=/404" should NOT set "width=404" PASS
features "width=_404" should NOT set "width=404" PASS
features "width=L404" should NOT set "width=404" PASS
features "width=405.5" should set "width=405" PASS
features "width=405.32" should set "width=405" PASS
features "width=405LLl" should set "width=405" PASS
features "width=405^4" should set "width=405" PASS
features "width=405*3" should set "width=405" PASS
features "width=405/5" should set "width=405" PASS
features "t "top=104" PASS
features "top=L104" should NOT set "top=104" PASS
features "top=105.5" should set "top=105" PASS
features "top=105.32" should set "top=105" PASS
features "top=105LLl" should set "top=105" PASS
features "top=105^4" should set "top=105" PASS
features "top=105*3" should set "top=105" PASS
features "top=105/5" should set "top=105" PASS
features "top=105 " should set "top=105" PASS
features "top=105e1" should set "top=105" PASS
features "top=105e-1" should set "top=105" PASS
/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-non-integer-width.html

| Subtest | Results | Messages |
|-----------------------------------------------------------------------width=405 " should set "width=405" | PASS | | |features "width=405e1" should set "width=405" | PASS | | |features "width=405e-1" should set "width=405"` | PASS | |

/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-tokenization-innerheight-innerwidth.html
Subtest Results Messages
OK
"innerwidth=401" should set width of opened window PASS
" innerwidth = 401" should set width of opened window PASS
OK

Copy link
Member

@zcorpan zcorpan left a comment

Choose a reason for hiding this comment

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

Did you get any test to pass?

Would also be good to test interaction of width and innerwidth features (which one is used if both are present, if they are repeated...), and more testing of the value (is invalid value set to 0 or does it drop the feature?).

assert_equals(data.left, 152);
}));
var win = window.open(prefixedMessage.url(windowURL), '', features);
}, `"${features}" (${idx + 1} of ${arr.length}) should set left position of opened window`);
Copy link
Member

Choose a reason for hiding this comment

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

Remove index/length from the test name. Removing or adding tests shouldn't cause other tests to be renamed.

<script>
var windowURL = 'resources/message-opener.html';

[ 'width=142',
Copy link
Member

Choose a reason for hiding this comment

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

Need bigger value for width and height as browsers have a minimum size for windows. Maybe 400 something is ok.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

FWIW, that value seems to be 100 in at least FireFox's case. But sure, yes, wider is fine!

@zcorpan
Copy link
Member

zcorpan commented Apr 6, 2017

You may also need to specify dimentions in all tests to avoid getting it opened as a tab...

@zcorpan
Copy link
Member

zcorpan commented Apr 6, 2017

I made a commit to address some of my comments but did not have permission to push to your branch. For now pushed the branch to this repo, see 590ee4b

zcorpan added a commit to w3c/csswg-drafts that referenced this pull request Apr 6, 2017
See whatwg/html#2476

Also change the behavior for left=foo to act as if left=0 to align
with the behavior of at least WebKit and Chromium.

Tests:
web-platform-tests/wpt#5306
web-platform-tests/wpt#5390
zcorpan added a commit to whatwg/html that referenced this pull request Apr 6, 2017
This was specified in CSSOM View but the "noopener" feature did
not use the same tokenizer as the legacy features. Fixes #2474.

Also specify the aliases screenx, screeny, innerwidth, innerheight
for left, top, width, and height, respectively. Part of #2464.
Closes w3c/csswg-drafts#1128.

The tokenizer specified here closely follows Edge.
Chromium and WebKit are also very similar to Edge.
Difference from Edge: U+0000 does not end the string.
Difference from Chromium: U+0000 is not a separator.
Difference from WebKit/Chromium/Edge: U+000C is a separator.

For the input `width toolbar=450, height=450`,
Edge tokenizes like `width, toolbar=450, height=450` while
WebKit/Chromium like `width=450, height=450`.
The Edge behavior seems better.

Tests:
web-platform-tests/wpt#5306
web-platform-tests/wpt#5390
@lyzadanger
Copy link
Contributor Author

@zcorpan: When I read the CSSOM View's coverage of open features, I don't see explicit language around whether it's expected to pass both sizing features. Given that some browsers ignore the presence of one if it's on its own...is that documented somewhere as an expected behavior or is it just how things are?

@lyzadanger
Copy link
Contributor Author

@zcorpan Thanks for feedback! I have your commit now and I'm going to add some tests for invalid values (via rules for parsing integers ) and different combinations.

@zcorpan
Copy link
Member

zcorpan commented Apr 6, 2017

I think specifying one of width or height works, it's just that the unspecified one might be too big which in turn overrides positioning (the spec allows adjusting values to fit available space).

@w3c-bots
Copy link

w3c-bots commented Apr 6, 2017

These tests are now available on w3c-test.org

@lyzadanger
Copy link
Contributor Author

@zcorpan I've pushed a commit that adds some tests for invalid values of top, left. I'm basing my logic on Rules for Parsing Integers — thing is, none of the browsers I tested in seem to be following that. Thus, a lot of fails here.

Anyway, before I go further: it seems evident that no browser implements parsing these values per the "rules for parsing integers". Am I misunderstanding the spec ? Is the spec wrong? Or just browsers not following the spec :) ?

BTW, my source here is step 11 under step 5 (parsing the tokens) in the CSSOM View spec. While the HTML spec now, as of your recent changes, defines the tokenization itself, it doesn't—so far as I know—define the parsing of the tokens. Right?

An aside: during the work on these tests, I got bogged down for some time by flaky behavior in my stable Chrome (57.0.2987.133) wherein sometimes opened windows inexplicably set their window.screenX and window.screenY values to 0 (which seems to persist until the open window gains focus). This was making me tear my hair out, especially as the behavior was variable and hard to track down. Given a test that rapid-fire opened 5 or more windows in one go with a left or top value, I had a near 100% ability to reproduce it — that is, at least one of the opened windows would report a screenX and/or screenY value of 0 — but which windows would be affected varied. However, it's a non-issue in Chrome Canary—tests behave as expected. There's some allusion to the wonky behavior in this ancient Chromium bug. I wanted to mention this in case I need to worry about it further.

@zcorpan
Copy link
Member

zcorpan commented Apr 7, 2017

@zcorpan
Copy link
Member

zcorpan commented Apr 7, 2017

Anyway, before I go further: it seems evident that no browser implements parsing these values per the "rules for parsing integers". Am I misunderstanding the spec ? Is the spec wrong? Or just browsers not following the spec :) ?

Maybe cssom-view is wrong. What do browsers do?

While the HTML spec now, as of your recent changes, defines the tokenization itself, it doesn't—so far as I know—define the parsing of the tokens. Right?

HTML doesn't define parsing of the values, right. It just passes tokenizedFeatures to cssom-view, which then uses "rules for parsing integers" for left/top/width/height.

Copy link
Member

@zcorpan zcorpan left a comment

Choose a reason for hiding this comment

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

The new approach seems good.

[ 'top=/104',
'top=_104',
'top=L104',
'top=0x68'
Copy link
Member

Choose a reason for hiding this comment

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

0x68 should probably be in a different bucket since it doesn't produce an error.

'top=105^4',
'top=105*3',
'top=105/5',
'top=105 '
Copy link
Member

Choose a reason for hiding this comment

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

Could also add 105e1 and 105e-1

@zcorpan
Copy link
Member

zcorpan commented Apr 7, 2017

No need to worry about bugs in stable releases of browsers, here we care about dev/nightly. (Although as a policy we avoid depending on features that are not yet available in stable releases of browsers.)

@lyzadanger lyzadanger force-pushed the window-open-optional-features branch from 211bf6e to 650b414 Compare April 7, 2017 20:00
@lyzadanger
Copy link
Contributor Author

@zcorpan I've fleshed out considerably and also cleaned up history.

For the current batch of tests:

  • Chrome passes everything
  • Firefox is choking on a couple of tokenization tests — not handling feature separators per newest spec language
  • Safari likes to mess with height in a manner I haven't tracked down yet. Windows opened with height values are ending up about 74px shorter than requested. Space for chrome deducted, maybe?

Of these, the Safari disparity might be worth checking out. Not sure.

Note tests 015 and 016 : observed browser behavior vis-a-vis invalid width and height values is described in a comment there — negative values are not treated as 0 but instead as the minimum allowed value for the dimension in question. This behavior is consistent in the browsers I tested in. Seems like OK behavior to me.

@zcorpan
Copy link
Member

zcorpan commented Apr 10, 2017

negative values are not treated as 0 but instead as the minimum allowed value for the dimension in question. This behavior is consistent in the browsers I tested in. Seems like OK behavior to me.

Interesting! So for width=0 or width=error the feature is effectively ignored. I'll fix cssom-view to reflect that.

@zcorpan
Copy link
Member

zcorpan commented Apr 10, 2017

w3c/csswg-drafts@f15a4a8

@zcorpan
Copy link
Member

zcorpan commented Apr 10, 2017

So negative values should instead be equivalent to baseline width=1,height=1, right?

Would be good to test that width=0 is equivalent to not specifying width at all. Probably with baseline left=0,top=0.

@lyzadanger
Copy link
Contributor Author

So negative values should instead be equivalent to baseline width=1,height=1, right?

Yep! You can see that in the negative value tests I use those values for setting up the baseline window.

Would be good to test that width=0 is equivalent to not specifying width at all. Probably with baseline left=0,top=0.

Will work on this one.

Copy link
Member

@zcorpan zcorpan left a comment

Choose a reason for hiding this comment

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

Nits

var featureString = `${featuresPrefix}left=0,${feature}`;
prefixedMessage.onMessage(t.step_func_done((data, e) => {
e.source.close();
assert_equals(data.top, baselineDimensions.top, `"${feature} is negative and should be ignored"`);
Copy link
Member

Choose a reason for hiding this comment

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

Message is incorrect.

var featureString = `${featuresPrefix}top=0,${feature}`;
prefixedMessage.onMessage(t.step_func_done((data, e) => {
e.source.close();
assert_equals(data.left, baselineDimensions.left, `"${feature} is negative and should be ignored"`);
Copy link
Member

Choose a reason for hiding this comment

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

Message is incorrect.

var featureString = `${featuresPrefix}left=0,${feature}`;
prefixedMessage.onMessage(t.step_func_done((data, e) => {
e.source.close();
assert_equals(data.top, baselineDimensions.top, `"${feature} is negative and should be ignored"`);
Copy link
Member

Choose a reason for hiding this comment

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

Message is incorrect.

var featureString = `${featuresPrefix}top=0,${feature}`;
prefixedMessage.onMessage(t.step_func_done((data, e) => {
e.source.close();
assert_equals(data.left, baselineDimensions.left, `"${feature} is negative and should be ignored"`);
Copy link
Member

Choose a reason for hiding this comment

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

Message is incorrect.

var featureString = `${featuresPrefix}height=405,${feature}`;
prefixedMessage.onMessage(t.step_func_done((data, e) => {
e.source.close();
assert_equals(data.width, baselineDimensions.width, `"${feature} is negative and should be ignored"`);
Copy link
Member

Choose a reason for hiding this comment

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

Message is incorrect.

var featureString = `${featuresPrefix}width=404,${feature}`;
prefixedMessage.onMessage(t.step_func_done((data, e) => {
e.source.close();
assert_equals(data.height, baselineDimensions.height, `"${feature} is negative and should be ignored"`);
Copy link
Member

Choose a reason for hiding this comment

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

Message is incorrect.

@lyzadanger lyzadanger force-pushed the window-open-optional-features branch from e34188d to 3b84b3c Compare April 11, 2017 16:21
@lyzadanger
Copy link
Contributor Author

OK: Let's hope this gets the final test-message details right (and I cleaned up the branch)!

@zcorpan
Copy link
Member

zcorpan commented Apr 11, 2017

If you check the checkbox in the sidebar to allow edits from maintainers then I can push to your branch. :-)

The messages are good now 👍

A thing that irks me now (sorry!) is the filenames. I understand that you follow the documentation for css tests, but the numbering naming convention generally sucks since it's impossible to tell which of the 16 files is the one that tests non-integer values for screenx.

Suggested fix: b84de1a

The instability in Chrome sucks, and the bug you pointed to does not appear to be fixed... I can reproduce 0 for screenX/screenY by focusing the opener window while the test is running, but just letting the test run without clicking anywhere seems to consistently pass for me. I can't reproduce failures for height that the stability checker got in Chrome. Maybe platform-specific? Anyway, seems like a bug in the browser rather than a bug in the test, so I think we can land and file an issue on chromium.

@zcorpan
Copy link
Member

zcorpan commented Apr 12, 2017

height bug in WebKit
https://bugs.webkit.org/show_bug.cgi?id=143678

@lyzadanger
Copy link
Contributor Author

@zcorpan I've given you permissions to commit your changes here! Wanna take it from here?

@zcorpan
Copy link
Member

zcorpan commented Apr 12, 2017

Sure! Thanks

@zcorpan
Copy link
Member

zcorpan commented Apr 12, 2017

Also filed an issue for chromium
https://bugs.chromium.org/p/chromium/issues/detail?id=710869

@zcorpan zcorpan merged commit 61bafa6 into web-platform-tests:master Apr 13, 2017
zcorpan added a commit that referenced this pull request Apr 13, 2017
Followup to #5390

#5390 (review)

> Would also be good to test interaction of width and innerwidth
> features (which one is used if both are present, if they are
> repeated...)
@foolip
Copy link
Member

foolip commented Apr 18, 2017

@bobholt, the formatting in #5390 (comment) seems to have gone wrong. Note how one of the test names is supposedly /html/browsers/the-window-405" and the test results are then in the wrong column. Is there some escaping missing?

@zcorpan
Copy link
Member

zcorpan commented Apr 18, 2017

@foolip I guess that's #5552

inikulin pushed a commit to HTMLParseErrorWG/html that referenced this pull request May 9, 2017
This was specified in CSSOM View but the "noopener" feature did
not use the same tokenizer as the legacy features. Fixes whatwg#2474.

Also specify the aliases screenx, screeny, innerwidth, innerheight
for left, top, width, and height, respectively. Part of whatwg#2464.
Closes w3c/csswg-drafts#1128.

The tokenizer specified here closely follows Edge.
Chromium and WebKit are also very similar to Edge.
Difference from Edge: U+0000 does not end the string.
Difference from Chromium: U+0000 is not a separator.
Difference from WebKit/Chromium/Edge: U+000C is a separator.

For the input `width toolbar=450, height=450`,
Edge tokenizes like `width, toolbar=450, height=450` while
WebKit/Chromium like `width=450, height=450`.
The Edge behavior seems better.

Tests:
web-platform-tests/wpt#5306
web-platform-tests/wpt#5390
inikulin pushed a commit to HTMLParseErrorWG/html that referenced this pull request May 9, 2017
This was specified in CSSOM View but the "noopener" feature did
not use the same tokenizer as the legacy features. Fixes whatwg#2474.

Also specify the aliases screenx, screeny, innerwidth, innerheight
for left, top, width, and height, respectively. Part of whatwg#2464.
Closes w3c/csswg-drafts#1128.

The tokenizer specified here closely follows Edge.
Chromium and WebKit are also very similar to Edge.
Difference from Edge: U+0000 does not end the string.
Difference from Chromium: U+0000 is not a separator.
Difference from WebKit/Chromium/Edge: U+000C is a separator.

For the input `width toolbar=450, height=450`,
Edge tokenizes like `width, toolbar=450, height=450` while
WebKit/Chromium like `width=450, height=450`.
The Edge behavior seems better.

Tests:
web-platform-tests/wpt#5306
web-platform-tests/wpt#5390
zcorpan added a commit that referenced this pull request Jun 21, 2017
Followup to #5390

#5390 (review)

> Would also be good to test interaction of width and innerwidth
> features (which one is used if both are present, if they are
> repeated...)
zcorpan added a commit that referenced this pull request Aug 25, 2017
Followup to #5390

#5390 (review)

> Would also be good to test interaction of width and innerwidth
> features (which one is used if both are present, if they are
> repeated...)
alice pushed a commit to alice/html that referenced this pull request Jan 8, 2019
This was specified in CSSOM View but the "noopener" feature did
not use the same tokenizer as the legacy features. Fixes whatwg#2474.

Also specify the aliases screenx, screeny, innerwidth, innerheight
for left, top, width, and height, respectively. Part of whatwg#2464.
Closes w3c/csswg-drafts#1128.

The tokenizer specified here closely follows Edge.
Chromium and WebKit are also very similar to Edge.
Difference from Edge: U+0000 does not end the string.
Difference from Chromium: U+0000 is not a separator.
Difference from WebKit/Chromium/Edge: U+000C is a separator.

For the input `width toolbar=450, height=450`,
Edge tokenizes like `width, toolbar=450, height=450` while
WebKit/Chromium like `width=450, height=450`.
The Edge behavior seems better.

Tests:
web-platform-tests/wpt#5306
web-platform-tests/wpt#5390
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants