Import upstream patch that makes doctype name null to pass html5lib tokenizer tests
Categories
(Core :: DOM: HTML Parser, task, P3)
Tracking
()
Tracking | Status | |
---|---|---|
firefox93 | --- | fixed |
People
(Reporter: hsivonen, Assigned: hsivonen)
Details
Attachments
(2 files)
<!DOCTYPE>
and similar report the tag name as the empty string. Should be null.
Updated•6 years ago
|
Assignee | ||
Comment 1•4 years ago
|
||
Now I don't understand why the spec and the html5lib test suite except null
when the name is not nullable in the DOM spec: https://dom.spec.whatwg.org/#documenttype
Skipping https://github.com/validator/htmlparser/commit/3be25a0e44adda338c99bcc85ae9b6167522bc75 for the moment.
Assignee | ||
Comment 2•4 years ago
|
||
Sadly, the specified interface between the tokenizer and the tree builder differs for doctype tokens from what the DOM exposes. The html5lib test suite tests the tokenizer interface as specified. The tokenizer interface isn't exposed to the Web.
Taking the upstream patch here and ensuring that there are no Web-exposed changes is easier for everyone than either keeping the branch divergence between Gecko and the validator or getting the spec, the test suite, and all other projects relying on the test suite changed.
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 3•4 years ago
|
||
This change ensures that the tokenizer sets the doctype name to null
when the doctype name is missing in the input source.
Otherwise, without this change, the doctype name is set to the empty
string — which doesn’t conform to the requirements in the HTML spec, and
which causes us to fail 9 tests in the html5lib-tests suite.
Relates to https://github.com/validator/htmlparser/issues/35
Assignee | ||
Comment 4•4 years ago
|
||
Unfortunately, the HTML tokenizer can emit a doctype token with a missing doctype name and the html5lib
test suite tests this even though the doctype name is not nullable in the DOM. This tests checks that
the empty string still appears in the DOM.
Assignee | ||
Comment 5•4 years ago
|
||
Updated•4 years ago
|
Comment 8•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/49feef3910bf
https://hg.mozilla.org/mozilla-central/rev/9ba4529104b9
Description
•