New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 675695 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Jan 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 1
Type: Bug



Sign in to add a comment

Scrolling broken with two OOPIFs in the same origin

Project Member Reported by lfg@chromium.org, Dec 19 2016

Issue description

Tested on windows canary 57.0.2956.1.

0) Open chrome with --site-per-process

1) Navigate to "data:text/html,<iframe src="https://csreis.github.io/tests/input-types.html"></iframe><iframe src="https://csreis.github.io/tests/input-types.html"></iframe>"

2) Notice that only one iframe scrolls with the mouse wheel. The scrollbar is also partially broken on one of the iframes.

 
Is it just mousewheel scroll that's broken? How about touch scroll, arrow keys, etc.?

Comment 2 by lfg@chromium.org, Dec 19 2016

I don't have the hardware to test touch, but arrow keys are broken as well.

Comment 3 by kenrb@chromium.org, Dec 19 2016

Cc: bokan@chromium.org
+bokan, who might have thoughts on this. I'm tracing this now, and it looks like something on the renderer side (MouseWheel and GestureScroll* events are getting targeted correctly AFAICT).

Comment 4 by lfg@chromium.org, Dec 19 2016

Cc: -kenrb@chromium.org
Owner: kenrb@chromium.org
Status: Assigned (was: Available)
Assigning to Ken.

Comment 5 by bokan@chromium.org, Dec 19 2016

I can repro on Linux too so likely not OS specific but I don't really have any theories on this. I can help you dig in further if you find where the scroll gets blocked.
One possibility that comes to mind: OOPIFs have no support for ScrollingCoordinator scrollable rects at present ... worth checking?

Comment 7 by kenrb@chromium.org, Dec 20 2016

bokan@: Are you available to help with this? The divergence between the scrolling frames and non-scrolling frames seems to be in ScrollAnimator, I can see the animation getting sent to the compositor for both cases but for the frame that doesn't scroll, ScrollingAnimatorCompositorCoordinator doesn't have any of its notifyAnimation* methods called back from the compositor. I am not very familiar with this code so debugging is slow.

As an aside, it is interesting that if you create 3 or 4 iframes to the same origin, all but one scroll correctly.

Comment 8 by bokan@chromium.org, Dec 20 2016

Cc: skobes@chromium.org
Unfortunately I've never poked around in there either. ymalik@ wrote a bunch of code in there but he's no longer working on Chrome. +skobes@ who should be quite familiar.

Comment 9 by skobes@chromium.org, Dec 20 2016

Cc: loyso@chromium.org ajuma@chromium.org
Looks like something in the cc animation machinery.

Comment 10 by loyso@chromium.org, Dec 20 2016

re#7: Unfortunately, I'm not familiar with ScrollAnimator code as well.
kenrb@, can you check that player gets attached to a layer for all iframes? 
(In ScrollAnimatorCompositorCoordinator::reattachCompositorPlayerIfNeeded)
I think I have a rough diagnosis, with some debugging help from ajuma@ this afternoon.

Note that with OOPIFs, every local frame root has its own compositor (plus LayerTreeHost, LayerTree, etc), and in particular has its own ScrollAnimatorCompositorCoordinator. This includes independent OOPIFs that are on the same frame tree and in the same process as each other.

In reattachCompositorPlayerIfNeeded(), ScrollAnimatorCompositorCoordinator attaches its AnimationPlayer to a CompositorAnimationTimeline. The timeline is owned by ScrollingCoordinator, which is owned by Page. So in a page with multiple OOPIFs, this means a single CompositorAnimationTimeline will have multiple AnimationPlayers getting attached to it. It looks like the problem scrolling comes from the fact that the LayerTree associated with the AnimationPlayer (which it got from the Timeline) isn't the same as the LayerTree for the Frame's compositor, where the element was registered.

This looks like a pretty clear bug, although it isn't clear to me why scrolling OOPIFs *normally* works, and even works for some of the sibling OOPIFs while breaking for another. We know that ScrollingCoordinator is a problem for OOPIFs (there are some TODOs in the code), but I hadn't caught this interaction before. I won't be able to start trying to figure out a fix for this until next week. Any assistance from experts in this area would be appreciated.

Comment 12 by creis@chromium.org, Jan 11 2017

Labels: -Pri-2 Proj-IsolateExtensions-BlockingLaunch M-56 Pri-1
Possibly related to  issue 680158 ?

Also, I'm tentatively marking this as a blocker for --isolate-extensions, though we may revisit.  (I don't know if we're aware of any extensions this affects.)  Can you post an update with your findings and whether you think we can get a fix merged to M56?

Comment 13 by bokan@chromium.org, Jan 12 2017

ScrollingCoordinator being per-Page seems to be causing all these OOPIF issues, I think it needs to be split up. The baked-in assumption is that ScrollingCoordinator is 1-1 with Compositors which isn't true anymore.

Comment 14 by kenrb@chromium.org, Jan 12 2017

I have filed issue 680606 to fix the larger issue with ScrollingCoordinator, but I would like to proceed with this bug to attempt a shorter term fix (that potentially could be removed when 680606 is addressed). Changing ownership of ScrollingCoordinator looks like a signficant refactor, and if this bug ends up remaining as an isolate-extensions blocker then having to wait for that would impact shipping schedule.
Project Member

Comment 15 by bugdroid1@chromium.org, Jan 20 2017

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

commit 65c7df6e695eb4435ccf5485498b34fd1629f898
Author: kenrb <kenrb@chromium.org>
Date: Fri Jan 20 02:04:02 2017

Give OOPIF FrameViews their own scroll animation timelines and hosts

OOPIFs need independent scroll animation timelines and hosts, because
they have separate compositors. Ultimately we need to associate a
ScrollingCoordinator which each local frame root, but until that work
is done this CL resolves some known scrolling problems in
--site-per-process mode.

BUG= 675695 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2631853002
Cr-Commit-Position: refs/heads/master@{#444947}

[add] https://crrev.com/65c7df6e695eb4435ccf5485498b34fd1629f898/third_party/WebKit/LayoutTests/http/tests/misc/resources/cross-origin-subframe-for-scrolling.html
[add] https://crrev.com/65c7df6e695eb4435ccf5485498b34fd1629f898/third_party/WebKit/LayoutTests/http/tests/misc/scroll-cross-origin-iframes-expected.txt
[add] https://crrev.com/65c7df6e695eb4435ccf5485498b34fd1629f898/third_party/WebKit/LayoutTests/http/tests/misc/scroll-cross-origin-iframes.html
[modify] https://crrev.com/65c7df6e695eb4435ccf5485498b34fd1629f898/third_party/WebKit/Source/core/frame/FrameView.cpp
[modify] https://crrev.com/65c7df6e695eb4435ccf5485498b34fd1629f898/third_party/WebKit/Source/core/frame/FrameView.h
[modify] https://crrev.com/65c7df6e695eb4435ccf5485498b34fd1629f898/third_party/WebKit/Source/core/frame/VisualViewport.cpp
[modify] https://crrev.com/65c7df6e695eb4435ccf5485498b34fd1629f898/third_party/WebKit/Source/core/page/Page.cpp
[modify] https://crrev.com/65c7df6e695eb4435ccf5485498b34fd1629f898/third_party/WebKit/Source/core/page/Page.h
[modify] https://crrev.com/65c7df6e695eb4435ccf5485498b34fd1629f898/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp
[modify] https://crrev.com/65c7df6e695eb4435ccf5485498b34fd1629f898/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.h
[modify] https://crrev.com/65c7df6e695eb4435ccf5485498b34fd1629f898/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
[modify] https://crrev.com/65c7df6e695eb4435ccf5485498b34fd1629f898/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp
[modify] https://crrev.com/65c7df6e695eb4435ccf5485498b34fd1629f898/third_party/WebKit/Source/web/WebPagePopupImpl.cpp
[modify] https://crrev.com/65c7df6e695eb4435ccf5485498b34fd1629f898/third_party/WebKit/Source/web/WebViewImpl.cpp

Comment 17 by kenrb@chromium.org, Jan 23 2017

Labels: -M-56 M-57 Merge-Request-57
Status: Fixed (was: Assigned)
This fixes a scrolling bug that could affect some extensions starting in m56, so it might make sense to merge it after it has had a few days to bake. The layout test CL doesn't need to be merged, but the first one does, https://crrev.com/65c7df6e695eb4435ccf5485498b34fd1629f898, as well as a fix to a regression that it caused which is on  issue 683282 , https://chromium.googlesource.com/chromium/src/+/f15f669d84991252dd186c7093b885d7e909fad3.

Comment 18 by creis@chromium.org, Jan 24 2017

Components: Blink>Scroll
Labels: -Proj-IsolateExtensions-BlockingLaunch
I think we might be able to get by without this fixed in M56, since we don't have known extensions that it affects yet.  Agreed that we should merge it to M57, though.
Project Member

Comment 19 by sheriffbot@chromium.org, Jan 24 2017

Labels: -Merge-Request-57 Hotlist-Merge-Approved Merge-Approved-57
Your change meets the bar and is auto-approved for M57. Please go ahead and merge the CL to branch 2987 manually. Please contact milestone owner if you have questions.
Owners: amineer@(clank), cmasso@(bling), ketakid@(cros), govind@(desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Please merge your change to M57 branch 2987 ASAP so we can pick it up for this week dev release. Thank you.

Comment 21 by kenrb@chromium.org, Jan 24 2017

govind@: Can I merge both this and the follow-up bug fix, on  issue 683282 , or do I need to separately request merge on that bug?
Project Member

Comment 22 by bugdroid1@chromium.org, Jan 24 2017

Labels: -merge-approved-57 merge-merged-2987
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/66ec94ea64f65f9d305390b7636bb49ad00b508c

commit 66ec94ea64f65f9d305390b7636bb49ad00b508c
Author: Ken Buchanan <kenrb@chromium.org>
Date: Tue Jan 24 18:27:17 2017

Give OOPIF FrameViews their own scroll animation timelines and hosts

OOPIFs need independent scroll animation timelines and hosts, because
they have separate compositors. Ultimately we need to associate a
ScrollingCoordinator which each local frame root, but until that work
is done this CL resolves some known scrolling problems in
--site-per-process mode.

BUG= 675695 
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2

Review-Url: https://codereview.chromium.org/2631853002
Cr-Commit-Position: refs/heads/master@{#444947}
(cherry picked from commit 65c7df6e695eb4435ccf5485498b34fd1629f898)

Review-Url: https://codereview.chromium.org/2654883002 .
Cr-Commit-Position: refs/branch-heads/2987@{#62}
Cr-Branched-From: ad51088c0e8776e8dcd963dbe752c4035ba6dab6-refs/heads/master@{#444943}

[add] https://crrev.com/66ec94ea64f65f9d305390b7636bb49ad00b508c/third_party/WebKit/LayoutTests/http/tests/misc/resources/cross-origin-subframe-for-scrolling.html
[add] https://crrev.com/66ec94ea64f65f9d305390b7636bb49ad00b508c/third_party/WebKit/LayoutTests/http/tests/misc/scroll-cross-origin-iframes-expected.txt
[add] https://crrev.com/66ec94ea64f65f9d305390b7636bb49ad00b508c/third_party/WebKit/LayoutTests/http/tests/misc/scroll-cross-origin-iframes.html
[modify] https://crrev.com/66ec94ea64f65f9d305390b7636bb49ad00b508c/third_party/WebKit/Source/core/frame/FrameView.cpp
[modify] https://crrev.com/66ec94ea64f65f9d305390b7636bb49ad00b508c/third_party/WebKit/Source/core/frame/FrameView.h
[modify] https://crrev.com/66ec94ea64f65f9d305390b7636bb49ad00b508c/third_party/WebKit/Source/core/frame/VisualViewport.cpp
[modify] https://crrev.com/66ec94ea64f65f9d305390b7636bb49ad00b508c/third_party/WebKit/Source/core/page/Page.cpp
[modify] https://crrev.com/66ec94ea64f65f9d305390b7636bb49ad00b508c/third_party/WebKit/Source/core/page/Page.h
[modify] https://crrev.com/66ec94ea64f65f9d305390b7636bb49ad00b508c/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp
[modify] https://crrev.com/66ec94ea64f65f9d305390b7636bb49ad00b508c/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.h
[modify] https://crrev.com/66ec94ea64f65f9d305390b7636bb49ad00b508c/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp
[modify] https://crrev.com/66ec94ea64f65f9d305390b7636bb49ad00b508c/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp
[modify] https://crrev.com/66ec94ea64f65f9d305390b7636bb49ad00b508c/third_party/WebKit/Source/web/WebPagePopupImpl.cpp
[modify] https://crrev.com/66ec94ea64f65f9d305390b7636bb49ad00b508c/third_party/WebKit/Source/web/WebViewImpl.cpp

Sign in to add a comment