#65372 closed defect (bug) (fixed)
HTML API: Fuzz-test and fix detections in 7.1
| Reported by: | dmsnell | Owned by: | dmsnell |
|---|---|---|---|
| Priority: | normal | Milestone: | 7.1 |
| Component: | HTML API | Version: | |
| Severity: | normal | Keywords: | has-patch has-unit-tests dev-reviewed |
| Cc: | Focuses: |
Description (last modified by )
The purpose of this ticket is to track work to fuzz-test the HTML API against inputs that could raise issues or bugs and then fix them in 7.1.
Noted already are a few cases where:
- out-of-bounds text access throws warnings
- HTML normalization is non-idempotent on malformed inputs
- HTML normalization of prefixed attributes like
xlink:href=…(incorrectly serialized asxlink href=…
Change History (87)
This ticket was mentioned in PR #11982 on WordPress/wordpress-develop by @dmsnell.
6 months ago
#1
- Keywords has-patch has-unit-tests added
#3
@
5 months ago
- Resolution fixed
- Status closed → reopened
Reopening for additional fixes during 7.1 cycle. Additions to be included in description.
This ticket was mentioned in PR #12140 on WordPress/wordpress-develop by @jonsurrell.
5 months ago
#5
Fixes an issue where HTML Processor serialization issue where adjusted foreign attributes such as xlink:href were emitted with a space separator as xlink href. After normalization, this would become two attributes, xlink and href.
This keeps duplicate detection keyed to the adjusted qualified attribute name while converting adjusted foreign attributes back to colon-prefixed names when writing HTML. It also adds regression coverage for both WP_HTML_Processor::normalize() and serialize_token().
Trac ticket: https://core.trac.wordpress.org/ticket/65372
## Use of AI Tools
AI assistance: Yes
Tool(s): Codex
Model(s): GPT-5
Used for: Discover issue with fuzz testing, add the regression test, implement fix, perform verification, and draft this PR description.
@jonsurrell commented on PR #12140:
5 months ago
#6
### Code review
No issues found. Checked for bugs and CLAUDE.md compliance.
🤖 Generated with Claude Code
@jonsurrell commented on PR #12140:
5 months ago
#7
### Code review
No issues found. Checked for bugs and CLAUDE.md compliance.
🤖 Generated with Claude Code
@jonsurrell commented on PR #12140:
5 months ago
#8
### Code review
No issues found. Checked for bugs and CLAUDE.md compliance.
Verified that the space-to-colon replacement in `serialize_token()` is safe: the tokenizer never permits spaces in attribute names, so a space can only appear in a qualified name via the adjusted foreign attributes table in `get_qualified_attribute_name()`. Keeping duplicate detection keyed on the space-form qualified name is equivalent to keying on the serialized name, since attribute names from the tag processor are unique lowercase names and the mapping is collision-free.
🤖 Generated with Claude Code
<sub>- If this code review was useful, please react with 👍. Otherwise, react with 👎.</sub>
This ticket was mentioned in PR #12147 on WordPress/wordpress-develop by @dmsnell.
5 months ago
#9
Trac ticket: Core-65372
Detected while fuzz-testing the UTF-8 handling code, this defect meant that the tests were verifying the wrong behavior. Namely, they verified a stringification of ASCII digits, which always converted plainly, when they were meant to test handling of invalid UTF-8 sequences.
This patch fixes the test by calling chr() on the byte values before concatenating into a big string.
Follow-up to: [60950].
This ticket was mentioned in PR #12148 on WordPress/wordpress-develop by @dmsnell.
5 months ago
#10
Trac ticket: Core-65372
Found during fuzzing work on the HTML API and adjacent code. The previous version of this function used a Unicode PCRE to detect noncharacter code points, but that invocation failed if the input string contained sequences of invalid UTF-8 bytes.
This patch replaces the Unicode PCRE with a mapped sequence of raw bytes. This version works in environments without Unicode support and it works when invalid bytes are present, making it possible to remove the fallback function as well.
Follow-up to [61000].
@dmsnell commented on PR #12147:
5 months ago
#12
@dmsnell commented on PR #12148:
5 months ago
#14
This ticket was mentioned in PR #12155 on WordPress/wordpress-develop by @dmsnell.
5 months ago
#15
Trac ticket: Core-65372
⚠️ Not sure if this is a positive fix or not because things get really messy when a site isn’t running UTF-8. For example, if the
blog_charsetis non-UTF-8, then the encoded code points won’t render on the frontend; they will be corrupted. However, if we encode in the configured charset, it’s likely that the code points aren’t represented in that charset, and will be rendered as?instead, which is corrupt. It still makes most sense to run everything internally as UTF-8 and then only re-encode on transit to the browser if the site isn’t running UTF-8. In that case, this is a positive change.
This was brought up during fuzz testing of the HTML API. After polyfilling mb_chr() and relying on it in the HTML decoder, it became possible that for sites with a non-UTF-8 charset selected, then the creation of text from code points when decoding numeric character references might produce corrupted text, or text which encodes to non-UTF-8 bytes.
While for these sites, there are broader issues with non-UTF-8 support, this change ensures that code point encoding remains deterministic.
Follow-up to [62424].
@dmsnell commented on PR #12155:
5 months ago
#17
@dmsnell commented on PR #12140:
5 months ago
#19
This ticket was mentioned in PR #9657 on WordPress/wordpress-develop by @jonsurrell.
5 months ago
#20
</br> gets special treatment in the HTML standard. It creates a BR element with no attributes (regardless of whether it _appears_ to have attributes in the HTML like </br attr-name>).
- Stop on
</br>in::next_tag()like other openers. - Return
array()from::get_attribute_names_with_prefix()on</br>instead ofnulllike true close tags. - Add tests.
To do:
- [ ] Ensure
</br>works with functions like::set_attribute()and::add_class(). These will require rewriting the tag to<br attrs …>or the attributes will be discarded.
Trac ticket: https://core.trac.wordpress.org/ticket/65372
@jonsurrell commented on PR #9657:
5 months ago
#21
Moved to trac ticket https://core.trac.wordpress.org/ticket/65372, this has been appearing in fuzz testing. I added a to-do, this likely needs some extra work to handle attribute modification. It will basically need to rewrite the entire token span I think because any attribute-like syntax needs to be removed before rewriting to <br> and only then can attributes be added.
I would like to move this forward when those issues are handled.
This ticket was mentioned in PR #12184 on WordPress/wordpress-develop by @jonsurrell.
5 months ago
#22
## Summary
- Reconsume a non-matching byte after
<while scanning script data. - Prevent less-than sequences before the real
</script>closer from making normalization drop the script element. - Add coverage for script less-than parsing and normalization cases.
Trac ticket: https://core.trac.wordpress.org/ticket/65372
## Testing
- Focused script parsing and normalization PHPUnit coverage passes.
- See HTML API debugger text example.
## Use of AI Tools
AI assistance: Yes
Tool(s): Codex
Model(s): GPT-5.5
Used for: PR description cleanup and code review.
@jonsurrell commented on PR #12184:
5 months ago
#23
Yes! HTML API fuzz tests caught this.
@jonsurrell commented on PR #12184:
5 months ago
#25
Merged in r62509.
This ticket was mentioned in PR #12193 on WordPress/wordpress-develop by @jonsurrell.
5 months ago
#26
XMP contents are not decoded and should not use HTML character reference escaping when serializing.
Escaping on serialize does not preserve the contents, so sequential normalizations of the original become:
<xmp> < > & \" ' ␀ </xmp>(original, ␀ isU+0000 NUL)<xmp> < > & \" ' � </xmp><xmp> &lt; &gt; &amp; \&quot; &apos; � </xmp>- etc…
(Note that the NUL -> � replacement is correct).
Note that XMP is an obsolete element, however it is still present in the HTML5 specification.
Trac ticket: https://core.trac.wordpress.org/ticket/65372
## Testing
Compare the HTML API debugger example above on 7.0 with this branch.
## Use of AI Tools
AI assistance: Yes
Tool(s): Claude (Opus 4.8, Fable 5), Codex (GPT-5.5)
Used for: Fuzz test implementation, analysis of defects, fix implementation, review.
@jonsurrell commented on PR #12193:
5 months ago
#28
Merged in r62542.
This ticket was mentioned in PR #12286 on WordPress/wordpress-develop by @jonsurrell.
5 months ago
#29
Part of decoding HTML named character references in attribute values may involve checking the codepoint immediately following the named character reference:
13.2.5.73 Named character reference state
…
If there is a [named character reference] match
- If the character reference was consumed as part of an attribute, and the last character matched is not a U+003B SEMICOLON character (;), and the next input character is either a U+003D EQUALS SIGN character (=) or an ASCII alphanumeric, then, for historical reasons, flush code points consumed as a character reference and switch to the return state.
The ASCII alphanumeric check was implemented using ctype_alnum(). The behavior of this depends on the host system and the locale. On my system (macOS) it returns true for characters outside of the desired ASCII alphanumeric range.
php -r 'echo ctype_alnum( "\xC2" ) ? "Affected" : "Unaffected";' // Affected
This change compares the following byte with the well-defined ASCII alphanumeric ranges from the HTML specification.
This change also does some minor restructuring of the method to make it align clearly with the specification and to include an early return and avoid the byte comparison in the majority of cases.
Trac ticket: https://core.trac.wordpress.org/ticket/65372
## Use of AI Tools
@jonsurrell commented on PR #12286:
5 months ago
#30
I'm trying a revert of the ctype_alnum() change to see if there are any failures on CI.
On my system, I get these failures from one of the new tests:
1) Tests_HtmlApi_WpHtmlDecoder::test_semicolonless_legacy_reference_before_multibyte_attribute_follower with data set #0 ('©¯\_(ツ)_/¯', '©¯\_(ツ)_/¯', '©', 5)
Failed to decode the full attribute value as expected.
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-'©¯\_(ツ)_/¯'
+'©¯\_(ツ)_/¯'
/Users/jonsurrell/a8c/wordpress-develop/trunk/tests/phpunit/tests/html-api/wpHtmlDecoder.php:121
2) Tests_HtmlApi_WpHtmlDecoder::test_semicolonless_legacy_reference_before_multibyte_attribute_follower with data set #1 ('¬ಠ_ಠ', '¬ಠ_ಠ', '¬', 4)
Failed to decode the full attribute value as expected.
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-'¬ಠ_ಠ'
+'¬ಠ_ಠ'
/Users/jonsurrell/a8c/wordpress-develop/trunk/tests/phpunit/tests/html-api/wpHtmlDecoder.php:121
3) Tests_HtmlApi_WpHtmlDecoder::test_semicolonless_legacy_reference_before_multibyte_attribute_follower with data set #2 (' £20', ' £20', ' ', 5)
Failed to decode the full attribute value as expected.
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-' £20'
+' £20'
/Users/jonsurrell/a8c/wordpress-develop/trunk/tests/phpunit/tests/html-api/wpHtmlDecoder.php:121
4) Tests_HtmlApi_WpHtmlDecoder::test_semicolonless_legacy_reference_before_multibyte_attribute_follower with data set #3 (' 🎉', ' 🎉', ' ', 5)
Failed to decode the full attribute value as expected.
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-' 🎉'
+' 🎉'
/Users/jonsurrell/a8c/wordpress-develop/trunk/tests/phpunit/tests/html-api/wpHtmlDecoder.php:121
5) Tests_HtmlApi_WpHtmlDecoder::test_semicolonless_legacy_reference_before_multibyte_attribute_follower with data set #4 ('®™', '®™', '®', 4)
Failed to decode the full attribute value as expected.
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-'®™'
+'®™'
/Users/jonsurrell/a8c/wordpress-develop/trunk/tests/phpunit/tests/html-api/wpHtmlDecoder.php:121
FAILURES!
Tests: 115, Assertions: 331, Failures: 5.
This ticket was mentioned in PR #12289 on WordPress/wordpress-develop by @jonsurrell.
5 months ago
#31
IFRAME, NOEMBED, and NOFRAMES contents were omitted from normalized HTML. Print their rawtext contents verbatim according to the standard for serializing HTML fragments.
If current node is a Text node
If the parent of current node is a style, script, xmp, iframe, noembed, noframes, or plaintext element, or if the parent of current node is a noscript element and scripting is enabled for the node, then append the value of current node's data literally.
Otherwise, append the value of current node's data, escaped as described below.
Trac ticket: https://core.trac.wordpress.org/ticket/65372
## Use of AI Tools
AI assistance: Yes
Tool(s): Codex
Model(s): GPT-5.5
Used for: Detection and initial implementation.
This ticket was mentioned in PR #12319 on WordPress/wordpress-develop by @jonsurrell.
5 months ago
#32
<g attr=/> is not a self-closing tag. It is a tag with the [attr="/"] attribute.
Trac ticket: https://core.trac.wordpress.org/ticket/65372
## Use of AI Tools
This ticket was mentioned in PR #12322 on WordPress/wordpress-develop by @jonsurrell.
5 months ago
#33
HTML PRE, LISTING, and TEXTAREA elements ignore a leading newline. Previous changes ensured those newline were preserved (r61747, r61754), but did not account for non-HTML examples of these elements (for example svg:textarea).
Trac ticket: https://core.trac.wordpress.org/ticket/65372
Follow-up to r61747, r61754
## Use of AI Tools
AI assistance: Yes
Tool(s): Codex GPT-5.5
Used for: Fuzz testing, diagnosis, initial fix implementation, review and feedback.
This ticket was mentioned in PR #12323 on WordPress/wordpress-develop by @jonsurrell.
5 months ago
#34
Trac ticket: https://core.trac.wordpress.org/ticket/65372
Follow-up to r61754.
## Use of AI Tools
AI assistance: Yes
Tool(s): Codex GPT-5.5
Used for: Fuzz testing, initial implementation, review and feedback.
@jonsurrell commented on PR #12323:
5 months ago
#35
@jonsurrell commented on PR #12286:
5 months ago
#37
Committed in r62573.
@jonsurrell commented on PR #12322:
5 months ago
#39
Committed in r62574.
This ticket was mentioned in PR #12353 on WordPress/wordpress-develop by @jonsurrell.
5 months ago
#40
Ensure foreign content elements do not match HTML elements on the stack of open element checks.
A closing HTML tag could close non-matching foreign content elements producing breadcrumgbs in some documents.
Trac ticket: https://core.trac.wordpress.org/ticket/65372
## Use of AI Tools
AI assistance: Yes
Tool(s): Codex
Model(s): GPT-5.5
Used for: Fuzzing, diagnosis, fix implementation.
@jonsurrell commented on PR #12353:
5 months ago
#42
Merged in r62575.
@jonsurrell commented on PR #12319:
5 months ago
#43
There’s a case of removing an attribute and leaving an ambiguous trailing
/>that came up in my fuzz-testing
Nice one, I'll see if variant of that is reproducible and add some unit tests.
@jonsurrell commented on PR #12319:
5 months ago
#44
I plan to land this and address that on its own. Attribute removal behavior with the self-closing flag are a different issue.
@jonsurrell commented on PR #12319:
5 months ago
#46
Merged in r62595.
This ticket was mentioned in PR #12367 on WordPress/wordpress-develop by @jonsurrell.
5 months ago
#47
r62595 introduced an test code that asserts the wrong behavior. Fix it.
This fixed a test that is currently failing on trunk.
Trac ticket: https://core.trac.wordpress.org/ticket/65372
Follow-up to r62595.
## Use of AI Tools
@jonsurrell commented on PR #12367:
5 months ago
#49
Merged in r62598.
This ticket was mentioned in PR #12368 on WordPress/wordpress-develop by @jonsurrell.
5 months ago
#50
Trac ticket: https://core.trac.wordpress.org/ticket/65372
## Use of AI Tools
@jonsurrell commented on PR #12319:
4 months ago
#51
There’s a case of removing an attribute and leaving an ambiguous trailing
/>that came up in my fuzz-testing, but I may have fixed it already.
<div a b=3 /b> <div a />something like this
Work-in-progress: https://github.com/WordPress/wordpress-develop/pull/12368
This ticket was mentioned in PR #12379 on WordPress/wordpress-develop by @jonsurrell.
4 months ago
#52
Prevent modifying the by-reference variable when WP_HTML_Decoder::read_character_reference() misses a named reference.
Trac ticket: https://core.trac.wordpress.org/ticket/65372
## Use of AI Tools
AI assistance: Yes
Tool(s): Codex
Model(s): GPT-5.5
Used for: Fuzz tests, diagnosis, implementation.
This ticket was mentioned in PR #12380 on WordPress/wordpress-develop by @jonsurrell.
4 months ago
#53
Trac ticket: https://core.trac.wordpress.org/ticket/65372
## Use of AI Tools
This ticket was mentioned in PR #12385 on WordPress/wordpress-develop by @jonsurrell.
4 months ago
#54
The tag processor defers some processing. It is currently applied inconsistently.
Newline should be normalized (CRLF and CR become LF). This is from the input stream pre-processing phase.
Null bytes are replaced with U+FFFD replacement. This depends on the tokenization rules, but relevant for this PR is that it applies in tag names, attribute names, and attribute values.
Trac ticket: https://core.trac.wordpress.org/ticket/65372
## Use of AI Tools
AI assistance: Yes
Tool(s): Codex
Model(s): GPT-5.5
Used for: Fuzz testing, diagnosis, initial implementation, review.
@jonsurrell commented on PR #12379:
4 months ago
#55
Failing tests are currently failing on trunk:
There was 1 failure: 1) WP_Test_REST_Attachments_Controller::test_sideload_animated_video_companions_write_metadata Sideloading animated_video should succeed. Failed asserting that 400 is identical to 200.
@jonsurrell commented on PR #12385:
4 months ago
#57
Merged in r62667.
This ticket was mentioned in PR #12466 on WordPress/wordpress-develop by @jonsurrell.
4 months ago
#58
## Summary
- Serialize decoded carriage returns in text, attributes, and RCDATA-style contents as
so normalization reaches a fixed point. - Built on r62667.
## Testing
- Regression coverage for decoded CR handling across text, attributes, RCDATA, tables, and templates.
- HTML API and html5lib PHPUnit groups and PHPCS pass.
Trac ticket: https://core.trac.wordpress.org/ticket/65372
## Use of AI Tools
AI assistance: Yes
Tool(s): Codex
Model(s): GPT-5.5
Used for: PR description cleanup and code review.
@jonsurrell commented on PR #12380:
4 months ago
#60
Merged in r62711.
@jonsurrell commented on PR #12289:
4 months ago
#62
Merged in r62715.
@jonsurrell commented on PR #12466:
4 months ago
#64
Merged in r62716.
This ticket was mentioned in PR #12518 on WordPress/wordpress-develop by @jonsurrell.
4 months ago
#65
Removing an attribute could accidentally change tag semantics. For example, removing attr from <svg><g /attr>ok produced <svg><g />ok, turning the g element into a self-closing tag.
The / is outside the recorded attribute span, so deleting the span exposed it directly before >. This keeps a separating space when removing a slash-adjacent attribute. Duplicate and repeated removals are covered and remain idempotent.
Tests were added first for primary, duplicate, and repeated removals. The Tag Processor and full HTML API test suites pass.
Trac ticket: https://core.trac.wordpress.org/ticket/65372
Alternative to #12368.
## Use of AI Tools
AI assistance: Yes
Tool(s): Codex
Model(s): GPT-5
Used for: Diagnosis, tests, implementation, adversarial review, and verification. All generated changes were reviewed before submission.
@jonsurrell commented on PR #12368:
4 months ago
#66
Closing in favor of https://github.com/WordPress/wordpress-develop/pull/12518.
This ticket was mentioned in Slack in #core by adrianduffell. View the logs.
3 months ago
#68
follow-up:
↓ 70
@
3 months ago
Hey folks, it looks like a lot work went into this for 7.1! Do you have anything more planned for the release?
This ticket was mentioned in PR #12936 on WordPress/wordpress-develop by @jonsurrell.
3 months ago
#70
WP_HTML_Tag_Processor::skip_rcdata() omits U+000C FORM FEED from the end-tag-name terminator set. A valid closer such as </xmp\f> is treated as text, and the processor reports the complete XMP element as incomplete. The same broken scanner handles six other RCDATA and RAWTEXT elements.
Add FORM FEED to the predicate. Test the complete terminator contract — space, tab, LF, FF, CR, /, and > — against every element routed through skip_rcdata() and skip_rawtext(). The Cartesian provider keeps all 49 cases independent and leaves the terminator provider reusable. SCRIPT uses a separate scanner that already handles the full set.
Trac ticket: https://core.trac.wordpress.org/ticket/65372
## Testing
WP_TESTS_SKIP_INSTALL=1 vendor/bin/phpunit --group html-api- 1,714 tests, 6,107 assertions, 1 skipped.
WP_TESTS_SKIP_INSTALL=1 vendor/bin/phpunit --group=html-api-web-platform-tests- 1,707 tests, 1,261 assertions, 446 skipped.
vendor/bin/phpcs --standard=phpcs.xml.dist src/wp-includes/html-api/class-wp-html-tag-processor.php tests/phpunit/tests/html-api/wpHtmlTagProcessor.php- PHP syntax and
git diff --checkpass.
## Use of AI Tools
AI assistance: Yes
Tool(s): OpenAI Codex
Model(s): GPT-5
Used for: Reproducing the defect, auditing related tokenizer paths, implementing the fix and tests, adversarial review, and drafting this description. The contributor reviewed the final changes and test results.
This ticket was mentioned in PR #12957 on WordPress/wordpress-develop by @jonsurrell.
3 months ago
#69
WP_HTML_Tag_Processor::set_modifiable_text() emits a _doing_it_wrong() notice when called on a tag that doesn't support it. [62715] replaced the message's list of supported tags with a generic "This tag does not support setting modifiable text.", removing the only hint about which tags *are* supported.
Restore the list, extended with the raw text tags that [62715] added support for:
Only the IFRAME, NOEMBED, NOFRAMES, SCRIPT, STYLE, TEXTAREA, TITLE, and XMP tags support setting modifiable text.
The generic message for non-tag tokens is unchanged.
Follow-up to [62715].
## Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 4.5
Used for: Applying the message change and drafting this description.
#70
in reply to: ↑ 68
@
3 months ago
Replying to adrianduffell:
Hey folks, it looks like a lot work went into this for 7.1! Do you have anything more planned for the release?
#71
@
3 months ago
@jonsurrell Thanks for working on this.
Hey folks, it looks like a lot work went into this for 7.1! Do you have anything more planned for the release?
Can you commit these two by tomorrow's RC3? Please note that the release branch has already been created, so after committing to trunk and receiving a second review, we will need to backport the changes to 7.1.
@jonsurrell commented on PR #12957:
3 months ago
#74
Merged in r63178.
@jonsurrell commented on PR #12936:
3 months ago
#76
Merged in r63179.
This ticket was mentioned in PR #13203 on WordPress/wordpress-develop by @jonsurrell.
3 months ago
#83
Docs-only follow-up to #12319, which rolled back a change to the parse_next_attribute() return docs so it wouldn't hold up the fix. See the review discussion: https://github.com/WordPress/wordpress-develop/pull/12319#discussion_r3494789615
Two things were in tension there:
- The return value should be framed positively — "whether an attribute was found" — not as a continuation flag. A
truemeans one was found, not that more follow; afalsemeans none was found, whether because the document ended or some other stop condition was reached. - The existing doc was confusing in practice: it returns
trueon end tags even though end tags don't have attributes, and "before the end of the document" is not the only reason it returnsfalse(reaching>is the common one).
This keeps the positive framing and resolves the confusion by making the implicit parts explicit:
- States up front that attribute syntax is parsed on both start and end tags, and that on end tags the attribute is consumed and discarded rather than recorded, but still reported as found.
- Explains why callers loop on it (finding one means another may follow) while being clear that
truedoesn't promise more. - Names the concrete
falseconditions: end of tag (>or/>) or end of document. - Lists the side effects (cursor advance, attribute recording, self-closing flag,
STATE_INCOMPLETE_INPUT). - Adds an inline comment at the
is_closing_tagearly return, which is the line that prompted the original question.
No behavior change. php -l and phpcs pass; tests/phpunit/tests/html-api/wpHtmlTagProcessor.php passes (560 tests).
Trac ticket: https://core.trac.wordpress.org/ticket/65372 (closed; this is a follow-up to that work — a new ticket may be preferable)
## Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Fable 5
Used for: Drafting the docblock and inline comment text from the linked review discussion; reviewed and edited by me.
@jonsurrell commented on PR #13203:
2 months ago
#86
Merged in r63515.
Trac ticket: Core-65372
Fuzz-testing was performed against the HTML API for finding edge cases
that might be broken in the existing parsing code. A few issues were
discovered with HTML normalization and warnings from out-of-bounds
string reads.
This patch contains new tests catching regressions on these behaviors
and adds fixes for the discovered issues.
A special-case for FORM closing tags inside TABLEs was added after
investigation turned up that many normalization issues stem from this
single issue, where
next_tag()would already fail to proceed, but thenormalization was continuing with already-created virtual tokens. This
special-case should be investigated as more support is added to the HTML
API to ensure that it couldn’t be removed for more robust core code.