Make WordPress Core

Changeset 60647


Ignore:
Timestamp:
08/19/2025 03:06:12 PM (3 months ago)
Author:
jonsurrell
Message:

HTML API: Fix typo in indicated_compatibility_mode.

Developed in https://github.com/WordPress/wordpress-develop/pull/9401.

Follow-up to [60540].

Props jonsurrell, dmsnell.
Fixes #63391.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/html-api/class-wp-html-doctype-info.php

    r60540 r60647  
    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:
     
    151151     * @var string One of "no-quirks", "limited-quirks", or "quirks".
    152152     */
    153     public $indicated_compatability_mode;
     153    public $indicated_compatibility_mode;
    154154
    155155    /**
     
    195195         */
    196196        if ( $force_quirks_flag ) {
    197             $this->indicated_compatability_mode = 'quirks';
     197            $this->indicated_compatibility_mode = 'quirks';
    198198            return;
    199199        }
     
    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        }
     
    215215         */
    216216        if ( 'html' !== $name ) {
    217             $this->indicated_compatability_mode = 'quirks';
     217            $this->indicated_compatibility_mode = 'quirks';
    218218            return;
    219219        }
     
    243243            'html' === $public_identifier
    244244        ) {
    245             $this->indicated_compatability_mode = 'quirks';
     245            $this->indicated_compatibility_mode = 'quirks';
    246246            return;
    247247        }
     
    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        }
     
    260260         */
    261261        if ( '' === $public_identifier ) {
    262             $this->indicated_compatability_mode = 'no-quirks';
     262            $this->indicated_compatibility_mode = 'no-quirks';
    263263            return;
    264264        }
     
    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        }
     
    341341            )
    342342        ) {
    343             $this->indicated_compatability_mode = 'quirks';
     343            $this->indicated_compatibility_mode = 'quirks';
    344344            return;
    345345        }
     
    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        }
     
    370370            )
    371371        ) {
    372             $this->indicated_compatability_mode = 'limited-quirks';
    373             return;
    374         }
    375 
    376         $this->indicated_compatability_mode = 'no-quirks';
     372            $this->indicated_compatibility_mode = 'limited-quirks';
     373            return;
     374        }
     375
     376        $this->indicated_compatibility_mode = 'no-quirks';
    377377    }
    378378
     
    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.
  • trunk/src/wp-includes/html-api/class-wp-html-processor.php

    r60633 r60647  
    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                }
  • trunk/tests/phpunit/tests/html-api/wpHtmlDoctypeInfo.php

    r58925 r60647  
    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
  • trunk/tests/phpunit/tests/html-api/wpHtmlTagProcessor.php

    r60617 r60647  
    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 );
Note: See TracChangeset for help on using the changeset viewer.