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

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

Issue 1157363007: Refactoring: Use enum class for SerializationType (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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
« no previous file with comments | « Source/core/editing/MarkupAccumulator.h ('k') | Source/core/xml/XMLSerializer.cpp » ('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) 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 496 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 return false; 507 return false;
508 if (element.hasChildren()) 508 if (element.hasChildren())
509 return false; 509 return false;
510 if (element.isHTMLElement() && !elementCannotHaveEndTag(element)) 510 if (element.isHTMLElement() && !elementCannotHaveEndTag(element))
511 return false; 511 return false;
512 return true; 512 return true;
513 } 513 }
514 514
515 bool MarkupAccumulator::serializeAsHTMLDocument(const Node& node) const 515 bool MarkupAccumulator::serializeAsHTMLDocument(const Node& node) const
516 { 516 {
517 if (m_serializationType == ForcedXML) 517 if (m_serializationType == SerializationType::ForcedXML)
518 return false; 518 return false;
519 return node.document().isHTMLDocument(); 519 return node.document().isHTMLDocument();
520 } 520 }
521 521
522 template<typename Strategy> 522 template<typename Strategy>
523 static void serializeNodesWithNamespaces(MarkupAccumulator& accumulator, Node& t argetNode, EChildrenOnly childrenOnly, const Namespaces* namespaces) 523 static void serializeNodesWithNamespaces(MarkupAccumulator& accumulator, Node& t argetNode, EChildrenOnly childrenOnly, const Namespaces* namespaces)
524 { 524 {
525 Namespaces namespaceHash; 525 Namespaces namespaceHash;
526 if (namespaces) 526 if (namespaces)
527 namespaceHash = *namespaces; 527 namespaceHash = *namespaces;
(...skipping 22 matching lines...) Expand all
550 namespaces = &namespaceHash; 550 namespaces = &namespaceHash;
551 } 551 }
552 552
553 serializeNodesWithNamespaces<Strategy>(accumulator, targetNode, childrenOnly , namespaces); 553 serializeNodesWithNamespaces<Strategy>(accumulator, targetNode, childrenOnly , namespaces);
554 return accumulator.toString(); 554 return accumulator.toString();
555 } 555 }
556 556
557 template String serializeNodes<EditingStrategy>(MarkupAccumulator&, Node&, EChil drenOnly); 557 template String serializeNodes<EditingStrategy>(MarkupAccumulator&, Node&, EChil drenOnly);
558 558
559 } 559 }
OLDNEW
« no previous file with comments | « Source/core/editing/MarkupAccumulator.h ('k') | Source/core/xml/XMLSerializer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698