Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upelement.clientHeight & element.scrollHeight incomplete implement #19280
Comments
|
I figure out that <div id="scroller" style="height: 100px; width: 100px; overflow: scroll; background: red;">
<div style="background: green; margin-top: 100px; width: 100px; height: 100px;"></div>
</div>to |
|
Seems
<style>
#scroller {
height: 100px;
width: 100px;
overflow: hidden;
background: red;
}
#container {
background: green;
margin-top: 100px;
width: 100px;
height: 30px;
}
</style>
<div id="scroller">
<div id="container"></div>
</div>
<style>
#scroller {
height: 100px;
width: 100px;
overflow: hidden;
background: red;
}
#container {
background: green;
margin-top: 100px;
width: 100px;
height: 190px;
}
</style>
<div id="scroller">
<div id="container"></div>
</div>I also test changing |
|
Something might be related: servo/components/layout/query.rs Lines 135 to 139 in fe4139b servo/components/layout/query.rs Lines 628 to 656 in fe4139b |
|
servo/components/layout/query.rs Lines 874 to 886 in fe4139b |
[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 -->
[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 -->
With the following
test.html:Firefox will get:
Servo will get:
As
clientHeightis a known issue, we may need to check outscrollHeightThis might be an issue related to #19268
servo/components/script/dom/element.rs
Lines 373 to 376 in b2b51d3