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

Improve the clipping and scrolling API #1428

Merged
merged 4 commits into from Jul 10, 2017
Merged

Conversation

@mrobinson
Copy link
Member

mrobinson commented Jun 24, 2017

This branch includes two improvements to the clipping and scrolling API:

  1. Create DisplayListBuilder::define_scroll_frame API which avoids having to guess when a Clip item should create a ScrollFrame and when it shouldn't. Additionally, this removes a lot of weirdness around whether a ScrollFrame's clip starts at the origin of the ScrollFrame or not. It doesn't matter any longer, because the Clip created for the ScrollFrame is entirely independent.
  2. Make all clipping coordinates relative to the StackingContext. This was whirlpool of weirdness in the API that only caused confusion. We now hide this detail, making clip coordinates the same as any other coordinates.

There are a few other small cleanups included with this, such as remove the push_clip_node and pop_clip_node APIs.


This change is Reviewable

@mrobinson mrobinson requested review from kvark and glennw Jun 24, 2017
@glennw
Copy link
Member

glennw commented Jun 24, 2017

@mrobinson Do you have Servo branch with API updates for this and the previous PR? Would be good to be able to do some testing with Servo and land a WR update once this is reviewed and merged.

@mrobinson mrobinson force-pushed the mrobinson:scroll-clip-api branch from 6371218 to 6b5a3a1 Jun 29, 2017
@mrobinson
Copy link
Member Author

mrobinson commented Jun 29, 2017

I've pushed a new commit to this branch and the Servo part of this PR is available here: https://github.com/mrobinson/servo/tree/webrender-update.

@bors-servo
Copy link
Contributor

bors-servo commented Jun 30, 2017

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

@mrobinson mrobinson force-pushed the mrobinson:scroll-clip-api branch 2 times, most recently from c3a09cd to 82a4153 Jun 30, 2017
This makes it explicit whether or not you are creating a ScrollFrame
when using the API. Before this was based on the content size of the
clip, which was awkward and could lead to weird situations where you
created a ScrollFrame when you didn't mean to or the reverse.

Fixes #1335.
@staktrace
Copy link
Contributor

staktrace commented Jul 7, 2017

@glennw or @kvark , can we get this one reviewed and landed? It is needed in order to do a WR update in gecko. (Well, we either need this or #1459, but this is the correct solution and #1459 is just a temp workaround).

@mrobinson
Copy link
Member Author

mrobinson commented Jul 7, 2017

I just noticed the reftest failure here. I'm looking at this now.

mrobinson added 3 commits Jun 24, 2017
Clip coordinates previously used a weird coordinate space relative to
the origin of the display item. This was different than every other
coordinate specified in the display list, so we smooth over this
wrinkle. To do this we need to copy out the complex clips from the
auxiliary list and adjust them so that they are relative to the scroll
clip node.

Fixes #1090.
Fixes #1408.
This is a slight revert of the removal of per-item complex clips, but
these clips are important for Servo.
This is necessary because of the changes to the API.
@mrobinson mrobinson force-pushed the mrobinson:scroll-clip-api branch from e5f754a to 957ded1 Jul 7, 2017
@mrobinson
Copy link
Member Author

mrobinson commented Jul 7, 2017

Okay. The latest version of the PR fixes the typo in the ref test, but one of the jobs seemed to fail due to an error on the bot. I'll rerun that particular configuration.

@glennw
Copy link
Member

glennw commented Jul 9, 2017

Reviewed 16 of 27 files at r1, 15 of 15 files at r2, 3 of 3 files at r3.
Review status: all files reviewed at latest revision, all discussions resolved.


Comments from Reviewable

@glennw
glennw approved these changes Jul 9, 2017
Copy link
Member

glennw left a comment

This seems like a much cleaner API, nice!

@glennw
Copy link
Member

glennw commented Jul 9, 2017

Let's get this merged, and try to get both Servo and Gecko updated to the API changes this week :)

@bors-servo r+

@bors-servo
Copy link
Contributor

bors-servo commented Jul 9, 2017

📌 Commit 957ded1 has been approved by glennw

@bors-servo
Copy link
Contributor

bors-servo commented Jul 9, 2017

Testing commit 957ded1 with merge b9cfcc5...

bors-servo added a commit that referenced this pull request Jul 9, 2017
Improve the clipping and scrolling API

This branch includes two improvements to the clipping and scrolling API:

1. Create `DisplayListBuilder::define_scroll_frame` API which avoids having to guess when a Clip item should create a ScrollFrame and when it shouldn't. Additionally, this removes a lot of weirdness around whether a ScrollFrame's clip starts at the origin of the ScrollFrame or not. It doesn't matter any longer, because the Clip created for the ScrollFrame is entirely independent.
2. Make all clipping coordinates relative to the StackingContext. This was whirlpool of weirdness in the API that only caused confusion. We now hide this detail, making clip coordinates the same as any other coordinates.

There are a few other small cleanups included with this, such as remove the `push_clip_node` and `pop_clip_node` APIs.

<!-- 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/1428)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Jul 9, 2017

💔 Test failed - status-travis

@glennw
Copy link
Member

glennw commented Jul 9, 2017

@bors-servo retry

  • Looks like a nightly-specific compile error in a dependency? Let's just confirm it's consistent...
@bors-servo
Copy link
Contributor

bors-servo commented Jul 9, 2017

Testing commit 957ded1 with merge 84d1044...

bors-servo added a commit that referenced this pull request Jul 9, 2017
Improve the clipping and scrolling API

This branch includes two improvements to the clipping and scrolling API:

1. Create `DisplayListBuilder::define_scroll_frame` API which avoids having to guess when a Clip item should create a ScrollFrame and when it shouldn't. Additionally, this removes a lot of weirdness around whether a ScrollFrame's clip starts at the origin of the ScrollFrame or not. It doesn't matter any longer, because the Clip created for the ScrollFrame is entirely independent.
2. Make all clipping coordinates relative to the StackingContext. This was whirlpool of weirdness in the API that only caused confusion. We now hide this detail, making clip coordinates the same as any other coordinates.

There are a few other small cleanups included with this, such as remove the `push_clip_node` and `pop_clip_node` APIs.

<!-- 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/1428)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Jul 9, 2017

💔 Test failed - status-travis

@glennw
Copy link
Member

glennw commented Jul 10, 2017

This appears to be broken on nightly due to this change rust-lang/rust#34537 which is causing a compile error in core-text.

A change has been made in core-text to fix this servo/core-text-rs@6847e69 but it hasn't been version bumped / published yet.

If it requires a major version bump in core-text, that could take quite a while to get all deps updated. Perhaps we could disable building WR on nightly temporarily, since we really need to get this PR (and a few others) landed soon.

Thoughts @nox @jdm @kvark ?

@glennw
Copy link
Member

glennw commented Jul 10, 2017

#1462 has landed now, which should fix the CI error here.

@bors-servo retry

@bors-servo
Copy link
Contributor

bors-servo commented Jul 10, 2017

Testing commit 957ded1 with merge 519e519...

bors-servo added a commit that referenced this pull request Jul 10, 2017
Improve the clipping and scrolling API

This branch includes two improvements to the clipping and scrolling API:

1. Create `DisplayListBuilder::define_scroll_frame` API which avoids having to guess when a Clip item should create a ScrollFrame and when it shouldn't. Additionally, this removes a lot of weirdness around whether a ScrollFrame's clip starts at the origin of the ScrollFrame or not. It doesn't matter any longer, because the Clip created for the ScrollFrame is entirely independent.
2. Make all clipping coordinates relative to the StackingContext. This was whirlpool of weirdness in the API that only caused confusion. We now hide this detail, making clip coordinates the same as any other coordinates.

There are a few other small cleanups included with this, such as remove the `push_clip_node` and `pop_clip_node` APIs.

<!-- 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/1428)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Jul 10, 2017

☀️ Test successful - status-travis
Approved by: glennw
Pushing 519e519 to master...

@bors-servo bors-servo merged commit 957ded1 into servo:master Jul 10, 2017
4 checks passed
4 checks passed
code-review/reviewable 34 files reviewed
Details
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:scroll-clip-api 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

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