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

Fix clamping of scroll position in window.scrollBy #16807

Merged
merged 1 commit into from May 11, 2017

Conversation

@mrobinson
Copy link
Member

mrobinson commented May 11, 2017

For rightward and downward overflow the spec says:

Let x be max(0, min(x, viewport scrolling area width - viewport width)).
Let y be max(0, min(y, viewport scrolling area height - viewport height)).

Previously, those operations were reversed, which created negative
overflow even when the overflow direction was downward. This change
ensures that Servo matches spec behavior.


  • ./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

@highfive
Copy link

highfive commented May 11, 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 May 11, 2017

warning Warning warning

  • These commits include an empty title element (<title></title>). Consider adding appropriate metadata.
@mrobinson mrobinson force-pushed the mrobinson:scroll-clamping branch from 9d0a235 to 0bcb4a9 May 11, 2017
@emilio
Copy link
Member

emilio commented May 11, 2017

@bors-servo
Copy link
Contributor

bors-servo commented May 11, 2017

📌 Commit 0bcb4a9 has been approved by emilio

@highfive highfive assigned emilio and unassigned mbrubeck May 11, 2017
@bors-servo
Copy link
Contributor

bors-servo commented May 11, 2017

Testing commit 0bcb4a9 with merge 2013456e192eff4f26642c6012109f44183f50b0...

@bors-servo
Copy link
Contributor

bors-servo commented May 11, 2017

💔 Test failed - linux-dev

@jdm
Copy link
Member

jdm commented May 11, 2017

This needs ./mach update-manifest.

For rightward and downward overflow the spec says:

Let x be max(0, min(x, viewport scrolling area width - viewport width)).
Let y be max(0, min(y, viewport scrolling area height - viewport height)).

Previously, those operations were reversed, which created negative
overflow even when the overflow direction was downward. This change
ensures that Servo matches spec behavior.
@mrobinson mrobinson force-pushed the mrobinson:scroll-clamping branch from 0bcb4a9 to b13cf11 May 11, 2017
@mrobinson
Copy link
Member Author

mrobinson commented May 11, 2017

The latest branch includes the new hash from update-manifest.

@jdm
Copy link
Member

jdm commented May 11, 2017

@bors-servo: r=emilio

@bors-servo
Copy link
Contributor

bors-servo commented May 11, 2017

📌 Commit b13cf11 has been approved by emilio

@bors-servo
Copy link
Contributor

bors-servo commented May 11, 2017

Testing commit b13cf11 with merge e196776...

bors-servo added a commit that referenced this pull request May 11, 2017
Fix clamping of scroll position in window.scrollBy

For rightward and downward overflow the spec says:

Let x be max(0, min(x, viewport scrolling area width - viewport width)).
Let y be max(0, min(y, viewport scrolling area height - viewport height)).

Previously, those operations were reversed, which created negative
overflow even when the overflow direction was downward. This change
ensures that Servo matches spec behavior.

<!-- 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: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [x] 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/16807)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented May 11, 2017

☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel-css, linux-rel-wpt, mac-dev-unit, mac-rel-css, mac-rel-wpt1, mac-rel-wpt2, windows-msvc-dev
Approved by: emilio
Pushing e196776 to master...

@bors-servo bors-servo merged commit b13cf11 into servo:master May 11, 2017
2 of 3 checks passed
2 of 3 checks passed
continuous-integration/travis-ci/pr The Travis CI build failed
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
homu Test successful
Details
@mrobinson mrobinson deleted the mrobinson:scroll-clamping branch May 12, 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.

None yet

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