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

Issue 755515 link

Starred by 6 users

Issue metadata

Status: Fixed
Owner:
Closed: Jan 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug-Regression

Blocked on:
issue 788807

Blocking:
issue 791225



Sign in to add a comment

Cannot select inside an extension's iframe using toolbar's selector (Ctrl+Shift+C)

Reported by nai....@gmail.com, Aug 15 2017

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.90 Safari/537.36

Steps to reproduce the problem:
1. Open the developer tools with "inspect" inside iframe
2. Click the leftmost icon button (or Ctrl+Shift+C )
3. Cannot select elements inside the iframe but can select those in outer page.

What is the expected behavior?
To smoothly support extension debugging, devtools element selector should be able to select in iframe.

What went wrong?
I cannot select elements inside an extension's iframe like in previous chrome versions, although in previous versions devtools opened a seperate window.

Did this work before? Yes 58 or 59

Chrome version: 60.0.3112.78  Channel: n/a
OS Version: ubuntu 16.04
Flash Version: Shockwave Flash 26.0 r0
 

Comment 1 by woxxom@gmail.com, Aug 15 2017

Bisect info: 469563 (good) - 469575 (bad)
https://chromium.googlesource.com/chromium/src/+log/82cbc419..ba9abc4c?pretty=fuller
Suspecting r469568 "[DevTools] Enable "auto attach to sub frames" by default"
Landed in 60.0.3091.0

Repro: test case extension is attached. Install it and follow the displayed instructions.
EXPECTED: able to select the element
OBSERVED: not able to select the element
test-extension.zip
1.2 KB Download
good.png
16.4 KB View Download
bad.png
12.3 KB View Download

Comment 2 by woxxom@gmail.com, Aug 15 2017

To reiterate the obvious just in case: extension iframes aren't handled the same as web iframes and don't get a devtools attached internally.

Comment 3 by l...@chromium.org, Aug 16 2017

Owner: dgozman@chromium.org
Status: Assigned (was: Unconfirmed)
Thanks for the report, and thanks for the bisect.  I can repro this bug on commit #469569.  dgozman@, could you please take a look?
Labels: -OS-Linux OS-All
Hmm... This is overlay not working for OOPIFs properly. I remember we fixed that, perhaps it did break? I'll take a look.
Cc: kenrb@chromium.org dcheng@chromium.org
So, this is definitely OOPIF problem. Usually, mouse move events go to child frame's WebFrameWidgetImpl and being handled there. But with DevTools overlay things change:
- Main frame instantiates a PageOverlay instance, which adds a layer [1]. Not doing so makes the problem disappear.
- This layer somehow prevents mouse move events to be first dispatched to child frame's WebFrameWidgetImpl.
- Instead, events go directly to main frame's WebViewImpl and get handled there.
- Child frame's PageOverlay doesn't affect the picture - I tried disabling it.

dcheng@, kenrb@, do you have any idea why extra layer affects the input events routing for OOPIF?

[1] https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/page/PageOverlay.cpp?rcl=c3a1e507c5ecd4c3dfcd550d6e884873222e6d10&l=64

Comment 6 by kenrb@chromium.org, Aug 17 2017

Cc: sadrul@chromium.org lfg@chromium.org
I believe this would be because the browser process is looking at which renderer process should receive the mouse event, and sees the main frame is painting something over top of the iframe, and decides that means the main frame should be the target of the event.

This is a specific case of a known issue with our current hit testing system, and while we have a long term plan to resolve it (a new system is being built for the viz service), we hadn't actually seen any significant regressions from it until now. We have a way to make the browser-side event router ignore frames that have pointer-events:none, but AFAIK there isn't a similar mechanic to make it ignore a layer.

We might be able to build something to do that in the shorter term. Usually this isn't a problem because if an element is drawing over top of a cross-site iframe, no mouse events can be targeted to that iframe. If I understand correctly, the issue here is that we are painting a layer that doesn't correspond to anything in the DOM.
> If I understand correctly, the issue here is that we are painting a layer that doesn't correspond to anything in the DOM.
Correct. What you describe here matches my understanding of how overlay works.
Cc: dgozman@chromium.org
Components: Internals>Sandbox>SiteIsolation
Labels: -Pri-2 Pri-3
Owner: kenrb@chromium.org
Tentatively assigning to kenrb@ as I don't see anything I can do.

Comment 9 by kenrb@chromium.org, Oct 18 2017

Cc: sc00335...@techmahindra.com
 Issue 775401  has been merged into this issue.

Comment 10 by creis@chromium.org, Nov 27 2017

Blockedon: 788807
Blocking: 791225
Issue 800832 has been merged into this issue.
Ken, is there anything we can do short-term and/or from our side? More user reports are coming.
Cc: gklassen@chromium.org vollick@chromium.org
@vollick, gklassen: can we apply a temporary fix from https://bugs.chromium.org/p/chromium/issues/detail?id=788807#c12 here as well?

Comment 15 by kenrb@chromium.org, Jan 16 2018

This is fixed on trunk as a result of the work on  issue 796651 . None of that is mergeable to M64, unfortunately, but M65 hasn't branched yet so that should carry the fix.

We couldn't find any easy fixes for this problem that we'd be able to merge to an earlier release because it is considerably more complicated than the layer squashing bug.
Thanks, that sounds great! I think it's fine to not merge to M64 given the situation.
Issue 800966 has been merged into this issue.

Comment 18 by woxxom@gmail.com, Jan 20 2018

>This is fixed on trunk as a result of the work on  issue 796651 

Not really: right-clicking an element and choosing "Inspect" does not open that element in devtools even in Chrome 66. One has to use element picker from within devtools to click that element while the entire page is being overlayed with a blue background hindering selection process. I hope nobody thinks this is WAI as it's obviously a huge regression in usability from the historical behavior.

Comment 19 by woxxom@gmail.com, Jan 20 2018

Er, correction. This issue is indeed fixed in Chrome 66, but not the complementary issue about rightclick + Inspect inside an iframe. Was it even reported?
Project Member

Comment 20 by bugdroid1@chromium.org, Jan 27 2018

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

commit 902bffab618a622ed802ff3b1cfe5647d2687191
Author: Dmitry Gozman <dgozman@chromium.org>
Date: Sat Jan 27 15:20:46 2018

[DevTools] Make Inspect Element work for OOPIF

To support this, we issue inspect element command to the agent
beforehand, and dispatch it in the next session which attaches
(or the existing one if any). This moves InspectElement from
DevToolsSession interface to DevToolsAgent interface, as there
might be no session yet.

Note this could fail in case of multiple sessions, one of which is
DevTools frontend, by choosing the wrong one. This is a rare
case though, so we can tolerate that.

TBR=alexclarke@chromium.org

Bug:  755515 ,  804100 
Change-Id: I331bfb7f5410868fd47bfe8d558b54b7a30de00c
Reviewed-on: https://chromium-review.googlesource.com/881522
Reviewed-by: Alex Clarke <alexclarke@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Pavel Feldman <pfeldman@chromium.org>
Commit-Queue: Dmitry Gozman <dgozman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#532220}
[modify] https://crrev.com/902bffab618a622ed802ff3b1cfe5647d2687191/chrome/browser/devtools/devtools_sanity_browsertest.cc
[modify] https://crrev.com/902bffab618a622ed802ff3b1cfe5647d2687191/chrome/browser/devtools/devtools_window.cc
[add] https://crrev.com/902bffab618a622ed802ff3b1cfe5647d2687191/chrome/test/data/devtools/oopif.html
[add] https://crrev.com/902bffab618a622ed802ff3b1cfe5647d2687191/chrome/test/data/devtools/oopif_frame.html
[modify] https://crrev.com/902bffab618a622ed802ff3b1cfe5647d2687191/content/browser/devtools/devtools_agent_host_impl.cc
[modify] https://crrev.com/902bffab618a622ed802ff3b1cfe5647d2687191/content/browser/devtools/devtools_agent_host_impl.h
[modify] https://crrev.com/902bffab618a622ed802ff3b1cfe5647d2687191/content/browser/devtools/devtools_session.cc
[modify] https://crrev.com/902bffab618a622ed802ff3b1cfe5647d2687191/content/browser/devtools/devtools_session.h
[modify] https://crrev.com/902bffab618a622ed802ff3b1cfe5647d2687191/content/browser/devtools/render_frame_devtools_agent_host.cc
[modify] https://crrev.com/902bffab618a622ed802ff3b1cfe5647d2687191/content/browser/devtools/render_frame_devtools_agent_host.h
[modify] https://crrev.com/902bffab618a622ed802ff3b1cfe5647d2687191/content/public/browser/devtools_agent_host.h
[modify] https://crrev.com/902bffab618a622ed802ff3b1cfe5647d2687191/content/shell/browser/shell_devtools_bindings.cc
[modify] https://crrev.com/902bffab618a622ed802ff3b1cfe5647d2687191/headless/public/util/testing/mock_devtools_agent_host.h
[modify] https://crrev.com/902bffab618a622ed802ff3b1cfe5647d2687191/third_party/WebKit/Source/core/exported/WebDevToolsAgentImpl.cpp
[modify] https://crrev.com/902bffab618a622ed802ff3b1cfe5647d2687191/third_party/WebKit/Source/core/exported/WebDevToolsAgentImpl.h
[modify] https://crrev.com/902bffab618a622ed802ff3b1cfe5647d2687191/third_party/WebKit/Source/devtools/front_end/Tests.js
[modify] https://crrev.com/902bffab618a622ed802ff3b1cfe5647d2687191/third_party/WebKit/Source/devtools/front_end/elements/ElementsPanel.js
[modify] https://crrev.com/902bffab618a622ed802ff3b1cfe5647d2687191/third_party/WebKit/public/web/devtools_agent.mojom

Status: Fixed (was: Assigned)

Comment 22 by kenrb@chromium.org, Feb 27 2018

Cc: sindhu.chelamcherla@chromium.org
 Issue 816468  has been merged into this issue.
 Issue 816455  has been merged into this issue.
There seems to be an issue showing up in chrome 66 that might be related to this fix.

I'm currently running this build:
Version 66.0.3359.33 (Official Build) beta (64-bit)

If you side load the test extension attached with this issue, the first time you try to right click and inspect something inside the iframe, it will open dev tools and an element in the contents of the iframe will be selected properly.

However, if you then navigate to another tab (or just create a new tab) then come back to the tab where the extension is open, you can no longer right click on the iframe to get the context menu.  In fact, it looks like no mouse events are being captured in the iframe at all (you cannot highlight text or click on anything inside the iframe).

Once you get in this state of not being to click on the iframe, you can only recover if you resize the browser window.

I also tested this on Version 65.0.3325.162 (Official Build) (64-bit) and it does not happen there.

 

Comment 25 by creis@chromium.org, Mar 20 2018

Comment 24: From the discussion on  issue 823405 , it sounds like this has been fixed in  issue 822442 .

Sign in to add a comment