OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |