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

Trigger WindowEvent::Resize when resizing in headless mode #15818

Closed
wants to merge 3 commits into from

Conversation

@alanhoff
Copy link

alanhoff commented Mar 4, 2017

When resizing in headless mode a resize event is now fired


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #15621
  • There are tests for these changes OR
  • These changes do not require tests because _____

This change is Reviewable

@highfive
Copy link

highfive commented Mar 4, 2017

Thanks for the pull request, and welcome! The Servo team is excited to review your changes, and you should hear from @SimonSapin (or someone else) soon.

@alanhoff
Copy link
Author

alanhoff commented Mar 4, 2017

@jdm I believe this code fixes #15621, now I need some help on how I should add tests.

@jdm
Copy link
Member

jdm commented Mar 4, 2017

If you follow these instructions, you can add a new test in tests/wpt/mozilla/tests/mozilla using the testharness.js API (you probably want to use async_test).

@alanhoff alanhoff force-pushed the alanhoff:resize-event-headless branch from dcaffbe to 9e8ff67 Mar 4, 2017
@alanhoff alanhoff force-pushed the alanhoff:resize-event-headless branch from 9e8ff67 to 8b19cd5 Mar 4, 2017
@alanhoff alanhoff force-pushed the alanhoff:resize-event-headless branch from cedb71d to bafdbbd Mar 4, 2017
@alanhoff alanhoff changed the title [wip] Trigger WindowEvent::Resize when resizing in headless mode Trigger WindowEvent::Resize when resizing in headless mode Mar 4, 2017
@alanhoff
Copy link
Author

alanhoff commented Mar 4, 2017

@jdm @SimonSapin ready for review

@jdm
Copy link
Member

jdm commented Mar 5, 2017

We should add an assert that window.clientWidth and clientHeight equal the new dimension inside of the event handler, too.

@alanhoff
Copy link
Author

alanhoff commented Mar 5, 2017

@jdm I just submitted the tests you asked for. Everything is working correctly :-)

Copy link
Member

jdm left a comment

This ends up testing that clientWidth == clientHeight, and uses a descriptive label of "200". We should use two separate uses of assert_equals instead.

@alanhoff
Copy link
Author

alanhoff commented Mar 5, 2017

@jdm oh that was some ugly mistake – by reading the examples I thought that assert_equals would compare equality across all arguments.

So, it turns out that both clientWidth and clientHeight are undefined and that makes me think that they're not being set at all during the window's lifecycle. Having said that I think it's a separated issue (one that I'm also interested in solving) that deserves an equally separated PR. What do you think?

Also, do you have ideias why this build is failing?

@jdm
Copy link
Member

jdm commented Mar 6, 2017

Oops, I meant innerWidth/innerHeight; clientWidth/clientHeight is a property of Element objects, not Window.

@jdm
Copy link
Member

jdm commented Mar 6, 2017

The travis build is failing because you have modified a test file without updating the manifest (I know, it's rather annoying). You will need to run ./mach update-manifest every time and commit the changes to MANIFEST.json before pushing after modifying the test file.

@alanhoff alanhoff force-pushed the alanhoff:resize-event-headless branch from 581fbe5 to 3bf1ede Mar 6, 2017
@alanhoff
Copy link
Author

alanhoff commented Mar 6, 2017

@jdm Now it makes sense and tests are passing, thx for the tips.
Ready for review

@alanhoff
Copy link
Author

alanhoff commented Mar 12, 2017

@jdm any updates about this pr? :-)

@SimonSapin SimonSapin assigned jdm and unassigned SimonSapin Mar 13, 2017
@jdm
Copy link
Member

jdm commented Mar 13, 2017

Sorry, I've been on vacation. I will look at my review queue (including this PR) starting Wednesday.

@nox
Copy link
Member

nox commented Mar 14, 2017

@bors-servo
Copy link
Contributor

bors-servo commented Mar 14, 2017

Trying commit 3bf1ede with merge 5127faa...

bors-servo added a commit that referenced this pull request Mar 14, 2017
Trigger WindowEvent::Resize when resizing in headless mode

When resizing in headless mode a resize event is now fired

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #15621

<!-- Either: -->
- [x] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15818)
<!-- Reviewable:end -->
@nox nox assigned nox and unassigned jdm Mar 14, 2017
@nox nox dismissed jdm’s stale review Mar 14, 2017

Single remark addressed by PR author.

@bors-servo
Copy link
Contributor

bors-servo commented Mar 14, 2017

💔 Test failed - linux-rel-wpt

@nox
Copy link
Member

nox commented Mar 14, 2017

  ▶ TIMEOUT [expected OK] /_mozilla/mozilla/resizeTo.html
  │ 
  │ VMware, Inc.
  │ Gallium 0.4 on softpipe
  └ 3.3 (Core Profile) Mesa 12.0.1

  ▶ Unexpected subtest result in /_mozilla/mozilla/resizeTo.html:
  │ TIMEOUT [expected PASS] onresize
  └   → Test timed out
@alanhoff
Copy link
Author

alanhoff commented Mar 14, 2017

@jdm @nox I need guidance on what went wrong with the homu test and how to fix it

@KiChjang
Copy link
Member

KiChjang commented Mar 14, 2017

@alanhoff Are you able to reproduce the test failures locally on your machine?

@jdm
Copy link
Member

jdm commented Mar 15, 2017

Does the test pass locally with --no-pause-after-test? That flag ensures that the test is run in a headless environment.

@nox nox removed the S-awaiting-review label Mar 15, 2017
@alanhoff
Copy link
Author

alanhoff commented Mar 16, 2017

@jdm it completes without error

./mach test tests/wpt/mozilla/tests/mozilla/resizeTo.html --no-pause-after-test
Running 1 tests in web-platform-tests

Ran 1 tests finished in 53.0 seconds.
  • 1 ran as expected. 0 tests skipped.

Tests completed in 57.49s
@alanhoff
Copy link
Author

alanhoff commented Mar 16, 2017

@KiChjang I don't know exactly the commend that the test runner used to yield that error, could you help me with that?

@jdm
Copy link
Member

jdm commented Mar 16, 2017

I'm not sure why the test take almost 60s for you, but when I run ./mach test-wpt tests/wpt/mozilla/tests/mozilla/resizeTo.html --no-pause-after-test locally it takes about 5s for me. I'm really confused about why the build machines are timing out :<

@bors-servo
Copy link
Contributor

bors-servo commented Jun 19, 2017

The latest upstream changes (presumably #17410) made this pull request unmergeable. Please resolve the merge conflicts.

@nox
Copy link
Member

nox commented Oct 7, 2017

@alanhoff Do you need help with this?

@jdm
Copy link
Member

jdm commented Oct 8, 2017

@nox I need help figuring out why the test works locally and times out on the build machines.

@dralley
Copy link
Contributor

dralley commented Apr 14, 2020

Since Glutin is going away and the issues with this PR were never fixed, it can be closed :(

This is still a problem however, even with the Surfman + Winit PR branch, so the issue should stay open.

@jdm jdm closed this Apr 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

8 participants
You can’t perform that action at this time.