Skip to content

Commit 1435cf9

Browse files
committed
Update to use document_mode
Subsequent changes introduced document_mode instead of compat_mode
1 parent c103410 commit 1435cf9

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -287,14 +287,14 @@ class WP_HTML_Processor extends WP_HTML_Tag_Processor {
287287
* @since 6.4.0
288288
* @since 6.6.0 Returns `static` instead of `self` so it can create subclass instances.
289289
*
290-
* @param string $html Input HTML fragment to process.
291-
* @param string $context Context element for the fragment, must be default of `<body>`.
292-
* @param string $encoding Optional. Text encoding of the document; must be default of 'UTF-8'.
293-
* @param string $compat_mode Optional. Set document compatibility mode (quirks). Should be
294-
* 'quirks-mode' or 'no-quirks-mode'. Default: 'no-quirks-mode'.
290+
* @param string $html Input HTML fragment to process.
291+
* @param string $context Context element for the fragment, must be default of `<body>`.
292+
* @param string $encoding Optional. Text encoding of the document; must be default of 'UTF-8'.
293+
* @param string $document_mode Optional. Set document compatibility mode (quirks). Should be
294+
* 'quirks-mode' or 'no-quirks-mode'. Default: 'no-quirks-mode'.
295295
* @return static|null The created processor if successful, otherwise null.
296296
*/
297-
public static function create_fragment( $html, $context = '<body>', $encoding = 'UTF-8', $compat_mode = WP_HTML_Processor_State::NO_QUIRKS_MODE ) {
297+
public static function create_fragment( $html, $context = '<body>', $encoding = 'UTF-8', $document_mode = WP_HTML_Processor_State::NO_QUIRKS_MODE ) {
298298
if ( '<body>' !== $context || 'UTF-8' !== $encoding ) {
299299
return null;
300300
}
@@ -305,8 +305,8 @@ public static function create_fragment( $html, $context = '<body>', $encoding =
305305
$processor->state->encoding = $encoding;
306306
$processor->state->encoding_confidence = 'certain';
307307

308-
if ( WP_HTML_Processor_State::QUIRKS_MODE === $compat_mode ) {
309-
$processor->state->compat_mode = WP_HTML_Processor_State::QUIRKS_MODE;
308+
if ( WP_HTML_Processor_State::QUIRKS_MODE === $document_mode ) {
309+
$processor->state->document_mode = WP_HTML_Processor_State::QUIRKS_MODE;
310310
}
311311

312312
// @todo Create "fake" bookmarks for non-existent but implied nodes.
@@ -4667,7 +4667,7 @@ public function has_class( $wanted_class ): ?bool {
46674667
return null;
46684668
}
46694669

4670-
$compare_func = WP_HTML_Processor_State::QUIRKS_MODE === $this->state->compat_mode ?
4670+
$compare_func = WP_HTML_Processor_State::QUIRKS_MODE === $this->state->document_mode ?
46714671
'strcasecmp' :
46724672
'strcmp';
46734673

0 commit comments

Comments
 (0)