Visitar URL original
Add tests for 'class' and 'for' aliases for 'className' and 'htmlFor' by Psychpsyo · Pull Request #48220 · web-platform-tests/wpt · GitHub
Skip to content

Add tests for 'class' and 'for' aliases for 'className' and 'htmlFor' - #48220

Draft
Psychpsyo wants to merge 6 commits into
web-platform-tests:masterfrom
Psychpsyo:classNameHtmlForAliases
Draft

Psychpsyo wants to merge 6 commits into
web-platform-tests:masterfrom
Psychpsyo:classNameHtmlForAliases

Conversation

@Psychpsyo

Copy link
Copy Markdown
Contributor

This adds new tests that test for the behavior proposed in issue #9379 on the HTML spec and issue #1310 on the DOM spec.

Some other tests have also been updated and expanded to include the new behavior.
(Notably, acid3 was testing for the exact opposite, this has been inverted)

@Psychpsyo
Psychpsyo marked this pull request as draft September 17, 2024 11:35
@Psychpsyo
Psychpsyo marked this pull request as ready for review September 17, 2024 17:53

@schenney-chromium schenney-chromium left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me but I think a second opinion is needed just because I'm not experienced to know that we merge tests before the work has been done to verify that the change is not going to break the web.

For subsequent reviewers, the changes are good apart from the one issue I flagged. So deep second review is not necessary (I feel).

Comment thread acid/acid3/test.html Resolved
@Psychpsyo

Copy link
Copy Markdown
Contributor Author

Looks good to me but I think a second opinion is needed just because I'm not experienced to know that we merge tests before the work has been done to verify that the change is not going to break the web.

I think they'd need to be marked as tentative for that, which is impossible for the modified tests so I also think this should only get merged after the spec changes, which should only get merged after we know if this is actually web compatible.

@schenney-chromium

Copy link
Copy Markdown
Contributor

Looks good to me but I think a second opinion is needed just because I'm not experienced to know that we merge tests before the work has been done to verify that the change is not going to break the web.

I think they'd need to be marked as tentative for that, which is impossible for the modified tests so I also think this should only get merged after the spec changes, which should only get merged after we know if this is actually web compatible.

Delaying landing this seems good. In that case I'll approve the PR.


<script>
test(function() {
assert_true(testDiv.class == "", "class must reflect \"class\"");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use assert_equals

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assert_equals

Comment thread interfaces/dom.idl
[CEReactions] attribute DOMString id;
[CEReactions] attribute DOMString className;
[CEReactions] attribute DOMString class;
[CEReactions] attribute DOMString className; // legacy alias of .class

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that a bot will make those changes as soon as the spec change lands

@HtooAun HtooAun left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good

@Psychpsyo
Psychpsyo marked this pull request as draft July 5, 2026 11:20

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants