Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML API: Active format reconstruction with noah's ark #19

Draft
wants to merge 7 commits into
base: html-api/improve-active-element-reconstruction
Choose a base branch
from

Conversation

sirreal
Copy link
Collaborator

@sirreal sirreal commented Aug 29, 2024

WORK IN PROGRESS

Implement Noah's Ark when pushing to the stack of active formatting elements.

If there are already three elements in the list of active formatting elements after the last marker, if any, or anywhere in the list if there are no markers, that have the same tag name, namespace, and attributes as element, then remove the earliest such element from the list of active formatting elements. For these purposes, the attributes must be compared as they were when the elements were created by the parser; two elements have the same attributes if all their parsed attributes can be paired such that the two attributes in each pair have identical names, namespaces, and values (the order of the attributes does not matter).

TODO:

  • When adding the equivalent element, the earliest should be removed (not skip the 4th). For practical purposes in the HTML API, this may be irrelevant and can be ignored.
  • Are the performance characteristics of this acceptable?
  • Fix all the lints and improve the new classes and constructors.
 FAILURES!
-Tests: 1494, Assertions: 1076, Failures: 2, Skipped: 418.
+Tests: 1494, Assertions: 1097, Failures: 2, Skipped: 397.

Builds on WordPress#6982.

Trac ticket:


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

@sirreal sirreal force-pushed the html-api/try-active-formatting-attributes branch from bbaa396 to 7942a0c Compare August 29, 2024 15:29
@sirreal sirreal changed the base branch from trunk to html-api/improve-active-element-reconstruction August 29, 2024 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant