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

Unified Diff: third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp

Issue 2292913002: Ensure clean layout before calling plainText() (flat tree version) (Closed)
Patch Set: 201609021415 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
Index: third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp
diff --git a/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp b/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp
index 79689699ab7321b56aa665fb1d521ff9f584e24a..f9a54e515331fbbfcf5f83fb2b2fa379f6ef930c 100644
--- a/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp
+++ b/third_party/WebKit/Source/core/editing/iterators/TextIterator.cpp
@@ -1210,6 +1210,12 @@ String plainText(const EphemeralRange& range, TextIteratorBehaviorFlags behavior
String plainText(const EphemeralRangeInFlatTree& range, TextIteratorBehaviorFlags behavior)
{
+ // TODO(xiaochengh): Move this check and the DisallowTransitionScope to
+ // |createPlainText| after we have ensured that both versions of |plainText|
+ // are called with clean layout.
+ if (range.isNull())
+ return emptyString();
+ DocumentLifecycle::DisallowTransitionScope disallowTransition(range.startPosition().document()->lifecycle());
return createPlainText<EditingInFlatTreeStrategy>(range, behavior);
}
« no previous file with comments | « third_party/WebKit/Source/core/editing/SelectionController.cpp ('k') | third_party/WebKit/Source/core/frame/LocalFrame.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698