-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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: Add current_node_is method to stack of open elements #6968
Conversation
public function current_node_is( string $node_name ): bool { | ||
$current_node = end( $this->stack ); | ||
return $current_node && $current_node->node_name === $node_name; | ||
} |
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.
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.
Seems fair enough. Also we can include the other token types.
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
…ents. As part of work to add more spec support to the HTML API, this new method will make it easier to implement the logic when in the SELECT and TABLE insertion modes. Developed in #6968 Discussed in https://core.trac.wordpress.org/ticket/51576 Props dmsnell, jonsurrell. See #61576. git-svn-id: https://develop.svn.wordpress.org/trunk@58676 602fd350-edb4-49c9-b593-d223f7449a82
…ents. As part of work to add more spec support to the HTML API, this new method will make it easier to implement the logic when in the SELECT and TABLE insertion modes. Developed in WordPress/wordpress-develop#6968 Discussed in https://core.trac.wordpress.org/ticket/51576 Props dmsnell, jonsurrell. See #61576. Built from https://develop.svn.wordpress.org/trunk@58676 git-svn-id: http://core.svn.wordpress.org/trunk@58078 1a063a9b-81f0-0310-95a4-ce76da25c4cd
…ents. As part of work to add more spec support to the HTML API, this new method will make it easier to implement the logic when in the SELECT and TABLE insertion modes. Developed in WordPress/wordpress-develop#6968 Discussed in https://core.trac.wordpress.org/ticket/51576 Props dmsnell, jonsurrell. See #61576. Built from https://develop.svn.wordpress.org/trunk@58676 git-svn-id: https://core.svn.wordpress.org/trunk@58078 1a063a9b-81f0-0310-95a4-ce76da25c4cd
…ents. As part of work to add more spec support to the HTML API, this new method will make it easier to implement the logic when in the SELECT and TABLE insertion modes. Developed in WordPress#6968 Discussed in https://core.trac.wordpress.org/ticket/51576 Props dmsnell, jonsurrell. See #61576. git-svn-id: https://develop.svn.wordpress.org/trunk@58676 602fd350-edb4-49c9-b593-d223f7449a82
Trac ticket: Core-61576
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.