New issue
Advanced search Search tips

Issue 846798 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Oct 31
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Incorrect HitTestRegion Data in test

Project Member Reported by jonr...@chromium.org, May 25 2018

Issue description

OS: Linux
Test Suite: content_browsertests
Viz: using default (not-enabled)
Test: SitePerProcessHitTestBrowserTest.HitTestStaleDataDeletedView/2

This test involves creating two RenderWidgetHostViewChildFrame which are attached to the same root. Then waiting for their surfaces to be ready.

The FrameSinkID hierarchy ends up looking like this:
  (0, 1)
    - (3, 1) <- RenderWidgetHostViewBase* that both children are attached too
         -  (4, 5) <- the first child, and the one detailed in the rest of this bug
         -  (5, 5)

Currently when running the /2 variant of this test HostFrameSinkManager::OnAggregatedHitTestRegionListUpdated is never notified of (4, 5), but receives regions for all the other FrameSinkIds.

However in /1 HostFrameSinkManager::OnAggregatedHitTestRegionListUpdated does also receive (4, 5).

With riajiang@'s guidance I did some debugging of what occurs in the test before the first  WaitForChildFrameSurfaceReady is called.

HitTestManager::SubmitHitTestRegionList calls:
  In /1
    FrameSinkId(0, 1) frame index 4 number of HitTestRegions 1
      Region FrameSinkId(3, 1)
    FrameSinkId(3, 1) frame index 4 number of HitTestRegions 1
      Region FrameSinkId(4, 5)
    FrameSinkId(4, 5) frame index 3 number of HitTestRegions 0

  In /2
    FrameSinkId(0, 1) frame index 4 number of HitTestRegions 1
      Region FrameSinkId(3, 1)
    FrameSinkId(3, 1) frame index 4 number of HitTestRegion 1
       Region FrameSinkId(5, 5)  - which hasn't activated nor sent hit test data yet
    FrameSinkId(4, 5) frame index 3 number of HitTestRegion 0

In fact in /2 (3, 1) never submits data containing (4, 5) as one of its hit test regions. Furthermore in /2 (0, 1) updates its frame index to 5.

This leads to a difference during the HitTestAggregator::Aggregate process:
  In /1
    HitTestManager::GetActiveHitTestRegionList( (0, 1) ) -> frame index 4
         - frame index map (4, HitTestRegionList.regions( (3, 1) )
         - finds (3, 1)
    HitTestManager::GetActiveHitTestRegionList( (3, 1) )
         - frame index map (4, HitTestRegionList.regions( (4, 5) )
         - finds (4, 5)

  In /2
    HitTestManager::GetActiveHitTestRegionList( (0, 1) ) -> frame index 4
         - frame index map (5, HitTestRegionList.regions( (3, 1) )
         - finds (3, 1)
    HitTestManager::GetActiveHitTestRegionList( (3, 1) )
         - frame index map (4, HitTestRegionList.regions( empty )
         - finds nothing

I could use some help in figuring out the cause of this difference between submitted hit test regions. It looks as if in /2 that HitTestManager is not being given the correct data.

I ran into this while working on a HitTestRegion testing api: https://chromium-review.googlesource.com/c/chromium/src/+/1071886

Where instead of blocking on surfaces, tests would block on hit test regions.

In the interim I'll probably disable the /2 variant of the test
 

Comment 1 by sunxd@chromium.org, May 25 2018

Owner: sunxd@chromium.org
Status: Assigned (was: Untriaged)
In variant /2 we use cc layers as the source of generating hit test regions, I'll investigate into this bug.

Comment 2 by sunxd@chromium.org, May 25 2018

Blocking: -785986
Also I think we can unblock the issue, /2 variant is hidden --use-viz-hit-testing-surface-layer, which is by default is disabled.

Comment 3 by sunxd@chromium.org, May 25 2018

/2 variant does not submit (4, 5) because it is completely covered by the other iframe. We put a logic in cc hit test data provider that eliminates completely covered surfaces.

Comment 4 by sunxd@chromium.org, May 25 2018

I can confirm that if we change the position of "frame2" to left: 30px in page_with_two_iframes.html(https://cs.chromium.org/chromium/src/content/test/data/frame_tree/page_with_two_iframes.html?q=/frame_tree/page_with_two_iframes.html&sq=package:chromium&g=0&l=1), we will also submit (4, 5) in variant /2.

jonross@, can you take a look at this and confirm that?
That does lead to submitting (4, 5) in variant /2, while continuing to submit it in variant /1.

Looking at that page_with_two_iframes.html test they are creating completely overlapping iframes. Is it expected that this would lead to one not submitting hit test data?

If so this does expose a flaw in the testing strategy of  issue 785986 . As if an obscured region never has its submitted hit test data provided to the browser, then how can one detect that the submission occurred? Though alternatively it could be that tests shouldn't wait on hit test data from obscured regions.

Comment 6 by sunxd@chromium.org, May 25 2018

I think in the long term, we want to roll out /2 logic for performance issues. I personally think variant /2 should have different checks in test from /1.

In the future when we generate hit test data based on blink's knowledge, we will experience more differences between current draw quad hit testing and "paint" hit testing. I think the solution is to not wait for obscured region if /2 flag is enabled?
Xianda, can the iframe on the top specify that it doesn't want some type of events, so that we have to target the iframe on the bottom for those events? Basically I'm concerned if eliminating obscured surfaces going to give us correct results in all cases

Comment 8 by sunxd@chromium.org, May 28 2018

Afaik in cc, if a layer is hit testable it accepts both types of events. (I could be wrong here)

I think in v3 hit testing we'll focus on that problem. Before that is implemented I can certainly submit those regions.
Project Member

Comment 9 by bugdroid1@chromium.org, Jun 19 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/79f35d0e90605e72245b8c1ea5d560e5f9e0b6ab

commit 79f35d0e90605e72245b8c1ea5d560e5f9e0b6ab
Author: jonross <jonross@chromium.org>
Date: Tue Jun 19 15:00:40 2018

Update SitePerProcessHitTestBrowserTest.HitTestStaleDataDeletedView hit test waiting

Currently SitePerProcessHitTestBrowserTest.HitTestStaleDataDeletedView is using
a legacy method for waiting for hit test data. This change updates it to use
the new HitTestRegionObserver.

However there is a bug in the /2 variant of the test, there overlapping hit test
regions are not submitted. Due to this I have it exit early in that config.

TEST=SitePerProcessHitTestBrowserTest.HitTestStaleDataDeletedView

Bug:  846798 
Change-Id: I410d493f1abc7334e4cc21c3c4edceb4e2edd8c9
Reviewed-on: https://chromium-review.googlesource.com/1102721
Reviewed-by: Ken Buchanan <kenrb@chromium.org>
Commit-Queue: Jonathan Ross <jonross@chromium.org>
Cr-Commit-Position: refs/heads/master@{#568447}
[modify] https://crrev.com/79f35d0e90605e72245b8c1ea5d560e5f9e0b6ab/content/browser/site_per_process_hit_test_browsertest.cc
[modify] https://crrev.com/79f35d0e90605e72245b8c1ea5d560e5f9e0b6ab/testing/buildbot/filters/viz.content_browsertests.filter

Reproduced today ahead of triage
Project Member

Comment 11 by bugdroid1@chromium.org, Oct 31

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/bd4ae48dae4a5c62c9513d0080301d2baffebdfa

commit bd4ae48dae4a5c62c9513d0080301d2baffebdfa
Author: Xianda Sun <sunxd@chromium.org>
Date: Wed Oct 31 18:06:11 2018

VizHitTest: Do not skip OOPIF even if it's occluded

We previously employed an optimization that skips OOPIFs occluded by
parent frame's layers. This optimization is problematic as the layer's
bounds do not necessarily represent its hit test region, and it works
incorrectly when the occluding layers have pointer-events property.

This CL removes that optimization.

Bug:  846798 , 896786
Change-Id: Id33c7d658cfd677ab3eb496371a213de2423d349
Reviewed-on: https://chromium-review.googlesource.com/c/1296821
Reviewed-by: Ken Buchanan <kenrb@chromium.org>
Reviewed-by: Robert Flack <flackr@chromium.org>
Commit-Queue: Xianda Sun <sunxd@chromium.org>
Cr-Commit-Position: refs/heads/master@{#604329}
[modify] https://crrev.com/bd4ae48dae4a5c62c9513d0080301d2baffebdfa/cc/trees/layer_tree_host_impl.cc
[modify] https://crrev.com/bd4ae48dae4a5c62c9513d0080301d2baffebdfa/content/browser/site_per_process_hit_test_browsertest.cc
[add] https://crrev.com/bd4ae48dae4a5c62c9513d0080301d2baffebdfa/content/test/data/frame_tree/page_with_occluded_iframes.html

Status: Fixed (was: Assigned)

Sign in to add a comment