-
Notifications
You must be signed in to change notification settings - Fork 3.2k
HTML API: Simplify META tag encoding processing #9231
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: Simplify META tag encoding processing #9231
Conversation
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. |
86e40c4 to
77aadec
Compare
dmsnell
left a comment
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 left some notes to make the versions all concrete. after that I think this is ready to go.
|
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. |
dmsnell
left a comment
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 ready. At some point we can benchmark it.
9a01561 to
81e0713
Compare
This prevents a test case from running
META tag processing can be simplified in most cases. Add an early check and return to avoid additional processing. Developed in #9231. Props jonsurrell, dmsnell. See #63738. git-svn-id: https://develop.svn.wordpress.org/trunk@60502 602fd350-edb4-49c9-b593-d223f7449a82
META tag processing can be simplified in most cases. Add an early check and return to avoid additional processing. Developed in WordPress/wordpress-develop#9231. Props jonsurrell, dmsnell. See #63738. Built from https://develop.svn.wordpress.org/trunk@60502 git-svn-id: http://core.svn.wordpress.org/trunk@59838 1a063a9b-81f0-0310-95a4-ce76da25c4cd
|
Merged in [60502]. |
META tag processing can be simplified in most cases. Add an early check and return to avoid additional processing. Developed in WordPress/wordpress-develop#9231. Props jonsurrell, dmsnell. See #63738. Built from https://develop.svn.wordpress.org/trunk@60502 git-svn-id: https://core.svn.wordpress.org/trunk@59838 1a063a9b-81f0-0310-95a4-ce76da25c4cd
META tag processing can be simplified in most cases. Add an early check and return to avoid additional processing. Developed in WordPress#9231. Props jonsurrell, dmsnell. See #63738. git-svn-id: https://develop.svn.wordpress.org/trunk@60502 602fd350-edb4-49c9-b593-d223f7449a82
META tag processing can be simplified in most cases. Add an early check and return to avoid additional processing. Developed in WordPress#9231. Props jonsurrell, dmsnell. See #63738. git-svn-id: https://develop.svn.wordpress.org/trunk@60502 602fd350-edb4-49c9-b593-d223f7449a82
Trac ticket: Core-63738
Simplify META tag handling with regards to encoding confidence.
With any of the standard HTML Processor creation paths (
WP_HTML_Processor::create_fragment()andWP_HTML_Processor::create_full_parser()), the encoding is never set totentative. It is eitherirrelevant(on fragments) orcertainon full parsers. In both cases, only theUTF-8encoding is supported.This is an optimization to lift a necessary condition to the top level and avoid processing in the case we expect to encounter in almost every case.
Fragments follow this path to set
irrelevant:wordpress-develop/src/wp-includes/html-api/class-wp-html-processor.php
Line 319 in 1c8185e
wordpress-develop/src/wp-includes/html-api/class-wp-html-processor.php
Line 547 in 1c8185e
And full parsers set
certainhere:wordpress-develop/src/wp-includes/html-api/class-wp-html-processor.php
Line 345 in 1c8185e
Trac ticket:
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.