PositionIterator returns redundant position on SELECT+OPTION |
||
Issue description
PositionIterator returns AfterNode(SELECT) twice.
TEST_F(PositionIteratorTest, incrementWithSelectElement) {
setBodyContent("<select><option>1</option><option>2</option></select>123");
Element* const select = document().querySelector("select");
Node* const text = select->nextSibling();
PositionIterator domIterator(
Position::firstPositionInNode(document().body()));
domIterator.increment();
EXPECT_EQ(Position::beforeNode(select), domIterator.computePosition());
domIterator.increment();
EXPECT_EQ(Position::afterNode(select), domIterator.computePosition());
domIterator.increment();
EXPECT_EQ(Position::afterNode(select), domIterator.computePosition())
<< "This is redundant result, we should not have.";
domIterator.increment();
EXPECT_EQ(Position(document().body(), 1), domIterator.computePosition());
domIterator.increment();
EXPECT_EQ(Position(text, 0), domIterator.computePosition());
...
}
,
Feb 8 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/2faa2b6b25dc948985640efbb5f4b6b5c38efbcb commit 2faa2b6b25dc948985640efbb5f4b6b5c38efbcb Author: Rune Lillesveen <futhark@chromium.org> Date: Thu Feb 08 09:44:43 2018 Introduce slot-in-flat-tree behind experimental flag. Use two separate flags to be able to ship slot-in-flat-tree before incremental shadow dom. With this new flag enabled we utilize FlatTreeTraversalNg for flat tree traversal which includes slots. Previously landed CLs have prepared style recalc and layout tree building traversal to handle slot elements as any other element. There is one code change here to handle slots in optgroup UA shadow where we require ComputedStyle to be stored for optgroup and option even when they are display:none. The rest of the changes are test expectation changes and runtime flag changes. Bug: 660265 , 697283 Change-Id: I3149896927a2e677790b9fb452b20832db8a7840 Reviewed-on: https://chromium-review.googlesource.com/871150 Commit-Queue: Rune Lillesveen <futhark@chromium.org> Reviewed-by: Kent Tamura <tkent@chromium.org> Reviewed-by: Yoshifumi Inoue <yosin@chromium.org> Reviewed-by: Hayato Ito <hayato@chromium.org> Cr-Commit-Position: refs/heads/master@{#535342} [modify] https://crrev.com/2faa2b6b25dc948985640efbb5f4b6b5c38efbcb/third_party/WebKit/LayoutTests/TestExpectations [modify] https://crrev.com/2faa2b6b25dc948985640efbb5f4b6b5c38efbcb/third_party/WebKit/LayoutTests/editing/assert_selection.html [modify] https://crrev.com/2faa2b6b25dc948985640efbb5f4b6b5c38efbcb/third_party/WebKit/LayoutTests/inspector-protocol/dom-snapshot/dom-snapshot-getSnapshot-input-value-expected.txt [modify] https://crrev.com/2faa2b6b25dc948985640efbb5f4b6b5c38efbcb/third_party/WebKit/Source/core/dom/FlatTreeTraversal.cpp [modify] https://crrev.com/2faa2b6b25dc948985640efbb5f4b6b5c38efbcb/third_party/WebKit/Source/core/dom/FlatTreeTraversal.h [modify] https://crrev.com/2faa2b6b25dc948985640efbb5f4b6b5c38efbcb/third_party/WebKit/Source/core/dom/FlatTreeTraversalTest.cpp [modify] https://crrev.com/2faa2b6b25dc948985640efbb5f4b6b5c38efbcb/third_party/WebKit/Source/core/dom/Node.cpp [modify] https://crrev.com/2faa2b6b25dc948985640efbb5f4b6b5c38efbcb/third_party/WebKit/Source/core/dom/ng/flat_tree_traversal_ng_test.cc [modify] https://crrev.com/2faa2b6b25dc948985640efbb5f4b6b5c38efbcb/third_party/WebKit/Source/core/editing/PositionIteratorTest.cpp [modify] https://crrev.com/2faa2b6b25dc948985640efbb5f4b6b5c38efbcb/third_party/WebKit/Source/core/editing/testing/SelectionSampleTest.cpp [modify] https://crrev.com/2faa2b6b25dc948985640efbb5f4b6b5c38efbcb/third_party/WebKit/Source/core/html/HTMLSlotElement.cpp [modify] https://crrev.com/2faa2b6b25dc948985640efbb5f4b6b5c38efbcb/third_party/WebKit/Source/platform/runtime_enabled_features.json5
,
Feb 9 2018
|
||
►
Sign in to add a comment |
||
Comment 1 by yosin@chromium.org
, Feb 8 2018Components: -Blink>Editing Blink>Editing>Selection