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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/editing/EditingStyle.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2005, 2006, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2009, 2010, 2011 Google Inc. All rights reserved. 3 * Copyright (C) 2009, 2010, 2011 Google Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 // If Mail wraps the fragment with a Paste as Quotation blockquote, or if 601 // If Mail wraps the fragment with a Paste as Quotation blockquote, or if
602 // you're pasting into a quoted region, styles from blockquoteNode are 602 // you're pasting into a quoted region, styles from blockquoteNode are
603 // allowed to override those from the source document, see 603 // allowed to override those from the source document, see
604 // <rdar://problem/4930986> and <rdar://problem/5089327>. 604 // <rdar://problem/4930986> and <rdar://problem/5089327>.
605 HTMLQuoteElement* blockquoteElement = 605 HTMLQuoteElement* blockquoteElement =
606 !context || isMailPasteAsQuotationHTMLBlockQuoteElement(context) 606 !context || isMailPasteAsQuotationHTMLBlockQuoteElement(context)
607 ? toHTMLQuoteElement(context) 607 ? toHTMLQuoteElement(context)
608 : toHTMLQuoteElement(enclosingNodeOfType( 608 : toHTMLQuoteElement(enclosingNodeOfType(
609 Position::firstPositionInNode(context), 609 Position::firstPositionInNode(context),
610 isMailHTMLBlockquoteElement, CanCrossEditingBoundary)); 610 isMailHTMLBlockquoteElement, CanCrossEditingBoundary));
611
612 // EditingStyle::removeStyleFromRulesAndContext() uses StyleResolver,
613 // which requires clean style.
614 // TODO(editing-dev): There is currently no way to update style without
615 // updating layout. We might want to have updateLifcycleToStyleClean()
616 // similar to FrameView::updateLifecylceToLayoutClean() in Document.
617 document().updateStyleAndLayoutIgnorePendingStylesheets();
618
611 if (blockquoteElement) 619 if (blockquoteElement)
612 newInlineStyle->removeStyleFromRulesAndContext( 620 newInlineStyle->removeStyleFromRulesAndContext(
613 element, document().documentElement()); 621 element, document().documentElement());
614 622
615 newInlineStyle->removeStyleFromRulesAndContext(element, context); 623 newInlineStyle->removeStyleFromRulesAndContext(element, context);
616 } 624 }
617 625
618 if (!inlineStyle || newInlineStyle->isEmpty()) { 626 if (!inlineStyle || newInlineStyle->isEmpty()) {
619 if (isStyleSpanOrSpanWithOnlyStyleAttribute(element) || 627 if (isStyleSpanOrSpanWithOnlyStyleAttribute(element) ||
620 isEmptyFontTag(element, AllowNonEmptyStyleAttribute)) { 628 isEmptyFontTag(element, AllowNonEmptyStyleAttribute)) {
(...skipping 1463 matching lines...) Expand 10 before | Expand all | Expand 10 after
2084 visitor->trace(m_startOfInsertedContent); 2092 visitor->trace(m_startOfInsertedContent);
2085 visitor->trace(m_endOfInsertedContent); 2093 visitor->trace(m_endOfInsertedContent);
2086 visitor->trace(m_insertionStyle); 2094 visitor->trace(m_insertionStyle);
2087 visitor->trace(m_documentFragment); 2095 visitor->trace(m_documentFragment);
2088 visitor->trace(m_startOfInsertedRange); 2096 visitor->trace(m_startOfInsertedRange);
2089 visitor->trace(m_endOfInsertedRange); 2097 visitor->trace(m_endOfInsertedRange);
2090 CompositeEditCommand::trace(visitor); 2098 CompositeEditCommand::trace(visitor);
2091 } 2099 }
2092 2100
2093 } // namespace blink 2101 } // namespace blink
OLDNEW
« 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