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

Unified Diff: third_party/WebKit/Source/web/tests/WebFrameTest.cpp

Issue 2704933006: Expand FrameSeleciton::rootEditableElement() to increase chances of hoisting update layout (Closed)
Patch Set: 2017-02-21T15:42:51 Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/web/WebRange.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/tests/WebFrameTest.cpp
diff --git a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
index ad051847ab84776d8527648b118e11162f668476..5cf3d886c2f2063ea69db0be24a73080cc397bad 100644
--- a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
+++ b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
@@ -5452,9 +5452,18 @@ TEST_P(ParameterizedWebFrameTest, MoveRangeSelectionExtentScollsInputField) {
EXPECT_EQ("Length", selectionAsString(frame));
webViewHelper.webView()->selectionBounds(startWebRect, endWebRect);
- EXPECT_EQ(0, frame->frame()->selection().rootEditableElement()->scrollLeft());
+ EXPECT_EQ(0, frame->frame()
+ ->selection()
+ .computeVisibleSelectionInDOMTreeDeprecated()
+ .rootEditableElement()
+ ->scrollLeft());
frame->moveRangeSelectionExtent(WebPoint(endWebRect.x + 500, endWebRect.y));
- EXPECT_GE(frame->frame()->selection().rootEditableElement()->scrollLeft(), 1);
+ EXPECT_GE(frame->frame()
+ ->selection()
+ .computeVisibleSelectionInDOMTreeDeprecated()
+ .rootEditableElement()
+ ->scrollLeft(),
+ 1);
EXPECT_EQ("Lengthy text goes here.", selectionAsString(frame));
}
@@ -5473,8 +5482,11 @@ TEST_P(ParameterizedWebFrameTest, DISABLED_PositionForPointTest) {
initializeTextSelectionWebView(m_baseURL + "select_range_span_editable.html",
&webViewHelper);
WebLocalFrameImpl* mainFrame = webViewHelper.webView()->mainFrameImpl();
- LayoutObject* layoutObject =
- mainFrame->frame()->selection().rootEditableElement()->layoutObject();
+ LayoutObject* layoutObject = mainFrame->frame()
+ ->selection()
+ .computeVisibleSelectionInDOMTreeDeprecated()
+ .rootEditableElement()
+ ->layoutObject();
EXPECT_EQ(0, computeOffset(layoutObject, -1, -1));
EXPECT_EQ(64, computeOffset(layoutObject, 1000, 1000));
@@ -5482,8 +5494,11 @@ TEST_P(ParameterizedWebFrameTest, DISABLED_PositionForPointTest) {
initializeTextSelectionWebView(m_baseURL + "select_range_div_editable.html",
&webViewHelper);
mainFrame = webViewHelper.webView()->mainFrameImpl();
- layoutObject =
- mainFrame->frame()->selection().rootEditableElement()->layoutObject();
+ layoutObject = mainFrame->frame()
+ ->selection()
+ .computeVisibleSelectionInDOMTreeDeprecated()
+ .rootEditableElement()
+ ->layoutObject();
EXPECT_EQ(0, computeOffset(layoutObject, -1, -1));
EXPECT_EQ(64, computeOffset(layoutObject, 1000, 1000));
}
« no previous file with comments | « third_party/WebKit/Source/web/WebRange.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698