Changeset 153508 in webkit
- Timestamp:
- Jul 30, 2013 6:59:00 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r153501 r153508 1 2013-07-30 Rob Buis <rwlbuis@webkit.org> 2 3 XMLSerializer should reset default namespace when necessary 4 https://bugs.webkit.org/show_bug.cgi?id=16739 5 XMLSerializer's handling of namespaces seems to be pretty broken 6 https://bugs.webkit.org/show_bug.cgi?id=106531 7 8 Reviewed by Ryosuke Niwa. 9 10 Add tests based on the testcases of both bugs. 11 12 * fast/dom/XMLSerializer-element-empty-namespace-expected.txt: Added. 13 * fast/dom/XMLSerializer-element-empty-namespace.html: Added. 14 * fast/dom/XMLSerializer-element-empty-namespace2-expected.txt: Added. 15 * fast/dom/XMLSerializer-element-empty-namespace2.html: Added. 16 1 17 2013-07-30 Alexey Proskuryakov <ap@apple.com> 2 18 -
trunk/Source/WebCore/ChangeLog
r153507 r153508 1 2013-07-30 Rob Buis <rwlbuis@webkit.org> 2 3 XMLSerializer should reset default namespace when necessary 4 https://bugs.webkit.org/show_bug.cgi?id=16739 5 XMLSerializer's handling of namespaces seems to be pretty broken 6 https://bugs.webkit.org/show_bug.cgi?id=106531 7 8 Reviewed by Ryosuke Niwa. 9 10 Write out empty default namespace declaration if the element is not in any namespace, as 11 described in http://www.whatwg.org/specs/web-apps/current-work/multipage/the-xhtml-syntax.html#xml-fragment-serialization-algorithm. 12 13 Tests: fast/dom/XMLSerializer-element-empty-namespace.html 14 fast/dom/XMLSerializer-element-empty-namespace2.html 15 16 * editing/MarkupAccumulator.cpp: 17 (WebCore::MarkupAccumulator::appendNamespace): 18 (WebCore::MarkupAccumulator::appendOpenTag): 19 * editing/MarkupAccumulator.h: 20 1 21 2013-07-30 Chris Fleizach <cfleizach@apple.com> 2 22 -
trunk/Source/WebCore/editing/MarkupAccumulator.cpp
r152785 r153508 294 294 } 295 295 296 void MarkupAccumulator::appendNamespace(StringBuilder& result, const AtomicString& prefix, const AtomicString& namespaceURI, Namespaces& namespaces )296 void MarkupAccumulator::appendNamespace(StringBuilder& result, const AtomicString& prefix, const AtomicString& namespaceURI, Namespaces& namespaces, bool allowEmptyDefaultNS) 297 297 { 298 298 namespaces.checkConsistency(); 299 if (namespaceURI.isEmpty()) 300 return; 299 if (namespaceURI.isEmpty()) { 300 // http://www.whatwg.org/specs/web-apps/current-work/multipage/the-xhtml-syntax.html#xml-fragment-serialization-algorithm 301 if (allowEmptyDefaultNS && namespaces.get(emptyAtom.impl())) { 302 result.append(' '); 303 result.append(xmlnsAtom.string()); 304 result.appendLiteral("=\"\""); 305 } 306 return; 307 } 301 308 302 309 // Use emptyAtoms's impl() for both null and empty strings since the HashMap can't handle 0 as a key … … 440 447 result.append(element->nodeNamePreservingCase()); 441 448 if ((inXMLFragmentSerialization() || !element->document()->isHTMLDocument()) && namespaces && shouldAddNamespaceElement(element)) 442 appendNamespace(result, element->prefix(), element->namespaceURI(), *namespaces );449 appendNamespace(result, element->prefix(), element->namespaceURI(), *namespaces, inXMLFragmentSerialization()); 443 450 } 444 451 -
trunk/Source/WebCore/editing/MarkupAccumulator.h
r152685 r153508 89 89 bool shouldAddNamespaceElement(const Element*); 90 90 bool shouldAddNamespaceAttribute(const Attribute&, Namespaces&); 91 void appendNamespace(StringBuilder&, const AtomicString& prefix, const AtomicString& namespaceURI, Namespaces& );91 void appendNamespace(StringBuilder&, const AtomicString& prefix, const AtomicString& namespaceURI, Namespaces&, bool allowEmptyDefaultNS = false); 92 92 EntityMask entityMaskForText(Text*) const; 93 93 virtual void appendText(StringBuilder&, Text*);
Note: See TracChangeset
for help on using the changeset viewer.