Skip to content

Add slow path for hit testing of iframe behind positioned content layer - #8785

Merged
bors-servo merged 2 commits into
servo:masterfrom
mbrubeck:fixed-hit-test
Dec 3, 2015
Merged

bors-servo merged 2 commits into
servo:masterfrom
mbrubeck:fixed-hit-test

Conversation

@mbrubeck

@mbrubeck mbrubeck commented Dec 2, 2015

Copy link
Copy Markdown
Contributor

Fixes browser.html blocker #8759. r? @pcwalton

This adds a slow path for cases where the compositor's layer-based hit testing is incorrect. If the script task discovers that a mouse event should have been dispatched to an iframe, it bounces the event back to the constellation to be forwarded to the correct pipeline.

This isn't terribly slow (on the slow path, it adds one extra round-trip message between script and constellation), but if we want to optimize this better we could instead replace the compositor's layer hit testing with display list hit testing in the paint task. This would be a more complicated change that I think we should save for a follow-up.

This only fixes mouse input for now. A basically-identical change will be needed for touch-screen input, whether we stick with this approach or switch to the paint task.

Review on Reviewable

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Dec 2, 2015
@pcwalton

pcwalton commented Dec 2, 2015

Copy link
Copy Markdown
Contributor

Just had one nit, otherwise looks good.

@mbrubeck
mbrubeck force-pushed the fixed-hit-test branch 2 times, most recently from 4b300ab to 8eb19d1 Compare December 2, 2015 22:24
@mbrubeck

mbrubeck commented Dec 2, 2015

Copy link
Copy Markdown
Contributor Author

@bors-servo r=pcwalton

Fixed review nit and tidy failures; rebased.

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit 8eb19d1 has been approved by pcwalton

@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. labels Dec 2, 2015
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 8eb19d1 with merge d4fba2a...

bors-servo pushed a commit that referenced this pull request Dec 3, 2015
Add slow path for hit testing of iframe behind positioned content layer

Fixes browser.html blocker #8759. r? @pcwalton

This adds a slow path for cases where the compositor's layer-based hit testing is incorrect.  If the script task discovers that a mouse event should have been dispatched to an iframe, it bounces the event back to the constellation to be forwarded to the correct pipeline.

This isn't terribly slow (on the slow path, it adds one extra round-trip message between script and constellation), but if we want to optimize this better we could instead replace the compositor's layer hit testing with display list hit testing in the paint task.  This would be a more complicated change that I think we should save for a follow-up.

This only fixes mouse input for now.  A basically-identical change will be needed for touch-screen input, whether we stick with this approach or switch to the paint task.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8785)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - gonk

@highfive highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Dec 3, 2015
@KiChjang

KiChjang commented Dec 3, 2015

Copy link
Copy Markdown
Contributor
   Compiling layout v0.0.1 (file:///home/servo/buildbot/slave/gonk/build/ports/gonk)
/home/servo/buildbot/slave/gonk/build/components/layout/display_list_builder.rs:1798:22: 1798:57 warning: unnecessary parentheses around `for` head expression, #[warn(unused_parens)] on by default
/home/servo/buildbot/slave/gonk/build/components/layout/display_list_builder.rs:1798         for index in (0..self.fragments.fragments.len()) {
                                                                                                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/input.rs:9:5: 9:31 error: unresolved import `script_traits::MouseButton`. There is no `MouseButton` in `script_traits` [E0432]
src/input.rs:9 use script_traits::MouseButton;
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~
src/input.rs:9:5: 9:31 help: run `rustc --explain E0432` to see a detailed explanation
error: aborting due to previous error
Could not compile `b2s`.

@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 Dec 3, 2015
* Move some types into the `msg` crate so they can be shared more.
* Use MouseEventType instead of duplicating it in other enums.
…nner window

Fixes servo#8759.

This adds a slow path for cases where the compositor's layer-based hit testing
is incorrect.  To optimize for this case, we could instead replace the
layer hit testing with display-list hit testing done in the paint task.
@mbrubeck

mbrubeck commented Dec 3, 2015

Copy link
Copy Markdown
Contributor Author

@bors-servo r=pcwalton

Fixed import path in ports/gonk

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit 9551363 has been approved by pcwalton

@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. labels Dec 3, 2015
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 9551363 with merge bc62b5a...

bors-servo pushed a commit that referenced this pull request Dec 3, 2015
Add slow path for hit testing of iframe behind positioned content layer

Fixes browser.html blocker #8759. r? @pcwalton

This adds a slow path for cases where the compositor's layer-based hit testing is incorrect.  If the script task discovers that a mouse event should have been dispatched to an iframe, it bounces the event back to the constellation to be forwarded to the correct pipeline.

This isn't terribly slow (on the slow path, it adds one extra round-trip message between script and constellation), but if we want to optimize this better we could instead replace the compositor's layer hit testing with display list hit testing in the paint task.  This would be a more complicated change that I think we should save for a follow-up.

This only fixes mouse input for now.  A basically-identical change will be needed for touch-screen input, whether we stick with this approach or switch to the paint task.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8785)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

☀️ Test successful - android, gonk, linux-dev, linux-rel, mac-dev-ref-unit, mac-rel-css, mac-rel-wpt

@bors-servo
bors-servo merged commit 9551363 into servo:master Dec 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants