Changeset 58072
- Timestamp:
- 05/01/2024 11:43:11 PM (10 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/html-api/wpHtmlProcessorHtml5lib.php
r58010 r58072 61 61 'tests25/line0169' => 'Bug.', 62 62 'tests26/line0263' => 'Bug: An active formatting element should be created for a trailing text node.', 63 'tests7/line0354' => 'Bug.', 63 64 'tests8/line0001' => 'Bug.', 64 65 'tests8/line0020' => 'Bug.', … … 156 157 * Generates the tree-like structure represented in the Html5lib tests. 157 158 * 158 * @param string $fragment_context Context element in which to parse HTML, such as BODY or SVG.159 * @param string $html Given test HTML.159 * @param string|null $fragment_context Context element in which to parse HTML, such as BODY or SVG. 160 * @param string $html Given test HTML. 160 161 * @return string|null Tree structure of parsed HTML, if supported, else null. 161 162 */ 162 private static function build_tree_representation( $fragment_context, $html ) { 163 $processor = WP_HTML_Processor::create_fragment( $html, "<{$fragment_context}>" ); 163 private static function build_tree_representation( ?string $fragment_context, string $html ) { 164 $processor = $fragment_context 165 ? WP_HTML_Processor::create_fragment( $html, "<{$fragment_context}>" ) 166 : WP_HTML_Processor::create_fragment( $html ); 164 167 if ( null === $processor ) { 165 168 return null; … … 274 277 $test_html = ''; 275 278 $test_dom = ''; 276 $test_context_element = 'body';279 $test_context_element = null; 277 280 $test_line_number = 0; 278 281 … … 295 298 296 299 // Finish previous test. 297 $test_line_number = $line_number; 298 $test_html = ''; 299 $test_dom = ''; 300 $test_line_number = $line_number; 301 $test_html = ''; 302 $test_dom = ''; 303 $test_context_element = null; 300 304 } 301 305
Note: See TracChangeset
for help on using the changeset viewer.