Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(319)

Issue 2963753003: Fix discrepancies in form text selection between PDF and HTML forms. (Closed)

Created:
3 years, 5 months ago by drgage
Modified:
3 years, 5 months ago
Reviewers:
Lei Zhang, dsinclair
CC:
chromium-reviews
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix discrepancies in form text selection between PDF and HTML forms. Refactored form text selection code in pdfium_engine.cc so plugin text selection changes whenever a new character is selected/unselected. Previously, only sent updates after a user released the left mouse button or released the shift key. This change also fixes the following issue: if a user selected text with the mouse and released the left mouse button outside the form text area, the plugin text selection would not be set and text could not be copied. BUG=59266 Review-Url: https://codereview.chromium.org/2963753003 Cr-Commit-Position: refs/heads/master@{#484732} Committed: https://chromium.googlesource.com/chromium/src/+/b0175c42eca66d5bad2e7d41d2fc125e78b03122

Patch Set 1 #

Patch Set 2 : Remove extra parentheses #

Total comments: 8

Patch Set 3 : Remove |old_selected_text_| #

Patch Set 4 : Rebase #

Patch Set 5 : Remove unneeded file #

Total comments: 10

Patch Set 6 : Rename and relocate SetMouseHeldDown() to indicate left button #

Total comments: 2

Patch Set 7 : Adjust calls to SetMouseLeftButtonDown() to avoid early returns #

Total comments: 4

Patch Set 8 : Initialize in_form_text_area_ and mouse_left_button_down_ + change comment in SetFormSelectedText #

Unified diffs Side-by-side diffs Delta from patch set Stats (+42 lines, -23 lines) Patch
M pdf/pdfium/pdfium_engine.h View 1 2 3 4 5 2 chunks +11 lines, -2 lines 0 comments Download
M pdf/pdfium/pdfium_engine.cc View 1 2 3 4 5 6 7 10 chunks +31 lines, -21 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 23 (9 generated)
drgage
Hi Lei and Dan, In this CL, I have changed the form text selection code ...
3 years, 5 months ago (2017-06-29 00:52:21 UTC) #5
Lei Zhang
https://codereview.chromium.org/2963753003/diff/20001/pdf/pdfium/pdfium_engine.cc File pdf/pdfium/pdfium_engine.cc (left): https://codereview.chromium.org/2963753003/diff/20001/pdf/pdfium/pdfium_engine.cc#oldcode1860 pdf/pdfium/pdfium_engine.cc:1860: if (area == PDFiumPage::FORM_TEXT_AREA) This change is a bit ...
3 years, 5 months ago (2017-06-29 02:52:46 UTC) #6
drgage
Hi Lei and Dan, In this patchset, I have removed the |old_selected_text_| member variable in ...
3 years, 5 months ago (2017-06-29 17:49:59 UTC) #7
Lei Zhang
https://codereview.chromium.org/2963753003/diff/20001/pdf/pdfium/pdfium_engine.cc File pdf/pdfium/pdfium_engine.cc (left): https://codereview.chromium.org/2963753003/diff/20001/pdf/pdfium/pdfium_engine.cc#oldcode1860 pdf/pdfium/pdfium_engine.cc:1860: if (area == PDFiumPage::FORM_TEXT_AREA) On 2017/06/29 17:49:58, drgage wrote: ...
3 years, 5 months ago (2017-06-29 22:38:04 UTC) #8
drgage
Hi Lei and Dan, I have rebased so that the other bug fix is included ...
3 years, 5 months ago (2017-06-29 23:00:51 UTC) #9
Lei Zhang
https://codereview.chromium.org/2963753003/diff/80001/pdf/pdfium/pdfium_engine.cc File pdf/pdfium/pdfium_engine.cc (right): https://codereview.chromium.org/2963753003/diff/80001/pdf/pdfium/pdfium_engine.cc#newcode1734 pdf/pdfium/pdfium_engine.cc:1734: SetMouseHeldDown(true); If SetMouseHeldDown() is really SetMouseLeftButtonDown(), then this isn't ...
3 years, 5 months ago (2017-06-30 21:39:36 UTC) #10
drgage
Hi Lei and Dan, In this patchset, I have renamed |mouse_held_down_| and SetMouseHeldDown() so they ...
3 years, 5 months ago (2017-06-30 23:37:32 UTC) #12
Lei Zhang
https://codereview.chromium.org/2963753003/diff/120001/pdf/pdfium/pdfium_engine.cc File pdf/pdfium/pdfium_engine.cc (right): https://codereview.chromium.org/2963753003/diff/120001/pdf/pdfium/pdfium_engine.cc#newcode1751 pdf/pdfium/pdfium_engine.cc:1751: SetMouseLeftButtonDown(true); So if we move the call here, then ...
3 years, 5 months ago (2017-07-01 00:30:46 UTC) #13
drgage
Hi Lei and Dan, In this patchset, I moved the calls to SetMouseLeftButtonDown() further up ...
3 years, 5 months ago (2017-07-05 18:29:31 UTC) #14
Lei Zhang
lgtm https://codereview.chromium.org/2963753003/diff/140001/pdf/pdfium/pdfium_engine.cc File pdf/pdfium/pdfium_engine.cc (right): https://codereview.chromium.org/2963753003/diff/140001/pdf/pdfium/pdfium_engine.cc#newcode1640 pdf/pdfium/pdfium_engine.cc:1640: // NUL-terminator. Update the comment, now that the ...
3 years, 5 months ago (2017-07-05 19:31:12 UTC) #15
Lei Zhang
https://codereview.chromium.org/2963753003/diff/140001/pdf/pdfium/pdfium_engine.h File pdf/pdfium/pdfium_engine.h (right): https://codereview.chromium.org/2963753003/diff/140001/pdf/pdfium/pdfium_engine.h#newcode674 pdf/pdfium/pdfium_engine.h:674: bool mouse_left_button_down_; We need to initialize this. We also ...
3 years, 5 months ago (2017-07-05 22:02:21 UTC) #16
drgage
Hi Lei and Dan, In this patchset, I addressed Lei's comment regarding initializing the boolean ...
3 years, 5 months ago (2017-07-06 19:13:55 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2963753003/160001
3 years, 5 months ago (2017-07-06 19:17:38 UTC) #20
commit-bot: I haz the power
3 years, 5 months ago (2017-07-06 20:36:15 UTC) #23
Message was sent while issue was closed.
Committed patchset #8 (id:160001) as
https://chromium.googlesource.com/chromium/src/+/b0175c42eca66d5bad2e7d41d2fc...

Powered by Google App Engine
This is Rietveld 408576698