File tree Expand file tree Collapse file tree
tests/phpunit/tests/html-api Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -371,6 +371,7 @@ public static function parse_html5_dat_testfile( $filename ) {
371371 $ test_html = '' ;
372372 $ test_dom = '' ;
373373 $ test_context_element = null ;
374+ $ test_script_flag = false ;
374375 $ test_line_number = 0 ;
375376
376377 while ( false !== ( $ line = fgets ( $ handle ) ) ) {
@@ -379,8 +380,12 @@ public static function parse_html5_dat_testfile( $filename ) {
379380 if ( '# ' === $ line [0 ] ) {
380381 // Finish section.
381382 if ( "#data \n" === $ line ) {
382- // Yield when switching from a previous state.
383- if ( $ state ) {
383+ /*
384+ * Yield when switching from a previous state.
385+ * Do not yield tests with the scripting flag enabled. The scripting flag
386+ * is always disabled in the HTML API.
387+ */
388+ if ( $ state && ! $ test_script_flag ) {
384389 yield array (
385390 $ test_line_number ,
386391 $ test_context_element ,
@@ -395,6 +400,10 @@ public static function parse_html5_dat_testfile( $filename ) {
395400 $ test_html = '' ;
396401 $ test_dom = '' ;
397402 $ test_context_element = null ;
403+ $ test_script_flag = false ;
404+ }
405+ if ( "#script-on \n" === $ line ) {
406+ $ test_script_flag = true ;
398407 }
399408
400409 $ state = trim ( substr ( $ line , 1 ) );
You can’t perform that action at this time.
0 commit comments