Skip to content

[WIP] fix scroll area about scrollHeight and scrollWidth - #19469

Closed
tigercosmos wants to merge 1 commit into
servo:masterfrom
tigercosmos:z1
Closed

tigercosmos wants to merge 1 commit into
servo:masterfrom
tigercosmos:z1

Conversation

@tigercosmos

@tigercosmos tigercosmos commented Dec 3, 2017 •

Copy link
Copy Markdown
Contributor

Currently scrollHeight will get the result that max(height + padding, margin)
It should be scrollHeight = height + padding + margin
Same as scrollWidth


  • There are tests for these changes OR
  • These changes do not require tests because _____

This change is Reviewable

@highfive

highfive commented Dec 3, 2017

Copy link
Copy Markdown

Heads up! This PR modifies the following files:

  • @emilio: components/layout/query.rs

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Dec 3, 2017
@tigercosmos

Copy link
Copy Markdown
Contributor Author

@bors-servo try

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Trying commit 9d08a35 with merge 9a684b4...

bors-servo pushed a commit that referenced this pull request Dec 3, 2017
[WIP] fix scroll area about scrollHeight and scrollWidth

<!-- Please describe your changes on the following line: -->
Currently `scrollHeight` will get the result that `max(height + padding, margin)`
It should be `scrollHeight = height + padding + margin`

---
<!-- 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 #19280 (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/19469)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - android

@highfive highfive added the S-tests-failed The changes caused existing tests to fail. label Dec 3, 2017
@tigercosmos

Copy link
Copy Markdown
Contributor Author

@jdm

jdm commented Dec 3, 2017

Copy link
Copy Markdown
Member

That is a problem affecting many PRs right now that we don't understand yet :(

@tigercosmos

Copy link
Copy Markdown
Contributor Author

@jdm This PR has many PASS, but is also has many TIMEOUT. How could I determine this change is fine? Is TIMEOUT intermittent? maybe try again?

@@ -463,16 +463,16 @@ impl FragmentBorderBoxIterator for UnioningFragmentScrollAreaIterator {
let bottom_padding = (border_box.size.height.to_f32_px() - bottom_border - top_border) as i32;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This looks somewhat fishy to me, in the sense that margin accounts for writing-mode, but not padding... Not that it wasn't wrong before, though...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Are you saying bottom_padding here is weird? What is writing-mode?

let left = max(iterator.union_rect.origin.x, iterator.origin_rect.origin.x);
Rect::new(Point2D::new(left, iterator.origin_rect.origin.y),
Size2D::new(iterator.origin_rect.size.width, bottom))
Size2D::new(iterator.union_rect.size.width, bottom))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

So, this also includes left and top margins, right? That looks wrong per https://drafts.csswg.org/cssom-view/#scrolling-area, isn't it?

@emilio

emilio commented Dec 4, 2017

Copy link
Copy Markdown
Member

All the passes and timeouts are known-intermittent.

@emilio

emilio commented Dec 4, 2017

Copy link
Copy Markdown
Member

@bors-servo try

@tigercosmos

Copy link
Copy Markdown
Contributor Author

@emilio this commit is for scroll area, and I try before.
#19478 need to fix first

@KiChjang

KiChjang commented Dec 7, 2017

Copy link
Copy Markdown
Contributor

@bors-servo try

@KiChjang

KiChjang commented Dec 7, 2017

Copy link
Copy Markdown
Contributor

@bors-servo retry

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Trying commit 9d08a35 with merge 69e24cf...

bors-servo pushed a commit that referenced this pull request Dec 7, 2017
[WIP] fix scroll area about scrollHeight and scrollWidth

<!-- Please describe your changes on the following line: -->
Currently `scrollHeight` will get the result that `max(height + padding, margin)`
It should be `scrollHeight = height + padding + margin`
Same as `scrollWidth`

---
<!-- 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 #19280 (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/19469)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - android

@highfive highfive added the S-tests-failed The changes caused existing tests to fail. label Dec 7, 2017
@tigercosmos

Copy link
Copy Markdown
Contributor Author
{"status": "FAIL", "group": "default", "message": "assert_equals: scrollWidth should be 700 expected 700 but got 660", "stack": "nonQuirksFrame.onload/<@http://web-platform.test:8000/css/cssom-view/scrolling-quirks-vs-nonquirks.html:189:5\nTest.prototype.step@http://web-platform.test:8000/resources/testharness.js:1489:20\ntest@http://web-platform.test:8000/resources/testharness.js:511:9\nnonQuirksFrame.onload@http://web-platform.test:8000/css/cssom-view/scrolling-quirks-vs-nonquirks.html:188:3\n", "subtest": "scrollWidth/scrollHeight on the HTML body element in non-quirks mode", "test": "/css/cssom-view/scrolling-quirks-vs-nonquirks.html", "line": 128714, "action": "test_result", "expected": "PASS"}
{"status": "FAIL", "group": "default", "message": "assert_equals: initial scrollWidth should be 510 expected 510 but got 310", "stack": "@http://web-platform.test:8000/css/cssom-view/elementScroll-002.html:70:9\nTest.prototype.step@http://web-platform.test:8000/resources/testharness.js:1489:20\ntest@http://web-platform.test:8000/resources/testharness.js:511:9\n@http://web-platform.test:8000/css/cssom-view/elementScroll-002.html:67:5\n", "subtest": "Element scrollHeight/scrollWidth getter test with padding + height/width + margin", "test": "/css/cssom-view/elementScroll-002.html", "line": 148747, "action": "test_result", "expected": "PASS"}
{"status": "FAIL", "group": "default", "message": "assert_equals: initial scrollWidth should be 500 expected 500 but got 300", "stack": "@http://web-platform.test:8000/css/cssom-view/elementScroll-002.html:76:9\nTest.prototype.step@http://web-platform.test:8000/resources/testharness.js:1489:20\ntest@http://web-platform.test:8000/resources/testharness.js:511:9\n@http://web-platform.test:8000/css/cssom-view/elementScroll-002.html:73:5\n", "subtest": "Element scrollHeight/scrollWidth getter test with height/width + margin", "test": "/css/cssom-view/elementScroll-002.html", "line": 148748, "action": "test_result", "expected": "PASS"}

@tigercosmos
tigercosmos deleted the z1 branch June 17, 2018 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-awaiting-review There is new code that needs to be reviewed. S-tests-failed The changes caused existing tests to fail.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

element.clientHeight & element.scrollHeight incomplete implement

6 participants