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

Add tests for dialog centering #4605

Merged
merged 4 commits into from
Apr 7, 2017
Merged

Add tests for dialog centering #4605

merged 4 commits into from
Apr 7, 2017

Conversation

domenic
Copy link
Member

@domenic domenic commented Jan 23, 2017

Follows whatwg/html#2208.

Several of these are probably wrong but I feel I've gone as far as I can with my knowledge of writing modes. @zcorpan can you take this over from here?


This change is Reviewable

@wpt-pr-bot
Copy link
Collaborator

@wpt-stability-bot
Copy link

wpt-stability-bot commented Jan 23, 2017

Firefox (nightly channel)

Testing web-platform-tests at revision c38f204
Using browser at version BuildID 20170123125947; SourceStamp 36486fdc3813ef7943ae5b07b4128866d1938a6c
Starting 10 test iterations
All results were stable

All results

/html/semantics/interactive-elements/the-dialog-element/centering.html
Subtest Results
OK
vertical-rl (dialog/dialog container horizontal-tb): tall viewport PASS
horizontal-tb: tall viewport FAIL
horizontal-tb: square viewport FAIL
horizontal-tb: wide viewport FAIL
horizontal-tb: dialog and viewport match FAIL
vertical-lr: dialog bigger than viewport FAIL
horizontal-tb (dialog/dialog container vertical-rl): tall viewport PASS
vertical-rl: tall viewport FAIL
horizontal-tb: dialog bigger than viewport FAIL
vertical-lr: tall viewport FAIL

@wpt-stability-bot
Copy link

wpt-stability-bot commented Jan 23, 2017

Chrome (unstable channel)

Testing web-platform-tests at revision c38f204
Using browser at version 55.0.2883.75
Starting 10 test iterations
All results were stable

All results

/html/semantics/interactive-elements/the-dialog-element/centering.html
Subtest Results
OK
vertical-rl (dialog/dialog container horizontal-tb): tall viewport PASS
horizontal-tb: tall viewport PASS
horizontal-tb: square viewport PASS
horizontal-tb: wide viewport PASS
horizontal-tb: dialog and viewport match PASS
vertical-lr: dialog bigger than viewport PASS
horizontal-tb (dialog/dialog container vertical-rl): tall viewport FAIL
vertical-rl: tall viewport FAIL
horizontal-tb: dialog bigger than viewport PASS
vertical-lr: tall viewport FAIL

writing-mode: {{GET[html-writing-mode]}}
}

dialog, body {
Copy link
Member

Choose a reason for hiding this comment

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

We can't use body here because 'writing-mode' propagates from body to the viewport. Should use a div. Also don't need to put dialog in the selector since it's inherited.

iframe.height = iframeHeight;
iframe.onload = t.step_func_done(() => {
const dialog = iframe.contentDocument.querySelector("dialog");
assert_equals(window.getComputedStyle(dialog)[property], numericValue + "px");
Copy link
Member

Choose a reason for hiding this comment

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

I think this should probably invoke the iframe's getComputedStyle to avoid weirdness with crossing globals.

@domenic
Copy link
Member Author

domenic commented Jan 24, 2017

@zcorpan review comments addressed. Still hoping for your help on the TODOs :)

@domenic
Copy link
Member Author

domenic commented Feb 8, 2017

Ping @zcorpan

@ghost
Copy link

ghost commented Mar 23, 2017

These tests are now available on w3c-test.org

@zcorpan
Copy link
Member

zcorpan commented Mar 23, 2017

Finally got around to this, sorry for the delay.

@domenic
Copy link
Member Author

domenic commented Mar 23, 2017

Great!! Your changes LGTM, hopefully my changes LGTY, so we can land this?

Travis is having trouble finding Firefox nightly... I restarted it to see what happens. Maybe rebasing would help too if the test infra has changed since the original PR.

@zcorpan
Copy link
Member

zcorpan commented Mar 23, 2017

Restarting won't help, need to rebase. (Edit: now done)

@ghost
Copy link

ghost commented Mar 23, 2017

View the complete job log.

Firefox (nightly channel)

Testing web-platform-tests at revision 190a5d5
Using browser at version BuildID 20170322110306; SourceStamp 201231223cd4354a450c3e5d80959f35b8e4cf0c
Starting 10 test iterations
All results were stable

All results

1 test ran
/html/semantics/interactive-elements/the-dialog-element/centering.html
Subtest Results Messages
OK
horizontal-tb: tall viewport FAIL assert_equals: expected "45px" but got "auto"
horizontal-tb: wide viewport FAIL assert_equals: expected "15px" but got "auto"
horizontal-tb: square viewport FAIL assert_equals: expected "45px" but got "auto"
horizontal-tb: dialog and viewport match FAIL assert_equals: expected "0px" but got "auto"
horizontal-tb: dialog bigger than viewport FAIL assert_equals: expected "0px" but got "auto"
vertical-rl: tall viewport FAIL assert_equals: expected "10px" but got "auto"
vertical-lr: tall viewport FAIL assert_equals: expected "10px" but got "auto"
vertical-lr: dialog bigger than viewport FAIL assert_equals: expected "0px" but got "auto"
vertical-rl (dialog horizontal-tb): tall viewport FAIL assert_equals: expected "10px" but got "0px"
vertical-lr (dialog horizontal-tb): tall viewport FAIL assert_equals: expected "10px" but got "0px"
vertical-lr (dialog horizontal-tb): dialog bigger than viewport PASS
horizontal-tb (container vertical-rl): tall viewport FAIL assert_equals: expected "10px" but got "auto"
vertical-rl (container horizontal-tb): tall viewport FAIL assert_equals: expected "45px" but got "auto"
horizontal-tb (container vertical-rl) (dialog horizontal-tb): tall viewport FAIL assert_equals: expected "10px" but got "0px"
vertical-rl (container horizontal-tb) (dialog vertical-rl): tall viewport FAIL assert_equals: expected "45px" but got "0px"

@ghost
Copy link

ghost commented Mar 23, 2017

View the complete job log.

Chrome (unstable channel)

Testing web-platform-tests at revision 190a5d5
Using browser at version 59.0.3047.0 dev
Starting 10 test iterations
All results were stable

All results

1 test ran
/html/semantics/interactive-elements/the-dialog-element/centering.html
Subtest Results Messages
OK
horizontal-tb: tall viewport PASS
horizontal-tb: wide viewport PASS
horizontal-tb: square viewport PASS
horizontal-tb: dialog and viewport match PASS
horizontal-tb: dialog bigger than viewport PASS
vertical-rl: tall viewport FAIL assert_equals: expected "10px" but got "0px"
vertical-lr: tall viewport FAIL assert_equals: expected "10px" but got "0px"
vertical-lr: dialog bigger than viewport PASS
vertical-rl (dialog horizontal-tb): tall viewport FAIL assert_equals: expected "10px" but got "0px"
vertical-lr (dialog horizontal-tb): tall viewport FAIL assert_equals: expected "10px" but got "0px"
vertical-lr (dialog horizontal-tb): dialog bigger than viewport PASS
horizontal-tb (container vertical-rl): tall viewport FAIL assert_equals: expected "10px" but got "0px"
vertical-rl (container horizontal-tb): tall viewport PASS
horizontal-tb (container vertical-rl) (dialog horizontal-tb): tall viewport FAIL assert_equals: expected "10px" but got "0px"
vertical-rl (container horizontal-tb) (dialog vertical-rl): tall viewport PASS

@zcorpan
Copy link
Member

zcorpan commented Mar 23, 2017

Sigh, the spec's small-screen style is messing with this, since the iframe is small...

@ghost
Copy link

ghost commented Mar 23, 2017

View the complete job log.

Firefox (nightly channel)

Testing web-platform-tests at revision 3b248100668aebdc5f58cca3135c0aecf31728d3
Using browser at version BuildID 20170322110306; SourceStamp 201231223cd4354a450c3e5d80959f35b8e4cf0c
Starting 10 test iterations

@ghost
Copy link

ghost commented Mar 23, 2017

View the complete job log.

Chrome (unstable channel)

Testing web-platform-tests at revision 3b248100668aebdc5f58cca3135c0aecf31728d3
Using browser at version 59.0.3047.0 dev
Starting 10 test iterations

@zcorpan zcorpan merged commit 03b2ae7 into master Apr 7, 2017
@zcorpan zcorpan deleted the dialog-centering branch April 7, 2017 15:44
zcorpan pushed a commit to whatwg/html that referenced this pull request Apr 7, 2017
inikulin pushed a commit to HTMLParseErrorWG/html that referenced this pull request May 9, 2017
inikulin pushed a commit to HTMLParseErrorWG/html that referenced this pull request May 9, 2017
alice pushed a commit to alice/html that referenced this pull request Jan 8, 2019
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.

5 participants