Hi reviewers, I fixed the issue by adjusting the parsing for mis-nested `<form>` tags in `<template>`, based on [HTML5 specs](https://html.spec.whatwg.org/multipage/parsing.html#parsing-main-inbody).
I do have a couple of questions:
1. Is `fast/parser/misnested-form-tags-in-template.html` the right location for this test?
2. How can I configure this test to be text-only? It currently fails with `-expected.png was missing`.
I'm new to chromium, apologies for any mistakes i made.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Thanks for writing what looks like your first patch to Chromium! 😊
aligning behavior with HTML5 parsing spec.It would help to link directly to the relevant section of the HTML spec in this comment also. For this section, it's a bit hard to link to, but you should be able to use this:
Fix: Mis-nested form tags inside template
parsed incorrectly
Ensures that form end tags inside templates
forcibly close any inner tags,
aligning behavior with HTML5 parsing spec.nit: please line wrap at 72 characters.
Haoran Tang <haoran.tan...@gmail.com>Note to self: I verified that this user has signed the CLA.
if (!tree_.OpenElements()->InScope(tag)) {
ParseError(token);
return;
}
tree_.GenerateImpliedEndTags();
if (!tree_.CurrentStackItem()->MatchesHTMLTag(tag)) {
ParseError(token);
}
tree_.OpenElements()->PopUntilPopped(tag);This looks good. But for safety, it's always a good idea to flag-guard any such change, in case of emergency. You can use this as an example to follow:
Thank you for writing a test. But this should be a WPT, rather than an (internal-only) web_test. I think this is probably the right place to put that:
and you could use something like this one as an example to follow:
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Fix: Mis-nested form tags inside template
parsed incorrectly
Ensures that form end tags inside templates
forcibly close any inner tags,
aligning behavior with HTML5 parsing spec.nit: please line wrap at 72 characters.
Done
aligning behavior with HTML5 parsing spec.It would help to link directly to the relevant section of the HTML spec in this comment also. For this section, it's a bit hard to link to, but you should be able to use this:
is there a preferred way to wrap long URLs in the commit message
if (!tree_.OpenElements()->InScope(tag)) {
ParseError(token);
return;
}
tree_.GenerateImpliedEndTags();
if (!tree_.CurrentStackItem()->MatchesHTMLTag(tag)) {
ParseError(token);
}
tree_.OpenElements()->PopUntilPopped(tag);This looks good. But for safety, it's always a good idea to flag-guard any such change, in case of emergency. You can use this as an example to follow:
Done
Thank you for writing a test. But this should be a WPT, rather than an (internal-only) web_test. I think this is probably the right place to put that:
and you could use something like this one as an example to follow:
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
aligning behavior with HTML5 parsing spec.Haoran TangIt would help to link directly to the relevant section of the HTML spec in this comment also. For this section, it's a bit hard to link to, but you should be able to use this:
is there a preferred way to wrap long URLs in the commit message
Done
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +1 |
Thanks for adding the flag and moving the test! Just a few smaller comments now and then I think this is ok to land.
name: "CorrectTemplateFormParsing",I think to pass the tests, this needs to be in the correct position, alphabetically.
<html>
<head>nit: it's better if you don't include non-essential tags in the test. So you can generally skip `<html>`, `<head>`, `<body>`, etc.
<title>Template Form Parsing Test</title>Feel free, if you like, to add an `author` <link> tag, like this one:
<h1>Template Form Parsing Test</h1>You don't need this
<div id="log" style="display:block"></div>You don't need this either.
<div id="testTemplateContainer">This is ok, but easier would be:
```
<div>
A<template><br>BC<form>D<div>E</form>F</div>G</template>H
</div>
const wrapper = document.querySelector('div');
```
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
I think to pass the tests, this needs to be in the correct position, alphabetically.
Done
nit: it's better if you don't include non-essential tags in the test. So you can generally skip `<html>`, `<head>`, `<body>`, etc.
Done
Feel free, if you like, to add an `author` <link> tag, like this one:
Done
You don't need this
Done
You don't need this either.
Done
You don't need this
Done
This is ok, but easier would be:
```
<div>
A<template><br>BC<form>D<div>E</form>F</div>G</template>H
</div>const wrapper = document.querySelector('div');
```
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Hi Mason. I've updated the test to alphabetical order and removed unnecessary components from the test HTML. Could you help start the test run?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
Assuming the tests pass, LGTM! Thanks for contributing to Chromium! 🎉
I can land this for you, just let me know.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Assuming the tests pass, LGTM! Thanks for contributing to Chromium! 🎉
I can land this for you, just let me know.
Hi Mason. As I’m not a Chromium committer, it seems that two Code-Review +1s are needed to proceed. Would I need an additional reviewer for this CL to be landed.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Haoran TangAssuming the tests pass, LGTM! Thanks for contributing to Chromium! 🎉
I can land this for you, just let me know.
Hi Mason. As I’m not a Chromium committer, it seems that two Code-Review +1s are needed to proceed. Would I need an additional reviewer for this CL to be landed.
Ahh right, I forgot about that. I'll add one.
+dizhangg for another review.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Haoran TangAssuming the tests pass, LGTM! Thanks for contributing to Chromium! 🎉
I can land this for you, just let me know.
Mason FreedHi Mason. As I’m not a Chromium committer, it seems that two Code-Review +1s are needed to proceed. Would I need an additional reviewer for this CL to be landed.
Ahh right, I forgot about that. I'll add one.
Hi, Mason. Since the tests have passed, could you help submit it for me? Thank you for your guidance and for reviewing my CL!
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Exportable changes to web-platform-tests were detected in this CL and a pull request in the upstream repo has been made: https://github.com/web-platform-tests/wpt/pull/49206.
When this CL lands, the bot will automatically merge the PR on GitHub if the required GitHub checks pass; otherwise, ecosystem-infra@ team will triage the failures and may contact you.
WPT Export docs:
https://chromium.googlesource.com/chromium/src/+/main/docs/testing/web_platform_tests.md#Automatic-export-process
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Fix: Mis-nested form tags inside template parsed incorrectly
Ensures that form end tags inside templates forcibly close any inner
tags, aligning behavior with HTML5 standard:
https://html.spec.whatwg.org/multipage/parsing.html#parsing:~:text=An%20end%20tag%20whose%20tag%20name%20is%20%22form%22
Bug: 352896478
TEST=Added web test case to check parsing behavior with nested form
tags.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
The WPT PR for this CL has been merged upstream! https://github.com/web-platform-tests/wpt/pull/49206
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
I observed the following results on Chrome Canary, which still don't seem to be expected.[1]
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
I observed the following results on Chrome Canary, which still don't seem to be expected.[1]
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Ho CheungI observed the following results on Chrome Canary, which still don't seem to be expected.[1]
Perhaps I'm missing something?
Thanks for the update. I’ll look into this in the coming days and keep you noticed.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Ho CheungI observed the following results on Chrome Canary, which still don't seem to be expected.[1]
Haoran TangPerhaps I'm missing something?
Thanks for the update. I’ll look into this in the coming days and keep you noticed.
Enabling the experimental flag `chrome://flags/#enable-experimental-web-platform-features` can solve the problem.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |