Opened 7 months ago
Closed 4 months ago
#62583 closed enhancement (fixed)
Ensure HTML Processor step adds to element_queue
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 6.8 | Priority: | normal |
Severity: | normal | Version: | 6.6 |
Component: | HTML API | Keywords: | has-patch |
Focuses: | Cc: |
Description
There are some cases where the step
functions in the HTML processor return true
, but do not add anything to the element queue. When step
returns true, it should indicate the progress has been made progressing the document and there are tokens to process.
There is a todo in code right now describing this situation:
In some cases, probably related to the adoption agency
algorithm, this call to step() doesn't create any new
events. Calling it again creates them. Figure out why
this is and if it's inherent or if it's a bug. Looping
until there are events or until there are no more
tokens works in the meantime and isn't obviously wrong.
Change History (12)
This ticket was mentioned in PR #7627 on WordPress/wordpress-develop by @jonsurrell.
7 months ago
#1
- Keywords has-patch added
This ticket was mentioned in PR #7904 on WordPress/wordpress-develop by @jonsurrell.
7 months ago
#2
- Proceed past BODY and HTML close tags
- DROPME: Add exception in failure case
- Do not return true when closing HTML (but not popping off stack)
- Do not return from step if active formatting POP did not occur
- Do not return from foreign tag closer if stack not modified
Trac ticket:
#3
@
7 months ago
- Owner set to gziolo
- Resolution set to fixed
- Status changed from new to closed
In 59500:
7 months ago
#4
Committed with https://core.trac.wordpress.org/changeset/59500.
#6
@
7 months ago
- Resolution fixed deleted
- Status changed from closed to reopened
PR 7904 contains more cases for consideration (although it's not yet ready for review). Reopening.
This ticket was mentioned in Slack in #core by audrasjb. View the logs.
4 months ago
#8
@
4 months ago
As per today's bugscrub: This ticket was committed and reopened to handle further use case, so we'll keep it open in the milestone for now, but can we have a status update on the remaining work @gziolo @jonsurrell? It would be nice to get this closed before beta 1 next week. Thanks!
This ticket was mentioned in Slack in #core by audrasjb. View the logs.
4 months ago
#10
@
4 months ago
There is some valid work in PR 7904, but I don't expect that work to be finished or merged in 6.8. The changes in that PR are not essential and are fine to bump to a future release.
I'm not sure what the preferred approach is. Would it be best to close this ticket with the changes that are already merged, then open another ticket with the ongoing work is ready to continue?
The HTML specification does not close HTML or BODY tags (pop them off the stack of open elements) when their tag closers are encountered. The HTML processor correctly handles this behavior, however it "pauses" by returning
true
from the step functions. This behavior is incorrect behavior for step because there are no additional tokens to be processed (nothing has been added to the element queue).When encountering these closers, internal state is updated correctly, but the parser should continue processing without pausing.
Trac ticket: https://core.trac.wordpress.org/ticket/62583