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

Scroll via HitTester #2736

Merged
merged 1 commit into from May 8, 2018
Merged

Conversation

@mrobinson
Copy link
Member

mrobinson commented May 7, 2018

This change uses the HitTester to do scrolling, which allows us to
remove some redundant code. It also will help us to remove bounds for
reference frames, which will be useful when we separate the concept of
reference frames and stacking contexts.


This change is Reviewable

@mrobinson
Copy link
Member Author

mrobinson commented May 7, 2018

r? anyone

Copy link
Member

kvark left a comment

Nice! A few concerns (minor) from me

let mut should_render = true;
let node_index = match doc.hit_tester {
Some(ref hit_tester) => {
let test = HitTest::new(None, cursor, HitTestFlags::empty());

This comment has been minimized.

@kvark

kvark May 7, 2018

Member

since this is where we have the node index and this is where checking for scroll_nearest_scrolling_ancestor is really needed, can we rewrite this part as:

let should_render = match doc.hit_tester {
...
};

This comment has been minimized.

@mrobinson

mrobinson May 8, 2018

Author Member

This bit of ugliness is necessary to avoid a double-borrow of doc, unfortunately. I can leave a comment about that.

_ => {}
}

return self.find_nearest_scrolling_ancestor(node.parent)

This comment has been minimized.

@kvark

kvark May 7, 2018

Member

nit: let's move this into _ => arm and remove return calls

This comment has been minimized.

@mrobinson

mrobinson May 8, 2018

Author Member

Sure thing.

*/

// Assumes rect is in the z=0 plane!
pub fn ray_intersects_rect(

This comment has been minimized.

@kvark

kvark May 7, 2018

Member

oh god, so nice to see the cleanup here!

}

let clip_chain_index = clip_and_scroll.clip_chain_index;
clipped_in |=

This comment has been minimized.

@kvark

kvark May 7, 2018

Member

should probably avoid calling this method if clipped_in is already true

This comment has been minimized.

@mrobinson

mrobinson May 8, 2018

Author Member

Yikes! Thanks for pointing out this bug. This should really be

clipped_in = clipped_in || 
    self.is_point_clipped_in_for_clip_chain(point, clip_chain_index, &mut test);

so that we can rely on short-circuit logic. If it's okay with you, I'll do this in another PR since the change is unrelated to this one.

This comment has been minimized.

@mrobinson

mrobinson May 8, 2018

Author Member

A fix for this has landed here: #2739

This change uses the HitTester to do scrolling, which allows us to
remove some redundant code. It also will help us to remove bounds for
reference frames, which will be useful when we separate the concept of
reference frames and stacking contexts.
@mrobinson mrobinson force-pushed the mrobinson:hit-testing-scroll-node branch from c8f0625 to f5d899e May 8, 2018
@kvark
Copy link
Member

kvark commented May 8, 2018

Cool, thanks!
@bors-servo r+

@bors-servo
Copy link
Contributor

bors-servo commented May 8, 2018

📌 Commit f5d899e has been approved by kvark

@bors-servo
Copy link
Contributor

bors-servo commented May 8, 2018

Testing commit f5d899e with merge f3d34e4...

bors-servo added a commit that referenced this pull request May 8, 2018
Scroll via HitTester

This change uses the HitTester to do scrolling, which allows us to
remove some redundant code. It also will help us to remove bounds for
reference frames, which will be useful when we separate the concept of
reference frames and stacking contexts.

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

bors-servo commented May 8, 2018

💔 Test failed - status-taskcluster

@mrobinson
Copy link
Member Author

mrobinson commented May 8, 2018

Interesting. Looks like a rawtest failure, but I'm not sure how this change could affect it:

thread 'main' panicked at 'assertion failed: called.load(Ordering::SeqCst) == 1', wrench/src/rawtest.rs:175:9
@kvark
Copy link
Member

kvark commented May 8, 2018

@mrobinson I'm tempted to say let's disable the raw tests for now. They were enabled recently and we can re-enable them without disrupting the other changes, hopefully.
@jrmuizel are you ok with this?

@Gankra
Copy link
Contributor

Gankra commented May 8, 2018

@kvark
Copy link
Member

kvark commented May 8, 2018

@bors-servo retry

bors-servo added a commit that referenced this pull request May 8, 2018
Scroll via HitTester

This change uses the HitTester to do scrolling, which allows us to
remove some redundant code. It also will help us to remove bounds for
reference frames, which will be useful when we separate the concept of
reference frames and stacking contexts.

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

bors-servo commented May 8, 2018

Testing commit f5d899e with merge 8d895b3...

@bors-servo
Copy link
Contributor

bors-servo commented May 8, 2018

☀️ Test successful - status-appveyor, status-taskcluster
Approved by: kvark
Pushing 8d895b3 to master...

@bors-servo bors-servo merged commit f5d899e into servo:master May 8, 2018
3 checks passed
3 checks passed
Taskcluster (pull_request) TaskGroup: success
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
homu Test successful
Details
@bors-servo bors-servo mentioned this pull request May 8, 2018
3 of 3 tasks complete
@mrobinson mrobinson deleted the mrobinson:hit-testing-scroll-node branch May 9, 2018
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.