HTML 5 namespace prefix normalization for HTML and XHTML serializers #2588
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements HTML 5 namespace prefix normalization for the HTML and XHTML serializers.
It introduces two new hooks in the
Serializerbase class:elementName(QNm)- allows revising the element QName before it gets serializedadjustNamespaces(QNm)- allows adjusting namespaces before they get serializedThe default implementations ar no-ops. Both
HTMLSerializerandXHTMLSerializernow share a new common base class that overrides these methods, checks the HTML 5 preconditions, and applies the required prefix normalization and namespace adjustments.This fixes QT4 test cases
Serialization-html-19candSerialization-xhtml-50through-52.In addition, the PR fixes a bug in canonical XML serialization where the namespace node added for a
DBNodewas always serialized before all others, ignoring the required canonical namespace ordering.