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

Remove parse error for <template><tr></tr> </template> #8271

Merged
merged 1 commit into from
Sep 15, 2022

Conversation

zcorpan
Copy link
Member

@zcorpan zcorpan commented Sep 8, 2022

The spec would enable foster parenting for whitespace in template after seeing table-related markup and trigger a parse error. Whitespace in template should not be a parse error. This change should not affect the parsed tree structure, only the number of parse errors. Non-whitespace text will still go through foster parenting and is still a parse error.

Fixes #7922.

cc @whatwg/html-parser

(See WHATWG Working Mode: Changes for more details.)


/parsing.html ( diff )

The spec would enable foster parenting for whitespace in template after seeing table-related markup and trigger a parse error. Whitespace in template should not be a parse error. This change should not affect the parsed tree structure, only the number of parse errors. Non-whitespace text will still go through foster parenting and is still a parse error.

Fixes #7922.
@zcorpan
Copy link
Member Author

zcorpan commented Sep 8, 2022

Checking Firefox's view source and in https://validator.nu for

<!DOCTYPE html>
<html lang="">
<head>
<title>Test</title>
</head>
<body>
<template><tr></tr> </template>
</body>
</html>

there is no parse error reported (but non-whitespace there is reported), so the implementation already seems to match this change.

Copy link
Member

@domenic domenic left a comment

Choose a reason for hiding this comment

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

Not entirely sure I understand the parser enough to give a good review, but this makes some sense, and I'm happy for it to be merged.

@hsivonen
Copy link
Member

Checking Firefox's view source
...
so the implementation already seems to match this change.

Unfortunately not. Instead, it looks like an intermediate spec change remains unimplemented. 😬

@hsivonen
Copy link
Member

Please don't let this be blocked on my review. I have a hard time reviewing this, because I discovered that I need to catch up on older spec changes. Specifically, https://searchfox.org/whatwg-html/diff/98c83e5eb83be811cc2534af7c44664a19981d39/source#100001 and https://searchfox.org/whatwg-html/diff/301fe28ae2ee46fab52676abff5f3c3560f795f1/source#77256 .

@zcorpan
Copy link
Member Author

zcorpan commented Sep 15, 2022

OK, thanks @hsivonen. Then I think we should merge, as @alexander-akait has implemented it in swc-project/swc#5779 and the tests pass there.

@zcorpan zcorpan merged commit e00906b into main Sep 15, 2022
@zcorpan zcorpan deleted the bocoup/parsing-tr-td-in-template branch September 15, 2022 19:10
zcorpan added a commit to html5lib/html5lib-tests that referenced this pull request Sep 15, 2022
flavorjones added a commit to sparklemotion/nokogiri that referenced this pull request Oct 21, 2022
flavorjones added a commit to sparklemotion/nokogiri that referenced this pull request Oct 21, 2022
JKingweb added a commit to mensbeam/HTML-Parser that referenced this pull request Mar 9, 2023
See whatwg/html#8271

Also removed test patches which are no longer needed, and fixed a bug
exposed by new tests

The testsuite includes tests for the new <search> element, but this is
not included in the specification yet, so the tests have been suppressed
kevinhendricks added a commit to Sigil-Ebook/sigil-gumbo that referenced this pull request Apr 8, 2023
dougmassay added a commit to Sigil-Ebook/PageEdit that referenced this pull request Jul 6, 2023
189aee2 fix KR style function declarations for C2X compilers
5f16d4c fix omissions from change long [skipci]
d89915b archive setup.py
23decb0 created updated local (controllable) copy of html5lib tests
382e8f4 unlink dated html5lib tests
10567da fixes to make sigil-gumbo pass html5lib tree-construction tests
7630679 restructure and simplify everything
f907c01 fix parse error by template misuse in table see whatwg/html#8271
20e7be7 correctly handle text in form elements ala nokogirl commit 73c5df2
4469240 prevent very minor memory leak

git-subtree-dir: gumbo_subtree
git-subtree-split: 189aee231c525a17a8b6b0615b93df45aaee2c8f
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.

Table parts in <template>- <td> and <td>
3 participants