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

Allow a layer to mask its children to its boundaries #110

Closed
wants to merge 2 commits into from

Conversation

@mrobinson
Copy link
Member

mrobinson commented Sep 16, 2014

This allows preventing iframes from overlowing their boundaries.

@zwarich
Copy link
Contributor

zwarich commented Sep 16, 2014

Would it be better to allow a layer to clip to its bounds and instead express this through nesting of layers? That would obviously be harder to fit into what we have today.

@mrobinson
Copy link
Member Author

mrobinson commented Sep 16, 2014

Yeah, my original goal here was to implement masks_to_bounds. There is some more work to do on scrolling before that is possible though. Right now root layers expand to the size of their children, which enables them to scroll properly. We need to refactor scrolling so that can happen with a root layer that defines the clipping region of all of its children.

I plan to tackle this soon after the next couple patches.

mrobinson added 2 commits Sep 9, 2014
This allows preventing iframes from overlowing their boundaries.
This will be used by the compositor so that the top-level root layer
can track window size.
@mrobinson mrobinson force-pushed the mrobinson:clip-rect branch from d2e690a to f387b00 Sep 17, 2014
@mrobinson mrobinson changed the title Allow setting a layer clip rect Allow a layer to mask its children to its boundaries Sep 17, 2014
@mrobinson
Copy link
Member Author

mrobinson commented Sep 17, 2014

Okay. I reworked this using the "masks to bounds" paradigm. Things are working pretty well on the Servo side because of this, moving the needle on iframe scrolling from not working at all to mostly broken. :)

@mrobinson
Copy link
Member Author

mrobinson commented Sep 23, 2014

Looks like it's hard to do this in a way that doesn't interfere with scrolling. Going to abandon this version for one that properly handles iframe scrolling.

@mrobinson mrobinson closed this Sep 24, 2014
@mrobinson mrobinson deleted the mrobinson:clip-rect branch Sep 24, 2014
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

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