Bug 200283 - Element.outerHTML is missing attribute prefixes in some cases in HTML documents
Summary: Element.outerHTML is missing attribute prefixes in some cases in HTML documents
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://html.spec.whatwg.org/#attribu...
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-07-30 14:37 PDT by Chris Dumez
Modified: 2019-07-31 08:13 PDT (History)
5 users (show)

See Also:


Attachments
WIP Patch (6.41 KB, patch)
2019-07-30 14:48 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
WIP Patch (7.71 KB, patch)
2019-07-30 15:22 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
WIP Patch (7.86 KB, patch)
2019-07-30 15:40 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (10.09 KB, patch)
2019-07-30 15:46 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (11.74 KB, patch)
2019-07-30 16:33 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-07-30 14:37:44 PDT
Element.outerHTML is missing attribute prefixes in some cases in HTML documents.
Comment 1 Chris Dumez 2019-07-30 14:48:55 PDT
Created attachment 375181 [details]
WIP Patch
Comment 2 Chris Dumez 2019-07-30 15:22:37 PDT
Created attachment 375187 [details]
WIP Patch
Comment 3 Chris Dumez 2019-07-30 15:40:45 PDT
Created attachment 375189 [details]
WIP Patch
Comment 4 Chris Dumez 2019-07-30 15:46:35 PDT
Created attachment 375190 [details]
Patch
Comment 5 Chris Dumez 2019-07-30 16:33:25 PDT
Created attachment 375194 [details]
Patch
Comment 6 Ryosuke Niwa 2019-07-31 00:06:55 PDT
Comment on attachment 375194 [details]
Patch

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

> Source/WebCore/editing/MarkupAccumulator.cpp:562
> +            AtomStringImpl* foundNS = namespaces && attribute.prefix().impl() ? namespaces->get(attribute.prefix().impl()) : 0;

I know you're just moving code around but maybe use nullptr?

> Source/WebCore/editing/MarkupAccumulator.cpp:565
> +                if (AtomStringImpl* prefix = namespaces ? namespaces->get(attribute.namespaceURI().impl()) : 0)

Ditto.
Comment 7 Chris Dumez 2019-07-31 08:10:37 PDT
(In reply to Ryosuke Niwa from comment #6)
> Comment on attachment 375194 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=375194&action=review
> 
> > Source/WebCore/editing/MarkupAccumulator.cpp:562
> > +            AtomStringImpl* foundNS = namespaces && attribute.prefix().impl() ? namespaces->get(attribute.prefix().impl()) : 0;
> 
> I know you're just moving code around but maybe use nullptr?
> 
> > Source/WebCore/editing/MarkupAccumulator.cpp:565
> > +                if (AtomStringImpl* prefix = namespaces ? namespaces->get(attribute.namespaceURI().impl()) : 0)
> 
> Ditto.

Sure thing.
Comment 8 Chris Dumez 2019-07-31 08:12:46 PDT
Committed r248042: <https://trac.webkit.org/changeset/248042>
Comment 9 Radar WebKit Bug Importer 2019-07-31 08:13:19 PDT
<rdar://problem/53762119>