Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editorial: clarify adoption agency step 13.3 #9785

Conversation

not-my-profile
Copy link
Contributor

@not-my-profile not-my-profile commented Sep 25, 2023

After implementing the adoption agency algorithm as described in the specification, I was very confused why some respective tests of html5lib-tests were failing. As it turns out I misinterpreted:

If node is formatting element, then break.

as "if node is a formatting element" (i.e. any element in the formatting category). I missed that "formatting element" referred to the "formatting element" variable. Indeed, the source file does declare it with the tag, however in the rendered spec this just becomes italic text, which evidently is easy to miss.

This commit therefore clarifies the wording to:

If node is the formatting element, then break.


/parsing.html ( diff )

After implementing the adoption agency algorithm as described in
the specification, I was very confused why some respective tests
of html5lib-tests were failing. As it turns out I misinterpreted:

> If node is formatting element, then break.

as "if node is a formatting element" (i.e. any element in the
formatting category). I missed that "formatting element" referred
to the "formatting element" variable. Indeed, the source file does
declare it with the <var> tag, however in the rendered spec this
just becomes italic text, which evidently is easy to miss.

This commit therefore clarifies the wording to:

> If node is the formatting element, then break.
@domenic
Copy link
Member

domenic commented Sep 25, 2023

It is not correct to use "the" when referring to variables in spec language, so this change is not correct.

One potential fix here is to move the algorithm toward using modern style camelCase variables. However, I wouldn't want to do this for only a single variable. Are you up for a PR that updates all the variables in the adoption agency to that modern style?

@not-my-profile
Copy link
Contributor Author

For sure ... that makes sense :)

Closing in favor of #9786.

@not-my-profile
Copy link
Contributor Author

It is not correct to use "the" when referring to variables in spec language

Sidenote: is the "spec language" documented somewhere? i.e. is there a style guide?

@annevk
Copy link
Member

annevk commented Sep 26, 2023

There's a very high-level one: https://whatwg.org/style-guide. We also specify a bunch of the modern rules in https://infra.spec.whatwg.org.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants