mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
HTML API: Add explicit handling or failure for all tags.
The HTML API HTML processor does not yet support all tags. Many tags (e.g. list elements) have some complicated rules in the [https://html.spec.whatwg.org/#parsing-main-inbody "in body" insertion mode]. Implementing these special rules is blocking the implementation for a catch-all rule for "any other tag" because we need to prevent special rules from being handled by the catch-all. Any other start tag Reconstruct the active formatting elements, if any. Insert an HTML element for the token. … This change ensures the HTML Processor fails when handling special tags. This is the same as existing behavior, but will allow us to implement the catch-all "any other tag" handling without unintentionally handling special elements. Additionally, we add tests that assert the special elements are unhandled. As these tags are implemented, this should help to ensure they're removed from the unsupported tag list. Props jonsurrell, dmsnell. Fixes #60092. git-svn-id: https://develop.svn.wordpress.org/trunk@57248 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -60,22 +60,6 @@ class Tests_HtmlApi_WpHtmlProcessor extends WP_UnitTestCase {
|
||||
$this->assertNull( $p->get_tag() );
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensures that if the HTML Processor encounters inputs that it can't properly handle,
|
||||
* that it stops processing the rest of the document. This prevents data corruption.
|
||||
*
|
||||
* @ticket 59167
|
||||
*
|
||||
* @covers WP_HTML_Processor::next_tag
|
||||
*/
|
||||
public function test_stops_processing_after_unsupported_elements() {
|
||||
$p = WP_HTML_Processor::create_fragment( '<p><x-not-supported></p><p></p>' );
|
||||
$p->next_tag( 'P' );
|
||||
$this->assertFalse( $p->next_tag(), 'Stepped into a tag after encountering X-NOT-SUPPORTED element when it should have aborted.' );
|
||||
$this->assertNull( $p->get_tag(), "Should have aborted processing, but still reported tag {$p->get_tag()} after properly failing to step into tag." );
|
||||
$this->assertFalse( $p->next_tag( 'P' ), 'Stepped into normal P element after X-NOT-SUPPORTED element when it should have aborted.' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensures that the HTML Processor maintains its internal state through seek calls.
|
||||
*
|
||||
@@ -147,4 +131,96 @@ class Tests_HtmlApi_WpHtmlProcessor extends WP_UnitTestCase {
|
||||
$this->assertTrue( $p->next_tag( 'EM' ), 'Could not find first EM.' );
|
||||
$this->assertFalse( $p->next_tag( 'EM' ), 'Should have aborted before finding second EM as it required reconstructing the first EM.' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Ensures that special handling of unsupported tags is cleaned up
|
||||
* as handling is implemented. Otherwise there's risk of leaving special
|
||||
* handling (that is never reached) when tag handling is implemented.
|
||||
*
|
||||
* @ticket 60092
|
||||
*
|
||||
* @dataProvider data_unsupported_special_in_body_tags
|
||||
*
|
||||
* @covers WP_HTML_Processor::step_in_body
|
||||
*
|
||||
* @param string $tag_name Name of the tag to test.
|
||||
*/
|
||||
public function test_step_in_body_fails_on_unsupported_tags( $tag_name ) {
|
||||
$fragment = WP_HTML_Processor::create_fragment( '<' . $tag_name . '></' . $tag_name . '>' );
|
||||
$this->assertFalse( $fragment->next_tag(), 'Should fail to find tag: ' . $tag_name . '.' );
|
||||
$this->assertEquals( $fragment->get_last_error(), WP_HTML_Processor::ERROR_UNSUPPORTED, 'Should have unsupported last error.' );
|
||||
}
|
||||
|
||||
/**
|
||||
* Data provider.
|
||||
*
|
||||
* @return array[]
|
||||
*/
|
||||
public function data_unsupported_special_in_body_tags() {
|
||||
return array(
|
||||
'APPLET' => array( 'APPLET' ),
|
||||
'AREA' => array( 'AREA' ),
|
||||
'BASE' => array( 'BASE' ),
|
||||
'BASEFONT' => array( 'BASEFONT' ),
|
||||
'BGSOUND' => array( 'BGSOUND' ),
|
||||
'BODY' => array( 'BODY' ),
|
||||
'BR' => array( 'BR' ),
|
||||
'CAPTION' => array( 'CAPTION' ),
|
||||
'COL' => array( 'COL' ),
|
||||
'COLGROUP' => array( 'COLGROUP' ),
|
||||
'DD' => array( 'DD' ),
|
||||
'DT' => array( 'DT' ),
|
||||
'EMBED' => array( 'EMBED' ),
|
||||
'FORM' => array( 'FORM' ),
|
||||
'FRAME' => array( 'FRAME' ),
|
||||
'FRAMESET' => array( 'FRAMESET' ),
|
||||
'HEAD' => array( 'HEAD' ),
|
||||
'HR' => array( 'HR' ),
|
||||
'HTML' => array( 'HTML' ),
|
||||
'IFRAME' => array( 'IFRAME' ),
|
||||
'INPUT' => array( 'INPUT' ),
|
||||
'KEYGEN' => array( 'KEYGEN' ),
|
||||
'LI' => array( 'LI' ),
|
||||
'LINK' => array( 'LINK' ),
|
||||
'LISTING' => array( 'LISTING' ),
|
||||
'MARQUEE' => array( 'MARQUEE' ),
|
||||
'MATH' => array( 'MATH' ),
|
||||
'META' => array( 'META' ),
|
||||
'NOBR' => array( 'NOBR' ),
|
||||
'NOEMBED' => array( 'NOEMBED' ),
|
||||
'NOFRAMES' => array( 'NOFRAMES' ),
|
||||
'NOSCRIPT' => array( 'NOSCRIPT' ),
|
||||
'OBJECT' => array( 'OBJECT' ),
|
||||
'OL' => array( 'OL' ),
|
||||
'OPTGROUP' => array( 'OPTGROUP' ),
|
||||
'OPTION' => array( 'OPTION' ),
|
||||
'PARAM' => array( 'PARAM' ),
|
||||
'PLAINTEXT' => array( 'PLAINTEXT' ),
|
||||
'PRE' => array( 'PRE' ),
|
||||
'RB' => array( 'RB' ),
|
||||
'RP' => array( 'RP' ),
|
||||
'RT' => array( 'RT' ),
|
||||
'RTC' => array( 'RTC' ),
|
||||
'SARCASM' => array( 'SARCASM' ),
|
||||
'SCRIPT' => array( 'SCRIPT' ),
|
||||
'SELECT' => array( 'SELECT' ),
|
||||
'SOURCE' => array( 'SOURCE' ),
|
||||
'STYLE' => array( 'STYLE' ),
|
||||
'SVG' => array( 'SVG' ),
|
||||
'TABLE' => array( 'TABLE' ),
|
||||
'TBODY' => array( 'TBODY' ),
|
||||
'TD' => array( 'TD' ),
|
||||
'TEMPLATE' => array( 'TEMPLATE' ),
|
||||
'TEXTAREA' => array( 'TEXTAREA' ),
|
||||
'TFOOT' => array( 'TFOOT' ),
|
||||
'TH' => array( 'TH' ),
|
||||
'THEAD' => array( 'THEAD' ),
|
||||
'TITLE' => array( 'TITLE' ),
|
||||
'TR' => array( 'TR' ),
|
||||
'TRACK' => array( 'TRACK' ),
|
||||
'UL' => array( 'UL' ),
|
||||
'WBR' => array( 'WBR' ),
|
||||
'XMP' => array( 'XMP' ),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,14 +37,26 @@ class Tests_HtmlApi_WpHtmlProcessorBreadcrumbs extends WP_UnitTestCase {
|
||||
public function data_single_tag_of_supported_elements() {
|
||||
$supported_elements = array(
|
||||
'A',
|
||||
'ABBR',
|
||||
'ACRONYM', // Neutralized
|
||||
'ADDRESS',
|
||||
'ARTICLE',
|
||||
'ASIDE',
|
||||
'AUDIO',
|
||||
'B',
|
||||
'BDI',
|
||||
'BDO',
|
||||
'BIG',
|
||||
'BLINK', // Deprecated
|
||||
'BUTTON',
|
||||
'CANVAS',
|
||||
'CENTER', // Neutralized
|
||||
'CITE',
|
||||
'CODE',
|
||||
'DATA',
|
||||
'DATALIST',
|
||||
'DFN',
|
||||
'DEL',
|
||||
'DETAILS',
|
||||
'DIALOG',
|
||||
'DIR',
|
||||
@@ -66,19 +78,42 @@ class Tests_HtmlApi_WpHtmlProcessorBreadcrumbs extends WP_UnitTestCase {
|
||||
'HGROUP',
|
||||
'I',
|
||||
'IMG',
|
||||
'INS',
|
||||
'ISINDEX', // Deprecated
|
||||
'KBD',
|
||||
'LABEL',
|
||||
'LEGEND',
|
||||
'MAIN',
|
||||
'MAP',
|
||||
'MARK',
|
||||
'MENU',
|
||||
'METER',
|
||||
'MULTICOL', // Deprecated
|
||||
'NAV',
|
||||
'NEXTID', // Deprecated
|
||||
'OUTPUT',
|
||||
'P',
|
||||
'PICTURE',
|
||||
'PROGRESS',
|
||||
'Q',
|
||||
'RUBY',
|
||||
'SAMP',
|
||||
'SEARCH',
|
||||
'SECTION',
|
||||
'SLOT',
|
||||
'SMALL',
|
||||
'SPACER', // Deprecated
|
||||
'SPAN',
|
||||
'STRIKE',
|
||||
'STRONG',
|
||||
'SUB',
|
||||
'SUMMARY',
|
||||
'SUP',
|
||||
'TIME',
|
||||
'TT',
|
||||
'U',
|
||||
'VAR',
|
||||
'VIDEO',
|
||||
);
|
||||
|
||||
$data = array();
|
||||
@@ -121,28 +156,16 @@ class Tests_HtmlApi_WpHtmlProcessorBreadcrumbs extends WP_UnitTestCase {
|
||||
*/
|
||||
public function data_unsupported_elements() {
|
||||
$unsupported_elements = array(
|
||||
'ABBR',
|
||||
'ACRONYM', // Neutralized
|
||||
'APPLET', // Deprecated
|
||||
'AREA',
|
||||
'AUDIO',
|
||||
'BASE',
|
||||
'BDI',
|
||||
'BDO',
|
||||
'BGSOUND', // Deprecated; self-closing if self-closing flag provided, otherwise normal.
|
||||
'BLINK', // Deprecated
|
||||
'BODY',
|
||||
'BR',
|
||||
'CANVAS',
|
||||
'CAPTION',
|
||||
'CITE',
|
||||
'COL',
|
||||
'COLGROUP',
|
||||
'DATA',
|
||||
'DATALIST',
|
||||
'DD',
|
||||
'DEL',
|
||||
'DEFN',
|
||||
'DT',
|
||||
'EMBED',
|
||||
'FORM',
|
||||
@@ -153,23 +176,13 @@ class Tests_HtmlApi_WpHtmlProcessorBreadcrumbs extends WP_UnitTestCase {
|
||||
'HTML',
|
||||
'IFRAME',
|
||||
'INPUT',
|
||||
'INS',
|
||||
'ISINDEX', // Deprecated
|
||||
'KBD',
|
||||
'KEYGEN', // Deprecated; void
|
||||
'LABEL',
|
||||
'LEGEND',
|
||||
'LI',
|
||||
'LINK',
|
||||
'LISTING', // Deprecated, use PRE instead.
|
||||
'MAP',
|
||||
'MARK',
|
||||
'MARQUEE', // Deprecated
|
||||
'MATH',
|
||||
'META',
|
||||
'METER',
|
||||
'MULTICOL', // Deprecated
|
||||
'NEXTID', // Deprecated
|
||||
'NOBR', // Neutralized
|
||||
'NOEMBED', // Neutralized
|
||||
'NOFRAMES', // Neutralized
|
||||
@@ -178,26 +191,16 @@ class Tests_HtmlApi_WpHtmlProcessorBreadcrumbs extends WP_UnitTestCase {
|
||||
'OL',
|
||||
'OPTGROUP',
|
||||
'OPTION',
|
||||
'OUTPUT',
|
||||
'PICTURE',
|
||||
'PLAINTEXT', // Neutralized
|
||||
'PRE',
|
||||
'PROGRESS',
|
||||
'Q',
|
||||
'RB', // Neutralized
|
||||
'RP',
|
||||
'RT',
|
||||
'RTC', // Neutralized
|
||||
'RUBY',
|
||||
'SAMP',
|
||||
'SCRIPT',
|
||||
'SELECT',
|
||||
'SLOT',
|
||||
'SOURCE',
|
||||
'SPACER', // Deprecated
|
||||
'STYLE',
|
||||
'SUB',
|
||||
'SUP',
|
||||
'SVG',
|
||||
'TABLE',
|
||||
'TBODY',
|
||||
@@ -207,19 +210,12 @@ class Tests_HtmlApi_WpHtmlProcessorBreadcrumbs extends WP_UnitTestCase {
|
||||
'TFOOT',
|
||||
'TH',
|
||||
'THEAD',
|
||||
'TIME',
|
||||
'TITLE',
|
||||
'TR',
|
||||
'TRACK',
|
||||
'UL',
|
||||
'VAR',
|
||||
'VIDEO',
|
||||
'WBR',
|
||||
'XMP', // Deprecated, use PRE instead.
|
||||
|
||||
// Made up elements, custom elements.
|
||||
'X-NOT-AN-HTML-ELEMENT',
|
||||
'HUMAN-TIME',
|
||||
);
|
||||
|
||||
$data = array();
|
||||
@@ -360,6 +356,10 @@ class Tests_HtmlApi_WpHtmlProcessorBreadcrumbs extends WP_UnitTestCase {
|
||||
'H4 inside H2' => array( '<h2><span>Major<h4 target>Minor</h3></span>', array( 'HTML', 'BODY', 'H2', 'SPAN', 'H4' ), 1 ),
|
||||
'H5 after unclosed H4 inside H2' => array( '<h2><span>Major<h4>Minor</span></h3><h5 target>', array( 'HTML', 'BODY', 'H2', 'SPAN', 'H5' ), 1 ),
|
||||
'H5 after H4 inside H2' => array( '<h2><span>Major<h4>Minor</h4></span></h3><h5 target>', array( 'HTML', 'BODY', 'H5' ), 1 ),
|
||||
|
||||
// Custom elements.
|
||||
'WP-EMOJI' => array( '<div><wp-emoji target></wp-emoji></div>', array( 'HTML', 'BODY', 'DIV', 'WP-EMOJI' ), 1 ),
|
||||
'WP-EMOJI then IMG' => array( '<div><wp-emoji></wp-emoji><img target></div>', array( 'HTML', 'BODY', 'DIV', 'IMG' ), 1 ),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -72,21 +72,16 @@ class Tests_HtmlApi_WpHtmlSupportRequiredOpenElements extends WP_UnitTestCase {
|
||||
$this->ensure_support_is_added_everywhere( 'OBJECT' );
|
||||
$this->ensure_support_is_added_everywhere( 'TEMPLATE' );
|
||||
|
||||
// MathML Elements
|
||||
$this->ensure_support_is_added_everywhere( 'MI' );
|
||||
$this->ensure_support_is_added_everywhere( 'MO' );
|
||||
$this->ensure_support_is_added_everywhere( 'MN' );
|
||||
$this->ensure_support_is_added_everywhere( 'MS' );
|
||||
$this->ensure_support_is_added_everywhere( 'MTEXT' );
|
||||
$this->ensure_support_is_added_everywhere( 'ANNOTATION-XML' );
|
||||
// MathML Elements: MI, MO, MN, MS, MTEXT, ANNOTATION-XML.
|
||||
$this->ensure_support_is_added_everywhere( 'MATH' );
|
||||
|
||||
/*
|
||||
* SVG elements: note that TITLE is both an HTML element and an SVG element
|
||||
* so care must be taken when adding support for either one.
|
||||
*
|
||||
* FOREIGNOBJECT, DESC, TITLE.
|
||||
*/
|
||||
$this->ensure_support_is_added_everywhere( 'FOREIGNOBJECT' );
|
||||
$this->ensure_support_is_added_everywhere( 'DESC' );
|
||||
$this->ensure_support_is_added_everywhere( 'TITLE' );
|
||||
$this->ensure_support_is_added_everywhere( 'SVG' );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -115,21 +110,16 @@ class Tests_HtmlApi_WpHtmlSupportRequiredOpenElements extends WP_UnitTestCase {
|
||||
$this->ensure_support_is_added_everywhere( 'OBJECT' );
|
||||
$this->ensure_support_is_added_everywhere( 'TEMPLATE' );
|
||||
|
||||
// MathML Elements
|
||||
$this->ensure_support_is_added_everywhere( 'MI' );
|
||||
$this->ensure_support_is_added_everywhere( 'MO' );
|
||||
$this->ensure_support_is_added_everywhere( 'MN' );
|
||||
$this->ensure_support_is_added_everywhere( 'MS' );
|
||||
$this->ensure_support_is_added_everywhere( 'MTEXT' );
|
||||
$this->ensure_support_is_added_everywhere( 'ANNOTATION-XML' );
|
||||
// MathML Elements: MI, MO, MN, MS, MTEXT, ANNOTATION-XML.
|
||||
$this->ensure_support_is_added_everywhere( 'MATH' );
|
||||
|
||||
/*
|
||||
* SVG elements: note that TITLE is both an HTML element and an SVG element
|
||||
* so care must be taken when adding support for either one.
|
||||
*
|
||||
* FOREIGNOBJECT, DESC, TITLE.
|
||||
*/
|
||||
$this->ensure_support_is_added_everywhere( 'FOREIGNOBJECT' );
|
||||
$this->ensure_support_is_added_everywhere( 'DESC' );
|
||||
$this->ensure_support_is_added_everywhere( 'TITLE' );
|
||||
$this->ensure_support_is_added_everywhere( 'SVG' );
|
||||
|
||||
// These elements are specific to list item scope.
|
||||
$this->ensure_support_is_added_everywhere( 'OL' );
|
||||
@@ -161,21 +151,16 @@ class Tests_HtmlApi_WpHtmlSupportRequiredOpenElements extends WP_UnitTestCase {
|
||||
$this->ensure_support_is_added_everywhere( 'OBJECT' );
|
||||
$this->ensure_support_is_added_everywhere( 'TEMPLATE' );
|
||||
|
||||
// MathML Elements
|
||||
$this->ensure_support_is_added_everywhere( 'MI' );
|
||||
$this->ensure_support_is_added_everywhere( 'MO' );
|
||||
$this->ensure_support_is_added_everywhere( 'MN' );
|
||||
$this->ensure_support_is_added_everywhere( 'MS' );
|
||||
$this->ensure_support_is_added_everywhere( 'MTEXT' );
|
||||
$this->ensure_support_is_added_everywhere( 'ANNOTATION-XML' );
|
||||
// MathML Elements: MI, MO, MN, MS, MTEXT, ANNOTATION-XML.
|
||||
$this->ensure_support_is_added_everywhere( 'MATH' );
|
||||
|
||||
/*
|
||||
* SVG elements: note that TITLE is both an HTML element and an SVG element
|
||||
* so care must be taken when adding support for either one.
|
||||
*
|
||||
* FOREIGNOBJECT, DESC, TITLE.
|
||||
*/
|
||||
$this->ensure_support_is_added_everywhere( 'FOREIGNOBJECT' );
|
||||
$this->ensure_support_is_added_everywhere( 'DESC' );
|
||||
$this->ensure_support_is_added_everywhere( 'TITLE' );
|
||||
$this->ensure_support_is_added_everywhere( 'SVG' );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -201,21 +186,16 @@ class Tests_HtmlApi_WpHtmlSupportRequiredOpenElements extends WP_UnitTestCase {
|
||||
$this->ensure_support_is_added_everywhere( 'OBJECT' );
|
||||
$this->ensure_support_is_added_everywhere( 'TEMPLATE' );
|
||||
|
||||
// MathML Elements
|
||||
$this->ensure_support_is_added_everywhere( 'MI' );
|
||||
$this->ensure_support_is_added_everywhere( 'MO' );
|
||||
$this->ensure_support_is_added_everywhere( 'MN' );
|
||||
$this->ensure_support_is_added_everywhere( 'MS' );
|
||||
$this->ensure_support_is_added_everywhere( 'MTEXT' );
|
||||
$this->ensure_support_is_added_everywhere( 'ANNOTATION-XML' );
|
||||
// MathML Elements: MI, MO, MN, MS, MTEXT, ANNOTATION-XML.
|
||||
$this->ensure_support_is_added_everywhere( 'MATH' );
|
||||
|
||||
/*
|
||||
* SVG elements: note that TITLE is both an HTML element and an SVG element
|
||||
* so care must be taken when adding support for either one.
|
||||
*
|
||||
* FOREIGNOBJECT, DESC, TITLE.
|
||||
*/
|
||||
$this->ensure_support_is_added_everywhere( 'FOREIGNOBJECT' );
|
||||
$this->ensure_support_is_added_everywhere( 'DESC' );
|
||||
$this->ensure_support_is_added_everywhere( 'TITLE' );
|
||||
$this->ensure_support_is_added_everywhere( 'SVG' );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -241,21 +221,16 @@ class Tests_HtmlApi_WpHtmlSupportRequiredOpenElements extends WP_UnitTestCase {
|
||||
$this->ensure_support_is_added_everywhere( 'OBJECT' );
|
||||
$this->ensure_support_is_added_everywhere( 'TEMPLATE' );
|
||||
|
||||
// MathML Elements
|
||||
$this->ensure_support_is_added_everywhere( 'MI' );
|
||||
$this->ensure_support_is_added_everywhere( 'MO' );
|
||||
$this->ensure_support_is_added_everywhere( 'MN' );
|
||||
$this->ensure_support_is_added_everywhere( 'MS' );
|
||||
$this->ensure_support_is_added_everywhere( 'MTEXT' );
|
||||
$this->ensure_support_is_added_everywhere( 'ANNOTATION-XML' );
|
||||
// MathML Elements: MI, MO, MN, MS, MTEXT, ANNOTATION-XML.
|
||||
$this->ensure_support_is_added_everywhere( 'MATH' );
|
||||
|
||||
/*
|
||||
* SVG elements: note that TITLE is both an HTML element and an SVG element
|
||||
* so care must be taken when adding support for either one.
|
||||
*
|
||||
* FOREIGNOBJECT, DESC, TITLE.
|
||||
*/
|
||||
$this->ensure_support_is_added_everywhere( 'FOREIGNOBJECT' );
|
||||
$this->ensure_support_is_added_everywhere( 'DESC' );
|
||||
$this->ensure_support_is_added_everywhere( 'TITLE' );
|
||||
$this->ensure_support_is_added_everywhere( 'SVG' );
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -280,21 +255,16 @@ class Tests_HtmlApi_WpHtmlSupportRequiredOpenElements extends WP_UnitTestCase {
|
||||
$this->ensure_support_is_added_everywhere( 'OBJECT' );
|
||||
$this->ensure_support_is_added_everywhere( 'TEMPLATE' );
|
||||
|
||||
// MathML Elements
|
||||
$this->ensure_support_is_added_everywhere( 'MI' );
|
||||
$this->ensure_support_is_added_everywhere( 'MO' );
|
||||
$this->ensure_support_is_added_everywhere( 'MN' );
|
||||
$this->ensure_support_is_added_everywhere( 'MS' );
|
||||
$this->ensure_support_is_added_everywhere( 'MTEXT' );
|
||||
$this->ensure_support_is_added_everywhere( 'ANNOTATION-XML' );
|
||||
// MathML Elements: MI, MO, MN, MS, MTEXT, ANNOTATION-XML.
|
||||
$this->ensure_support_is_added_everywhere( 'MATH' );
|
||||
|
||||
/*
|
||||
* SVG elements: note that TITLE is both an HTML element and an SVG element
|
||||
* so care must be taken when adding support for either one.
|
||||
*
|
||||
* FOREIGNOBJECT, DESC, TITLE.
|
||||
*/
|
||||
$this->ensure_support_is_added_everywhere( 'FOREIGNOBJECT' );
|
||||
$this->ensure_support_is_added_everywhere( 'DESC' );
|
||||
$this->ensure_support_is_added_everywhere( 'TITLE' );
|
||||
$this->ensure_support_is_added_everywhere( 'SVG' );
|
||||
|
||||
// These elements are specific to TABLE scope.
|
||||
$this->ensure_support_is_added_everywhere( 'HTML' );
|
||||
@@ -335,21 +305,16 @@ class Tests_HtmlApi_WpHtmlSupportRequiredOpenElements extends WP_UnitTestCase {
|
||||
$this->ensure_support_is_added_everywhere( 'OBJECT' );
|
||||
$this->ensure_support_is_added_everywhere( 'TEMPLATE' );
|
||||
|
||||
// MathML Elements
|
||||
$this->ensure_support_is_added_everywhere( 'MI' );
|
||||
$this->ensure_support_is_added_everywhere( 'MO' );
|
||||
$this->ensure_support_is_added_everywhere( 'MN' );
|
||||
$this->ensure_support_is_added_everywhere( 'MS' );
|
||||
$this->ensure_support_is_added_everywhere( 'MTEXT' );
|
||||
$this->ensure_support_is_added_everywhere( 'ANNOTATION-XML' );
|
||||
// MathML Elements: MI, MO, MN, MS, MTEXT, ANNOTATION-XML.
|
||||
$this->ensure_support_is_added_everywhere( 'MATH' );
|
||||
|
||||
/*
|
||||
* SVG elements: note that TITLE is both an HTML element and an SVG element
|
||||
* so care must be taken when adding support for either one.
|
||||
*
|
||||
* FOREIGNOBJECT, DESC, TITLE.
|
||||
*/
|
||||
$this->ensure_support_is_added_everywhere( 'FOREIGNOBJECT' );
|
||||
$this->ensure_support_is_added_everywhere( 'DESC' );
|
||||
$this->ensure_support_is_added_everywhere( 'TITLE' );
|
||||
$this->ensure_support_is_added_everywhere( 'SVG' );
|
||||
|
||||
// These elements are specific to SELECT scope.
|
||||
$this->ensure_support_is_added_everywhere( 'OPTGROUP' );
|
||||
|
||||
Reference in New Issue
Block a user