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

scroll_offset_query returns inner scrolls #17346

Closed
wants to merge 1 commit into from

Conversation

@pyfisch
Copy link
Contributor

pyfisch commented Jun 15, 2017

Before this change scroll_offset_query returned the
next scroll offset in the parents of the node.
If there was no scroll offset it returned the window
scroll offset.
Now if no scrolls are present a zero scroll is returned
ignoring window scrolling.
This solves a bug for element.scrollLeft/Top returning wrong
values.

closes #17342


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • These changes fix #__ (github issue number if applicable).
  • There are tests for these changes OR
  • These changes do not require tests because _____

This change is Reviewable

Before this change scroll_offset_query returned the
next scroll offset in the parents of the node.
If there was no scroll offset it returned the window
scroll offset.
Now if no scrolls are present a zero scroll is returned
ignoring window scrolling.
This solves a bug for element.scrollLeft/Top returning wrong
values.

closes #17342
@highfive
Copy link

highfive commented Jun 15, 2017

Heads up! This PR modifies the following files:

  • @fitzgen: components/script/dom/window.rs
  • @KiChjang: components/script/dom/window.rs
@highfive
Copy link

highfive commented Jun 15, 2017

warning Warning warning

  • These commits modify script code, but no tests are modified. Please consider adding a test!
@pyfisch
Copy link
Contributor Author

pyfisch commented Jun 15, 2017

@bors-servo
Copy link
Contributor

bors-servo commented Jun 15, 2017

Trying commit b9a348b with merge a4d4dfa...

bors-servo added a commit that referenced this pull request Jun 15, 2017
scroll_offset_query returns inner scrolls

Before this change scroll_offset_query returned the
next scroll offset in the parents of the node.
If there was no scroll offset it returned the window
scroll offset.
Now if no scrolls are present a zero scroll is returned
ignoring window scrolling.
This solves a bug for element.scrollLeft/Top returning wrong
values.

closes #17342

r? @emilio

<!-- Please describe your changes on the following line: -->

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

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

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- 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/17346)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Jun 15, 2017

💔 Test failed - linux-rel-wpt

@jdm
Copy link
Member

jdm commented Jun 15, 2017

  ▶ Unexpected subtest result in /cssom-view/elementScroll.html:
  │ FAIL [expected PASS] Element scrollTop/Left getter/setter test
  │   → assert_equals: changed scrollTop should be 40 expected 30 but got 0
  │ 
  │ window.onload/<@http://web-platform.test:8000/cssom-view/elementScroll.html:50:13
  │ Test.prototype.step@http://web-platform.test:8000/resources/testharness.js:1406:20
  │ test@http://web-platform.test:8000/resources/testharness.js:497:9
  └ window.onload@http://web-platform.test:8000/cssom-view/elementScroll.html:43:9

  ▶ Unexpected subtest result in /cssom-view/elementScroll.html:
  │ FAIL [expected PASS] Element scrollTo test
  │   → assert_equals: changed scrollLeft should be 70 expected 80 but got 0
  │ 
  │ window.onload/<@http://web-platform.test:8000/cssom-view/elementScroll.html:64:13
  │ Test.prototype.step@http://web-platform.test:8000/resources/testharness.js:1406:20
  │ test@http://web-platform.test:8000/resources/testharness.js:497:9
  └ window.onload@http://web-platform.test:8000/cssom-view/elementScroll.html:61:9

  ▶ Unexpected subtest result in /cssom-view/elementScroll.html:
  │ FAIL [expected PASS] Element scroll test
  │   → assert_equals: changed scrollLeft should be 60 expected 50 but got 0
  │ 
  │ window.onload/<@http://web-platform.test:8000/cssom-view/elementScroll.html:57:13
  │ Test.prototype.step@http://web-platform.test:8000/resources/testharness.js:1406:20
  │ test@http://web-platform.test:8000/resources/testharness.js:497:9
  └ window.onload@http://web-platform.test:8000/cssom-view/elementScroll.html:54:9

  ▶ Unexpected subtest result in /cssom-view/elementScroll.html:
  │ FAIL [expected PASS] cssom-view - elementScroll
  │   → assert_equals: increment of scrollLeft should be 10 expected 10 but got 0
  │ 
  │ window.onload/<@http://web-platform.test:8000/cssom-view/elementScroll.html:74:13
  │ Test.prototype.step@http://web-platform.test:8000/resources/testharness.js:1406:20
  │ test@http://web-platform.test:8000/resources/testharness.js:497:9
  └ window.onload@http://web-platform.test:8000/cssom-view/elementScroll.html:68:9

  ▶ Unexpected subtest result in /html/browsers/browsing-the-web/scroll-to-fragid/003.html:
  │ FAIL [expected PASS] Fragment Navigation: Updating scroll position
  │   → assert_true: expected true got false
  │ 
  │ @http://web-platform.test:8000/html/browsers/browsing-the-web/scroll-to-fragid/003.html:17:3
  │ Test.prototype.step@http://web-platform.test:8000/resources/testharness.js:1406:20
  │ test@http://web-platform.test:8000/resources/testharness.js:497:9
  └ @http://web-platform.test:8000/html/browsers/browsing-the-web/scroll-to-fragid/003.html:12:1
@pyfisch
Copy link
Contributor Author

pyfisch commented Jun 16, 2017

Closing this since it surfaces other problems. Currently modifying one scrollTop changes the scrollTop of all elements.

@pyfisch pyfisch closed this Jun 16, 2017
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.

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