Skip to content

Commit 1adf6ef

Browse files
sirrealspacedmonkey
authored andcommitted
HTML API: Fix typo in indicated_compatibility_mode.
Developed in WordPress#9401. Follow-up to [60540]. Props jonsurrell, dmsnell. Fixes #63391. git-svn-id: https://develop.svn.wordpress.org/trunk@60647 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 6b74cef commit 1adf6ef

File tree

4 files changed

+20
-20
lines changed

4 files changed

+20
-20
lines changed

src/wp-includes/html-api/class-wp-html-doctype-info.php

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ class WP_HTML_Doctype_Info {
133133
* This value should be considered "read only" and not modified.
134134
*
135135
* When an HTML parser has not already set the document compatibility mode,
136-
* (e.g. "quirks" or "no-quirks" mode), it will infer if from the properties
136+
* (e.g. "quirks" or "no-quirks" mode), it will be inferred from the properties
137137
* of the appropriate DOCTYPE declaration, if one exists. The DOCTYPE can
138138
* indicate one of three possible document compatibility modes:
139139
*
@@ -150,7 +150,7 @@ class WP_HTML_Doctype_Info {
150150
*
151151
* @var string One of "no-quirks", "limited-quirks", or "quirks".
152152
*/
153-
public $indicated_compatability_mode;
153+
public $indicated_compatibility_mode;
154154

155155
/**
156156
* Constructor.
@@ -194,7 +194,7 @@ private function __construct(
194194
* > The force-quirks flag is set to on.
195195
*/
196196
if ( $force_quirks_flag ) {
197-
$this->indicated_compatability_mode = 'quirks';
197+
$this->indicated_compatibility_mode = 'quirks';
198198
return;
199199
}
200200

@@ -203,7 +203,7 @@ private function __construct(
203203
* public or system identifiers; short-circuit to avoid extra parsing.
204204
*/
205205
if ( 'html' === $name && null === $public_identifier && null === $system_identifier ) {
206-
$this->indicated_compatability_mode = 'no-quirks';
206+
$this->indicated_compatibility_mode = 'no-quirks';
207207
return;
208208
}
209209

@@ -214,7 +214,7 @@ private function __construct(
214214
* the document in upper case; thus no conversion is required here.
215215
*/
216216
if ( 'html' !== $name ) {
217-
$this->indicated_compatability_mode = 'quirks';
217+
$this->indicated_compatibility_mode = 'quirks';
218218
return;
219219
}
220220

@@ -242,15 +242,15 @@ private function __construct(
242242
'-/w3c/dtd html 4.0 transitional/en' === $public_identifier ||
243243
'html' === $public_identifier
244244
) {
245-
$this->indicated_compatability_mode = 'quirks';
245+
$this->indicated_compatibility_mode = 'quirks';
246246
return;
247247
}
248248

249249
/*
250250
* > The system identifier is set to…
251251
*/
252252
if ( 'http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd' === $system_identifier ) {
253-
$this->indicated_compatability_mode = 'quirks';
253+
$this->indicated_compatibility_mode = 'quirks';
254254
return;
255255
}
256256

@@ -259,7 +259,7 @@ private function __construct(
259259
* If the public identifier is empty, none of the following conditions will match.
260260
*/
261261
if ( '' === $public_identifier ) {
262-
$this->indicated_compatability_mode = 'no-quirks';
262+
$this->indicated_compatibility_mode = 'no-quirks';
263263
return;
264264
}
265265

@@ -327,7 +327,7 @@ private function __construct(
327327
str_starts_with( $public_identifier, '-//webtechs//dtd mozilla html 2.0//' ) ||
328328
str_starts_with( $public_identifier, '-//webtechs//dtd mozilla html//' )
329329
) {
330-
$this->indicated_compatability_mode = 'quirks';
330+
$this->indicated_compatibility_mode = 'quirks';
331331
return;
332332
}
333333

@@ -340,7 +340,7 @@ private function __construct(
340340
str_starts_with( $public_identifier, '-//w3c//dtd html 4.01 transitional//' )
341341
)
342342
) {
343-
$this->indicated_compatability_mode = 'quirks';
343+
$this->indicated_compatibility_mode = 'quirks';
344344
return;
345345
}
346346

@@ -356,7 +356,7 @@ private function __construct(
356356
str_starts_with( $public_identifier, '-//w3c//dtd xhtml 1.0 frameset//' ) ||
357357
str_starts_with( $public_identifier, '-//w3c//dtd xhtml 1.0 transitional//' )
358358
) {
359-
$this->indicated_compatability_mode = 'limited-quirks';
359+
$this->indicated_compatibility_mode = 'limited-quirks';
360360
return;
361361
}
362362

@@ -369,11 +369,11 @@ private function __construct(
369369
str_starts_with( $public_identifier, '-//w3c//dtd html 4.01 transitional//' )
370370
)
371371
) {
372-
$this->indicated_compatability_mode = 'limited-quirks';
372+
$this->indicated_compatibility_mode = 'limited-quirks';
373373
return;
374374
}
375375

376-
$this->indicated_compatability_mode = 'no-quirks';
376+
$this->indicated_compatibility_mode = 'no-quirks';
377377
}
378378

379379
/**
@@ -387,15 +387,15 @@ private function __construct(
387387
*
388388
* // Normative HTML DOCTYPE declaration.
389389
* $doctype = WP_HTML_Doctype_Info::from_doctype_token( '<!DOCTYPE html>' );
390-
* 'no-quirks' === $doctype->indicated_compatability_mode;
390+
* 'no-quirks' === $doctype->indicated_compatibility_mode;
391391
*
392392
* // A nonsensical DOCTYPE is still valid, and will indicate "quirks" mode.
393393
* $doctype = WP_HTML_Doctype_Info::from_doctype_token( '<!doctypeJSON SILLY "nonsense\'>' );
394-
* 'quirks' === $doctype->indicated_compatability_mode;
394+
* 'quirks' === $doctype->indicated_compatibility_mode;
395395
*
396396
* // Textual quirks present in raw HTML are handled appropriately.
397397
* $doctype = WP_HTML_Doctype_Info::from_doctype_token( "<!DOCTYPE\nhtml\n>" );
398-
* 'no-quirks' === $doctype->indicated_compatability_mode;
398+
* 'no-quirks' === $doctype->indicated_compatibility_mode;
399399
*
400400
* // Anything other than a proper DOCTYPE declaration token fails to parse.
401401
* null === WP_HTML_Doctype_Info::from_doctype_token( ' <!DOCTYPE>' );

src/wp-includes/html-api/class-wp-html-processor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1470,7 +1470,7 @@ private function step_initial(): bool {
14701470
*/
14711471
case 'html':
14721472
$doctype = $this->get_doctype_info();
1473-
if ( null !== $doctype && 'quirks' === $doctype->indicated_compatability_mode ) {
1473+
if ( null !== $doctype && 'quirks' === $doctype->indicated_compatibility_mode ) {
14741474
$this->compat_mode = WP_HTML_Tag_Processor::QUIRKS_MODE;
14751475
}
14761476

tests/phpunit/tests/html-api/wpHtmlDoctypeInfo.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ public function test_doctype_doc_info(
3434

3535
$this->assertSame(
3636
$expected_compat_mode,
37-
$doctype->indicated_compatability_mode,
38-
'Failed to infer the expected document compatability mode.'
37+
$doctype->indicated_compatibility_mode,
38+
'Failed to infer the expected document compatibility mode.'
3939
);
4040

4141
$this->assertSame(

tests/phpunit/tests/html-api/wpHtmlTagProcessor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3023,7 +3023,7 @@ public function test_doctype_doc_name() {
30233023
$doctype = $processor->get_doctype_info();
30243024
$this->assertNotNull( $doctype );
30253025
$this->assertSame( 'html', $doctype->name );
3026-
$this->assertSame( 'no-quirks', $doctype->indicated_compatability_mode );
3026+
$this->assertSame( 'no-quirks', $doctype->indicated_compatibility_mode );
30273027
$this->assertNull( $doctype->public_identifier );
30283028
$this->assertNull( $doctype->system_identifier );
30293029
}

0 commit comments

Comments
 (0)