Attention is currently required from: Mason Freed.
Keiichiro Nagashima would like Mason Freed to review this change.
Fix incorrect tree construction by the AAA
Prior to this CL, the following code:
<code some-attribute><div><code><code><code><code></code></code></code></code>
parsed to this:
<code some-attribute></code>
<div><code some-attribute><code><code><code><code></code></code></code></code></code></div>
The adoption agency algorithm reparented the div tag though code tags
were properly nested. A step was added to the spec[1] in order to fix
this, but not implemented in Chromium. This CL implements it.
[1] https://www.w3.org/Bugs/Public/show_bug.cgi?id=24833
Bug: 1217523
Change-Id: I2ce1ada69d37305041468b9c10f59e6238e9a209
---
M AUTHORS
M third_party/blink/renderer/core/html/parser/html_tree_builder.cc
A third_party/blink/web_tests/external/wpt/html/syntax/parsing/adoption_agency_check_the_end_tag_name.html
3 files changed, 28 insertions(+), 0 deletions(-)
To view, visit change 3162497. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Mason Freed.
1 comment:
Patchset:
Hi! Could you review this patch?
I think you suggested the fix in [1].
(I'm not 100% sure because only first three letters are displayed as "mas...@chromium.org")
[1] https://bugs.chromium.org/p/chromium/issues/detail?id=1217523
And if it's OK, could you run automated tests for me?
I have never contributed a patch, so I don't have an access.
Thanks!
To view, visit change 3162497. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Mason Freed.
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/30804.
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
Attention is currently required from: Keiichiro Nagashima.
1 comment:
Patchset:
Hi! Could you review this patch? […]
Yep, that's me! I'd be happy to review. And I just kicked off the tests.
To view, visit change 3162497. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Keiichiro Nagashima.
6 comments:
Commit Message:
<code some-attribute><div><code><code><code><code></code></code></code></code>
parsed to this:
<code some-attribute></code>
<div><code some-attribute><code><code><code><code></code></code></code></code></code></div>
It would be nice to format this a bit - you can use more lines and indent things if you like.
Patchset:
Looks pretty good! Thanks for fixing this bug. Just a few relatively small comments, and then I think this is good to land.
File third_party/blink/renderer/core/html/parser/html_tree_builder.cc:
Patch Set #1, Line 1567: http://www.whatwg.org/specs/web-apps/current-work/multipage/tree-construction.html#parsing-main-inbody
I know this is an old comment, but while you're here, can you please correct this link to:
https://html.spec.whatwg.org/multipage/parsing.html#adoption-agency-algorithm
Let's add a comment here referring to the new spec:
// 2. If the current node is an HTML element whose tag name is subject,
// and the current node is not in the list of active formatting elements,
// then pop the current node off the stack of open elements and return.
Patch Set #1, Line 1571: tree_.CurrentElement();
Do we need to check that !tree_.IsEmpty() before trying to retrieve the CurrentElement()? If so, you can do that in one line:
if (!tree_.IsEmpty() &&
tree_.CurrentElement()->HasLocalName(token->GetName()) &&
!tree_.ActiveFormattingElements()->Contains(current_element)) {
File third_party/blink/web_tests/external/wpt/html/syntax/parsing/adoption_agency_check_the_end_tag_name.html:
Thanks for adding a test!
To view, visit change 3162497. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Keiichiro Nagashima.
1 comment:
Commit Message:
tip: if you change this to "Fixed", the bug will get automatically closed when this CL lands. E.g.
Fixed: 1217523
To view, visit change 3162497. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Keiichiro Nagashima.
Keiichiro Nagashima uploaded patch set #3 to this change.
Fix incorrect tree construction by the AAA
Prior to this CL, the following code:
<code some-attribute>
<div>
<code>
<code>
<code>
<code>
</code>
</code>
</code>
</code>
parsed to this:
<code some-attribute></code>
<div>
<code some-attribute>
<code>
<code>
<code>
<code>
</code>
</code>
</code>
</code>
</code>
</div>
The adoption agency algorithm reparented the div tag though code tags
were properly nested. A step was added to the spec[1] in order to fix
this, but not implemented in Chromium. This CL implements it.
[1] https://www.w3.org/Bugs/Public/show_bug.cgi?id=24833
Fixed: 1217523
Change-Id: I2ce1ada69d37305041468b9c10f59e6238e9a209
---
M AUTHORS
M third_party/blink/renderer/core/html/parser/html_tree_builder.cc
A third_party/blink/web_tests/external/wpt/html/syntax/parsing/adoption_agency_check_the_end_tag_name.html
3 files changed, 32 insertions(+), 1 deletion(-)
To view, visit change 3162497. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Mason Freed.
5 comments:
Commit Message:
<code some-attribute><div><code><code><code><code></code></code></code></code>
parsed to this:
<code some-attribute></code>
<div><code some-attribute><code><code><code><code></code></code></code></code></code></div>
It would be nice to format this a bit - you can use more lines and indent things if you like.
Done
tip: if you change this to "Fixed", the bug will get automatically closed when this CL lands. E.g. […]
Done
File third_party/blink/renderer/core/html/parser/html_tree_builder.cc:
I know this is an old comment, but while you're here, can you please correct this link to: […]
Done
Let's add a comment here referring to the new spec: […]
Done
Patch Set #1, Line 1571: tree_.CurrentElement();
Do we need to check that !tree_. […]
I think we need it, thanks!
I still have a problem. It seems that some web tests[1] failed due to the lack of an emptiness check. I added the check and ran it locally, but it still failed..
I'm going to take a look at it in detail.
To view, visit change 3162497. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Keiichiro Nagashima.
2 comments:
Patchset:
Thanks for the changes! Let's wait to see if Patchset 3 passes. If not, see my other comment here.
File third_party/blink/renderer/core/html/parser/html_tree_builder.cc:
If you're still getting failures on Patchset 3 (and I'm not sure you are), then you might need to add this here:
&& tree_.TopStackItem()->IsElementNode() &&
(or something similar)
To view, visit change 3162497. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Mason Freed.
3 comments:
Patchset:
Thank you for the comment!
I think this patchset is going to pass.
File third_party/blink/renderer/core/html/parser/html_tree_builder.cc:
Patch Set #1, Line 1571: tree_.CurrentElement();
I think we need it, thanks! […]
Done
File third_party/blink/renderer/core/html/parser/html_tree_builder.cc:
If you're still getting failures on Patchset 3 (and I'm not sure you are), then you might need to ad […]
Thank you for the suggestion!
The test passed after I added IsElementNode(), yeah!
I'm going to upload a patchset.
To view, visit change 3162497. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Keiichiro Nagashima.
Patch set 4:Commit-Queue +2
1 comment:
Patchset:
Ok, this looks good! Thanks for the changes, and for working on this bug. I'll push the button to land it now.
To view, visit change 3162497. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Keiichiro Nagashima.
1 comment:
Patchset:
Ok, this looks good! Thanks for the changes, and for working on this bug. […]
...also, congratulations on your first patch! 🎉
To view, visit change 3162497. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Keiichiro Nagashima.
Patch set 4:Code-Review +1
1 comment:
Patchset:
... […]
Thank you for your kind support.
I learned a lot and enjoyed it!
To view, visit change 3162497. To unsubscribe, or for help writing mail filters, visit settings.
Attention is currently required from: Keiichiro Nagashima.
1 comment:
Patchset:
Thank you for your kind support. […]
I'm glad! Come back for more! 😊
To view, visit change 3162497. To unsubscribe, or for help writing mail filters, visit settings.
Chromium LUCI CQ submitted this change.
Fix incorrect tree construction by the AAA
Prior to this CL, the following code:
<code some-attribute>
<div>
<code>
<code>
<code>
<code>
</code>
</code>
</code>
</code>
parsed to this:
<code some-attribute></code>
<div>
<code some-attribute>
<code>
<code>
<code>
<code>
</code>
</code>
</code>
</code>
</code>
</div>
The adoption agency algorithm reparented the div tag though code tags
were properly nested. A step was added to the spec[1] in order to fix
this, but not implemented in Chromium. This CL implements it.
[1] https://www.w3.org/Bugs/Public/show_bug.cgi?id=24833
Fixed: 1217523
Change-Id: I2ce1ada69d37305041468b9c10f59e6238e9a209
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3162497
Commit-Queue: Mason Freed <mas...@chromium.org>
Reviewed-by: Mason Freed <mas...@chromium.org>
Cr-Commit-Position: refs/heads/main@{#922189}
---
M AUTHORS
M third_party/blink/renderer/core/html/parser/html_tree_builder.cc
A third_party/blink/web_tests/external/wpt/html/syntax/parsing/adoption_agency_check_the_end_tag_name.html
3 files changed, 32 insertions(+), 1 deletion(-)
The WPT PR for this CL has been merged upstream! https://github.com/web-platform-tests/wpt/pull/30804