Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add tests for xmlns & xmlns:xlink parse errors#174

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
not-my-profile wants to merge1 commit intohtml5lib:master
base:master
Choose a base branch
Loading
fromnot-my-profile:xmlns-errors

Conversation

not-my-profile
Copy link

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 errorsmentioned 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 parseerror according to the spec: "adjust foreign attributes"[2] is onlycalled 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 testcases but unfortunately the test case format doesn't support comments.)[1]:https://html.spec.whatwg.org/multipage/parsing.html#create-an-element-for-the-token[2]:https://html.spec.whatwg.org/multipage/parsing.html#adjust-foreign-attributes
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

1 participant
@not-my-profile

[8]ページ先頭

©2009-2025 Movatter.jp