Make WordPress Core

Opened 12 months ago

Closed 12 months ago

Last modified 9 months ago

#58961 closed enhancement (fixed)

HTML API: Add support for BUTTON element

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

Description

In this patch we're adding support to process the BUTTON element. This requires adding some additional semantic rules to handle situations where a BUTTON element is already in scope.

This patch is one in a series of changes to expand support within the HTML API, moving gradually to allow for more focused changes that are easier to review and test. The HTML Processor is a work in progress with a certain set of features slated to be ready and tested by 6.4.0, but it will only contain partial support of the HTML5 specification even after that. Whenever it cannot positively recognize and process its input it bails, and certain function stubs and logical stubs exist to structure future expansions of support.

Change History (11)

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


12 months ago
#1

  • Keywords has-unit-tests added

Ticket: #58961

In this patch we're adding support to process the BUTTON element. This requires adding some additional semantic rules to handle situations where a BUTTON element is already in scope.

This patch is one in a series of changes to expand support within the HTML API, moving gradually to allow for more focused changes that are easier to review and test. The HTML Processor is a work in progress with a certain set of features slated to be ready and tested by 6.4.0, but it will only contain partial support of the HTML5 specification even after that. Whenever it cannot positively recognize and process its input it bails, and certain function stubs and logical stubs exist to structure future expansions of support.

#2 @dmsnell
12 months ago

cc: @bernhard-reiter

#3 @Bernhard Reiter
12 months ago

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

#4 @Bernhard Reiter
12 months ago

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

In 56380:

HTML API: Add support for BUTTON element.

This patch adds support to process the BUTTON element. This requires adding some additional semantic rules to handle situations where a BUTTON element is already in scope.

Also included is a fixup to enforce that WP_HTML_Processor::next_tag() never returns for a tag closer. This is useful with the Tag Processor, but not for the HTML Processor. There were tests relying on this behavior to assert that internal processes were working as they should, but those tests have been updated to use the semi-private step() function, which does stop on tag closers.

This patch is one in a series of changes to expand support within the HTML API, moving gradually to allow for more focused changes that are easier to review and test. The HTML Processor is a work in progress with a certain set of features slated to be ready and tested by 6.4.0, but it will only contain partial support of the HTML5 specification even after that. Whenever it cannot positively recognize and process its input it bails, and certain function stubs and logical stubs exist to structure future expansions of support.

Props dmsnell.
Fixes #58961.

#6 @bph
10 months ago

  • Keywords needs-dev-note added

#7 @dmsnell
10 months ago

@bph this is a fairly minor and trivial patch to the HTML API, one of many that are all fairly nonconsequential. Did you want to mark #58517 instead, where the HTML Processor is introduced?

My thinking at the moment is that we may still limit how much is being introduced publicly in 6.4, whereas the most significant announcement might be less about the HTML Processor and more about being able to use it to match limited HTML structure through matches_breadcrumbs() (yet to be merged).

#8 @codente
9 months ago

I'm working with @webcommsat to check on dev notes for tickets.

Was it decided whether this one needs a dev note?

We have this tracked for dev notes and review here:
https://github.com/WordPress/Documentation-Issue-Tracker/issues/1151

#9 @dmsnell
9 months ago

I would suggest that there's definitely no reason to include this ticket in a dev note. The HTML Processor itself could use one, and I'd be willing to help write it, which relates more specifically to #58517

#10 @codente
9 months ago

Thank you! @dmsnell Did you have a dev note then for #58517? If not, could you let us know when you might have a draft available?

#11 @dmsnell
9 months ago

@codente drafted a dev note: would love some thoughts and review! draft

Note: See TracTickets for help on using tickets.