⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 243734 in webkit


Ignore:
Timestamp:
Apr 1, 2019, 8:14:50 PM (7 years ago)
Author:
Chris Dumez
Message:

Attr nodes are not cloned properly
https://bugs.webkit.org/show_bug.cgi?id=196466

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

Rebaseline WPT test now that one more check is passing.

  • web-platform-tests/dom/nodes/Document-importNode-expected.txt:

Source/WebCore:

Attr nodes are not cloned properly according to:

A cloned Attr node should retain its prefix and namespace.

Both Gecko and Blink agree with the DOM specification here.

No new tests, rebaselined existing test.

  • dom/Document.cpp:

(WebCore::Document::importNode):

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r243705 r243734  
     12019-04-01  Chris Dumez  <cdumez@apple.com>
     2
     3        Attr nodes are not cloned properly
     4        https://bugs.webkit.org/show_bug.cgi?id=196466
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Rebaseline WPT test now that one more check is passing.
     9
     10        * web-platform-tests/dom/nodes/Document-importNode-expected.txt:
     11
    1122019-04-01  Chris Dumez  <cdumez@apple.com>
    213
  • trunk/LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Document-importNode-expected.txt

    r229544 r243734  
    44PASS True 'deep' argument.
    55PASS False 'deep' argument.
    6 FAIL Import an Attr node with namespace/prefix correctly. assert_equals: expected (string) "p" but got (object) null
     6PASS Import an Attr node with namespace/prefix correctly.
    77
  • trunk/Source/WebCore/ChangeLog

    r243730 r243734  
     12019-04-01  Chris Dumez  <cdumez@apple.com>
     2
     3        Attr nodes are not cloned properly
     4        https://bugs.webkit.org/show_bug.cgi?id=196466
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Attr nodes are not cloned properly according to:
     9        - https://dom.spec.whatwg.org/#concept-node-clone
     10
     11        A cloned Attr node should retain its prefix and namespace.
     12
     13        Both Gecko and Blink agree with the DOM specification here.
     14
     15        No new tests, rebaselined existing test.
     16
     17        * dom/Document.cpp:
     18        (WebCore::Document::importNode):
     19
    1202019-04-01  Said Abou-Hallawa  <sabouhallawa@apple.com>
    221
  • trunk/Source/WebCore/dom/Document.cpp

    r243686 r243734  
    989989        return nodeToImport.cloneNodeInternal(document(), deep ? CloningOperation::Everything : CloningOperation::OnlySelf);
    990990
    991     case ATTRIBUTE_NODE:
    992         // FIXME: This will "Attr::normalize" child nodes of Attr.
    993         return Ref<Node> { Attr::create(*this, QualifiedName(nullAtom(), downcast<Attr>(nodeToImport).name(), nullAtom()), downcast<Attr>(nodeToImport).value()) };
    994 
     991    case ATTRIBUTE_NODE: {
     992        auto& attribute = downcast<Attr>(nodeToImport);
     993        return Ref<Node> { Attr::create(*this, attribute.qualifiedName(), attribute.value()) };
     994    }
    995995    case DOCUMENT_NODE: // Can't import a document into another document.
    996996    case DOCUMENT_TYPE_NODE: // FIXME: Support cloning a DocumentType node per DOM4.
Note: See TracChangeset for help on using the changeset viewer.