Skip to content

[regression] hittest issue - iframe in the background take precedence over foreground elements #11108

Closed

Description

@paulrouget
<style>
  iframe, div {
    display: block;
    top: 0;
    left: 0;
    position: absolute;
  }
  iframe {
    border-width: 0;
    width: 100%;
    height: 100%;
  }
  div {
    width: 100px;
    height: 100px;
    background: red;
  }
</style>
<iframe src="http://example.com"></iframe>
<div onclick="console.log(42)"></div>

Activity

  1. added
    C-has-manual-testcase
    on May 10, 2016
  2. paulrouget commented on May 18, 2016

    @paulrouget
    ContributorAuthor

    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

  3. pcwalton commented on May 18, 2016

    @pcwalton
    Contributor

    Grrrrrrrr. I think I'm going to put up a whiteboard next to my desk counting the number of times this has regressed.

  4. paulrouget commented on May 18, 2016

    @paulrouget
    ContributorAuthor

    I think it's also related to the overflow:scroll PR (#10717).

  5. metajack commented on May 18, 2016

    @metajack
    Collaborator

    Will @asajeffrey's new webdriver stuff allow us to make a test for this?

  6. asajeffrey commented on May 18, 2016

    @asajeffrey
    Contributor
  7. jgraham commented on May 18, 2016

    @jgraham
    Contributor

    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).

  8. asajeffrey commented on May 18, 2016

    @asajeffrey
    Contributor

    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.

  9. metajack commented on May 19, 2016

    @metajack
    Collaborator

    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.

  10. pcwalton commented on May 21, 2016

    @pcwalton
    Contributor

    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.

    How does this sound, @glennw?

  11. glennw commented on May 24, 2016

    @glennw
    Member

    @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.

  12. pcwalton commented on May 24, 2016

    @pcwalton
    Contributor

    OK, cool. I'll do it that way then.

  13. paulrouget commented on May 24, 2016

    @paulrouget
    ContributorAuthor

    Again - if this is too much work, we can work around that in browserhtml.

  14. 6 remaining items

  15. added a commit that references this issue on May 27, 2016
  16. added a commit that references this issue on May 28, 2016
  17. added a commit that references this issue on Jun 1, 2016
  18. added 2 commits that reference this issue on Jun 1, 2016
    5e7f0c8
    9a9762f
  19. added 3 commits that reference this issue on Jun 2, 2016
    51cfb5b
    19172af
    77e6ea9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-has-manual-testcase

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions