You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[regression] hittest issue - iframe in the background take precedence over foreground elements #11108
The deep reason is "this stuff is hard and, for some odd reason, I have ended up writing the spec for it (which is not yet done) despite having very little relevant domain experience". Since there is no spec there is also no implementation yet (although I have a branch of the protocol library which matches the current spec pre-drafts, so one could start implementing the semantics in servo, if one really wanted).
I suspect this is a case where our implementation would help push the spec forward, no? This is obviously not immediately critical, but we should get this done in Q3 if possible.
So per your test case this doesn't seem to be a regression (although it may well have been exposed by some enhancement to WR)—rather, it's a design issue. The problem is that WebRender iterates through scroll layer trees to do hit testing, whereas it really should be iterating through display items. There are two ways to fix this: (a) move the display item-based hit testing code to WebRender; (b) move the layer-to-point-translation code to Servo.
After experimenting with (a), I'm more inclined to pursue strategy (b). That's because we would have to duplicate the hit testing code into WR to keep both paths working, and we'd have to involve WebRender for hit tests even when those hit tests are not done on rendered content (e.g. when initiated by script). The way to make this work is to replace the TranslatePointToLayerSpace API message with a one like GetLayerTreeForHitTest. This would return the scroll offsets and transforms applied to every layer. That tree would be sent from the compositor to the constellation, and the mouse events would be routed (unconditionally) to the script task for the root pipeline. If they hit an iframe, they would be forwarded per the event forwarding logic we already have, and the constellation would be able to consult the stored layer tree information to be able to translate points appropriately through iframe layers. Effectively, this would move all the hit testing logic from WebRender into Servo.
@pcwalton That suggestion sounds good to me. Long term, I think it makes sense to have it in WR and take advantage of the culling trees for performance reasons, but that's certainly something we could consider later - let's just get it working correctly for now.
Activity
paulrouget commentedon May 18, 2016
I thought we could work around that, but it's messing up with the overlay code we use in browserhtml.
If this is too hard to solve, I can try harder to work around this.
/cc @pcwalton
pcwalton commentedon May 18, 2016
Grrrrrrrr. I think I'm going to put up a whiteboard next to my desk counting the number of times this has regressed.
paulrouget commentedon May 18, 2016
I think it's also related to the
overflow:scrollPR (#10717).metajack commentedon May 18, 2016
Will @asajeffrey's new webdriver stuff allow us to make a test for this?
asajeffrey commentedon May 18, 2016
At the moment, I'm afraid not, because the relevant bit of webdriver is https://www.w3.org/TR/webdriver/#actions, which is currently not implemented in https://github.com/jgraham/webdriver-rust/blob/master/src/command.rs#L52. @jgraham would know if there's a deep reason for this.
jgraham commentedon May 18, 2016
The deep reason is "this stuff is hard and, for some odd reason, I have ended up writing the spec for it (which is not yet done) despite having very little relevant domain experience". Since there is no spec there is also no implementation yet (although I have a branch of the protocol library which matches the current spec pre-drafts, so one could start implementing the semantics in servo, if one really wanted).
asajeffrey commentedon May 18, 2016
I added an issue for adding webdriver action support: #11254. We can decide whether to push forward on this, or wait until the spec stabilizes.
metajack commentedon May 19, 2016
I suspect this is a case where our implementation would help push the spec forward, no? This is obviously not immediately critical, but we should get this done in Q3 if possible.
pcwalton commentedon May 21, 2016
So per your test case this doesn't seem to be a regression (although it may well have been exposed by some enhancement to WR)—rather, it's a design issue. The problem is that WebRender iterates through scroll layer trees to do hit testing, whereas it really should be iterating through display items. There are two ways to fix this: (a) move the display item-based hit testing code to WebRender; (b) move the layer-to-point-translation code to Servo.
After experimenting with (a), I'm more inclined to pursue strategy (b). That's because we would have to duplicate the hit testing code into WR to keep both paths working, and we'd have to involve WebRender for hit tests even when those hit tests are not done on rendered content (e.g. when initiated by script). The way to make this work is to replace the
TranslatePointToLayerSpaceAPI message with a one likeGetLayerTreeForHitTest. This would return the scroll offsets and transforms applied to every layer. That tree would be sent from the compositor to the constellation, and the mouse events would be routed (unconditionally) to the script task for the root pipeline. If they hit an iframe, they would be forwarded per the event forwarding logic we already have, and the constellation would be able to consult the stored layer tree information to be able to translate points appropriately through iframe layers. Effectively, this would move all the hit testing logic from WebRender into Servo.How does this sound, @glennw?
glennw commentedon May 24, 2016
@pcwalton That suggestion sounds good to me. Long term, I think it makes sense to have it in WR and take advantage of the culling trees for performance reasons, but that's certainly something we could consider later - let's just get it working correctly for now.
pcwalton commentedon May 24, 2016
OK, cool. I'll do it that way then.
paulrouget commentedon May 24, 2016
Again - if this is too much work, we can work around that in browserhtml.
Add functionality to enable Servo to fetch scroll positions for all
6 remaining items
Auto merge of #11398 - pcwalton:webrender-viewport, r=glennw
script: Keep the DOM-side viewport up to date when scrolling happens in
script: Keep the DOM-side viewport up to date when scrolling happens in
Auto merge of #11398 - pcwalton:webrender-viewport, r=glennw
script: Keep the DOM-side viewport up to date when scrolling happens in
Auto merge of #11398 - pcwalton:webrender-viewport, r=glennw
compositing: Don't translate points to layer space when using WebRender.
compositing: Don't translate points to layer space when using WebRender.
Auto merge of #11537 - pcwalton:webrender-remove-layer-space-translat…
Auto merge of #11537 - pcwalton:webrender-remove-layer-space-translat…
Auto merge of #11537 - pcwalton:webrender-remove-layer-space-translat…
script: Keep the DOM-side viewport up to date when scrolling happens in
compositing: Don't translate points to layer space when using WebRender.