Make WordPress Core

Opened 7 months ago

Closed 7 months ago

Last modified 7 months ago

#59292 closed defect (bug) (fixed)

HTML API: Skip over contents of RAWTEXT elements such as STYLE.

Reported by: dmsnell's profile dmsnell Owned by: bernhard-reiter's profile Bernhard Reiter
Milestone: 6.3.2 Priority: normal
Severity: normal Version: 6.4
Component: HTML API Keywords: has-patch has-unit-tests commit fixed-major
Focuses: Cc:

Description

When encountering elements that imply switching into the RAWTEXT parsing state, the Tag Processor should skip processing until existing the RAWTEXT state.

In this patch the Tag Processor does just that, except for the case of the deprecated XMP element which implies further and more complicated rules.

There's an implicit assumption that the SCRIPT ENABLED flag in HTML parsing is enabled so that the contents of NOSCRIPT can be skipped. Otherwise, it would be required to parse the contents of that tag.

Change History (7)

This ticket was mentioned in PR #5145 on WordPress/wordpress-develop by @dmsnell.


7 months ago
#1

  • Keywords has-unit-tests added

Trac Ticket: #59292

When encountering elements that imply switching into the RAWTEXT parsing state, the Tag Processor should skip processing until existing the RAWTEXT state.

In this patch the Tag Processor does just that, except for the case of the deprecated XMP element which implies further and more complicated rules.

There's an implicit assumption that the SCRIPT ENABLED flag in HTML parsing is enabled so that the contents of NOSCRIPT can be skipped. Otherwise, it would be required to parse the contents of that tag.

_This was not a reported bug; it was discovered through the Core unit test cases for kses_

#2 @Bernhard Reiter
7 months ago

  • Keywords commit added
  • Milestone changed from Awaiting Review to 6.3.2

#3 @Bernhard Reiter
7 months ago

  • Owner set to Bernhard Reiter
  • Resolution set to fixed
  • Status changed from new to closed

In 56563:

HTML API: Skip over contents of RAWTEXT elements such as STYLE.

When encountering elements that imply switching into the RAWTEXT parsing state,
the Tag Processor should skip processing until exiting the RAWTEXT state.

In this patch the Tag Processor does just that, except for the case of the
deprecated XMP element which implies further and more complicated rules.

There's an implicit assumption that the SCRIPT ENABLED flag in HTML parsing
is enabled so that the contents of NOSCRIPT can be skipped. Otherwise, it would
be required to parse the contents of that tag.

Props dmsnell.
Fixes #59292.

#5 @Bernhard Reiter
7 months ago

  • Keywords fixed-major added
  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening for backport to 6.3.

#6 @Bernhard Reiter
7 months ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 56564:

HTML API: Skip over contents of RAWTEXT elements such as STYLE.

When encountering elements that imply switching into the RAWTEXT parsing state,
the Tag Processor should skip processing until exiting the RAWTEXT state.

In this patch the Tag Processor does just that, except for the case of the
deprecated XMP element which implies further and more complicated rules.

There's an implicit assumption that the SCRIPT ENABLED flag in HTML parsing
is enabled so that the contents of NOSCRIPT can be skipped. Otherwise, it would
be required to parse the contents of that tag.

Props dmsnell.
Merges [56563] to the 6.3 branch.
Fixes #59292.

@Bernhard Reiter commented on PR #5145:


7 months ago
#7

Backported to Core's 6.3 branch in https://core.trac.wordpress.org/changeset/56564.

Note: See TracTickets for help on using tickets.