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 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 appendProcessingInstruction(result, static_cast<const ProcessingInstruct
ion*>(node)->target(), static_cast<const ProcessingInstruction*>(node)->data()); | 505 appendProcessingInstruction(result, static_cast<const ProcessingInstruct
ion*>(node)->target(), static_cast<const ProcessingInstruction*>(node)->data()); |
506 break; | 506 break; |
507 case Node::ELEMENT_NODE: | 507 case Node::ELEMENT_NODE: |
508 appendElement(result, toElement(const_cast<Node*>(node)), namespaces); | 508 appendElement(result, toElement(const_cast<Node*>(node)), namespaces); |
509 break; | 509 break; |
510 case Node::CDATA_SECTION_NODE: | 510 case Node::CDATA_SECTION_NODE: |
511 appendCDATASection(result, static_cast<const CDATASection*>(node)->data(
)); | 511 appendCDATASection(result, static_cast<const CDATASection*>(node)->data(
)); |
512 break; | 512 break; |
513 case Node::ATTRIBUTE_NODE: | 513 case Node::ATTRIBUTE_NODE: |
514 case Node::ENTITY_NODE: | 514 case Node::ENTITY_NODE: |
515 case Node::ENTITY_REFERENCE_NODE: | |
516 case Node::NOTATION_NODE: | 515 case Node::NOTATION_NODE: |
517 case Node::XPATH_NAMESPACE_NODE: | 516 case Node::XPATH_NAMESPACE_NODE: |
518 ASSERT_NOT_REACHED(); | 517 ASSERT_NOT_REACHED(); |
519 break; | 518 break; |
520 } | 519 } |
521 } | 520 } |
522 | 521 |
523 // Rules of self-closure | 522 // Rules of self-closure |
524 // 1. No elements in HTML documents use the self-closing syntax. | 523 // 1. No elements in HTML documents use the self-closing syntax. |
525 // 2. Elements w/ children never self-close because they use a separate end tag. | 524 // 2. Elements w/ children never self-close because they use a separate end tag. |
(...skipping 27 matching lines...) Expand all Loading... |
553 if (!node->isElementNode() || shouldSelfClose(node) || (!node->hasChildNodes
() && elementCannotHaveEndTag(node))) | 552 if (!node->isElementNode() || shouldSelfClose(node) || (!node->hasChildNodes
() && elementCannotHaveEndTag(node))) |
554 return; | 553 return; |
555 | 554 |
556 result.append('<'); | 555 result.append('<'); |
557 result.append('/'); | 556 result.append('/'); |
558 result.append(toElement(node)->nodeNamePreservingCase()); | 557 result.append(toElement(node)->nodeNamePreservingCase()); |
559 result.append('>'); | 558 result.append('>'); |
560 } | 559 } |
561 | 560 |
562 } | 561 } |
OLD | NEW |