- Timestamp:
- 09/13/2023 12:53:32 PM (20 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/6.3/tests/phpunit/tests/html-api/wpHtmlTagProcessor.php
r56133 r56564 1873 1873 1874 1874 /** 1875 * @ticket 59292 1876 * 1877 * @covers WP_HTML_Tag_Processor::next_tag 1878 * 1879 * @dataProvider data_next_tag_ignores_contents_of_rawtext_tags 1880 * 1881 * @param string $rawtext_element_then_target_node HTML starting with a RAWTEXT-specifying element such as STYLE, 1882 * then an element afterward containing the "target" attribute. 1883 */ 1884 public function test_next_tag_ignores_contents_of_rawtext_tags( $rawtext_element_then_target_node ) { 1885 $processor = new WP_HTML_Tag_Processor( $rawtext_element_then_target_node ); 1886 $processor->next_tag(); 1887 1888 $processor->next_tag(); 1889 $this->assertNotNull( 1890 $processor->get_attribute( 'target' ), 1891 "Expected to find element with target attribute but found {$processor->get_tag()} instead." 1892 ); 1893 } 1894 1895 /** 1896 * Data provider. 1897 * 1898 * @return array[]. 1899 */ 1900 public function data_next_tag_ignores_contents_of_rawtext_tags() { 1901 return array( 1902 'IFRAME' => array( '<iframe><section>Inside</section></iframe><section target>' ), 1903 'NOEMBED' => array( '<noembed><p></p></noembed><div target>' ), 1904 'NOFRAMES' => array( '<noframes><p>Check the rules here.</p></noframes><div target>' ), 1905 'NOSCRIPT' => array( '<noscript><span>This assumes that scripting mode is enabled.</span></noscript><p target>' ), 1906 'STYLE' => array( '<style>* { margin: 0 }</style><div target>' ), 1907 'STYLE hiding DIV' => array( '<style>li::before { content: "<div non-target>" }</style><div target>' ), 1908 ); 1909 } 1910 1911 /** 1875 1912 * Ensures that the invalid comment closing syntax "--!>" properly closes a comment. 1876 1913 *
Note: See TracChangeset
for help on using the changeset viewer.