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

Side by Side Diff: third_party/WebKit/Source/core/editing/commands/ApplyStyleCommand.cpp

Issue 1703903002: Editing: Remove unreasonable ASSERT_NO_EDITING_ABORT instances. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 | « no previous file | third_party/WebKit/Source/core/editing/commands/EditingState.h » ('j') | 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, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2005, 2006, 2008, 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 1136 matching lines...) Expand 10 before | Expand all | Expand 10 after
1147 if (!child->parentNode()) 1147 if (!child->parentNode())
1148 continue; 1148 continue;
1149 if (!child->contains(targetNode) && elementsToPushDown.size()) { 1149 if (!child->contains(targetNode) && elementsToPushDown.size()) {
1150 for (const auto& element : elementsToPushDown) { 1150 for (const auto& element : elementsToPushDown) {
1151 RefPtrWillBeRawPtr<Element> wrapper = element->cloneElementW ithoutChildren(); 1151 RefPtrWillBeRawPtr<Element> wrapper = element->cloneElementW ithoutChildren();
1152 wrapper->removeAttribute(styleAttr); 1152 wrapper->removeAttribute(styleAttr);
1153 // Delete id attribute from the second element because the s ame id cannot be used for more than one element 1153 // Delete id attribute from the second element because the s ame id cannot be used for more than one element
1154 element->removeAttribute(HTMLNames::idAttr); 1154 element->removeAttribute(HTMLNames::idAttr);
1155 if (isHTMLAnchorElement(element)) 1155 if (isHTMLAnchorElement(element))
1156 element->removeAttribute(HTMLNames::nameAttr); 1156 element->removeAttribute(HTMLNames::nameAttr);
1157 surroundNodeRangeWithElement(child, child, wrapper, ASSERT_N O_EDITING_ABORT); 1157 surroundNodeRangeWithElement(child, child, wrapper, editingS tate);
1158 if (editingState->isAborted())
1159 return;
1158 } 1160 }
1159 } 1161 }
1160 1162
1161 // Apply style to all nodes containing targetNode and their siblings but NOT to targetNode 1163 // Apply style to all nodes containing targetNode and their siblings but NOT to targetNode
1162 // But if we've removed styledElement then go ahead and always apply the style. 1164 // But if we've removed styledElement then go ahead and always apply the style.
1163 if (child != targetNode || styledElement) { 1165 if (child != targetNode || styledElement) {
1164 applyInlineStyleToPushDown(child, styleToPushDown.get(), editing State); 1166 applyInlineStyleToPushDown(child, styleToPushDown.get(), editing State);
1165 if (editingState->isAborted()) 1167 if (editingState->isAborted())
1166 return; 1168 return;
1167 } 1169 }
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after
1711 DEFINE_TRACE(ApplyStyleCommand) 1713 DEFINE_TRACE(ApplyStyleCommand)
1712 { 1714 {
1713 visitor->trace(m_style); 1715 visitor->trace(m_style);
1714 visitor->trace(m_start); 1716 visitor->trace(m_start);
1715 visitor->trace(m_end); 1717 visitor->trace(m_end);
1716 visitor->trace(m_styledInlineElement); 1718 visitor->trace(m_styledInlineElement);
1717 CompositeEditCommand::trace(visitor); 1719 CompositeEditCommand::trace(visitor);
1718 } 1720 }
1719 1721
1720 } // namespace blink 1722 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/commands/EditingState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698