Chromium Code Reviews| 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, const Element& elem ent, Namespaces* namespaces) | 393 void MarkupAccumulator::appendOpenTag(StringBuilder& result, const Element& elem ent, Namespaces* namespaces) |
| 394 { | 394 { |
| 395 result.append('<'); | 395 result.append('<'); |
| 396 result.append(element.nodeNamePreservingCase()); | 396 result.append(element.tagQName().toString()); |
|
eseidel
2014/01/31 05:41:01
I see, we can't use nodeName() because it doesn't
| |
| 397 if (!element.document().isHTMLDocument() && namespaces && shouldAddNamespace Element(element)) | 397 if (!element.document().isHTMLDocument() && namespaces && shouldAddNamespace Element(element)) |
| 398 appendNamespace(result, element.prefix(), element.namespaceURI(), *names paces); | 398 appendNamespace(result, element.prefix(), element.namespaceURI(), *names paces); |
| 399 } | 399 } |
| 400 | 400 |
| 401 void MarkupAccumulator::appendCloseTag(StringBuilder& result, const Element& ele ment) | 401 void MarkupAccumulator::appendCloseTag(StringBuilder& result, const Element& ele ment) |
| 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).tagQName().toString()); |
| 530 result.append('>'); | 530 result.append('>'); |
| 531 } | 531 } |
| 532 | 532 |
| 533 } | 533 } |
| OLD | NEW |