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

Unified Diff: third_party/WebKit/Source/core/editing/SurroundingText.cpp

Issue 2430273006: Remove the redundant layout update from WebSurroundingText::textContent (Closed)
Patch Set: fix typo Created 4 years, 2 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/SurroundingText.cpp
diff --git a/third_party/WebKit/Source/core/editing/SurroundingText.cpp b/third_party/WebKit/Source/core/editing/SurroundingText.cpp
index 8c49e39bf8d5b552735dad55a354d1c46aabbcd7..e6534794fd2a6439503366a220cceae71a604044 100644
--- a/third_party/WebKit/Source/core/editing/SurroundingText.cpp
+++ b/third_party/WebKit/Source/core/editing/SurroundingText.cpp
@@ -104,15 +104,13 @@ void SurroundingText::initialize(const Position& startPosition,
DCHECK(m_contentRange);
}
-Document* SurroundingText::document() const {
- if (m_contentRange)
- return &m_contentRange->ownerDocument();
- return nullptr;
-}
-
String SurroundingText::content() const {
- if (m_contentRange)
+ if (m_contentRange) {
+ // SurroundingText is created with clean layout and must not be stored
+ // through DOM or style changes, so layout must still be clean here.
+ DCHECK(!m_contentRange->ownerDocument().needsLayoutTreeUpdate());
return m_contentRange->text();
+ }
return String();
}
« no previous file with comments | « third_party/WebKit/Source/core/editing/SurroundingText.h ('k') | third_party/WebKit/Source/web/WebSurroundingText.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698