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

Issue 596789 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Aug 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 3
Type: Bug-Regression



Sign in to add a comment

Overlaps in PDF text selection drawn incorrectly

Project Member Reported by sb00348...@techmahindra.com, Mar 22 2016

Issue description

Version: 51.0.2687.0 dev
OS: Ubuntu 12.04,14.04

What steps will reproduce the problem?
(1)Launch Chrome -> Open any pdf file in chrome browser (ex:http://www.cbu.edu.zm/downloads/pdf-sample.pdf)
(2)Select text using mouse or Ctrl+A and observe the behavior.

What is the expected output?
Text should select with out any underlines.

What do you see instead?
Instead text is selecting with the underline.

This is a regression issue seen from M-36.

Note :
Unable provide the tool bisect as pdf files are downloading in chromium builds instead of opening in new tab. Hence unable to check the behavior.

Hence providing manual Bisect:

Manual good and Bad Builds:
Good Build: 36.0.1984.0
Bad Build: 36.0.1985.0 

Below is the manual Bisect url:

Changelog: https://chromium.googlesource.com/chromium/src/+log/36.0.1984.0..36.0.1985.0?pretty=fuller&n=10000

suspecting: https://codereview.chromium.org/271753006 from change log

@thestig: Please help in re-assigning the issue if its not related to your change

 
Actual_pdf.ogv
1.7 MB Download
Expected_pdf.ogv
5.7 MB Download
Labels: OS-Linux OS-Windows
Components: Internals>Plugins>PDF
Labels: OS-Mac
Able to reproduce the issue on mac 10.11.3 using chrome version 51.0.2687.0  
Labels: -Pri-1 -M-51 Pri-3
It's not an underline. It's the text highlight from two rows of text overlapping to create a darker shade.

I'd hardly call this a P-1 issue, given it happened ~2 years ago and nobody really noticed.
FWIW, the code in CPDF_TextPage::ProcessTextObject() that checks fabsf(charinfo.m_CharBox.top - charinfo.m_CharBox.bottom) < 0.01f caused this, but presumably that was added to fix some other issue.

The Chrome PDF Viewer probably should fix this on its side by drawing overlapping highlights properly.

Comment 5 by mr.ber...@gmail.com, Aug 23 2016

This still happens. Could someone please fix the bug description so that interested people will find this? Something along the lines, "PDF text highlights in subsequent rows overlap visually".
Status: Started (was: Assigned)
Summary: Overlaps in PDF text selection drawn incorrectly (was: Regression : PDF selection shows underline text in chrome browser )
Project Member

Comment 7 by bugdroid1@chromium.org, Aug 30 2017

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

commit af5b2c13657eb117d448cf1080b80ac79d957fb2
Author: Lei Zhang <thestig@chromium.org>
Date: Wed Aug 30 20:03:36 2017

Fix incorrect drawing in PDF text selection.

When text selection consists of multiple rectangles that overlap, do not
highlight the overlapping portions multiple times.

BUG= 596789 

Change-Id: I8aa458f3050b045a8026646763912b6fae98e5e6
Reviewed-on: https://chromium-review.googlesource.com/631916
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#498581}
[modify] https://crrev.com/af5b2c13657eb117d448cf1080b80ac79d957fb2/pdf/pdfium/pdfium_engine.cc
[modify] https://crrev.com/af5b2c13657eb117d448cf1080b80ac79d957fb2/pdf/pdfium/pdfium_engine.h

Status: Fixed (was: Started)
Labels: TE-Verified-62.0.3202.0 TE-Verified-62
Note: Retested the above issue on Canary #62.0.3202.0 on Linux(14.04), Windows(7,8,10), Mac(10.11.6, 10,12,3, 10.12.5).
Above issue is fixed now and is working as intended.
Result.mov
2.7 MB Download
That looks nicer, thanks! The person who tackled this might also look the the very related Issue 761322 (about visual gaps in the text selection).

Sign in to add a comment