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

Issue 1404423005: Make most{Backward,Forward}CaretPosition() to handle first-letter pseudo element (Closed)

Created:
5 years, 2 months ago by yosin_UTC9
Modified:
5 years, 1 month ago
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

Make most{Backward,Forward}CaretPosition() to handle first-letter pseudo element Before this patch, Blink doesn't work well for first-letter pseudo element by two reasons: 1. Blink doesn't use first-letter text and uses only remaining text. 2. Scanning |InlineTextBox| with DOM offset rather than offset of |LayoutText::m_text| This patch makes |most{Backward,Forward}CaretPosition()| and associated functions to handle first-letter pseudo element with considering above. This patch also updates layout test expectation texts as result of correct handling of first-letter pseudo element. Background: In layout tree, |Text| node having first-letter style represented by two |LayoutTextFragment| objects, one for first-letter text and another for remaining text. |LayoutTextFragment| is derived from |LayutText|. Note: first-letter text can be multiple characters, which can contain leading whitespaces of |Text| node and punctuation characters and a letter character. |LayoutText::m_text| holds a text for layout/paint, which is different from text in DOM node, e.g. applying CSS text-transform. BUG=174349, 545520 TEST=webkit_unit_tests --gtest_filter=VisibleUnits.mostBackwardCaretPositionFirstLetter TEST=webkit_unit_tests --gtest_filter=VisibleUnits.mostForwardCaretPositionFirstLetter Committed: https://crrev.com/183a61e97bbb014b3b0a55e92cca03151632d1fe Cr-Commit-Position: refs/heads/master@{#358020}

Patch Set 1 #

Patch Set 2 : 2015-10-22T18:26:23 #

Patch Set 3 : 2015-10-23T11:15:50 #

Patch Set 4 : 2015-10-30T13:21:14 Rebase for LayoutTextFragment changes #

Total comments: 2

Patch Set 5 : 2015-11-02T14:06:55 #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+107 lines, -16 lines) Patch
M third_party/WebKit/LayoutTests/fast/text/first-letter-bad-line-boxes-crash-expected.txt View 1 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/fast/text/insert-text-crash-expected.txt View 1 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/editing/VisibleUnits.cpp View 1 2 3 4 8 chunks +59 lines, -13 lines 2 comments Download
M third_party/WebKit/Source/core/editing/VisibleUnitsTest.cpp View 1 2 chunks +44 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/layout/LayoutTextFragment.h View 1 2 3 2 chunks +1 line, -1 line 0 comments Download

Messages

Total messages: 22 (8 generated)
yosin_UTC9
Make most{Backward,Forward}CaretPosition() to handle first-letter pseudo element This patch makes |most{Backward,Forward}CaretPosition()| and associated functions to ...
5 years, 1 month ago (2015-10-30 07:38:58 UTC) #5
hajimehoshi
sgtm, but I don't have enough knowledge about this fix. Please wait for another reviewer. ...
5 years, 1 month ago (2015-10-30 08:36:59 UTC) #7
yoichio
Could you make the layouttests testharness and remove -expected.txt?
5 years, 1 month ago (2015-11-04 02:22:51 UTC) #8
yosin_UTC9
On 2015/11/04 at 02:22:51, yoichio wrote: > Could you make the layouttests testharness and remove ...
5 years, 1 month ago (2015-11-04 07:39:54 UTC) #9
yoichio
On 2015/11/04 at 07:39:54, yosin wrote: > On 2015/11/04 at 02:22:51, yoichio wrote: > > ...
5 years, 1 month ago (2015-11-05 04:00:07 UTC) #10
yoichio
https://codereview.chromium.org/1404423005/diff/100001/third_party/WebKit/Source/core/editing/VisibleUnits.cpp File third_party/WebKit/Source/core/editing/VisibleUnits.cpp (right): https://codereview.chromium.org/1404423005/diff/100001/third_party/WebKit/Source/core/editing/VisibleUnits.cpp#newcode2186 third_party/WebKit/Source/core/editing/VisibleUnits.cpp:2186: Could you use |Text* const anchorText = toText(anchorNode)| for ...
5 years, 1 month ago (2015-11-05 04:00:15 UTC) #11
yosin_UTC9
https://codereview.chromium.org/1404423005/diff/80001/third_party/WebKit/Source/core/editing/VisibleUnits.cpp File third_party/WebKit/Source/core/editing/VisibleUnits.cpp (right): https://codereview.chromium.org/1404423005/diff/80001/third_party/WebKit/Source/core/editing/VisibleUnits.cpp#newcode2156 third_party/WebKit/Source/core/editing/VisibleUnits.cpp:2156: static LayoutObject* associatedLayoutObjetOf(const Node& node, int offsetInNode) On 2015/10/30 ...
5 years, 1 month ago (2015-11-05 04:22:47 UTC) #12
yosin_UTC9
PTAL Update description.
5 years, 1 month ago (2015-11-05 06:51:24 UTC) #14
yoichio
lgtm
5 years, 1 month ago (2015-11-05 08:01:11 UTC) #15
yosin_UTC9
Could you take look for LayoutFragmentText.h change? Just expose member function length(). Thanks!
5 years, 1 month ago (2015-11-05 08:38:24 UTC) #17
kouhei (in TOK)
On 2015/11/05 08:38:24, Yosi_OOO_til_Oct_30 wrote: > Could you take look for LayoutFragmentText.h change? > Just ...
5 years, 1 month ago (2015-11-05 08:41:05 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1404423005/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1404423005/100001
5 years, 1 month ago (2015-11-05 09:03:02 UTC) #20
commit-bot: I haz the power
Committed patchset #5 (id:100001)
5 years, 1 month ago (2015-11-05 10:05:59 UTC) #21
commit-bot: I haz the power
5 years, 1 month ago (2015-11-05 10:06:41 UTC) #22
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/183a61e97bbb014b3b0a55e92cca03151632d1fe
Cr-Commit-Position: refs/heads/master@{#358020}

Powered by Google App Engine
This is Rietveld 408576698