Changeset 60647
- Timestamp:
- 08/19/2025 03:06:12 PM (3 months ago)
- Location:
- trunk
- Files:
-
- 4 edited
-
src/wp-includes/html-api/class-wp-html-doctype-info.php (modified) (13 diffs)
-
src/wp-includes/html-api/class-wp-html-processor.php (modified) (1 diff)
-
tests/phpunit/tests/html-api/wpHtmlDoctypeInfo.php (modified) (1 diff)
-
tests/phpunit/tests/html-api/wpHtmlTagProcessor.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/html-api/class-wp-html-doctype-info.php
r60540 r60647 134 134 * 135 135 * When an HTML parser has not already set the document compatibility mode, 136 * (e.g. "quirks" or "no-quirks" mode), it will infer iffrom the properties136 * (e.g. "quirks" or "no-quirks" mode), it will be inferred from the properties 137 137 * of the appropriate DOCTYPE declaration, if one exists. The DOCTYPE can 138 138 * indicate one of three possible document compatibility modes: … … 151 151 * @var string One of "no-quirks", "limited-quirks", or "quirks". 152 152 */ 153 public $indicated_compat ability_mode;153 public $indicated_compatibility_mode; 154 154 155 155 /** … … 195 195 */ 196 196 if ( $force_quirks_flag ) { 197 $this->indicated_compat ability_mode = 'quirks';197 $this->indicated_compatibility_mode = 'quirks'; 198 198 return; 199 199 } … … 204 204 */ 205 205 if ( 'html' === $name && null === $public_identifier && null === $system_identifier ) { 206 $this->indicated_compat ability_mode = 'no-quirks';206 $this->indicated_compatibility_mode = 'no-quirks'; 207 207 return; 208 208 } … … 215 215 */ 216 216 if ( 'html' !== $name ) { 217 $this->indicated_compat ability_mode = 'quirks';217 $this->indicated_compatibility_mode = 'quirks'; 218 218 return; 219 219 } … … 243 243 'html' === $public_identifier 244 244 ) { 245 $this->indicated_compat ability_mode = 'quirks';245 $this->indicated_compatibility_mode = 'quirks'; 246 246 return; 247 247 } … … 251 251 */ 252 252 if ( 'http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd' === $system_identifier ) { 253 $this->indicated_compat ability_mode = 'quirks';253 $this->indicated_compatibility_mode = 'quirks'; 254 254 return; 255 255 } … … 260 260 */ 261 261 if ( '' === $public_identifier ) { 262 $this->indicated_compat ability_mode = 'no-quirks';262 $this->indicated_compatibility_mode = 'no-quirks'; 263 263 return; 264 264 } … … 328 328 str_starts_with( $public_identifier, '-//webtechs//dtd mozilla html//' ) 329 329 ) { 330 $this->indicated_compat ability_mode = 'quirks';330 $this->indicated_compatibility_mode = 'quirks'; 331 331 return; 332 332 } … … 341 341 ) 342 342 ) { 343 $this->indicated_compat ability_mode = 'quirks';343 $this->indicated_compatibility_mode = 'quirks'; 344 344 return; 345 345 } … … 357 357 str_starts_with( $public_identifier, '-//w3c//dtd xhtml 1.0 transitional//' ) 358 358 ) { 359 $this->indicated_compat ability_mode = 'limited-quirks';359 $this->indicated_compatibility_mode = 'limited-quirks'; 360 360 return; 361 361 } … … 370 370 ) 371 371 ) { 372 $this->indicated_compat ability_mode = 'limited-quirks';373 return; 374 } 375 376 $this->indicated_compat ability_mode = 'no-quirks';372 $this->indicated_compatibility_mode = 'limited-quirks'; 373 return; 374 } 375 376 $this->indicated_compatibility_mode = 'no-quirks'; 377 377 } 378 378 … … 388 388 * // Normative HTML DOCTYPE declaration. 389 389 * $doctype = WP_HTML_Doctype_Info::from_doctype_token( '<!DOCTYPE html>' ); 390 * 'no-quirks' === $doctype->indicated_compat ability_mode;390 * 'no-quirks' === $doctype->indicated_compatibility_mode; 391 391 * 392 392 * // A nonsensical DOCTYPE is still valid, and will indicate "quirks" mode. 393 393 * $doctype = WP_HTML_Doctype_Info::from_doctype_token( '<!doctypeJSON SILLY "nonsense\'>' ); 394 * 'quirks' === $doctype->indicated_compat ability_mode;394 * 'quirks' === $doctype->indicated_compatibility_mode; 395 395 * 396 396 * // Textual quirks present in raw HTML are handled appropriately. 397 397 * $doctype = WP_HTML_Doctype_Info::from_doctype_token( "<!DOCTYPE\nhtml\n>" ); 398 * 'no-quirks' === $doctype->indicated_compat ability_mode;398 * 'no-quirks' === $doctype->indicated_compatibility_mode; 399 399 * 400 400 * // Anything other than a proper DOCTYPE declaration token fails to parse. -
trunk/src/wp-includes/html-api/class-wp-html-processor.php
r60633 r60647 1471 1471 case 'html': 1472 1472 $doctype = $this->get_doctype_info(); 1473 if ( null !== $doctype && 'quirks' === $doctype->indicated_compat ability_mode ) {1473 if ( null !== $doctype && 'quirks' === $doctype->indicated_compatibility_mode ) { 1474 1474 $this->compat_mode = WP_HTML_Tag_Processor::QUIRKS_MODE; 1475 1475 } -
trunk/tests/phpunit/tests/html-api/wpHtmlDoctypeInfo.php
r58925 r60647 35 35 $this->assertSame( 36 36 $expected_compat_mode, 37 $doctype->indicated_compat ability_mode,38 'Failed to infer the expected document compat ability mode.'37 $doctype->indicated_compatibility_mode, 38 'Failed to infer the expected document compatibility mode.' 39 39 ); 40 40 -
trunk/tests/phpunit/tests/html-api/wpHtmlTagProcessor.php
r60617 r60647 3024 3024 $this->assertNotNull( $doctype ); 3025 3025 $this->assertSame( 'html', $doctype->name ); 3026 $this->assertSame( 'no-quirks', $doctype->indicated_compat ability_mode );3026 $this->assertSame( 'no-quirks', $doctype->indicated_compatibility_mode ); 3027 3027 $this->assertNull( $doctype->public_identifier ); 3028 3028 $this->assertNull( $doctype->system_identifier );
Note: See TracChangeset
for help on using the changeset viewer.