diff --git a/src/wp-includes/html-api/class-wp-html-doctype-info.php b/src/wp-includes/html-api/class-wp-html-doctype-info.php index fd50ae05f5876..1e57afb3fd550 100644 --- a/src/wp-includes/html-api/class-wp-html-doctype-info.php +++ b/src/wp-includes/html-api/class-wp-html-doctype-info.php @@ -133,7 +133,7 @@ class WP_HTML_Doctype_Info { * This value should be considered "read only" and not modified. * * When an HTML parser has not already set the document compatibility mode, - * (e.g. "quirks" or "no-quirks" mode), it will infer if from the properties + * (e.g. "quirks" or "no-quirks" mode), it will be inferred from the properties * of the appropriate DOCTYPE declaration, if one exists. The DOCTYPE can * indicate one of three possible document compatibility modes: * @@ -150,7 +150,7 @@ class WP_HTML_Doctype_Info { * * @var string One of "no-quirks", "limited-quirks", or "quirks". */ - public $indicated_compatability_mode; + public $indicated_compatibility_mode; /** * Constructor. @@ -194,7 +194,7 @@ private function __construct( * > The force-quirks flag is set to on. */ if ( $force_quirks_flag ) { - $this->indicated_compatability_mode = 'quirks'; + $this->indicated_compatibility_mode = 'quirks'; return; } @@ -203,7 +203,7 @@ private function __construct( * public or system identifiers; short-circuit to avoid extra parsing. */ if ( 'html' === $name && null === $public_identifier && null === $system_identifier ) { - $this->indicated_compatability_mode = 'no-quirks'; + $this->indicated_compatibility_mode = 'no-quirks'; return; } @@ -214,7 +214,7 @@ private function __construct( * the document in upper case; thus no conversion is required here. */ if ( 'html' !== $name ) { - $this->indicated_compatability_mode = 'quirks'; + $this->indicated_compatibility_mode = 'quirks'; return; } @@ -242,7 +242,7 @@ private function __construct( '-/w3c/dtd html 4.0 transitional/en' === $public_identifier || 'html' === $public_identifier ) { - $this->indicated_compatability_mode = 'quirks'; + $this->indicated_compatibility_mode = 'quirks'; return; } @@ -250,7 +250,7 @@ private function __construct( * > The system identifier is set to… */ if ( 'http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd' === $system_identifier ) { - $this->indicated_compatability_mode = 'quirks'; + $this->indicated_compatibility_mode = 'quirks'; return; } @@ -259,7 +259,7 @@ private function __construct( * If the public identifier is empty, none of the following conditions will match. */ if ( '' === $public_identifier ) { - $this->indicated_compatability_mode = 'no-quirks'; + $this->indicated_compatibility_mode = 'no-quirks'; return; } @@ -327,7 +327,7 @@ private function __construct( str_starts_with( $public_identifier, '-//webtechs//dtd mozilla html 2.0//' ) || str_starts_with( $public_identifier, '-//webtechs//dtd mozilla html//' ) ) { - $this->indicated_compatability_mode = 'quirks'; + $this->indicated_compatibility_mode = 'quirks'; return; } @@ -340,7 +340,7 @@ private function __construct( str_starts_with( $public_identifier, '-//w3c//dtd html 4.01 transitional//' ) ) ) { - $this->indicated_compatability_mode = 'quirks'; + $this->indicated_compatibility_mode = 'quirks'; return; } @@ -356,7 +356,7 @@ private function __construct( str_starts_with( $public_identifier, '-//w3c//dtd xhtml 1.0 frameset//' ) || str_starts_with( $public_identifier, '-//w3c//dtd xhtml 1.0 transitional//' ) ) { - $this->indicated_compatability_mode = 'limited-quirks'; + $this->indicated_compatibility_mode = 'limited-quirks'; return; } @@ -369,11 +369,11 @@ private function __construct( str_starts_with( $public_identifier, '-//w3c//dtd html 4.01 transitional//' ) ) ) { - $this->indicated_compatability_mode = 'limited-quirks'; + $this->indicated_compatibility_mode = 'limited-quirks'; return; } - $this->indicated_compatability_mode = 'no-quirks'; + $this->indicated_compatibility_mode = 'no-quirks'; } /** @@ -387,15 +387,15 @@ private function __construct( * * // Normative HTML DOCTYPE declaration. * $doctype = WP_HTML_Doctype_Info::from_doctype_token( '' ); - * 'no-quirks' === $doctype->indicated_compatability_mode; + * 'no-quirks' === $doctype->indicated_compatibility_mode; * * // A nonsensical DOCTYPE is still valid, and will indicate "quirks" mode. * $doctype = WP_HTML_Doctype_Info::from_doctype_token( '' ); - * 'quirks' === $doctype->indicated_compatability_mode; + * 'quirks' === $doctype->indicated_compatibility_mode; * * // Textual quirks present in raw HTML are handled appropriately. * $doctype = WP_HTML_Doctype_Info::from_doctype_token( "" ); - * 'no-quirks' === $doctype->indicated_compatability_mode; + * 'no-quirks' === $doctype->indicated_compatibility_mode; * * // Anything other than a proper DOCTYPE declaration token fails to parse. * null === WP_HTML_Doctype_Info::from_doctype_token( ' ' ); diff --git a/src/wp-includes/html-api/class-wp-html-processor.php b/src/wp-includes/html-api/class-wp-html-processor.php index ba03ff44d7e53..f8b28427053b6 100644 --- a/src/wp-includes/html-api/class-wp-html-processor.php +++ b/src/wp-includes/html-api/class-wp-html-processor.php @@ -1469,7 +1469,7 @@ private function step_initial(): bool { */ case 'html': $doctype = $this->get_doctype_info(); - if ( null !== $doctype && 'quirks' === $doctype->indicated_compatability_mode ) { + if ( null !== $doctype && 'quirks' === $doctype->indicated_compatibility_mode ) { $this->compat_mode = WP_HTML_Tag_Processor::QUIRKS_MODE; } diff --git a/tests/phpunit/tests/html-api/wpHtmlDoctypeInfo.php b/tests/phpunit/tests/html-api/wpHtmlDoctypeInfo.php index d8e30d5028a86..40400984e5cff 100644 --- a/tests/phpunit/tests/html-api/wpHtmlDoctypeInfo.php +++ b/tests/phpunit/tests/html-api/wpHtmlDoctypeInfo.php @@ -34,8 +34,8 @@ public function test_doctype_doc_info( $this->assertSame( $expected_compat_mode, - $doctype->indicated_compatability_mode, - 'Failed to infer the expected document compatability mode.' + $doctype->indicated_compatibility_mode, + 'Failed to infer the expected document compatibility mode.' ); $this->assertSame( diff --git a/tests/phpunit/tests/html-api/wpHtmlTagProcessor.php b/tests/phpunit/tests/html-api/wpHtmlTagProcessor.php index cd8faee4ed6a4..e8102d926c23e 100644 --- a/tests/phpunit/tests/html-api/wpHtmlTagProcessor.php +++ b/tests/phpunit/tests/html-api/wpHtmlTagProcessor.php @@ -2980,7 +2980,7 @@ public function test_doctype_doc_name() { $doctype = $processor->get_doctype_info(); $this->assertNotNull( $doctype ); $this->assertSame( 'html', $doctype->name ); - $this->assertSame( 'no-quirks', $doctype->indicated_compatability_mode ); + $this->assertSame( 'no-quirks', $doctype->indicated_compatibility_mode ); $this->assertNull( $doctype->public_identifier ); $this->assertNull( $doctype->system_identifier ); }