Skip to content

Used shared clips for overflow:hidden and CSS clip - #16336

Merged
bors-servo merged 1 commit into
servo:masterfrom
mrobinson:overflow-hidden
Apr 17, 2017
Merged

bors-servo merged 1 commit into
servo:masterfrom
mrobinson:overflow-hidden

Conversation

@mrobinson

@mrobinson mrobinson commented Apr 10, 2017 •

Copy link
Copy Markdown
Member

Instead of passing down a complex clipping region to each item, used
shared clipping to handle overflow:hidden and CSS clips. In addition to
being more efficient, this should also fix quite a few issues related
to absolutely positioned elements.

One existing reftest is slightly modified to avoid tickling a quirk
with the way that WebRender rasterizes masks. We are working out how to
best express these combined masks with the API or need to. The change
does not affect the original subject of the reftest.

Fixes #13109.
Fixes #10151.
Fixes #7575.
Fixes #8074.


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

This change is Reviewable

@highfive

Copy link
Copy Markdown

Heads up! This PR modifies the following files:

  • @emilio: components/layout/display_list_builder.rs, components/layout/block.rs, components/layout/webrender_helpers.rs, components/layout/flow.rs

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Apr 10, 2017
@mrobinson
mrobinson requested review from glennw and pcwalton and removed request for glennw and pcwalton April 10, 2017 15:03
@mrobinson

Copy link
Copy Markdown
Member Author

@bors-servo try

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Trying commit 2721514 with merge 7ba2a0e...

bors-servo pushed a commit that referenced this pull request Apr 10, 2017
Used shared clips for overflow:hidden and CSS clip

Instead of passing down a complex clipping region to each item, used
shared clipping to handle overflow:hidden and CSS clips. In addition to
being more efficient, this should also fix quite a few issues related
to absolutely positioned elements.

One existing reftest is slightly modified to avoid tickling a quirk
with the way that WebRender rasterizes masks. We are working out how to
best express these combined masks with the API or need to. The change
does not affect the original subject of the reftest.

Fixes #13109.
Fixes #10151.
Fixes #7575.
Fixes #8074.

<!-- 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
- [x] These changes fix #13109, #10151, #7575, #8074.

<!-- 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/16336)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - arm64

@highfive highfive added the S-tests-failed The changes caused existing tests to fail. label Apr 10, 2017
@glennw

glennw commented Apr 10, 2017

Copy link
Copy Markdown
Member

Reviewed 15 of 15 files at r1.
Review status: all files reviewed at latest revision, 3 unresolved discussions, some commit checks failed.


components/layout/block.rs, line 1787 at r1 (raw file):

    /// parent does not know where the child's absolute position is at the time it assigns clipping
    /// regions, because flows compute their own absolute positions.
    fn switch_coordinate_system_if_necessary(&mut self) {

Super happy to see this function removed!


components/layout/display_list_builder.rs, line 580 at r1 (raw file):

        // Adjust the clipping region as necessary to account for `border-radius`.
        let border_radii = build_border_radius(absolute_bounds, style.get_border());
        let clip = if !border_radii.is_square() {

nit: This could probably be simplified - moving the creation of the clip outside the conditional.


components/layout/display_list_builder.rs, line 1871 at r1 (raw file):

}

pub struct PreservedDisplayListState {

Add a comment explaining when / how the preserved state is used?


Comments from Reviewable

@glennw

glennw commented Apr 10, 2017

Copy link
Copy Markdown
Member

@mrobinson This looks great! Added a few nits, and the manifest check failed on CI.

@jdm jdm assigned glennw and unassigned jdm Apr 11, 2017
@jdm jdm added S-needs-code-changes Changes have not yet been made that were requested by a reviewer. and removed S-awaiting-review There is new code that needs to be reviewed. labels Apr 11, 2017
@highfive highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-tests-failed The changes caused existing tests to fail. S-needs-code-changes Changes have not yet been made that were requested by a reviewer. labels Apr 11, 2017
@mrobinson

Copy link
Copy Markdown
Member Author

Review status: 13 of 15 files reviewed at latest revision, 2 unresolved discussions.


components/layout/display_list_builder.rs, line 580 at r1 (raw file):

Previously, glennw (Glenn Watson) wrote…

nit: This could probably be simplified - moving the creation of the clip outside the conditional.

Done.


components/layout/display_list_builder.rs, line 1871 at r1 (raw file):

Previously, glennw (Glenn Watson) wrote…

Add a comment explaining when / how the preserved state is used?

Done.


Comments from Reviewable

@glennw

glennw commented Apr 11, 2017

Copy link
Copy Markdown
Member

@bors-servo r+

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit 903230a has been approved by glennw

@highfive highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Apr 11, 2017
@highfive highfive added S-awaiting-review There is new code that needs to be reviewed. and removed S-tests-failed The changes caused existing tests to fail. labels Apr 13, 2017
@mrobinson

Copy link
Copy Markdown
Member Author

@bors-servo try

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Trying commit 7b3abcb with merge df0e7b1...

bors-servo pushed a commit that referenced this pull request Apr 13, 2017
Used shared clips for overflow:hidden and CSS clip

Instead of passing down a complex clipping region to each item, used
shared clipping to handle overflow:hidden and CSS clips. In addition to
being more efficient, this should also fix quite a few issues related
to absolutely positioned elements.

One existing reftest is slightly modified to avoid tickling a quirk
with the way that WebRender rasterizes masks. We are working out how to
best express these combined masks with the API or need to. The change
does not affect the original subject of the reftest.

Fixes #13109.
Fixes #10151.
Fixes #7575.
Fixes #8074.

<!-- 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
- [x] These changes fix #13109, #10151, #7575, #8074.

<!-- 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/16336)
<!-- Reviewable:end -->
@stshine

stshine commented Apr 13, 2017

Copy link
Copy Markdown
Contributor

I tried to fetch this branch and compiled it, but reddit looks worse in it when scrolling. Hope everything is right ...

@mrobinson

Copy link
Copy Markdown
Member Author

@stshine I'm investigating these problems now. Thanks for bringing them to my attention!

@mrobinson

Copy link
Copy Markdown
Member Author

Looks like this PR exposed a WebRender bug. I have a PR to fix it here: servo/webrender#1114. This should wait to land until we do a WebRender update.

@bors-servo

Copy link
Copy Markdown
Contributor

💥 Test timed out

@mrobinson

Copy link
Copy Markdown
Member Author

This should probably wait until #16463 lands to be rebased and reviewed. The changes here will exacerbate problems fixed in that PR.

@bors-servo

Copy link
Copy Markdown
Contributor

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

@highfive highfive added the S-needs-rebase There are merge conflict errors. label Apr 17, 2017
Instead of passing down a complex clipping region to each item, used
shared clipping to handle overflow:hidden and CSS clips. In addition to
being more efficient, this should also fix quite a few issues related
to absolutely positioned elements.

One existing reftest is slightly modified to avoid tickling a quirk
with the way that WebRender rasterizes masks. We are working out how to
best express these combined masks with the API or need to. The change
does not affect the original subject of the reftest.

Fixes servo#13109.
Fixes servo#10151.
Fixes servo#7575.
Fixes servo#8074.
Fixes servo#8780.
@mrobinson

Copy link
Copy Markdown
Member Author

Okay. This change should be good to go now.

@glennw

glennw commented Apr 17, 2017

Copy link
Copy Markdown
Member

@bors-servo r+

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit 4451b8a has been approved by glennw

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. S-needs-rebase There are merge conflict errors. labels Apr 17, 2017
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 4451b8a with merge ab7e1e2...

bors-servo pushed a commit that referenced this pull request Apr 17, 2017
Used shared clips for overflow:hidden and CSS clip

Instead of passing down a complex clipping region to each item, used
shared clipping to handle overflow:hidden and CSS clips. In addition to
being more efficient, this should also fix quite a few issues related
to absolutely positioned elements.

One existing reftest is slightly modified to avoid tickling a quirk
with the way that WebRender rasterizes masks. We are working out how to
best express these combined masks with the API or need to. The change
does not affect the original subject of the reftest.

Fixes #13109.
Fixes #10151.
Fixes #7575.
Fixes #8074.

<!-- 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
- [x] These changes fix #13109, #10151, #7575, #8074.

<!-- 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/16336)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

☀️ 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: glennw
Pushing ab7e1e2 to master...

@bors-servo
bors-servo merged commit 4451b8a into servo:master Apr 17, 2017
@highfive highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Apr 17, 2017
@mrobinson
mrobinson deleted the overflow-hidden branch April 17, 2017 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

7 participants