Skip to content

Add keygen to the list of elements with special parsing rules#2224

Merged
zcorpan merged 1 commit intomasterfrom
keygen-is-special
Jan 10, 2017
Merged

Add keygen to the list of elements with special parsing rules#2224
zcorpan merged 1 commit intomasterfrom
keygen-is-special

Conversation

@domenic
Copy link
Member

@domenic domenic commented Dec 29, 2016

I remember this list being tricky in the past, but I can't see a reason why basefont would be included here and keygen wouldn't, so this is probably just a bug fix...

@domenic domenic mentioned this pull request Dec 29, 2016
@annevk
Copy link
Member

annevk commented Dec 29, 2016

Per

Typically, the special elements have the start and end tag tokens handled specifically, while ordinary elements' tokens fall into "any other start tag" and "any other end tag" clauses, and some parts of the tree builder check if a particular element in the stack of open elements is in the special category. However, some elements (e.g., the option element) have their start or end tag tokens handled specifically, but are still not in the special category, so that they get the ordinary handling elsewhere.

it seems keygen not being included there might be intentional.

@domenic
Copy link
Member Author

domenic commented Dec 29, 2016

Hmm yeah OK. It'd be ideal if someone like @RReverser or @inikulin or @zcorpan who knows the parser stuff inside out could confirm for us, and then we could add a code comment if it's intentionally not there

@zcorpan
Copy link
Member

zcorpan commented Dec 29, 2016

Relevant commits:
3b0abe6
2dbce39

I think this was an oversight.

Special is cross-referenced (normatively) in:

https://html.spec.whatwg.org/#parsing-main-inbody:special
https://html.spec.whatwg.org/#parsing-main-inbody:special-2
https://html.spec.whatwg.org/#parsing-main-inbody:special-4

These do not apply to void elements since they can't be on the stack here.

https://html.spec.whatwg.org/#parsing-main-inbody:special-3

Hmmmm. This ... algorithm has bugs, I think! Filed #2226. But this algorithm shouldn't have a difference if keygen is special or not (but making it special means you don't need to walk the stack to look for it).

So all void elements should be in the special list, as far as I can tell.

@zcorpan
Copy link
Member

zcorpan commented Dec 29, 2016

https://github.com/html5lib/html5lib-tests/search?utf8=✓&q=keygen - we could add some more tests for </keygen> in different insertion modes (but at least in-body).

@zcorpan zcorpan added the needs tests Moving the issue forward requires someone to write tests label Dec 29, 2016
@domenic
Copy link
Member Author

domenic commented Jan 5, 2017

I've never added html5lib tests before---could someone help with that? Maybe @gsnedders?

@gsnedders
Copy link
Member

@domenic Is there anything much you need help with? Essentially, you have some input under #data, and some serialised expected tree under #document, and I think it's pretty obvious what that format is (there's a README that sorta defines it!). Pretty much ignore #errors for now.

@domenic
Copy link
Member Author

domenic commented Jan 10, 2017

I guess contributing to html5lib is not that hard, but I'm really unsure which scenarios need more testing here. @zcorpan, would appreciate your help if possible.

zcorpan added a commit to zcorpan/html5lib-tests that referenced this pull request Jan 10, 2017
@zcorpan zcorpan removed the needs tests Moving the issue forward requires someone to write tests label Jan 10, 2017
@zcorpan zcorpan merged commit 69be72e into master Jan 10, 2017
@zcorpan zcorpan deleted the keygen-is-special branch January 10, 2017 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

4 participants