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

Unified Diff: third_party/WebKit/Source/core/testing/Internals.cpp

Issue 2350303003: Prune CreateVisiblePositionDeprecated from SurroundingText-related callers (Closed)
Patch Set: Created 4 years, 3 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 | « no previous file | third_party/WebKit/Source/web/WebSurroundingText.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/testing/Internals.cpp
diff --git a/third_party/WebKit/Source/core/testing/Internals.cpp b/third_party/WebKit/Source/core/testing/Internals.cpp
index 61c8f550ac6d89bd2682672d8d1daff92ca4c000..e1ef4e41c9eed4eb65eeb4f416610bc5d76c8347 100644
--- a/third_party/WebKit/Source/core/testing/Internals.cpp
+++ b/third_party/WebKit/Source/core/testing/Internals.cpp
@@ -2431,10 +2431,17 @@ void Internals::setValueForUser(Element* element, const String& value)
String Internals::textSurroundingNode(Node* node, int x, int y, unsigned long maxLength)
{
- if (!node || !node->layoutObject())
+ if (!node)
+ return String();
+
+ // SurroundingText must be created in clean layout.
tkent 2016/09/20 08:08:21 "SurrondingText and VisiblePosition must be..." is
Xiaocheng 2016/09/20 08:22:17 Done.
+ node->document().updateStyleAndLayoutIgnorePendingStylesheets();
+ DocumentLifecycle::DisallowTransitionScope disallowTransition(node->document().lifecycle());
+
+ if (!node->layoutObject())
return String();
blink::WebPoint point(x, y);
- SurroundingText surroundingText(createVisiblePositionDeprecated(node->layoutObject()->positionForPoint(static_cast<IntPoint>(point))).deepEquivalent().parentAnchoredEquivalent(), maxLength);
+ SurroundingText surroundingText(createVisiblePosition(node->layoutObject()->positionForPoint(static_cast<IntPoint>(point))).deepEquivalent().parentAnchoredEquivalent(), maxLength);
return surroundingText.content();
}
« no previous file with comments | « no previous file | third_party/WebKit/Source/web/WebSurroundingText.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698