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

Issue 1654123002: Invalidate the previous caret even if the parent text node is removed. (Closed)

Created:
4 years, 10 months ago by dshwang
Modified:
4 years, 6 months ago
Reviewers:
yosin_UTC9, jbroman
CC:
blink-reviews, chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Invalidate the previous caret even if the parent text node is removed. When the last character is removed from an input, the caret node is detached, which is the anonymous #text node. However, FrameSelection still refer to the previous caret node to invalidate the previous caret. Before deleting the last character "a" > INPUT 0x3be145763a50 (focused) #shadow-root 0x3be145763b50 DIV 0x3be145763c20 ID="inner-editor" (editable) * #text 0x3be145763f58 "a" After deleting the last character "a" > INPUT 0x3be145763a50 (focused) #shadow-root 0x3be145763b50 * DIV 0x3be145763c20 ID="inner-editor" (editable) Currently, Blink doesn't invalidate the previous caret if the caret is detached from DOM. This CL invalidates the caret region when the caret is detached. TEST=webkit_unit_tests FrameSelectionTest.InvalidatePreviousCaretAfterRemovingLastCharacter ManualTests/caret-paint-after-last-text-is-removed.html with --enable-partial-raster BUG=528922 Committed: https://crrev.com/26006147cabc6a22d94afc81bdd657328cdc7cb7 Cr-Commit-Position: refs/heads/master@{#377696}

Patch Set 1 #

Total comments: 4

Patch Set 2 : add manual tests #

Patch Set 3 : more clear code #

Total comments: 1

Patch Set 4 : more polishing if statement #

Total comments: 2

Patch Set 5 : add only test #

Patch Set 6 : handle it in FrameSelection::nodeWillBeRemoved #

Patch Set 7 : handle layouttests failure #

Total comments: 2

Patch Set 8 : add FrameSelectionTest.InvalidatePreviousCaretAfterRemovingLastCharacter #

Total comments: 2

Patch Set 9 : patch for land #

Total comments: 3

Patch Set 10 : patch for land v2 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+68 lines, -2 lines) Patch
M third_party/WebKit/LayoutTests/TestExpectations View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/editing/FrameSelection.h View 1 2 3 4 5 6 7 8 9 2 chunks +4 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/editing/FrameSelection.cpp View 1 2 3 4 5 6 7 8 1 chunk +9 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/editing/FrameSelectionTest.cpp View 1 2 3 4 5 6 7 8 9 4 chunks +53 lines, -1 line 0 comments Download

Messages

Total messages: 53 (23 generated)
dshwang
yosin, could you review? I test it using input_partial_raster_bug.html attached in https://code.google.com/p/chromium/issues/detail?id=528922#c18 jbroman's analysis in ...
4 years, 10 months ago (2016-02-01 17:39:09 UTC) #3
yosin_UTC9
It seems we should hold global(?) caret rect rather than local caret rect with node ...
4 years, 10 months ago (2016-02-02 01:56:57 UTC) #4
dshwang
On 2016/02/02 01:56:57, Yosi_UTC9 wrote: > It seems we should hold global(?) caret rect rather ...
4 years, 10 months ago (2016-02-02 14:58:46 UTC) #6
yosin_UTC9
On 2016/02/02 at 14:58:46, dongseong.hwang wrote: > On 2016/02/02 01:56:57, Yosi_UTC9 wrote: > > It ...
4 years, 10 months ago (2016-02-03 04:49:15 UTC) #7
dshwang
On 2016/02/03 04:49:15, Yosi_UTC9 wrote: > https://codereview.chromium.org/1654123002/diff/1/third_party/WebKit/Source/core/editing/FrameSelection.cpp#newcode710 > > third_party/WebKit/Source/core/editing/FrameSelection.cpp:710: > invalidateLocalCaretRect(newNode, m_previousCaretRect); > > ...
4 years, 10 months ago (2016-02-03 11:27:39 UTC) #8
yosin_UTC9
On 2016/02/03 at 11:27:39, dongseong.hwang wrote: > On 2016/02/03 04:49:15, Yosi_UTC9 wrote: > > https://codereview.chromium.org/1654123002/diff/1/third_party/WebKit/Source/core/editing/FrameSelection.cpp#newcode710 ...
4 years, 10 months ago (2016-02-04 01:29:44 UTC) #9
dshwang
On 2016/02/04 01:29:44, Yosi_UTC9 wrote: > This is very hacky and hard to understand code. ...
4 years, 10 months ago (2016-02-04 20:28:48 UTC) #12
yosin_UTC9
https://codereview.chromium.org/1654123002/diff/40001/third_party/WebKit/Source/core/editing/FrameSelection.cpp File third_party/WebKit/Source/core/editing/FrameSelection.cpp (right): https://codereview.chromium.org/1654123002/diff/40001/third_party/WebKit/Source/core/editing/FrameSelection.cpp#newcode723 third_party/WebKit/Source/core/editing/FrameSelection.cpp:723: if (m_previousCaretNode && newNode == m_parentOfPreviousCaretNode && !m_previousCaretNode->inDocument()) This ...
4 years, 10 months ago (2016-02-05 04:04:48 UTC) #13
dshwang
https://codereview.chromium.org/1654123002/diff/80001/third_party/WebKit/Source/core/editing/FrameSelection.cpp File third_party/WebKit/Source/core/editing/FrameSelection.cpp (right): https://codereview.chromium.org/1654123002/diff/80001/third_party/WebKit/Source/core/editing/FrameSelection.cpp#newcode724 third_party/WebKit/Source/core/editing/FrameSelection.cpp:724: && newNode == m_parentOfPreviousCaretNode.get()) { > This condition isn't ...
4 years, 10 months ago (2016-02-05 10:25:47 UTC) #15
dshwang
On 2016/02/05 10:25:47, dshwang wrote: > https://codereview.chromium.org/1654123002/diff/80001/third_party/WebKit/Source/core/editing/FrameSelection.cpp > File third_party/WebKit/Source/core/editing/FrameSelection.cpp (right): > > https://codereview.chromium.org/1654123002/diff/80001/third_party/WebKit/Source/core/editing/FrameSelection.cpp#newcode724 > ...
4 years, 10 months ago (2016-02-10 17:46:35 UTC) #16
yosin_UTC9
https://codereview.chromium.org/1654123002/diff/80001/third_party/WebKit/Source/core/editing/FrameSelection.cpp File third_party/WebKit/Source/core/editing/FrameSelection.cpp (right): https://codereview.chromium.org/1654123002/diff/80001/third_party/WebKit/Source/core/editing/FrameSelection.cpp#newcode724 third_party/WebKit/Source/core/editing/FrameSelection.cpp:724: && newNode == m_parentOfPreviousCaretNode.get()) { On 2016/02/05 at 10:25:47, ...
4 years, 10 months ago (2016-02-12 03:53:13 UTC) #17
yosin_UTC9
On 2016/02/12 at 03:53:13, Yosi_UTC9 wrote: > https://codereview.chromium.org/1654123002/diff/80001/third_party/WebKit/Source/core/editing/FrameSelection.cpp > File third_party/WebKit/Source/core/editing/FrameSelection.cpp (right): > > https://codereview.chromium.org/1654123002/diff/80001/third_party/WebKit/Source/core/editing/FrameSelection.cpp#newcode724 ...
4 years, 10 months ago (2016-02-12 04:11:51 UTC) #18
dshwang
On 2016/02/12 04:11:51, Yosi_UTC9 wrote: > On 2016/02/12 at 03:53:13, Yosi_UTC9 wrote: > > > ...
4 years, 10 months ago (2016-02-16 18:54:15 UTC) #19
yosin_UTC9
On 2016/02/16 at 18:54:15, dongseong.hwang wrote: > On 2016/02/12 04:11:51, Yosi_UTC9 wrote: > > On ...
4 years, 10 months ago (2016-02-17 04:29:26 UTC) #20
yosin_UTC9
On 2016/02/17 at 04:29:26, Yosi_UTC9 wrote: > On 2016/02/16 at 18:54:15, dongseong.hwang wrote: > > ...
4 years, 10 months ago (2016-02-17 04:51:24 UTC) #21
dshwang
This bug is fixed recently. I failed to find what commit fix it. Now Blink ...
4 years, 10 months ago (2016-02-19 15:16:27 UTC) #23
dshwang
If I change the caret style to bold, it's still reproduced. New CL applies your ...
4 years, 10 months ago (2016-02-19 17:16:40 UTC) #25
yosin_UTC9
Sorry for late response, I was OOO Monday and Tuesday. C++ changes good. Can you ...
4 years, 10 months ago (2016-02-24 03:55:25 UTC) #28
dshwang
On 2016/02/24 03:55:25, Yosi_UTC9 wrote: > C++ changes good. > Can you add layout-test or ...
4 years, 9 months ago (2016-02-24 13:12:18 UTC) #30
yosin_UTC9
lgtm https://codereview.chromium.org/1654123002/diff/220001/third_party/WebKit/ManualTests/caret-paint-after-last-text-is-removed.html File third_party/WebKit/ManualTests/caret-paint-after-last-text-is-removed.html (right): https://codereview.chromium.org/1654123002/diff/220001/third_party/WebKit/ManualTests/caret-paint-after-last-text-is-removed.html#newcode1 third_party/WebKit/ManualTests/caret-paint-after-last-text-is-removed.html:1: <!DOCTYPE html> Since we have an unit test, ...
4 years, 9 months ago (2016-02-25 02:03:55 UTC) #32
dshwang
Thank you for patient review! https://codereview.chromium.org/1654123002/diff/220001/third_party/WebKit/ManualTests/caret-paint-after-last-text-is-removed.html File third_party/WebKit/ManualTests/caret-paint-after-last-text-is-removed.html (right): https://codereview.chromium.org/1654123002/diff/220001/third_party/WebKit/ManualTests/caret-paint-after-last-text-is-removed.html#newcode1 third_party/WebKit/ManualTests/caret-paint-after-last-text-is-removed.html:1: <!DOCTYPE html> On 2016/02/25 ...
4 years, 9 months ago (2016-02-25 18:27:08 UTC) #33
jbroman
I trust yosin's review (and this seems reasonable enough), but I have one nit, sorry. ...
4 years, 9 months ago (2016-02-25 18:29:22 UTC) #36
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1654123002/240001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1654123002/240001
4 years, 9 months ago (2016-02-25 18:30:39 UTC) #37
dshwang
https://codereview.chromium.org/1654123002/diff/240001/third_party/WebKit/Source/core/editing/FrameSelection.h File third_party/WebKit/Source/core/editing/FrameSelection.h (right): https://codereview.chromium.org/1654123002/diff/240001/third_party/WebKit/Source/core/editing/FrameSelection.h#newcode290 third_party/WebKit/Source/core/editing/FrameSelection.h:290: bool ShouldPaintCaretForTesting() const { return m_shouldPaintCaret; } On 2016/02/25 ...
4 years, 9 months ago (2016-02-25 20:02:49 UTC) #39
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1654123002/260001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1654123002/260001
4 years, 9 months ago (2016-02-25 20:07:40 UTC) #46
commit-bot: I haz the power
Committed patchset #10 (id:260001)
4 years, 9 months ago (2016-02-25 23:17:45 UTC) #48
commit-bot: I haz the power
Patchset 10 (id:??) landed as https://crrev.com/26006147cabc6a22d94afc81bdd657328cdc7cb7 Cr-Commit-Position: refs/heads/master@{#377696}
4 years, 9 months ago (2016-02-25 23:18:45 UTC) #50
yosin_UTC9
I found it! Sorry, my memory is too small...
4 years, 6 months ago (2016-06-16 13:14:27 UTC) #51
dshwang
haha, no problem. Good to see you in person :) - Dongseong On Thu, Jun ...
4 years, 6 months ago (2016-06-17 12:26:16 UTC) #52
dshwang
4 years, 6 months ago (2016-06-17 12:26:17 UTC) #53
Message was sent while issue was closed.
haha, no problem. Good to see you in person :)

- Dongseong

On Thu, Jun 16, 2016 at 3:14 PM, yosin@chromium.org via
codereview.chromium.org <reply@chromiumcodereview-hr.appspotmail.com> wrote:

> I found it! Sorry, my memory is too small...
>
> https://codereview.chromium.org/1654123002/
>

-- 
You received this message because you are subscribed to the Google Groups
"Chromium-reviews" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to chromium-reviews+unsubscribe@chromium.org.

Powered by Google App Engine
This is Rietveld 408576698