Bug 16739 - XMLSerializer should reset default namespace when necessary
Summary: XMLSerializer should reset default namespace when necessary
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.4
: P3 Normal
Assignee: Rob Buis
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-05 04:18 PST by Alexey Proskuryakov
Modified: 2019-02-06 09:03 PST (History)
2 users (show)

See Also:


Attachments
test case (564 bytes, application/xhtml+xml)
2008-01-05 04:19 PST, Alexey Proskuryakov
no flags Details
Patch (6.05 KB, patch)
2013-06-25 08:26 PDT, Rob Buis
no flags Details | Formatted Diff | Diff
Patch (6.04 KB, patch)
2013-06-25 19:31 PDT, Rob Buis
no flags Details | Formatted Diff | Diff
Patch (6.81 KB, patch)
2013-06-26 08:07 PDT, Rob Buis
no flags Details | Formatted Diff | Diff
Patch (7.75 KB, patch)
2013-06-27 14:08 PDT, Rob Buis
no flags Details | Formatted Diff | Diff
Patch (8.36 KB, patch)
2013-07-15 19:07 PDT, Rob Buis
no flags Details | Formatted Diff | Diff
Patch (8.41 KB, patch)
2013-07-17 09:51 PDT, Rob Buis
rniwa: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey Proskuryakov 2008-01-05 04:18:25 PST
When serializing an element with null namespace within an XHTML document, XMLSerializer should reset the namespace - currently, the result is as if the element were in XHTML namespace, too.

Firefox 2 also has this problem.
Comment 1 Alexey Proskuryakov 2008-01-05 04:19:07 PST
Created attachment 18285 [details]
test case
Comment 2 Rob Buis 2013-06-25 08:26:13 PDT
Created attachment 205404 [details]
Patch
Comment 3 Rob Buis 2013-06-25 08:27:41 PDT
Comment on attachment 205404 [details]
Patch

This is based on bug 16496 patch which is not in yet, so clear the review flag for now.
Comment 4 Rob Buis 2013-06-25 19:31:28 PDT
Created attachment 205439 [details]
Patch
Comment 5 Rob Buis 2013-06-26 08:07:38 PDT
Created attachment 205491 [details]
Patch
Comment 6 Rob Buis 2013-06-27 14:08:32 PDT
Created attachment 205634 [details]
Patch
Comment 7 Rob Buis 2013-06-27 14:10:10 PDT
Comment on attachment 205634 [details]
Patch

Clearing review flag because it builds on the patch in bug 16496. Compared to the previous patch this now includes the missing MarkupAccumulator.h change.
Comment 8 Rob Buis 2013-07-15 19:07:07 PDT
Created attachment 206717 [details]
Patch
Comment 9 Rob Buis 2013-07-17 09:51:03 PDT
Created attachment 206894 [details]
Patch
Comment 10 Ryosuke Niwa 2013-07-30 15:53:23 PDT
Comment on attachment 206894 [details]
Patch

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

> Source/WebCore/editing/MarkupAccumulator.cpp:303
> +            result.append(xmlnsAtom.string());

Maybe we should probably add a version of append that takes AtomicString.

> Source/WebCore/editing/MarkupAccumulator.cpp:306
> +            result.append('=');
> +            result.append('"');
> +            result.append('"');

Why can't we just do result.appendLiteral("=\"\"");?

> LayoutTests/fast/dom/XMLSerializer-element-empty-namespace-expected.txt:2
> +<div xmlns="http://www.w3.org/1999/xhtml" id="target"> <div id="output"> </div><a xmlns="" href="#"/></div>
> +

It'll be nice if the test had some description on what it's testing.

> LayoutTests/fast/dom/XMLSerializer-element-empty-namespace2-expected.txt:1
> +<x xmlns="foo"><y xmlns=""/></x>

Ditto.
Comment 11 Rob Buis 2013-07-30 18:59:45 PDT
Committed r153508: <http://trac.webkit.org/changeset/153508>
Comment 12 Lucas Forschler 2019-02-06 09:03:19 PST
Mass moving XML DOM bugs to the "DOM" Component.