New issue
Advanced search Search tips

Issue 853517 link

Starred by 5 users

Issue metadata

Status: WontFix
Owner:
Closed: Oct 31
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 1
Type: Bug-Regression



Sign in to add a comment

Embedded pdf becomes completely isolated from the main HTML's DOM

Reported by shima...@gmail.com, Jun 17 2018

Issue description

UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36

Steps to reproduce the problem:
1. Open the console and Access to http://www.broadband-xp.com/test/chrome/emed/embed.html.
2. Click the PDF itself and find no console output by clicking it.
3. Click the button right next to the PDF and then document.getElementById("pdf").click() is detected.

What is the expected behavior?
Even when clicking the PDF itself, document.getElementById("pdf").onclick should be detected.

What went wrong?
When clicking the PDF itself, no onclick, mousedown, mousemove event is detected.

Did this work before? Yes 65.03325.162

Chrome version: 67.0.3396.87  Channel: stable
OS Version: 10.0
Flash Version: 

When detecting the mousemove event, "at first" mousemove on the PDF can be recorded. But this is only right after the load. After the initial load, the PDF becomes completely isolated from the main DOM. It can not be accessed from DOM anymore.

So if you move the mouse outside the PDF, document.onmouseevent is detected but if you move the mouse on the PDF, neither document.onmousemove event and document.getElementById("pdf").onmouseevent can be detected.

 This was not happening in the older version. You can not change the url of the PDF after the completion of the load.
 

Comment 1 by woxxom@gmail.com, Jun 17 2018

Simplified repro:
1. open the attached test.html
2. click anywhere inside the embedded PDF
3. observe "Click status" at the top

Expected: "PDF document" text is shown
Observed: nothing

Bisected to r526154 = 8e8ae37d2e02943cadb4d658777866e8e4a12f60 = https://crrev.com/c/838626 by sadrul@chromium.org
"event router: Use mojom.InputTargetClient for targeting."
Landed in 65.0.3304.0
test.html
10.9 KB View Download
Labels: Needs-Bisect Needs-Triage-M67
Cc: susan.boorgula@chromium.org
Labels: -Pri-2 -Needs-Bisect hasbisect-per-revision Triaged-ET M-69 RegressedIn-65 Target-67 FoundIn-67 FoundIn-69 FoundIn-68 Target-68 Target-69 OS-Linux Pri-1
Owner: sadrul@chromium.org
Status: Assigned (was: Unconfirmed)
Able to reproduce this issue on Windows 10, Mac OS 10.13.5 and Ubuntu 14.04 on the latest Stable 67.0.3396.87 and latest Canary 69.0.3463.0 as per comment #1.

Bisect Information:
===================
Good Build: 65.0.3303.0
Bad Build : 65.0.3304.0

By running the per-revision bisect script, below is the Changelog URL.

https://chromium.googlesource.com/chromium/src/+log/d37a9f10c7e32ff40e864a2ff30478fc8a0a1169..8e8ae37d2e02943cadb4d658777866e8e4a12f60

From the above Changelog, suspecting the below change:
Reviewed-on: https://chromium-review.googlesource.com/838626

sadrul@ Please check and confirm if this issue is related to your change, else help us in assigning to the right owner.

Thanks
Labels: OS-Mac

Comment 5 by bokan@chromium.org, Jun 19 2018

Components: -Blink Internals>Plugins>PDF Blink>Input

Comment 6 by shima...@gmail.com, Jun 25 2018

Thank you all.
I hope this issue will be fixed soon.
Is it possible to fix this bug until the release of stable version 68?
Thank you in advance.
 Issue 863729  has been merged into this issue.
To sadrul@chromium.org:

Could you please fix this bug as soon as possible?
Thank you in advance.

Cc: sadrul@chromium.org riajiang@chromium.org
Owner: kenrb@chromium.org
--> kenrb@, /cc+ riajiang@
The current behavior matches that of Firefox, does it not?

There was some discussion about this some time ago, and the behavior of clicks on PDFs generating DOM events. There was some thinking that it shouldn't be that way, and the embedding page only sees interactions with PDFs because of how WebKit implemented plugins.

That behavior is lost because PDFs are now in different processes and events are directly routed to them.

We might consider this working as intended.
Cc: nzolghadr@chromium.org
I have confirmed that the current behavior matches that of Firefox, even though it changed from previous Chrome behavior. I'd like to call this working as intended and close this bug.
Reporter, this is right now an intended behavior. So this is unlikely to get fixed.
However, can you elaborate more on the usecase that you have? What are you trying to achieve in your webpage?
Specifically speaking, I have wanted to disable contextmenu or want to detect oncontextmenu event.

And even though it is true that the current behavior is the same as Firefox's internal PDF Viewer, however, please compare it with Internet Explorer in relation to Adobe Reader.

Internet Explorer's JavaScript can communicate with Adobe Reader's Acrobat JavaScript (hostContainer), thus can control Adobe Reader through DOM. For example, you can change the current page or change the zoom percentage, with your own HTML interface, without relying on Adobe Reader's native interface.

From another perspective, you can know which page your readers are reading now and how much minutes they are reading the page. You can know when they left your site, and which page is attractive or boring.


I hope that in the future with Google Chrome as well it can communicate with embedded PDF and enable us to control it through DOM.
Status: WontFix (was: Assigned)
Re: comment 14, I can't authoritatively speak to the feasibility of that (although I believe it would be contrary to the goals of same origin policy, since a PDF loaded from another origin could be sensitive), but I'm closing this bug since we consider the current input event behavior is correct.

Sign in to add a comment