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 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
386 | 386 |
387 // Give an opportunity to subclasses to add their own attributes. | 387 // Give an opportunity to subclasses to add their own attributes. |
388 appendCustomAttributes(result, element, namespaces); | 388 appendCustomAttributes(result, element, namespaces); |
389 | 389 |
390 appendCloseTag(result, element); | 390 appendCloseTag(result, element); |
391 } | 391 } |
392 | 392 |
393 void MarkupAccumulator::appendOpenTag(StringBuilder& result, Element* element, N amespaces* namespaces) | 393 void MarkupAccumulator::appendOpenTag(StringBuilder& result, Element* element, N amespaces* namespaces) |
394 { | 394 { |
395 result.append('<'); | 395 result.append('<'); |
396 result.append(element->nodeNamePreservingCase()); | 396 result.append(element->Element::nodeName()); |
Inactive
2014/01/30 01:29:34
I don't really like this syntax. This makes the co
| |
397 if (!element->document().isHTMLDocument() && namespaces && shouldAddNamespac eElement(element)) | 397 if (!element->document().isHTMLDocument() && namespaces && shouldAddNamespac eElement(element)) |
398 appendNamespace(result, element->prefix(), element->namespaceURI(), *nam espaces); | 398 appendNamespace(result, element->prefix(), element->namespaceURI(), *nam espaces); |
399 } | 399 } |
400 | 400 |
401 void MarkupAccumulator::appendCloseTag(StringBuilder& result, Element* element) | 401 void MarkupAccumulator::appendCloseTag(StringBuilder& result, Element* element) |
402 { | 402 { |
403 if (shouldSelfClose(element)) { | 403 if (shouldSelfClose(element)) { |
404 if (element->isHTMLElement()) | 404 if (element->isHTMLElement()) |
405 result.append(' '); // XHTML 1.0 <-> HTML compatibility. | 405 result.append(' '); // XHTML 1.0 <-> HTML compatibility. |
406 result.append('/'); | 406 result.append('/'); |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
519 // which elements should be serialized w/o end tags. | 519 // which elements should be serialized w/o end tags. |
520 return toHTMLElement(node)->ieForbidsInsertHTML(); | 520 return toHTMLElement(node)->ieForbidsInsertHTML(); |
521 } | 521 } |
522 | 522 |
523 void MarkupAccumulator::appendEndMarkup(StringBuilder& result, const Node* node) | 523 void MarkupAccumulator::appendEndMarkup(StringBuilder& result, const Node* node) |
524 { | 524 { |
525 if (!node->isElementNode() || shouldSelfClose(node) || (!node->hasChildNodes () && elementCannotHaveEndTag(node))) | 525 if (!node->isElementNode() || shouldSelfClose(node) || (!node->hasChildNodes () && elementCannotHaveEndTag(node))) |
526 return; | 526 return; |
527 | 527 |
528 result.appendLiteral("</"); | 528 result.appendLiteral("</"); |
529 result.append(toElement(node)->nodeNamePreservingCase()); | 529 result.append(toElement(node)->Element::nodeName()); |
530 result.append('>'); | 530 result.append('>'); |
531 } | 531 } |
532 | 532 |
533 } | 533 } |
OLD | NEW |