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

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

Issue 2414263002: Audit the use of updateStyleAndLayoutIgnorePendingStylesheets in toNormalizedEphemeralRange (Closed)
Patch Set: fix nit 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 | « no previous file | third_party/WebKit/Source/core/editing/Editor.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/editing/DOMSelection.cpp
diff --git a/third_party/WebKit/Source/core/editing/DOMSelection.cpp b/third_party/WebKit/Source/core/editing/DOMSelection.cpp
index e67f81be07fa1e42a38d9b9d55a68e8ecacba91b..47b9e565e634c55601c8a5eb123d5fcf1a80d7e5 100644
--- a/third_party/WebKit/Source/core/editing/DOMSelection.cpp
+++ b/third_party/WebKit/Source/core/editing/DOMSelection.cpp
@@ -525,6 +525,11 @@ void DOMSelection::deleteFromDocument() {
if (selection.isNone())
return;
+ // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
+ // needs to be audited. See http://crbug.com/590369 for more details.
+ // |VisibleSelection::toNormalizedEphemeralRange| requires clean layout.
+ frame()->document()->updateStyleAndLayoutIgnorePendingStylesheets();
+
Range* selectedRange =
createRange(selection.selection().toNormalizedEphemeralRange());
if (!selectedRange)
@@ -550,6 +555,12 @@ bool DOMSelection::containsNode(const Node* n, bool allowPartial) const {
return false;
unsigned nodeIndex = n->nodeIndex();
+
+ // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
+ // needs to be audited. See http://crbug.com/590369 for more details.
+ // |VisibleSelection::toNormalizedEphemeralRange| requires clean layout.
+ frame()->document()->updateStyleAndLayoutIgnorePendingStylesheets();
+
const EphemeralRange selectedRange =
selection.selection().toNormalizedEphemeralRange();
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/Editor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698