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

Unified Diff: third_party/WebKit/Source/web/WebSurroundingText.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
« no previous file with comments | « third_party/WebKit/Source/core/editing/SurroundingText.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/WebSurroundingText.cpp
diff --git a/third_party/WebKit/Source/web/WebSurroundingText.cpp b/third_party/WebKit/Source/web/WebSurroundingText.cpp
index 497251765e9751444098988dca7b50a379e065ed..e7cec9067ea4485a5deada655d62ae5efcf1c368 100644
--- a/third_party/WebKit/Source/web/WebSurroundingText.cpp
+++ b/third_party/WebKit/Source/web/WebSurroundingText.cpp
@@ -58,6 +58,8 @@ void WebSurroundingText::initialize(const WebNode& webNode,
if (!node->layoutObject())
return;
+ // TODO(xiaochengh): The followinng SurroundingText can hold a null Range,
+ // in which case we should prevent it from being stored in |m_private|.
m_private.reset(new SurroundingText(
createVisiblePosition(node->layoutObject()->positionForPoint(
static_cast<IntPoint>(nodePoint)))
@@ -75,17 +77,14 @@ void WebSurroundingText::initializeFromCurrentSelection(WebLocalFrame* frame,
webFrame->document()->updateStyleAndLayoutIgnorePendingStylesheets();
if (Range* range = createRange(
- webFrame->selection().selection().toNormalizedEphemeralRange()))
+ webFrame->selection().selection().toNormalizedEphemeralRange())) {
+ // TODO(xiaochengh): The followinng SurroundingText can hold a null Range,
+ // in which case we should prevent it from being stored in |m_private|.
m_private.reset(new SurroundingText(*range, maxLength));
+ }
}
WebString WebSurroundingText::textContent() const {
- DCHECK(m_private->document());
-
- // TODO(editing-dev): The use of updateStyleAndLayoutIgnorePendingStylesheets
- // needs to be audited. See http://crbug.com/590369 for more details.
- m_private->document()->updateStyleAndLayoutIgnorePendingStylesheets();
-
return m_private->content();
}
« no previous file with comments | « third_party/WebKit/Source/core/editing/SurroundingText.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698