Bug 196466 - Attr nodes are not cloned properly
Summary: Attr nodes are not cloned properly
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL: https://dom.spec.whatwg.org/#concept-...
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-04-01 15:09 PDT by Chris Dumez
Modified: 2019-04-01 20:15 PDT (History)
9 users (show)

See Also:


Attachments
Patch (3.49 KB, patch)
2019-04-01 15:11 PDT, Chris Dumez
rniwa: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2019-04-01 15:09:45 PDT
Attr nodes are not cloned properly according to:
- https://dom.spec.whatwg.org/#concept-node-clone

A cloned Attr node should retain its prefix and namespace.

Both Gecko and Blink agree with the DOM specification here.
Comment 1 Chris Dumez 2019-04-01 15:11:57 PDT
Created attachment 366428 [details]
Patch
Comment 2 Ryosuke Niwa 2019-04-01 18:52:03 PDT
Comment on attachment 366428 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=366428&action=review

> Source/WebCore/dom/Document.cpp:992
>          // FIXME: This will "Attr::normalize" child nodes of Attr.

Should we remove this FIXME?
Comment 3 Chris Dumez 2019-04-01 19:40:35 PDT
Comment on attachment 366428 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=366428&action=review

>> Source/WebCore/dom/Document.cpp:992
>>          // FIXME: This will "Attr::normalize" child nodes of Attr.
> 
> Should we remove this FIXME?

Is it not valid anymore?
Comment 4 Ryosuke Niwa 2019-04-01 19:47:17 PDT
(In reply to Chris Dumez from comment #3)
> Comment on attachment 366428 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=366428&action=review
> 
> >> Source/WebCore/dom/Document.cpp:992
> >>          // FIXME: This will "Attr::normalize" child nodes of Attr.
> > 
> > Should we remove this FIXME?
> 
> Is it not valid anymore?

There is no Attr::normalize anymore. This is about normalizing the text child nodes of Attr when we supported multiple child nodes for Attr:
https://dom.spec.whatwg.org/#dom-node-normalize

But that's totally irrelevant now since Attr isn't even a ContainerNode now.
Comment 5 Chris Dumez 2019-04-01 20:14:56 PDT
Committed r243734: <https://trac.webkit.org/changeset/243734>
Comment 6 Radar WebKit Bug Importer 2019-04-01 20:15:18 PDT
<rdar://problem/49506786>
Comment 7 Chris Dumez 2019-04-01 20:15:31 PDT
(In reply to Ryosuke Niwa from comment #4)
> (In reply to Chris Dumez from comment #3)
> > Comment on attachment 366428 [details]
> > Patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=366428&action=review
> > 
> > >> Source/WebCore/dom/Document.cpp:992
> > >>          // FIXME: This will "Attr::normalize" child nodes of Attr.
> > > 
> > > Should we remove this FIXME?
> > 
> > Is it not valid anymore?
> 
> There is no Attr::normalize anymore. This is about normalizing the text
> child nodes of Attr when we supported multiple child nodes for Attr:
> https://dom.spec.whatwg.org/#dom-node-normalize
> 
> But that's totally irrelevant now since Attr isn't even a ContainerNode now.

Oh right. Fixed before landing, thanks.