Make 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}
8 files changed