Changeset 152685 in webkit


Ignore:
Timestamp:
Jul 15, 2013 5:37:02 PM (11 years ago)
Author:
rwlbuis@webkit.org
Message:

XMLSerializer doesn't include namespaces on nodes in HTML documents
https://bugs.webkit.org/show_bug.cgi?id=16496

Patch by Rob Buis <rwlbuis@webkit.org> on 2013-07-15
Reviewed by Ryosuke Niwa.

Source/WebCore:

Introduce a xml fragment serialization mode as indicated by
http://html5.org/specs/dom-parsing.html#xmlserializer (commit 00b84d2). In this mode
the XML fragment serialization algorithm is respected, the changes in this patch do the following:

This is achieved by always, when in xml fragment serialization mode, attempting to write out the element/attribute namespace,
preventing using the XML namespace as a default namespace and special casing the use of element's in XML namespace by using the xml prefix.

The chosen approach matches FireFox 25 behavior.

Test: fast/dom/dom-serialize-namespace.html

  • WebCore.order: Adapt to changed createMarkup signature.
  • editing/MarkupAccumulator.cpp:

(WebCore::MarkupAccumulator::MarkupAccumulator):
(WebCore::MarkupAccumulator::serializeNodesWithNamespaces): makes sure xml namespace/prefix is known so it is never used in namespace declarations.
(WebCore::MarkupAccumulator::appendNamespace): Avoid adding namespace declarations that do not differ from current default namespace.
(WebCore::MarkupAccumulator::appendOpenTag): Print xml prefix if the element's namespace is XML to avoid conflicts.
(WebCore::MarkupAccumulator::appendAttribute):
(WebCore::MarkupAccumulator::shouldAddNamespaceAttribute): Also take into account xmlns attributes with no namespace.
(WebCore::MarkupAccumulator::shouldSelfClose): Force self-closing to create well-formed XML elements.

  • editing/MarkupAccumulator.h: Use EFragmentSerialization.

(WebCore::MarkupAccumulator::inXMLFragmentSerialization):

  • editing/markup.cpp:

(WebCore::createMarkup):

  • editing/markup.h: Add EFragmentSerialization enum.
  • xml/XMLSerializer.cpp:

(WebCore::XMLSerializer::serializeToString):

LayoutTests:

The updated tests are progressions and match FF.

  • fast/dom/Element/getAttribute-check-case-sensitivity-expected.txt:
  • fast/dom/Element/script-tests/getAttribute-check-case-sensitivity.js:
  • fast/dom/XMLSerializer-xml-namespace-expected.txt:
  • fast/dom/dom-serialize-namespace-expected.txt: Added.
  • fast/dom/dom-serialize-namespace.html: Added.
  • fast/xsl/xslt-processor-expected.txt:
  • inspector/elements/set-outer-html-expected.txt:
  • svg/custom/xlink-prefix-in-attributes-expected.txt:
Location:
trunk
Files:
2 added
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r152668 r152685  
     12013-07-15  Rob Buis  <rwlbuis@webkit.org>
     2
     3        XMLSerializer doesn't include namespaces on nodes in HTML documents
     4        https://bugs.webkit.org/show_bug.cgi?id=16496
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        The updated tests are progressions and match FF.
     9
     10        * fast/dom/Element/getAttribute-check-case-sensitivity-expected.txt:
     11        * fast/dom/Element/script-tests/getAttribute-check-case-sensitivity.js:
     12        * fast/dom/XMLSerializer-xml-namespace-expected.txt:
     13        * fast/dom/dom-serialize-namespace-expected.txt: Added.
     14        * fast/dom/dom-serialize-namespace.html: Added.
     15        * fast/xsl/xslt-processor-expected.txt:
     16        * inspector/elements/set-outer-html-expected.txt:
     17        * svg/custom/xlink-prefix-in-attributes-expected.txt:
     18
    1192013-07-15  Ryosuke Niwa  <rniwa@webkit.org>
    220
  • trunk/LayoutTests/fast/dom/Element/getAttribute-check-case-sensitivity-expected.txt

    r35931 r152685  
    1414PASS testAttribNodeNamePreservesCaseGetNode2() is "B,B"
    1515PASS testAttribNodeNameGetMutate() is "1"
    16 PASS (new XMLSerializer).serializeToString(node) is "<div myAttrib=\"XXX\"></div>"
     16PASS (new XMLSerializer).serializeToString(node) is "<div xmlns=\"http://www.w3.org/1999/xhtml\" myAttrib=\"XXX\"></div>"
    1717PASS node.getAttributeNode('myAttrib').name is "myAttrib"
    1818PASS node.getAttributeNode('myattrib').name is "myAttrib"
  • trunk/LayoutTests/fast/dom/Element/script-tests/getAttribute-check-case-sensitivity.js

    r98407 r152685  
    136136node.setAttributeNode(attrib);
    137137
    138 shouldBe("(new XMLSerializer).serializeToString(node)", '"<div myAttrib=\\"XXX\\"></div>"');
     138shouldBe("(new XMLSerializer).serializeToString(node)", '"<div xmlns=\\"http://www.w3.org/1999/xhtml\\" myAttrib=\\"XXX\\"></div>"');
    139139shouldBe("node.getAttributeNode('myAttrib').name", '"myAttrib"');
    140140shouldBe("node.getAttributeNode('myattrib').name", '"myAttrib"');
  • trunk/LayoutTests/fast/dom/XMLSerializer-xml-namespace-expected.txt

    r124210 r152685  
    1 <div id="target"> <div id="output"> </div><foo xml:space="preserve"></foo><bar xml:space="default"></bar></div>
     1<div xmlns="http://www.w3.org/1999/xhtml" id="target"> <div id="output"> </div><xml:foo xml:space="preserve"/><xml:bar xml:space="default"/></div>
    22
  • trunk/LayoutTests/fast/xsl/xslt-processor-expected.txt

    r127710 r152685  
    3737
    38381.1 Import two different stylesheets:
    39 <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head><body>
    40               CHARACTERS IN XSLT: ééééééééééé <br><br>SOURCE XML: &lt;&lt;&lt;&amp;тест&amp;&gt;&gt;&gt;</body></html>
     39<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /></head><body>
     40              CHARACTERS IN XSLT: ééééééééééé <br /><br />SOURCE XML: &lt;&lt;&lt;&amp;тест&amp;&gt;&gt;&gt;</body></html>
    41411.2 Import same stylesheet twice:
    4242<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
  • trunk/LayoutTests/inspector/elements/set-outer-html-for-xhtml-expected.txt

    r146897 r152685  
    1616==========8<==========
    1717<div xmlns="http://www.w3.org/1999/xhtml" id="container" style="display:none">
    18 <p xmlns="http://www.w3.org/1999/xhtml">WebKit is used by <a href="http://www.apple.com/safari/">Safari</a>, Dashboard, etc.</p>
    19 <h2 xmlns="http://www.w3.org/1999/xhtml">Getting not involved</h2>
    20 <p xmlns="http://www.w3.org/1999/xhtml" id="identity">There are many ways to get involved. You can:</p>
     18<p>WebKit is used by <a href="http://www.apple.com/safari/">Safari</a>, Dashboard, etc.</p>
     19<h2>Getting not involved</h2>
     20<p id="identity">There are many ways to get involved. You can:</p>
    2121</div>
    2222==========>8==========
     
    2828==========8<==========
    2929<div xmlns="http://www.w3.org/1999/xhtml" id="container" style="display:none">
    30 <p xmlns="http://www.w3.org/1999/xhtml">WebKit is used by <a href="http://www.apple.com/safari/">Safari</a>, Dashboard, etc.</p>
    31 <h2 xmlns="http://www.w3.org/1999/xhtml">Getting involved</h2>
    32 <p xmlns="http://www.w3.org/1999/xhtml" id="identity">There are many ways to get involved. You can:</p>
     30<p>WebKit is used by <a href="http://www.apple.com/safari/">Safari</a>, Dashboard, etc.</p>
     31<h2>Getting involved</h2>
     32<p id="identity">There are many ways to get involved. You can:</p>
    3333</div>
    3434==========>8==========
     
    4747==========8<==========
    4848<div xmlns="http://www.w3.org/1999/xhtml" id="container" style="display:none">
    49 <p xmlns="http://www.w3.org/1999/xhtml">WebKit is used by <a foo="bar" href="http://www.apple.com/safari/">Safari</a>, Dashboard, etc.</p>
    50 <h2 xmlns="http://www.w3.org/1999/xhtml">Getting involved</h2>
    51 <p xmlns="http://www.w3.org/1999/xhtml" id="identity">There are many ways to get involved. You can:</p>
     49<p>WebKit is used by <a foo="bar" href="http://www.apple.com/safari/">Safari</a>, Dashboard, etc.</p>
     50<h2>Getting involved</h2>
     51<p id="identity">There are many ways to get involved. You can:</p>
    5252</div>
    5353==========>8==========
     
    6161==========8<==========
    6262<div xmlns="http://www.w3.org/1999/xhtml" id="container" style="display:none">
    63 <p xmlns="http://www.w3.org/1999/xhtml">WebKit is used by <a href="http://www.apple.com/safari/">Safari</a>, Dashboard, etc.</p>
    64 <h2 xmlns="http://www.w3.org/1999/xhtml">Getting involved</h2>
    65 <p xmlns="http://www.w3.org/1999/xhtml" id="identity">There are many ways to get involved. You can:</p>
     63<p>WebKit is used by <a href="http://www.apple.com/safari/">Safari</a>, Dashboard, etc.</p>
     64<h2>Getting involved</h2>
     65<p id="identity">There are many ways to get involved. You can:</p>
    6666</div>
    6767==========>8==========
     
    7878==========8<==========
    7979<div xmlns="http://www.w3.org/1999/xhtml" id="container" style="display:none">
    80 <p xmlns="http://www.w3.org/1999/xhtml">WebKit is used by <a href="http://www.apple.com/safari/">Safari</a>, Dashboard, etc.</p>
    81 <h2 xmlns="http://www.w3.org/1999/xhtml"></h2>
    82 <p xmlns="http://www.w3.org/1999/xhtml" id="identity">There are many ways to get involved. You can:</p>
     80<p>WebKit is used by <a href="http://www.apple.com/safari/">Safari</a>, Dashboard, etc.</p>
     81<h2></h2>
     82<p id="identity">There are many ways to get involved. You can:</p>
    8383</div>
    8484==========>8==========
     
    9090==========8<==========
    9191<div xmlns="http://www.w3.org/1999/xhtml" id="container" style="display:none">
    92 <p xmlns="http://www.w3.org/1999/xhtml">WebKit is used by <a href="http://www.apple.com/safari/">Safari</a>, Dashboard, etc.</p>
    93 <h2 xmlns="http://www.w3.org/1999/xhtml">Getting involved</h2>
    94 <p xmlns="http://www.w3.org/1999/xhtml" id="identity">There are many ways to get involved. You can:</p>
     92<p>WebKit is used by <a href="http://www.apple.com/safari/">Safari</a>, Dashboard, etc.</p>
     93<h2>Getting involved</h2>
     94<p id="identity">There are many ways to get involved. You can:</p>
    9595</div>
    9696==========>8==========
     
    109109==========8<==========
    110110<div xmlns="http://www.w3.org/1999/xhtml" id="container" style="display:none">
    111 <p xmlns="http://www.w3.org/1999/xhtml">WebKit is used by <a href="http://www.apple.com/safari/">Safari</a>, Dashboard, etc.</p>
    112 <h2 xmlns="http://www.w3.org/1999/xhtml">Getting</h2><h2 xmlns="http://www.w3.org/1999/xhtml">involved</h2>
    113 <p xmlns="http://www.w3.org/1999/xhtml" id="identity">There are many ways to get involved. You can:</p>
     111<p>WebKit is used by <a href="http://www.apple.com/safari/">Safari</a>, Dashboard, etc.</p>
     112<h2>Getting</h2><h2>involved</h2>
     113<p id="identity">There are many ways to get involved. You can:</p>
    114114</div>
    115115==========>8==========
     
    123123==========8<==========
    124124<div xmlns="http://www.w3.org/1999/xhtml" id="container" style="display:none">
    125 <p xmlns="http://www.w3.org/1999/xhtml">WebKit is used by <a href="http://www.apple.com/safari/">Safari</a>, Dashboard, etc.</p>
    126 <h2 xmlns="http://www.w3.org/1999/xhtml">Getting involved</h2>
    127 <p xmlns="http://www.w3.org/1999/xhtml" id="identity">There are many ways to get involved. You can:</p>
     125<p>WebKit is used by <a href="http://www.apple.com/safari/">Safari</a>, Dashboard, etc.</p>
     126<h2>Getting involved</h2>
     127<p id="identity">There are many ways to get involved. You can:</p>
    128128</div>
    129129==========>8==========
     
    141141==========8<==========
    142142<div xmlns="http://www.w3.org/1999/xhtml" id="container" style="display:none">
    143 <p xmlns="http://www.w3.org/1999/xhtml">WebKit is used by <a href="http://www.apple.com/safari/">Safari</a>, Dashboard, etc.</p>
    144 <h3 xmlns="http://www.w3.org/1999/xhtml">Getting involved</h3>
    145 <p xmlns="http://www.w3.org/1999/xhtml" id="identity">There are many ways to get involved. You can:</p>
     143<p>WebKit is used by <a href="http://www.apple.com/safari/">Safari</a>, Dashboard, etc.</p>
     144<h3>Getting involved</h3>
     145<p id="identity">There are many ways to get involved. You can:</p>
    146146</div>
    147147==========>8==========
     
    154154==========8<==========
    155155<div xmlns="http://www.w3.org/1999/xhtml" id="container" style="display:none">
    156 <p xmlns="http://www.w3.org/1999/xhtml">WebKit is used by <a href="http://www.apple.com/safari/">Safari</a>, Dashboard, etc.</p>
    157 <h2 xmlns="http://www.w3.org/1999/xhtml">Getting involved</h2>
    158 <p xmlns="http://www.w3.org/1999/xhtml" id="identity">There are many ways to get involved. You can:</p>
     156<p>WebKit is used by <a href="http://www.apple.com/safari/">Safari</a>, Dashboard, etc.</p>
     157<h2>Getting involved</h2>
     158<p id="identity">There are many ways to get involved. You can:</p>
    159159</div>
    160160==========>8==========
  • trunk/LayoutTests/svg/custom/xlink-prefix-in-attributes-expected.txt

    r136984 r152685  
    1 <div id="target"> <div id="svgoutput"> </div><svg xmlns="http://www.w3.org/2000/svg" svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><image width="20" height="20" xlink:href="resources/green-checker.png"></image><image x="0" y="30" width="20" height="20" xlink:href="resources/green-checker.png"></image></svg></div> <El xmlns:a="http://www.w3.org/1999/xlink" a:title="C" a:href="H"/>
     1<div xmlns="http://www.w3.org/1999/xhtml" id="target"> <div id="svgoutput"> </div><svg xmlns="http://www.w3.org/2000/svg" svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><image width="20" height="20" xlink:href="resources/green-checker.png"/><image x="0" y="30" width="20" height="20" xlink:href="resources/green-checker.png"/></svg></div> <El xmlns:a="http://www.w3.org/1999/xlink" a:title="C" a:href="H"/>
    22
  • trunk/Source/WebCore/ChangeLog

    r152673 r152685  
     12013-07-15  Rob Buis  <rwlbuis@webkit.org>
     2
     3        XMLSerializer doesn't include namespaces on nodes in HTML documents
     4        https://bugs.webkit.org/show_bug.cgi?id=16496
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Introduce a xml fragment serialization mode as indicated by
     9        http://html5.org/specs/dom-parsing.html#xmlserializer (commit 00b84d2). In this mode
     10        the XML fragment serialization algorithm is respected, the changes in this patch do the following:
     11
     12        - elements are self-closing if otherwise this would lead to invalid xml syntax.
     13        - the resulting xml is XML namespace-well-formed (http://www.w3.org/TR/xml-names11/#Conformance).
     14        This is achieved by always, when in xml fragment serialization mode, attempting to write out the element/attribute namespace,
     15        preventing using the XML namespace as a default namespace and special casing the use of element's in XML namespace by using the xml prefix.
     16
     17        The chosen approach matches FireFox 25 behavior.
     18
     19        Test: fast/dom/dom-serialize-namespace.html
     20
     21        * WebCore.order: Adapt to changed createMarkup signature.
     22        * editing/MarkupAccumulator.cpp:
     23        (WebCore::MarkupAccumulator::MarkupAccumulator):
     24        (WebCore::MarkupAccumulator::serializeNodesWithNamespaces): makes sure xml namespace/prefix is known so it is never used in namespace declarations.
     25        (WebCore::MarkupAccumulator::appendNamespace): Avoid adding namespace declarations that do not differ from current default namespace.
     26        (WebCore::MarkupAccumulator::appendOpenTag): Print xml prefix if the element's namespace is XML to avoid conflicts.
     27        (WebCore::MarkupAccumulator::appendAttribute):
     28        (WebCore::MarkupAccumulator::shouldAddNamespaceAttribute): Also take into account xmlns attributes with no namespace.
     29        (WebCore::MarkupAccumulator::shouldSelfClose): Force self-closing to create well-formed XML elements.
     30        * editing/MarkupAccumulator.h: Use EFragmentSerialization.
     31        (WebCore::MarkupAccumulator::inXMLFragmentSerialization):
     32        * editing/markup.cpp:
     33        (WebCore::createMarkup):
     34        * editing/markup.h: Add EFragmentSerialization enum.
     35        * xml/XMLSerializer.cpp:
     36        (WebCore::XMLSerializer::serializeToString):
     37
    1382013-07-15  Ryosuke Niwa  <rniwa@webkit.org>
    239
  • trunk/Source/WebCore/WebCore.order

    r152299 r152685  
    80478047__ZN7WebCore22jsHTMLElementInnerHTMLEPN3JSC9ExecStateENS0_7JSValueERKNS0_10IdentifierE
    80488048__ZNK7WebCore11HTMLElement9innerHTMLEv
    8049 __ZN7WebCore12createMarkupEPKNS_4NodeENS_13EChildrenOnlyEPN3WTF6VectorIPS0_Lm0EEENS_13EAbsoluteURLsE
     8049__ZN7WebCore12createMarkupEPKNS_4NodeENS_13EChildrenOnlyEPN3WTF6VectorIPS0_Lm0EEENS_13EAbsoluteURLsENS_22EFragmentSerializationE
    80508050__ZN7WebCore17MarkupAccumulatorC1EPN3WTF6VectorIPNS_4NodeELm0EEENS_13EAbsoluteURLsEPKNS_5RangeE
    80518051__ZN7WebCore17MarkupAccumulator14serializeNodesEPNS_4NodeES2_NS_13EChildrenOnlyE
  • trunk/Source/WebCore/editing/MarkupAccumulator.cpp

    r145818 r152685  
    101101}
    102102
    103 MarkupAccumulator::MarkupAccumulator(Vector<Node*>* nodes, EAbsoluteURLs resolveUrlsMethod, const Range* range)
     103MarkupAccumulator::MarkupAccumulator(Vector<Node*>* nodes, EAbsoluteURLs resolveUrlsMethod, const Range* range, EFragmentSerialization fragmentSerialization)
    104104    : m_nodes(nodes)
    105105    , m_range(range)
    106106    , m_resolveURLsMethod(resolveUrlsMethod)
     107    , m_fragmentSerialization(fragmentSerialization)
    107108{
    108109}
     
    138139    if (namespaces)
    139140        namespaceHash = *namespaces;
     141    else if (inXMLFragmentSerialization()) {
     142        // Make sure xml prefix and namespace are always known to uphold the constraints listed at http://www.w3.org/TR/xml-names11/#xmlReserved.
     143        namespaceHash.set(xmlAtom.impl(), XMLNames::xmlNamespaceURI.impl());
     144        namespaceHash.set(XMLNames::xmlNamespaceURI.impl(), xmlAtom.impl());
     145    }
    140146
    141147    if (!childrenOnly)
     
    273279
    274280    // Don't add namespace attributes twice
    275     if (attribute.name() == XMLNSNames::xmlnsAttr) {
     281    // HTML Parser will create xmlns attributes without namespace for HTML elements, allow those as well.
     282    if (attribute.name().localName() == xmlnsAtom && (attribute.namespaceURI().isEmpty() || attribute.namespaceURI() == XMLNSNames::xmlnsNamespaceURI)) {
    276283        namespaces.set(emptyAtom.impl(), attribute.value().impl());
    277284        return false;
     
    296303    AtomicStringImpl* pre = prefix.isEmpty() ? emptyAtom.impl() : prefix.impl();
    297304    AtomicStringImpl* foundNS = namespaces.get(pre);
    298     if (foundNS != namespaceURI.impl()) {
     305    if (foundNS != namespaceURI.impl() && !namespaces.get(namespaceURI.impl())) {
    299306        namespaces.set(pre, namespaceURI.impl());
    300307        result.append(' ');
     
    422429{
    423430    result.append('<');
     431    if (inXMLFragmentSerialization() && namespaces && element->prefix().isEmpty()) {
     432        // According to http://www.w3.org/TR/DOM-Level-3-Core/namespaces-algorithms.html#normalizeDocumentAlgo we now should create
     433        // a default namespace declaration to make this namespace well-formed. However, http://www.w3.org/TR/xml-names11/#xmlReserved states
     434        // "The prefix xml MUST NOT be declared as the default namespace.", so use the xml prefix explicitly.
     435        if (element->namespaceURI() == XMLNames::xmlNamespaceURI) {
     436            result.append(xmlAtom);
     437            result.append(':');
     438        }
     439    }
    424440    result.append(element->nodeNamePreservingCase());
    425     if (!element->document()->isHTMLDocument() && namespaces && shouldAddNamespaceElement(element))
     441    if ((inXMLFragmentSerialization() || !element->document()->isHTMLDocument()) && namespaces && shouldAddNamespaceElement(element))
    426442        appendNamespace(result, element->prefix(), element->namespaceURI(), *namespaces);
    427443}
     
    477493    }
    478494
    479     if (!documentIsHTML && namespaces && shouldAddNamespaceAttribute(attribute, *namespaces))
     495    if ((inXMLFragmentSerialization() || !documentIsHTML) && namespaces && shouldAddNamespaceAttribute(attribute, *namespaces))
    480496        appendNamespace(result, attribute.prefix(), attribute.namespaceURI(), *namespaces);
    481497}
     
    535551bool MarkupAccumulator::shouldSelfClose(const Node* node)
    536552{
    537     if (node->document()->isHTMLDocument())
     553    if (!inXMLFragmentSerialization() && node->document()->isHTMLDocument())
    538554        return false;
    539555    if (node->hasChildNodes())
  • trunk/Source/WebCore/editing/MarkupAccumulator.h

    r130795 r152685  
    6767class MarkupAccumulator {
    6868public:
    69     MarkupAccumulator(Vector<Node*>*, EAbsoluteURLs, const Range* = 0);
     69    MarkupAccumulator(Vector<Node*>*, EAbsoluteURLs, const Range* = 0, EFragmentSerialization = HTMLFragmentSerialization);
    7070    virtual ~MarkupAccumulator();
    7171
     
    112112    void appendQuotedURLAttributeValue(StringBuilder&, const Element*, const Attribute&);
    113113    void serializeNodesWithNamespaces(Node* targetNode, Node* nodeToSkip, EChildrenOnly, const Namespaces*, Vector<QualifiedName>* tagNamesToSkip);
     114    bool inXMLFragmentSerialization() const { return m_fragmentSerialization == XMLFragmentSerialization; }
    114115
    115116    StringBuilder m_markup;
    116117    const EAbsoluteURLs m_resolveURLsMethod;
     118    EFragmentSerialization m_fragmentSerialization;
    117119};
    118120
  • trunk/Source/WebCore/editing/markup.cpp

    r152440 r152685  
    756756}
    757757
    758 String createMarkup(const Node* node, EChildrenOnly childrenOnly, Vector<Node*>* nodes, EAbsoluteURLs shouldResolveURLs, Vector<QualifiedName>* tagNamesToSkip)
     758String createMarkup(const Node* node, EChildrenOnly childrenOnly, Vector<Node*>* nodes, EAbsoluteURLs shouldResolveURLs, Vector<QualifiedName>* tagNamesToSkip, EFragmentSerialization fragmentSerialization)
    759759{
    760760    if (!node)
     
    769769    }
    770770#endif
    771     MarkupAccumulator accumulator(nodes, shouldResolveURLs);
     771    MarkupAccumulator accumulator(nodes, shouldResolveURLs, 0, fragmentSerialization);
    772772    return accumulator.serializeNodes(const_cast<Node*>(node), deleteButtonContainerElement, childrenOnly, tagNamesToSkip);
    773773}
  • trunk/Source/WebCore/editing/markup.h

    r146264 r152685  
    4848enum EChildrenOnly { IncludeNode, ChildrenOnly };
    4949enum EAbsoluteURLs { DoNotResolveURLs, ResolveAllURLs, ResolveNonLocalURLs };
     50enum EFragmentSerialization { HTMLFragmentSerialization, XMLFragmentSerialization };
    5051
    5152PassRefPtr<DocumentFragment> createFragmentFromText(Range* context, const String& text);
     
    6566
    6667String createMarkup(const Range*, Vector<Node*>* = 0, EAnnotateForInterchange = DoNotAnnotateForInterchange, bool convertBlocksToInlines = false, EAbsoluteURLs = DoNotResolveURLs);
    67 String createMarkup(const Node*, EChildrenOnly = IncludeNode, Vector<Node*>* = 0, EAbsoluteURLs = DoNotResolveURLs, Vector<QualifiedName>* tagNamesToSkip = 0);
     68String createMarkup(const Node*, EChildrenOnly = IncludeNode, Vector<Node*>* = 0, EAbsoluteURLs = DoNotResolveURLs, Vector<QualifiedName>* tagNamesToSkip = 0, EFragmentSerialization = HTMLFragmentSerialization);
    6869
    6970String createFullMarkup(const Node*);
  • trunk/Source/WebCore/xml/XMLSerializer.cpp

    r127757 r152685  
    4343    }
    4444
    45     return createMarkup(node);
     45    return createMarkup(node, IncludeNode, 0, DoNotResolveURLs, 0, XMLFragmentSerialization);
    4646}
    4747
Note: See TracChangeset for help on using the changeset viewer.