DescriptionMake PositionIterator to skip contents of INPUT/SELECT/TEXTAREA
This patch makes |PositionIterator| to skip child nodes of INPUT, SELECT and
TEXTAREA and adopt |mostBackwardCaretPosition()|[1] to pass correct value to
|PositionIterator| to make |canonicalizePositionOf()| not to return a position
inside user agent shadow tree, e.g. a position of inner editor for INPUT to
allow "SelectAll" command works correctly documents which start with INPUT,
SELECT, and TEXTAREA element.
Before this patch, if document starts with INPUT, "SelectAll" command selects
contents in inner editor because flat tree version of |PositionIterator|
returns such position for a position before INPUT. Then |VisibleSelection|
shrink selection into inner editor of INPUT to avoid crossing editing boundary.
This patch uses "user-select:contain"[2] idea for skipping contents of INPUT,
SELECT and TEXTAREA, to align with the spec[2] rather than using internal
term "selection boundary".
[1] "empty-document-stylewithcss.html" is failed if we don't change
|mostBackwardCaretPosition()|
[2] https://drafts.csswg.org/css-ui-4/#user-interaction
BUG=695317
TEST=webkit_unit_tests --gtest_filter=PositionIteratorTest.*
TEST=webkit_unit_tests --gtest_filter=VisibleSelectionTest.SelectAllWithInputElement
TEST=webkit_unit_tests --gtest_filter=VisibleUnitsTest.canonicalPositionOfWithInputElement
Review-Url: https://codereview.chromium.org/2720593005
Cr-Commit-Position: refs/heads/master@{#454236}
Committed: https://chromium.googlesource.com/chromium/src/+/2211504ac2b999a125b2215ce7f6be9e50878fea
Patch Set 1 #Patch Set 2 : 2017-03-01T02:24:50 #Patch Set 3 : 2017-03-01T10:47:08 #Patch Set 4 : 2017-03-02T14:30:36 Simplify if-condition in PositionIterator::increment() #
Total comments: 4
Patch Set 5 : 2017-03-02T18:15:47 #Patch Set 6 : 2017-03-02T19:03:48 Add FrameSelectionTest.SelectAllWithInputElement #Messages
Total messages: 47 (35 generated)
|