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

Side by Side Diff: third_party/WebKit/Source/core/editing/VisibleUnitsTest.cpp

Issue 2952563002: Make PreviousRootInlineBoxCandidatePosition() to ignore nodes without layout object (Closed)
Patch Set: 2017-06-20T18:32:03 Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/editing/VisibleUnitsLine.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/editing/VisibleUnits.h" 5 #include "core/editing/VisibleUnits.h"
6 6
7 #include <ostream> // NOLINT 7 #include <ostream> // NOLINT
8 #include "bindings/core/v8/V8BindingForTesting.h" 8 #include "bindings/core/v8/V8BindingForTesting.h"
9 #include "core/dom/Text.h" 9 #include "core/dom/Text.h"
10 #include "core/editing/EditingTestBase.h" 10 #include "core/editing/EditingTestBase.h"
(...skipping 1891 matching lines...) Expand 10 before | Expand all | Expand 10 after
1902 TEST_F(VisibleUnitsTest, 1902 TEST_F(VisibleUnitsTest,
1903 canonicalizationWithCollapsedSpaceAndIsolatedCombiningCharacter) { 1903 canonicalizationWithCollapsedSpaceAndIsolatedCombiningCharacter) {
1904 SetBodyContent("<p> &#x20E3;</p>"); // Leading space is necessary 1904 SetBodyContent("<p> &#x20E3;</p>"); // Leading space is necessary
1905 1905
1906 Node* paragraph = GetDocument().QuerySelector("p"); 1906 Node* paragraph = GetDocument().QuerySelector("p");
1907 Node* text = paragraph->firstChild(); 1907 Node* text = paragraph->firstChild();
1908 Position start = CanonicalPositionOf(Position::BeforeNode(paragraph)); 1908 Position start = CanonicalPositionOf(Position::BeforeNode(paragraph));
1909 EXPECT_EQ(Position(text, 2), start); 1909 EXPECT_EQ(Position(text, 2), start);
1910 } 1910 }
1911 1911
1912 TEST_F(VisibleUnitsTest,
1913 PreviousRootInlineBoxCandidatePositionWithDisplayNone) {
1914 SetBodyContent(
1915 "<div contenteditable>"
1916 "<div id=one>one abc</div>"
1917 "<div id=two>two <b id=none style=display:none>def</b> ghi</div>"
1918 "</div>");
1919 Element* const one = GetDocument().getElementById("one");
1920 Element* const two = GetDocument().getElementById("two");
1921 const VisiblePosition& visible_position =
1922 CreateVisiblePosition(Position::LastPositionInNode(two));
1923 EXPECT_EQ(Position(one->firstChild(), 7),
1924 PreviousRootInlineBoxCandidatePosition(
1925 two->lastChild(), visible_position, kContentIsEditable));
1926 }
1927
1912 } // namespace blink 1928 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/VisibleUnitsLine.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698