commit | 36903eed8ea72bca570d965361406e1d9b2c610c | [log] [tgz] |
---|---|---|
author | Kent Tamura <tkent@chromium.org> | Fri Feb 15 02:02:55 2019 |
committer | Commit Bot <commit-bot@chromium.org> | Fri Feb 15 02:02:55 2019 |
tree | 826330ac32d3db5f59319cbb82b37115d93a1e33 | |
parent | 525f8a08b19b1aad66f54a56e07531c2b75f9716 [diff] |
XMLSerializer: Support element prefix rewriting. We need to change the prefix of an element if: - The element's namespace is same as the inherited default namespace, and the element prefix is not empty, - The prefix-namespace pair of an element is not declared, and there is another prefix associated to the namespace, or - The namespace of an element is not associated to any prefixes, and the element's prefix is declared for another namespace in the element. This CL implements Step 11, 12.1 to 12.5 of [1]. * Add capability to serialize prefix which is not element.prefix() to MarkupFormatter * MarkupAccumulator::AppendElement() returns a serialized prefix, and AppendEndTag() takes it as an argument. * MarkupAccumulator::AppendStartTagOpen() implements the steps, and returns a serialized prefix as well as 'ignore namespace definition attribute' flag. * MarkupAccumulator::RetrievePreferredPrefixString(): Remove the code for empty prefix for elements. Empty prefix is handled in the callsite. * MarkupAccumulator::ShouldAddNamespaceElement(): Removed. It's not used any longer. * dom/domparsing/xmlserializer-xml-namespace-expected.txt: The new behavior is expected. We successfully find 'xml' prefix. [1] https://w3c.github.io/DOM-Parsing/#xml-serializing-an-element-node Bug: 929035 Change-Id: Icf63cb40b120d29a4b8678104592739d773f3a48 Reviewed-on: https://chromium-review.googlesource.com/c/1473090 Reviewed-by: Yoshifumi Inoue <yosin@chromium.org> Commit-Queue: Kent Tamura <tkent@chromium.org> Cr-Commit-Position: refs/heads/master@{#632459}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure .