#61549 closed enhancement (fixed)
HTML API: Add "reset insertion mode appropriately"
Reported by: | jonsurrell | Owned by: | jonsurrell |
---|---|---|---|
Milestone: | 6.7 | Priority: | normal |
Severity: | normal | Version: | |
Component: | HTML API | Keywords: | has-patch has-unit-tests |
Focuses: | Cc: |
Description
The HTML standard describes an algorithm to "reset the insertion mode appropriately" that will be necessary for the HTML API to support a number of different tags such as TABLE or SELECT.
An implementation should be added so that the HTML Processor can continue to add tag support.
Change History (13)
This ticket was mentioned in PR #6020 on WordPress/wordpress-develop by @jonsurrell.
5 months ago
#1
- Keywords has-patch has-unit-tests added
This ticket was mentioned in PR #6957 on WordPress/wordpress-develop by @dmsnell.
5 months ago
#2
Trac ticket: Core-61549
As the HTML Processor starts to support other insertion modes outside of "IN BODY" it needs to be aware of those other modes. This patch introduces the missing insertion modes in preparation for adding that support.
Extracted as necessary prep work to the following more complete change: https://github.com/WordPress/wordpress-develop/pull/6020
Props @sirreal.
5 months ago
#5
@sirreal I've merged in trunk
after adding the new insertion modes. I hope that's helpful, as it was clouding the diff
for me.
@jonsurrell commented on PR #6020:
5 months ago
#6
@jonsurrell commented on PR #6020:
5 months ago
#7
At this point I feel pretty good about the implementation and whatever direction you want to take it.
@dmsnell I think you wanted to move it to the HTML Processor, that's fine with me. That's where I put it originally and only moved it so it was easily testable. I'm fine with removing the internals tests and moving the implementation 👍
5 months ago
#8
Noting that because of the inherent challenges in testing this change, we're going to lean on the existing html5lib
test suite, and new tests introduced with additional tag support in order to verify the behavior of the implementation.
The challenge is that this is an internal implementation and it's difficult to ascertain what the tests should be verifying. The test cases are unclear, and testing it in isolation doesn't bear a direct impact on whether the HTML API is working properly or not.
Therefore in order to avoid accidentally encoding incorrect behaviors in a unit test suite on an internal details, and to avoid architecting our code around the ability to test such internal details, we're foregoing specific new tests for this code.
This ticket was mentioned in PR #7194 on WordPress/wordpress-develop by @jonsurrell.
4 months ago
#11
- Make the reset insertion mode appropriately method private.
- Rename the method from
reset_insertion_mode
toreset_insertion_mode_appropriately
to align with how it is referenced in the specification.
The reset_insertion_mode
method was introduced in [58656]. The method's visibility was set to public
, but it was never intended to be part of the public interface.
Trac ticket: https://core.trac.wordpress.org/ticket/61549
Follow-up to https://core.trac.wordpress.org/ticket/61549
Follow-up to [58656]
Add an implementation and tests for "reset the insertion mode appropriately".
This unblocks work to support more tags:
Trac ticket: https://core.trac.wordpress.org/ticket/61549