This commit adds 14 tests for the two tree construction errors mentioned in the 12th step of "create an element for a token"1, which currently says:
If element has an xmlns attribute in the XMLNS namespace whose value
is not exactly the same as the element's namespace, that is a parse
error. Similarly, if element has an xmlns:xlink attribute in the XMLNS
namespace whose value is not the XLink Namespace, that is a parse error.
Previously these errors weren't tested at all.
It's worth noting why <html xmlns="totally not html"> isn't a parse error according to the spec: "adjust foreign attributes"2 is only called on foreign elements (i.e. not on elements in the HTML namespace). (I would have liked to add a comment about this to the respective test cases but unfortunately the test case format doesn't support comments.)
This commit adds 14 tests for the two tree construction errors mentioned in the 12th step of "create an element for a token"1, which currently says:
Previously these errors weren't tested at all.
It's worth noting why
<html xmlns="totally not html">
isn't a parse error according to the spec: "adjust foreign attributes"2 is only called on foreign elements (i.e. not on elements in the HTML namespace). (I would have liked to add a comment about this to the respective test cases but unfortunately the test case format doesn't support comments.)