mirrored from git://develop.git.wordpress.org/
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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: Improve implementation of adoption agency algorithm #6983
Open
dmsnell
wants to merge
19
commits into
WordPress:trunk
Choose a base branch
from
dmsnell:html-api/improve-adoption-agency-algorithm
base: trunk
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+332
−97
Open
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
38c29c8
HTML API: Simplify breadcrumb accounting.
dmsnell e11f9ee
HTML API: Expand Unsupported class and make it available for debugging.
dmsnell e97f678
HTML API: Support more of the adoption agency algorithm.
dmsnell 2b2d6fe
HTML API: Simplify breadcrumb accounting.
dmsnell 6962fa2
HTML API: Expand Unsupported class and make it available for debugging.
dmsnell ab1096f
HTML API: Implement "reconstruct the active formatting elements" algo…
dmsnell ad82d3a
Merge branch 'trunk' into html-api/improve-active-element-reconstruction
dmsnell 99d2175
Merge branch 'trunk' into html-api/improve-adoption-agency-algorithm
dmsnell 22856d3
More iteration
dmsnell 398ce37
Bail when needing to ignore token during adoption.
dmsnell 374cba3
Continue iterating
dmsnell 9bf12f4
Merge branch 'trunk' into html-api/improve-active-element-reconstruction
sirreal d7dac5e
Goto instead of ignore
dmsnell cabe36e
Remove dead code
dmsnell 5e4bab9
Merge branch 'trunk' into html-api/improve-active-element-reconstruction
dmsnell 301438f
Merge branch 'trunk' into html-api/improve-adoption-agency-algorithm
dmsnell 9856fce
Merge branch 'trunk' into html-api/improve-active-element-reconstruction
dmsnell 6d60b3a
Merge branch 'trunk' into html-api/improve-adoption-agency-algorithm
dmsnell dd0f59f
Merge branch 'html-api/improve-active-element-reconstruction' into ht…
dmsnell File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -622,12 +622,23 @@ public function remove_node( WP_HTML_Token $token ): bool { | |||||
* see WP_HTML_Open_Elements::walk_up(). | ||||||
* | ||||||
* @since 6.4.0 | ||||||
* @since 6.7.0 Accepts $below_this_node to start traversal below a given node, if it exists. | ||||||
* | ||||||
* @param ?WP_HTML_Token $below_this_node Start traversing below this node, if provided and if the node exists. | ||||||
*/ | ||||||
public function walk_down() { | ||||||
$count = count( $this->stack ); | ||||||
public function walk_down( $below_this_node = null ) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
$has_found_node = null === $below_this_node; | ||||||
$count = count( $this->stack ); | ||||||
|
||||||
for ( $i = 0; $i < $count; $i++ ) { | ||||||
yield $this->stack[ $i ]; | ||||||
$node = $this->stack[ $i ]; | ||||||
|
||||||
if ( ! $has_found_node ) { | ||||||
$has_found_node = $node === $below_this_node; | ||||||
continue; | ||||||
} | ||||||
|
||||||
yield $node; | ||||||
} | ||||||
} | ||||||
|
||||||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix PHPdoc: