XMLSerializer should reset default namespace when necessary
https://bugs.webkit.org/show_bug.cgi?id=16739
XMLSerializer's handling of namespaces seems to be pretty broken
https://bugs.webkit.org/show_bug.cgi?id=106531

Reviewed by Ryosuke Niwa.

Source/WebCore:

Write out empty default namespace declaration if the element is not in any namespace, as
described in http://www.whatwg.org/specs/web-apps/current-work/multipage/the-xhtml-syntax.html#xml-fragment-serialization-algorithm.

Tests: fast/dom/XMLSerializer-element-empty-namespace.html
       fast/dom/XMLSerializer-element-empty-namespace2.html

* editing/MarkupAccumulator.cpp:
(WebCore::MarkupAccumulator::appendNamespace):
(WebCore::MarkupAccumulator::appendOpenTag):
* editing/MarkupAccumulator.h:

LayoutTests:

Add tests based on the testcases of both bugs.

* fast/dom/XMLSerializer-element-empty-namespace-expected.txt: Added.
* fast/dom/XMLSerializer-element-empty-namespace.html: Added.
* fast/dom/XMLSerializer-element-empty-namespace2-expected.txt: Added.
* fast/dom/XMLSerializer-element-empty-namespace2.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@153508 268f45cc-cd09-0410-ab3c-d52691b4dbfc