Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 599 // If Mail wraps the fragment with a Paste as Quotation blockquote, or if | 599 // If Mail wraps the fragment with a Paste as Quotation blockquote, or if |
| 600 // you're pasting into a quoted region, styles from blockquoteNode are | 600 // you're pasting into a quoted region, styles from blockquoteNode are |
| 601 // allowed to override those from the source document, see | 601 // allowed to override those from the source document, see |
| 602 // <rdar://problem/4930986> and <rdar://problem/5089327>. | 602 // <rdar://problem/4930986> and <rdar://problem/5089327>. |
| 603 HTMLQuoteElement* blockquoteElement = | 603 HTMLQuoteElement* blockquoteElement = |
| 604 !context || isMailPasteAsQuotationHTMLBlockQuoteElement(context) | 604 !context || isMailPasteAsQuotationHTMLBlockQuoteElement(context) |
| 605 ? toHTMLQuoteElement(context) | 605 ? toHTMLQuoteElement(context) |
| 606 : toHTMLQuoteElement(enclosingNodeOfType( | 606 : toHTMLQuoteElement(enclosingNodeOfType( |
| 607 Position::firstPositionInNode(context), | 607 Position::firstPositionInNode(context), |
| 608 isMailHTMLBlockquoteElement, CanCrossEditingBoundary)); | 608 isMailHTMLBlockquoteElement, CanCrossEditingBoundary)); |
| 609 | |
| 610 // EditingStyle::removeStyleFromRulesAndContext() uses StyleResolver, | |
| 611 // which requires clean style. | |
| 612 document().updateStyleAndLayoutIgnorePendingStylesheets(); | |
|
yosin_UTC9
2016/10/17 09:45:18
Should we call Document::updateStyle() instead of
Xiaocheng
2016/10/17 10:07:27
Document::updateStyle is private...
yosin_UTC9
2016/10/18 01:40:19
Could you leave TODO comment that we need to updat
| |
| 613 | |
| 609 if (blockquoteElement) | 614 if (blockquoteElement) |
| 610 newInlineStyle->removeStyleFromRulesAndContext( | 615 newInlineStyle->removeStyleFromRulesAndContext( |
| 611 element, document().documentElement()); | 616 element, document().documentElement()); |
| 612 | 617 |
| 613 newInlineStyle->removeStyleFromRulesAndContext(element, context); | 618 newInlineStyle->removeStyleFromRulesAndContext(element, context); |
| 614 } | 619 } |
| 615 | 620 |
| 616 if (!inlineStyle || newInlineStyle->isEmpty()) { | 621 if (!inlineStyle || newInlineStyle->isEmpty()) { |
| 617 if (isStyleSpanOrSpanWithOnlyStyleAttribute(element) || | 622 if (isStyleSpanOrSpanWithOnlyStyleAttribute(element) || |
| 618 isEmptyFontTag(element, AllowNonEmptyStyleAttribute)) { | 623 isEmptyFontTag(element, AllowNonEmptyStyleAttribute)) { |
| (...skipping 1463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2082 visitor->trace(m_startOfInsertedContent); | 2087 visitor->trace(m_startOfInsertedContent); |
| 2083 visitor->trace(m_endOfInsertedContent); | 2088 visitor->trace(m_endOfInsertedContent); |
| 2084 visitor->trace(m_insertionStyle); | 2089 visitor->trace(m_insertionStyle); |
| 2085 visitor->trace(m_documentFragment); | 2090 visitor->trace(m_documentFragment); |
| 2086 visitor->trace(m_startOfInsertedRange); | 2091 visitor->trace(m_startOfInsertedRange); |
| 2087 visitor->trace(m_endOfInsertedRange); | 2092 visitor->trace(m_endOfInsertedRange); |
| 2088 CompositeEditCommand::trace(visitor); | 2093 CompositeEditCommand::trace(visitor); |
| 2089 } | 2094 } |
| 2090 | 2095 |
| 2091 } // namespace blink | 2096 } // namespace blink |
| OLD | NEW |