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

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

Issue 2328923002: Audit the use of UpdateStyleAndLayoutIgnorePendingStylesheets in Editor::replaceSelectionWithFragme… (Closed)
Patch Set: Address comment 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/core/editing/spellcheck/SpellChecker.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/Editor.cpp
diff --git a/third_party/WebKit/Source/core/editing/Editor.cpp b/third_party/WebKit/Source/core/editing/Editor.cpp
index 05ce23eed63f5161958e044fa99fd3829756dc3c..cbb110238a4f2956af58bba27bef52de12c241ea 100644
--- a/third_party/WebKit/Source/core/editing/Editor.cpp
+++ b/third_party/WebKit/Source/core/editing/Editor.cpp
@@ -189,6 +189,10 @@ bool Editor::handleTextEvent(TextEvent* event)
if (event->isDrop())
return false;
+ // TODO(xiaochengh): The use of updateStyleAndLayoutIgnorePendingStylesheets
+ // needs to be audited. See http://crbug.com/590369 for more details.
+ m_frame->document()->updateStyleAndLayoutIgnorePendingStylesheets();
+
if (event->isPaste()) {
if (event->pastingFragment())
replaceSelectionWithFragment(event->pastingFragment(), false, event->shouldSmartReplace(), event->shouldMatchStyle());
@@ -530,7 +534,7 @@ bool Editor::canSmartReplaceWithPasteboard(Pasteboard* pasteboard)
void Editor::replaceSelectionWithFragment(DocumentFragment* fragment, bool selectReplacement, bool smartReplace, bool matchStyle)
{
- frame().document()->updateStyleAndLayoutIgnorePendingStylesheets();
+ DCHECK(!frame().document()->needsLayoutTreeUpdate());
if (frame().selection().isNone() || !frame().selection().isContentEditable() || !fragment)
return;
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698