-
Notifications
You must be signed in to change notification settings - Fork 3.1k
HTML API: Update customizable <select> parsing #9298
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
Open
sirreal
wants to merge
15
commits into
WordPress:trunk
Choose a base branch
from
sirreal:html-api/update-select-tag-parsing
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.
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
aaee111
Apply patch from <select> parser PR
sirreal 9ab745d
Update reset_insertion_mode_appropriately
sirreal 1acfce7
Deprecate the has_element_in_select_scope method
sirreal aac853d
Update "normal" end tag handling to include SELECT
sirreal 89c113d
Update INPUT handling to account for SELECT
sirreal f75a08f
Update HR tag handling
sirreal 099f013
Update SELECT insertion handling
sirreal 7fe3598
Update OPTION, OPTGROUP insertion handling
sirreal 20e0807
Remove in_select and in_select_in_table step methods
sirreal 45edeae
Deprecate unused insertion mode constants
sirreal 446cdaa
Adjust html5lib-test expectation
sirreal 0ed0a68
Add close option tag comments, do not handle cloning
sirreal 8beb128
Update has_element_in_scope with SELECT
sirreal 6be6287
Bail when parsing SELECTEDCONTENT requiring clone
sirreal 9e79bb2
Update html5lib-tests
sirreal 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 hidden or 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 |
---|---|---|
|
@@ -280,6 +280,7 @@ public function has_element_in_specific_scope( string $tag_name, $termination_li | |
* > - th | ||
* > - marquee | ||
* > - object | ||
* > - select | ||
* > - template | ||
* > - MathML mi | ||
* > - MathML mo | ||
|
@@ -311,6 +312,7 @@ public function has_element_in_scope( string $tag_name ): bool { | |
'TH', | ||
'MARQUEE', | ||
'OBJECT', | ||
'SELECT', | ||
'TEMPLATE', | ||
|
||
'math MI', | ||
|
@@ -470,12 +472,14 @@ public function has_element_in_table_scope( string $tag_name ): bool { | |
* @since 6.4.0 Stub implementation (throws). | ||
* @since 6.7.0 Full implementation. | ||
* | ||
* @see https://html.spec.whatwg.org/#has-an-element-in-select-scope | ||
* @deprecated {WP_VERSION} This method is no longer part of the HTML standard. | ||
* | ||
* @param string $tag_name Name of tag to check. | ||
* @return bool Whether the given element is in SELECT scope. | ||
*/ | ||
public function has_element_in_select_scope( string $tag_name ): bool { | ||
_deprecated_function( __METHOD__, '{WP_VERSION}' ); | ||
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. I think we should also be able to remove the body from this function and always return |
||
|
||
foreach ( $this->walk_up() as $node ) { | ||
if ( $node->node_name === $tag_name ) { | ||
return true; | ||
|
This file contains hidden or 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
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.
I still don’t know how the docblock tag and the function call interact. Do you feel like you have a strong understand? Are both expected/appropriate?