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

Side by Side Diff: Source/core/editing/MarkupAccumulator.cpp

Issue 196683003: Use new is*Element() helper functions more in editing code (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2012 Apple Inc. All rights reserved.
3 * Copyright (C) 2009, 2010 Google Inc. All rights reserved. 3 * Copyright (C) 2009, 2010 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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 } 132 }
133 133
134 Namespaces namespaceHash; 134 Namespaces namespaceHash;
135 if (namespaces) 135 if (namespaces)
136 namespaceHash = *namespaces; 136 namespaceHash = *namespaces;
137 137
138 if (!childrenOnly) 138 if (!childrenOnly)
139 appendStartTag(targetNode, &namespaceHash); 139 appendStartTag(targetNode, &namespaceHash);
140 140
141 if (!(serializeAsHTMLDocument(targetNode) && elementCannotHaveEndTag(targetN ode))) { 141 if (!(serializeAsHTMLDocument(targetNode) && elementCannotHaveEndTag(targetN ode))) {
142 Node* current = targetNode.hasTagName(templateTag) ? toHTMLTemplateEleme nt(targetNode).content()->firstChild() : targetNode.firstChild(); 142 Node* current = isHTMLTemplateElement(targetNode) ? toHTMLTemplateElemen t(targetNode).content()->firstChild() : targetNode.firstChild();
143 for ( ; current; current = current->nextSibling()) 143 for ( ; current; current = current->nextSibling())
144 serializeNodesWithNamespaces(*current, IncludeNode, &namespaceHash, tagNamesToSkip); 144 serializeNodesWithNamespaces(*current, IncludeNode, &namespaceHash, tagNamesToSkip);
145 } 145 }
146 146
147 if (!childrenOnly) 147 if (!childrenOnly)
148 appendEndTag(targetNode); 148 appendEndTag(targetNode);
149 } 149 }
150 150
151 String MarkupAccumulator::resolveURLIfNeeded(const Element& element, const Strin g& urlString) const 151 String MarkupAccumulator::resolveURLIfNeeded(const Element& element, const Strin g& urlString) const
152 { 152 {
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 } 550 }
551 551
552 bool MarkupAccumulator::serializeAsHTMLDocument(const Node& node) const 552 bool MarkupAccumulator::serializeAsHTMLDocument(const Node& node) const
553 { 553 {
554 if (m_serializationType == ForcedXML) 554 if (m_serializationType == ForcedXML)
555 return false; 555 return false;
556 return node.document().isHTMLDocument(); 556 return node.document().isHTMLDocument();
557 } 557 }
558 558
559 } 559 }
OLDNEW
« no previous file with comments | « Source/core/editing/InsertParagraphSeparatorCommand.cpp ('k') | Source/core/editing/ReplaceSelectionCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698