DescriptionMake 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
Messages
Total messages: 22 (8 generated)
|