- Notifications
You must be signed in to change notification settings - Fork62
Update tests for relaxed <select> parser#178
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:master
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
This PR updates the tree-construction dat files for the HTML changewhich will allow additional tags within <select>:whatwg/html#10557
I'm not sure what the best practice is for rebaselining errors, but for now I removed all errors from affected tests. There are probably errors in tests I didn't change which may need to be rebaselined as well. |
Will there be a separate PR for new tests? |
FWIW when CI workflows are enabled, Nokogiri (downstream) tests will fail. I've started working on a branch with the proposed changes fromwhatwg/html#10557 |
I added new test cases to webkit02 including:
|
Nokogiri work-in-progress atsparklemotion/nokogiri#3317 |
@josepharhar I've got a question about two tests that are very similar. Zooming in on this one from
Nokogiri is constructing a different tree:
and I wanted to ask for a double-check that the test's assertion is correct, before I dive into Nokogiri's parser. Thank you! |
Thanks for asking! It looks like Nokogiri is nesting one Here's the relevant part of the spec PR:https://whatpr.org/html/10557/parsing.html#:~:text=A%20start%20tag%20whose%20tag%20name%20is%20%22select%22 As for the I'll take a closer look at which we should do and get back to you on that. Thanks! |
flavorjones commentedOct 17, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Thanks for replying so quickly.
No, sorry, unless I'm misunderstanding your comment, this is not a correct description of what Nokogiri's parser is doing. Here's a more graphical representation of the tree from my previous comment:
i.e. The select tags are not nested. Just wanted to clarify. (And if it's helpful context, Nokogiri is maintaining a fork of libgumbo.) |
Ah whoops, I failed to read the tree properly 😅 I looked into why chromium is putting the b inside the select instead of the other way around, and i found that the This is happening due to this call to the adoption agency algorithm when I verified that chromium does the same thing as Nokogiri when I comment out that call to the adoption agency algorithm. There's a lot of steps in that algorithm and I'm having a hard time wrapping my head around it, but does Nokogiri have that call to the adoption agency algorithm too? Or perhaps the implementations of the algorithm are different? |
@josepharhar Thanks again for your kind reply! Yes, Nokogiri's libgumbo has implemented the adoption agency algorithm, and I have confirmed that in these tests we are invoking it. It's helpful to know this is likely the source of the behavior difference, so I'll focus my efforts on making sure it matches the current spec (though I'll note it passes every other test in this suite ... 🤷). |
flavorjones commentedOct 18, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
OK, I think I know what's going on here. I think Chromium has missed this change: If
will not trigger a parse-error-and-return, and the algorithm will continue. But If I remove the Can you check to see if my hunch is right? |
Thanks so much for figuring this out! Yeah I totally missed that in the chromium implementation but I just added it and updated the tests here. |
@josepharhar That's great! Thank you! I've got a patch to get the error messages to a point where libgumbo is passing, would you mind taking a look and potentially applying to this PR? (Renamed to |
Looks good, thanks! I applied it. Sometimes I wonder why chromiumthrows away parse errors. |
This change was included in the parser spec changes but I forgot to addit to the implementation. It was identified here:html5lib/html5lib-tests#178Change-Id: I13f7ba11dc2dda814e488829a05fe4ee7c670d52Reviewed-on:https://chromium-review.googlesource.com/c/chromium/src/+/5948083Commit-Queue: Joey Arhar <jarhar@chromium.org>Reviewed-by: David Baron <dbaron@chromium.org>Cr-Commit-Position: refs/heads/main@{#1375607}
Uh oh!
There was an error while loading.Please reload this page.
Neither the proposal nor the test changes are merged yet. Also, thetests are still failing.html5lib/html5lib-tests#178whatwg/html#10557
untitaker commentedNov 1, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
the changes to |
html5lib/html5lib-tests#178The proposal isn't merged yet, and the error codes are off. The forkedhtml5lib-tests makes it more complicated. I recommend to ditch the forkof html5lib-tests and give up on standardizing errors.
Co-authored-by: Markus Unterwaditzer <markus-github@unterwaditzer.net>
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-whatwg/html#10557and pin to upstream html5lib-tests-html5lib/html5lib-tests#178
- update gumbo tests- pin tohtml5lib/html5lib-tests#178 branch
- update gumbo tests- pin tohtml5lib/html5lib-tests#178 branch
This patch makes the HTML parser convert nested <select> tags into</select> instead of </select><select> for backwards compatibility withthe old parser. This behavior will apply to any nested selects, such as<select><div><select>.This was recommended here:whatwg/html#10557 (comment)This will be tested here:html5lib/html5lib-tests#178 (comment)Change-Id: I7a39901582b96edc10deca8794b9ce117aa08229
This patch makes the HTML parser convert nested <select> tags into</select> instead of </select><select> for backwards compatibility withthe old parser. This behavior will apply to any nested selects, such as<select><div><select>.This was recommended here:whatwg/html#10557 (comment)This will be tested here:html5lib/html5lib-tests#178 (comment)Change-Id: I7a39901582b96edc10deca8794b9ce117aa08229Reviewed-on:https://chromium-review.googlesource.com/c/chromium/src/+/6040687Commit-Queue: Joey Arhar <jarhar@chromium.org>Reviewed-by: David Baron <dbaron@chromium.org>Cr-Commit-Position: refs/heads/main@{#1391787}
This patch makes the HTML parser convert nested <select> tags into</select> instead of </select><select> for backwards compatibility withthe old parser. This behavior will apply to any nested selects, such as<select><div><select>.This was recommended here:whatwg/html#10557 (comment)This will be tested here:html5lib/html5lib-tests#178 (comment)Change-Id: I7a39901582b96edc10deca8794b9ce117aa08229Reviewed-on:https://chromium-review.googlesource.com/c/chromium/src/+/6040687Commit-Queue: Joey Arhar <jarhar@chromium.org>Reviewed-by: David Baron <dbaron@chromium.org>Cr-Commit-Position: refs/heads/main@{#1391787}
This patch makes the HTML parser convert nested <select> tags into</select> instead of </select><select> for backwards compatibility withthe old parser. This behavior will apply to any nested selects, such as<select><div><select>.This was recommended here:whatwg/html#10557 (comment)This will be tested here:html5lib/html5lib-tests#178 (comment)Change-Id: I7a39901582b96edc10deca8794b9ce117aa08229Reviewed-on:https://chromium-review.googlesource.com/c/chromium/src/+/6040687Commit-Queue: Joey Arhar <jarhar@chromium.org>Reviewed-by: David Baron <dbaron@chromium.org>Cr-Commit-Position: refs/heads/main@{#1391787}
Context here:whatwg/html#10557 (comment)Tests will be added here:html5lib/html5lib-tests#178 (comment)Change-Id: I62cd28979abff3d5ea30b3502872f273a74bfde4Reviewed-on:https://chromium-review.googlesource.com/c/chromium/src/+/6042598Commit-Queue: Joey Arhar <jarhar@chromium.org>Reviewed-by: David Baron <dbaron@chromium.org>Cr-Commit-Position: refs/heads/main@{#1391836}
I just updated this PR, which mostly involved reverting stuff. Should all be up to date and in sync with the whatwg/html PR now. |
…t>, a=testonlyAutomatic update from web-platform-testsChange parser behavior of <select><select>This patch makes the HTML parser convert nested <select> tags into</select> instead of </select><select> for backwards compatibility withthe old parser. This behavior will apply to any nested selects, such as<select><div><select>.This was recommended here:whatwg/html#10557 (comment)This will be tested here:html5lib/html5lib-tests#178 (comment)Change-Id: I7a39901582b96edc10deca8794b9ce117aa08229Reviewed-on:https://chromium-review.googlesource.com/c/chromium/src/+/6040687Commit-Queue: Joey Arhar <jarhar@chromium.org>Reviewed-by: David Baron <dbaron@chromium.org>Cr-Commit-Position: refs/heads/main@{#1391787}--wpt-commits: c4c67222e7b0677f92f43280837db48473603f1ewpt-pr: 49525
…t>, a=testonlyAutomatic update from web-platform-testsChange parser behavior of <select><select>This patch makes the HTML parser convert nested <select> tags into</select> instead of </select><select> for backwards compatibility withthe old parser. This behavior will apply to any nested selects, such as<select><div><select>.This was recommended here:whatwg/html#10557 (comment)This will be tested here:html5lib/html5lib-tests#178 (comment)Change-Id: I7a39901582b96edc10deca8794b9ce117aa08229Reviewed-on:https://chromium-review.googlesource.com/c/chromium/src/+/6040687Commit-Queue: Joey Arhar <jarhar@chromium.org>Reviewed-by: David Baron <dbaron@chromium.org>Cr-Commit-Position: refs/heads/main@{#1391787}--wpt-commits: c4c67222e7b0677f92f43280837db48473603f1ewpt-pr: 49525
…t>, a=testonlyAutomatic update from web-platform-testsChange parser behavior of <select><select>This patch makes the HTML parser convert nested <select> tags into</select> instead of </select><select> for backwards compatibility withthe old parser. This behavior will apply to any nested selects, such as<select><div><select>.This was recommended here:whatwg/html#10557 (comment)This will be tested here:html5lib/html5lib-tests#178 (comment)Change-Id: I7a39901582b96edc10deca8794b9ce117aa08229Reviewed-on:https://chromium-review.googlesource.com/c/chromium/src/+/6040687Commit-Queue: Joey Arhar <jarharchromium.org>Reviewed-by: David Baron <dbaronchromium.org>Cr-Commit-Position: refs/heads/main{#1391787}--wpt-commits: c4c67222e7b0677f92f43280837db48473603f1ewpt-pr: 49525UltraBlame original commit: 666bbfe1252e12af9394a702ad62918ae14f44c2
…t>, a=testonlyAutomatic update from web-platform-testsChange parser behavior of <select><select>This patch makes the HTML parser convert nested <select> tags into</select> instead of </select><select> for backwards compatibility withthe old parser. This behavior will apply to any nested selects, such as<select><div><select>.This was recommended here:whatwg/html#10557 (comment)This will be tested here:html5lib/html5lib-tests#178 (comment)Change-Id: I7a39901582b96edc10deca8794b9ce117aa08229Reviewed-on:https://chromium-review.googlesource.com/c/chromium/src/+/6040687Commit-Queue: Joey Arhar <jarharchromium.org>Reviewed-by: David Baron <dbaronchromium.org>Cr-Commit-Position: refs/heads/main{#1391787}--wpt-commits: c4c67222e7b0677f92f43280837db48473603f1ewpt-pr: 49525UltraBlame original commit: 666bbfe1252e12af9394a702ad62918ae14f44c2
…t>, a=testonlyAutomatic update from web-platform-testsChange parser behavior of <select><select>This patch makes the HTML parser convert nested <select> tags into</select> instead of </select><select> for backwards compatibility withthe old parser. This behavior will apply to any nested selects, such as<select><div><select>.This was recommended here:whatwg/html#10557 (comment)This will be tested here:html5lib/html5lib-tests#178 (comment)Change-Id: I7a39901582b96edc10deca8794b9ce117aa08229Reviewed-on:https://chromium-review.googlesource.com/c/chromium/src/+/6040687Commit-Queue: Joey Arhar <jarharchromium.org>Reviewed-by: David Baron <dbaronchromium.org>Cr-Commit-Position: refs/heads/main{#1391787}--wpt-commits: c4c67222e7b0677f92f43280837db48473603f1ewpt-pr: 49525UltraBlame original commit: 666bbfe1252e12af9394a702ad62918ae14f44c2
@josepharhar Twelve of the tests changed or added in the recent commits do not have the correct number of error messages in the test data. I'm not sure if you wish to fix those up given the@untitaker feedback above, but if so here are the failures from the Nokogiri test suite. Please let me know if I can help format these for you. nokogiri libgumbo error match failures
|
- update gumbo tests- pin tohtml5lib/html5lib-tests#178 branch
That would be great! I could try but I might mess it up 😅 |
flavorjones commentedJan 19, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@josepharhar I've attached a patch file that indicates the number and nature of the error messages generated by libgumbo. I want to acknowledge@untitaker's comment above that these error messages do not follow the format of other existing errors or the format suggested bywhatwg/html#1339, but this is the best I can do in the time I've allotted. |
Thanks for generating those errors! I applied them in the latest commit |
Uh oh!
There was an error while loading.Please reload this page.
This PR updates the tree-construction dat files for the HTML change which will allow additional tags within
<select>
:whatwg/html#10557