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 combined_local_viewport_rect for nested nodes #1114

Merged

Conversation

@mrobinson
Copy link
Member

mrobinson commented Apr 13, 2017

The calculation of the combined_local_viewport_rect was being done
using the accumulated_scroll_offset, but this was not correct, because
the parent combined_local_viewport_rect was already calculated to be
independent of those offsets. This means that the only scrolling offset
that matters is one between the parent and the child.

Add a test for this as well.


This change is Reviewable

The calculation of the combined_local_viewport_rect was being done
using the accumulated_scroll_offset, but this was not correct, because
the parent combined_local_viewport_rect was already calculated to be
independent of those offsets. This means that the only scrolling offset
that matters is one between the parent and the child.

Add a test for this as well.
@mrobinson mrobinson requested review from kvark and glennw Apr 13, 2017
@kvark
kvark approved these changes Apr 13, 2017
Copy link
Member

kvark left a comment

Looks good! Just one question there

NodeType::Clip(_) => {
(*parent_reference_frame_transform,
parent_accumulated_scroll_offset + node.scrolling.offset)
node.scrolling.offset,
node.scrolling.offset + parent_accumulated_scroll_offset)

This comment has been minimized.

@kvark

kvark Apr 13, 2017

Member

why does this still need to use parent_accumulated_scroll_offset?

This comment has been minimized.

@mrobinson

mrobinson Apr 13, 2017

Author Member

The parent_accumulated_scroll_offset is used to setup the content and viewport transformation for each node. In those cases we do need to take into account the combined scroll offsets.

@kvark
Copy link
Member

kvark commented Apr 13, 2017

@bors-servo
Copy link
Contributor

bors-servo commented Apr 13, 2017

📌 Commit ef612d8 has been approved by kvark

@bors-servo
Copy link
Contributor

bors-servo commented Apr 13, 2017

Testing commit ef612d8 with merge 4f8a6f0...

bors-servo added a commit that referenced this pull request Apr 13, 2017
…kvark

Fix combined_local_viewport_rect for nested nodes

The calculation of the combined_local_viewport_rect was being done
using the accumulated_scroll_offset, but this was not correct, because
the parent combined_local_viewport_rect was already calculated to be
independent of those offsets. This means that the only scrolling offset
that matters is one between the parent and the child.

Add a test for this as well.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/webrender/1114)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Apr 13, 2017

☀️ Test successful - status-travis
Approved by: kvark
Pushing 4f8a6f0 to master...

@bors-servo bors-servo merged commit ef612d8 into servo:master Apr 13, 2017
3 checks passed
3 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
@mrobinson mrobinson deleted the mrobinson:clipping-nested-clip-scroll-nodes branch Jul 17, 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

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