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

Unified Diff: third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp

Issue 2422133002: Audit use of updateStyleAndLayoutIgnorePendingStylesheets in EditingStyle::removeStyleFromRulesAndC… (Closed)
Patch Set: Add further notes 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/EditingStyle.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/core/editing/commands/ReplaceSelectionCommand.cpp
diff --git a/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp b/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp
index 20d63aac1dde467fdef8ee85ee21ffeeac094139..89143181b1ed0c4af14094a4371065d10cb4b3f3 100644
--- a/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp
@@ -608,6 +608,14 @@ void ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline(
: toHTMLQuoteElement(enclosingNodeOfType(
Position::firstPositionInNode(context),
isMailHTMLBlockquoteElement, CanCrossEditingBoundary));
+
+ // EditingStyle::removeStyleFromRulesAndContext() uses StyleResolver,
+ // which requires clean style.
+ // TODO(editing-dev): There is currently no way to update style without
+ // updating layout. We might want to have updateLifcycleToStyleClean()
+ // similar to FrameView::updateLifecylceToLayoutClean() in Document.
+ document().updateStyleAndLayoutIgnorePendingStylesheets();
+
if (blockquoteElement)
newInlineStyle->removeStyleFromRulesAndContext(
element, document().documentElement());
« no previous file with comments | « third_party/WebKit/Source/core/editing/EditingStyle.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698