-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
HTML API: Trigger active format reconstruction when reaching text nodes. #6054
HTML API: Trigger active format reconstruction when reaching text nodes. #6054
Conversation
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN:
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
I expected this to fix some of the tests from #5794 but this seems to have no impact at all on the html5lib tests results. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change seems good, there seem to be no regressions, I do agree it would be good to have some tests for this behavior.
6ea811d
to
3050b34
Compare
@westonruter would you mind giving this another pass? I added tests to assert the behavior, and they fail in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good, thanks.
tests/phpunit/tests/html-api/wpHtmlSupportRequiredActiveFormatReconstruction.php
Outdated
Show resolved
Hide resolved
tests/phpunit/tests/html-api/wpHtmlSupportRequiredActiveFormatReconstruction.php
Outdated
Show resolved
Hide resolved
e9bbdbf
to
c57f20f
Compare
I'm not sure what is happening, because I thought this was all green, but it wasn't testing properly for me, and upon deeper inspection, I think many things need updating. In fdb23e7 I have made the tests pass, but I'm concerned this is too rushed and that we should try a different approach, namely, detecting if we need reconstruction and bailing on a text node if we do. |
96975a2
to
fdb23e7
Compare
fdb23e7
to
39f6ae2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've done another review pass and I'm happy with these changes.
I have no intention of continuing with sirreal#6.
When encountering text nodes in an HTML document, the HTML parser needs to run the active format reconstruction algorithm, even if it doesn't stop to visit those text nodes. This is because the formats, which might need reconstructing, will impact the breadcrumbs of all downstream nodes from the text node. In this patch, this process is triggered, but the text nodes are then skipped, since the HTML Processor doesn't currently support visiting them. Co-authored-by: Weston Ruter <westonruter@git.wordpress.org> Co-authored-by: Jon Surrell <jonsurrell@git.wordpress.org>
4e697fc
to
d8c1078
Compare
When encountering text nodes in an HTML document, the HTML parser needs to run the active format reconstruction algorithm, even if it doesn't stop to visit those text nodes. This is because the formats, which might need reconstructing, will impact the breadcrumbs of all downstream nodes from the text node. In this patch, this process is triggered, which properly triggers the active format reconstruction. It also enables the visiting of other token types as is possible in the Tag Processor. Developed in #6054 Discussed in https://core.trac.wordpress.org/ticket/60170 Props: dmsnell, jonsurrell, westonruter. Fixes: #60455. Follow-up to: [57348]. git-svn-id: https://develop.svn.wordpress.org/trunk@57806 602fd350-edb4-49c9-b593-d223f7449a82
When encountering text nodes in an HTML document, the HTML parser needs to run the active format reconstruction algorithm, even if it doesn't stop to visit those text nodes. This is because the formats, which might need reconstructing, will impact the breadcrumbs of all downstream nodes from the text node. In this patch, this process is triggered, which properly triggers the active format reconstruction. It also enables the visiting of other token types as is possible in the Tag Processor. Developed in WordPress/wordpress-develop#6054 Discussed in https://core.trac.wordpress.org/ticket/60170 Props: dmsnell, jonsurrell, westonruter. Fixes: #60455. Follow-up to: [57348]. Built from https://develop.svn.wordpress.org/trunk@57806 git-svn-id: http://core.svn.wordpress.org/trunk@57307 1a063a9b-81f0-0310-95a4-ce76da25c4cd
When encountering text nodes in an HTML document, the HTML parser needs to run the active format reconstruction algorithm, even if it doesn't stop to visit those text nodes. This is because the formats, which might need reconstructing, will impact the breadcrumbs of all downstream nodes from the text node. In this patch, this process is triggered, which properly triggers the active format reconstruction. It also enables the visiting of other token types as is possible in the Tag Processor. Developed in WordPress/wordpress-develop#6054 Discussed in https://core.trac.wordpress.org/ticket/60170 Props: dmsnell, jonsurrell, westonruter. Fixes: #60455. Follow-up to: [57348]. Built from https://develop.svn.wordpress.org/trunk@57806 git-svn-id: https://core.svn.wordpress.org/trunk@57307 1a063a9b-81f0-0310-95a4-ce76da25c4cd
When encountering text nodes in an HTML document, the HTML parser needs to run the active format reconstruction algorithm, even if it doesn't stop to visit those text nodes. This is because the formats, which might need reconstructing, will impact the breadcrumbs of all downstream nodes from the text node. In this patch, this process is triggered, which properly triggers the active format reconstruction. It also enables the visiting of other token types as is possible in the Tag Processor. Developed in #6054 Discussed in https://core.trac.wordpress.org/ticket/60170 Reviewed by swissspidy. Merges [57806] to the to the 6.5 branch. Props: dmsnell, jonsurrell, westonruter. Fixes: #60455. Follow-up to: [57348]. git-svn-id: https://develop.svn.wordpress.org/branches/6.5@57823 602fd350-edb4-49c9-b593-d223f7449a82
When encountering text nodes in an HTML document, the HTML parser needs to run the active format reconstruction algorithm, even if it doesn't stop to visit those text nodes. This is because the formats, which might need reconstructing, will impact the breadcrumbs of all downstream nodes from the text node. In this patch, this process is triggered, which properly triggers the active format reconstruction. It also enables the visiting of other token types as is possible in the Tag Processor. Developed in WordPress/wordpress-develop#6054 Discussed in https://core.trac.wordpress.org/ticket/60170 Reviewed by swissspidy. Merges [57806] to the to the 6.5 branch. Props: dmsnell, jonsurrell, westonruter. Fixes: #60455. Follow-up to: [57348]. Built from https://develop.svn.wordpress.org/branches/6.5@57823 git-svn-id: http://core.svn.wordpress.org/branches/6.5@57324 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Trac ticket: Core-60455
See alternative in #6203See alternative in sirreal#6
Status
Description
When encountering text nodes in an HTML document, the HTML Parser needs to run the active format reconstruction algorithm, even if it doesn't stop to visit those text nodes. This is because the formats, which might need reconstructing, will impact the breadcrumbs of all downstream nodes from the text node.
In this patch, this process is triggered, but the text nodes are then skipped, since the HTML Processor doesn't currently support visiting them.