PDF hyperlinks that should be occluded are clickable
Reported by
br...@amazon.com,
Sep 14 2017
|
||||||||
Issue descriptionUserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/60.0.3112.113 Chrome/60.0.3112.113 Safari/537.36 Steps to reproduce the problem: 1. Load a page that includes a hyperlinked region that is partially occluded by other content (e.g. partially_occluded_hyperlink.html attached). 2. Print the page to PDF through Chromium, selecting "Background graphics" under "More settings". 3. Observe that the entire yellow square is hyperlinked in the output PDF, including the area occluded by the red rectangle. What is the expected behavior? Only the yellow area should be hyperlinked---none of the red area should be hyperlinked. What went wrong? Hyperlinks are clickable on regions of the printed page that should not be clickable based on occlusion. Did this work before? No Does this work in other browsers? N/A Chrome version: 60.0.3112.113 Channel: stable OS Version: 16.04 Flash Version: Shockwave Flash 26.0 r0 == Attached Artifacts == Compare the clickable region when loading the attached .html versus the clickable region when loading the .pdf. I also attach a .png screenshot, illustrating the hyperlink tooltip when the cursor is positioned over the red box in the .pdf. == Preliminary Diagnosis == I believe this issue spans both Blink and Skia. Skia: On the one hand, SkPDFDevice appears to draw all "annotations" (e.g. hyperlinks) last. See SkPDFDevice::drawAnnotation, which enqueues annotations for later drawing rather than drawing them "inline". Annotations get drawn during SkPDFDocument::onEndPage(), causing annotations to appear on top rather than honoring occluding elements. So, I believe the first step is correcting SkPDFDevice to draw the annotations "inline" rather than queuing and drawing at the end. Blink: On the other hand, I noticed that on more complex pages, the draw call order sometimes, but not always, calls drawAnnotation() prior to the content being annotated. This might result in the opposite problem, where a hyperlink which should be clickable is occluded by its content. For example, a piece of text that is meant to be hyperlinked might have this call order: SkDevice::drawAnnotation() SkDevice::drawtext() instead of: SkDevice::drawText() SkDevice::drawAnnotation() So, there might be a second step to shuffle some calls in blink to ensure the device draw order ultimately ends up being correct.
,
Sep 14 2017
Is there any particular type of test case that would help repro this, beyond the MWE described above?
,
Sep 15 2017
Tested the issue on reported version Stable 61.0.3163.79, Latest Canary 63.0.3216.0 using Windows 7 and Ubuntu 14.04 This issue is seen from M50 and is a Non-Regression issue. Hence marking it as untraiged for further inputs on this. Note: Issue is not reproducible on Mac 10.12.1
,
Sep 15 2017
,
Sep 15 2017
Without selecting "background graphics" the squares do not appear in the printed PDF, but the link is still there and in a square shape, without occlusion. "linux_chrome61_nobggraphics.pdf" attached to illustrate. Also, for me the bug did reproduce on macOS 10.12.6. Attached "mac_chrome60.pdf" with the result.
,
Sep 16 2017
,
Sep 19 2017
,
Sep 29 2017
,
Oct 1
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue. Sorry for the inconvenience if the bug really should have been left as Available. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Oct 1
halcanary: Can you take a look?
,
Oct 30
PDF link annotations can only be specified as a rectangle. See PDF 32000-1:2008, Section 12.5.2: "The annotation rectangle, defining the location of the annotation on the page in default user space units." Blink could break the region into a sequence of rectangles and create a link for each of them. |
||||||||
►
Sign in to add a comment |
||||||||
Comment 1 by ligim...@chromium.org
, Sep 14 2017