Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#59292 closed defect (bug) (fixed)

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

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

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.


3 years 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
3 years ago

  • Keywords commit added
  • Milestone Awaiting Review6.3.2

#3 @Bernhard Reiter
3 years ago

  • Owner set to Bernhard Reiter
  • Resolutionfixed
  • Status newclosed

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
3 years ago

  • Keywords fixed-major added
  • Resolution fixed
  • Status closedreopened

Reopening for backport to 6.3.

#6 @Bernhard Reiter
3 years ago

  • Resolutionfixed
  • Status reopenedclosed

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:


3 years 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.