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

Issue 2325553002: Restore a collapsed leading space of text used for line break (Closed)

Created:
4 years, 3 months ago by joone
Modified:
4 years, 3 months ago
Reviewers:
yosin_UTC9
CC:
blink-reviews, chromium-reviews
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Restore a collapsed leading space of text used for line break When a text is wrapped during layout, the leading space of the text can be collapsed and a line break is inserted instead of the space. In this case, we need to restore the collapsed space when we copy the text. This CL handles the case that the below CL didn't cover: https://codereview.chromium.org/2320533002/ In addition, while iterating through the DOM range, the below case with the TextIteratorBehavior flag don't need to restore the leading space. * Running DumpRenderTree : TextIteratorForInnerText * Searching text : TextIteratorDoesNotBreakAtReplacedElement * Getting a plain text for copy & paste: TextIteratorEmitsImageAltText BUG=318925 TEST=editing/pasteboard/restore-collapsed-space-for-copy.html Committed: https://crrev.com/131df048e7e445a03706078367285112e6b3467d Cr-Commit-Position: refs/heads/master@{#418557}

Patch Set 1 #

Patch Set 2 : fix test fails #

Patch Set 3 : update test case #

Patch Set 4 : Make editing/selection/doubleclick-beside-cr-span.html pass #

Patch Set 5 : Make FindInPageControllerTest.SpanAndListsSearchable pass #

Total comments: 8

Patch Set 6 : Remove the additional space when restoring the leading space for getting plain text #

Total comments: 2

Patch Set 7 : Add gtests #

Total comments: 2

Patch Set 8 : Use plainText() #

Unified diffs Side-by-side diffs Delta from patch set Stats (+17 lines, -3 lines) Patch
M third_party/WebKit/Source/core/editing/iterators/TextIterator.h View 1 2 3 4 5 6 1 chunk +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp View 1 2 3 4 5 6 1 chunk +4 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/editing/iterators/TextIteratorTest.cpp View 1 2 3 4 5 6 7 1 chunk +9 lines, -0 lines 0 comments Download

Messages

Total messages: 56 (45 generated)
joone
Hi yosin@ As you mentioned, there is a little difference in the clipboard data between ...
4 years, 3 months ago (2016-09-09 19:07:41 UTC) #21
yosin_UTC9
https://codereview.chromium.org/2325553002/diff/100001/third_party/WebKit/LayoutTests/editing/pasteboard/restore-collapsed-space-for-copy.html File third_party/WebKit/LayoutTests/editing/pasteboard/restore-collapsed-space-for-copy.html (right): https://codereview.chromium.org/2325553002/diff/100001/third_party/WebKit/LayoutTests/editing/pasteboard/restore-collapsed-space-for-copy.html#newcode39 third_party/WebKit/LayoutTests/editing/pasteboard/restore-collapsed-space-for-copy.html:39: selection.document.execCommand('copy'); We can use internals.selectedTextForClipboard() to verify what we'll ...
4 years, 3 months ago (2016-09-12 04:09:11 UTC) #24
joone
https://codereview.chromium.org/2325553002/diff/100001/third_party/WebKit/LayoutTests/editing/pasteboard/restore-collapsed-space-for-copy.html File third_party/WebKit/LayoutTests/editing/pasteboard/restore-collapsed-space-for-copy.html (right): https://codereview.chromium.org/2325553002/diff/100001/third_party/WebKit/LayoutTests/editing/pasteboard/restore-collapsed-space-for-copy.html#newcode39 third_party/WebKit/LayoutTests/editing/pasteboard/restore-collapsed-space-for-copy.html:39: selection.document.execCommand('copy'); On 2016/09/12 04:09:10, Yosi_UTC9 wrote: > We can ...
4 years, 3 months ago (2016-09-12 21:33:02 UTC) #26
yosin_UTC9
https://codereview.chromium.org/2325553002/diff/100001/third_party/WebKit/LayoutTests/editing/pasteboard/restore-collapsed-space-for-copy.html File third_party/WebKit/LayoutTests/editing/pasteboard/restore-collapsed-space-for-copy.html (right): https://codereview.chromium.org/2325553002/diff/100001/third_party/WebKit/LayoutTests/editing/pasteboard/restore-collapsed-space-for-copy.html#newcode39 third_party/WebKit/LayoutTests/editing/pasteboard/restore-collapsed-space-for-copy.html:39: selection.document.execCommand('copy'); On 2016/09/12 at 21:33:02, joone wrote: > On ...
4 years, 3 months ago (2016-09-13 02:00:30 UTC) #35
joone
Please review the CL. Thanks! https://codereview.chromium.org/2325553002/diff/100001/third_party/WebKit/LayoutTests/editing/pasteboard/restore-collapsed-space-for-copy.html File third_party/WebKit/LayoutTests/editing/pasteboard/restore-collapsed-space-for-copy.html (right): https://codereview.chromium.org/2325553002/diff/100001/third_party/WebKit/LayoutTests/editing/pasteboard/restore-collapsed-space-for-copy.html#newcode39 third_party/WebKit/LayoutTests/editing/pasteboard/restore-collapsed-space-for-copy.html:39: selection.document.execCommand('copy'); On 2016/09/13 02:00:30, ...
4 years, 3 months ago (2016-09-14 04:04:35 UTC) #41
yosin_UTC9
https://codereview.chromium.org/2325553002/diff/200001/third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp File third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp (right): https://codereview.chromium.org/2325553002/diff/200001/third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp#newcode218 third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp:218: VisibleSelection validSelection(Position(sample->firstChild()->firstChild()->firstChild(), 0), Position(sample->lastChild(), 4)); Please use |plainText()| instead ...
4 years, 3 months ago (2016-09-14 05:13:52 UTC) #42
joone
I've updated the CL. Thanks! https://codereview.chromium.org/2325553002/diff/200001/third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp File third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp (right): https://codereview.chromium.org/2325553002/diff/200001/third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp#newcode218 third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp:218: VisibleSelection validSelection(Position(sample->firstChild()->firstChild()->firstChild(), 0), Position(sample->lastChild(), ...
4 years, 3 months ago (2016-09-14 07:09:13 UTC) #47
yosin_UTC9
lgtm Thanks!
4 years, 3 months ago (2016-09-14 07:49:44 UTC) #48
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/2325553002/220001
4 years, 3 months ago (2016-09-14 14:28:41 UTC) #52
commit-bot: I haz the power
Committed patchset #8 (id:220001)
4 years, 3 months ago (2016-09-14 14:33:28 UTC) #54
commit-bot: I haz the power
4 years, 3 months ago (2016-09-14 14:35:31 UTC) #56
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/131df048e7e445a03706078367285112e6b3467d
Cr-Commit-Position: refs/heads/master@{#418557}

Powered by Google App Engine
This is Rietveld 408576698