mirrored from git://develop.git.wordpress.org/
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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: Handle area, br, embed, keygen, wbr #5895
Closed
sirreal
wants to merge
11
commits into
WordPress:trunk
from
sirreal:html-api/handle-tags-area_br_embed_keygen_wbr
Closed
Changes from 7 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
c28ea1d
Add "area", "br", "embed", "img", "keygen", "wbr" tag rules
sirreal 2a80cd2
Test tweaks
sirreal 41f9527
Mention ticket, add unsupported test
sirreal 839a715
Add unnestable test
sirreal 4a50cc1
Fix void nesting tests
sirreal fd26b12
Fix lints
sirreal 94e0ff8
Fix lints
sirreal 8e3b3f2
Remove implemented tags from unsupported list
sirreal 02ffaae
Merge branch 'trunk' into html-api/handle-tags-area_br_embed_keygen_wbr
dmsnell 6f6e09b
Update tests, code styling, comments.
dmsnell 15658e2
Remove superfluous mention of being "incomplete" in test comment.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -934,12 +934,28 @@ private function step_in_body() { | |
$this->run_adoption_agency_algorithm(); | ||
return true; | ||
|
||
/* | ||
* > An end tag whose tag name is "br" | ||
* > Parse error. Drop the attributes from the token, and act as described in the next | ||
* > entry; i.e. act as if this was a "br" start tag token with no attributes, rather | ||
* > than the end tag token that it actually is. | ||
*/ | ||
case '-BR': | ||
$this->last_error = self::ERROR_UNSUPPORTED; | ||
throw new WP_HTML_Unsupported_Exception( 'Closing BR tags require unimplemented special handling.' ); | ||
|
||
/* | ||
* > A start tag whose tag name is one of: "area", "br", "embed", "img", "keygen", "wbr" | ||
*/ | ||
case '+AREA': | ||
case '+BR': | ||
case '+EMBED': | ||
case '+IMG': | ||
case '+KEYGEN': | ||
case '+WBR': | ||
$this->reconstruct_active_formatting_elements(); | ||
$this->insert_html_element( $this->state->current_token ); | ||
$this->state->frameset_ok = false; | ||
return true; | ||
} | ||
|
||
|
@@ -966,13 +982,11 @@ private function step_in_body() { | |
case 'BASEFONT': | ||
case 'BGSOUND': | ||
case 'BODY': | ||
case 'BR': | ||
case 'CAPTION': | ||
case 'COL': | ||
case 'COLGROUP': | ||
case 'DD': | ||
case 'DT': | ||
case 'EMBED': | ||
case 'FORM': | ||
case 'FRAME': | ||
case 'FRAMESET': | ||
|
@@ -981,7 +995,6 @@ private function step_in_body() { | |
case 'HTML': | ||
case 'IFRAME': | ||
case 'INPUT': | ||
case 'KEYGEN': | ||
case 'LI': | ||
case 'LINK': | ||
case 'LISTING': | ||
|
@@ -1021,7 +1034,6 @@ private function step_in_body() { | |
case 'TR': | ||
case 'TRACK': | ||
case 'UL': | ||
case 'WBR': | ||
case 'XMP': | ||
$this->last_error = self::ERROR_UNSUPPORTED; | ||
throw new WP_HTML_Unsupported_Exception( "Cannot process {$tag_name} element." ); | ||
|
@@ -1685,7 +1697,13 @@ public static function is_void( $tag_name ) { | |
'META' === $tag_name || | ||
'SOURCE' === $tag_name || | ||
'TRACK' === $tag_name || | ||
'WBR' === $tag_name | ||
'WBR' === $tag_name || | ||
|
||
// Obsolete | ||
// | ||
// This does not appear in https://html.spec.whatwg.org/#void-elements | ||
// but it was a void tag and browsers treat it as such. | ||
'KEYGEN' === $tag_name | ||
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. |
||
); | ||
} | ||
|
||
|
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
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.
We can deal with this later, it's tricky 🙂