From ce39e1ea404876d5707bc69b586c6704ee1e6d9a Mon Sep 17 00:00:00 2001 From: Dennis Snell Date: Fri, 15 Dec 2023 10:34:52 +0100 Subject: [PATCH 1/2] HTML API: Apply linting changes. --- .../html-api/class-wp-html-processor.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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 14dfc3aa869f0..0cc3aa9d24a18 100644 --- a/src/wp-includes/html-api/class-wp-html-processor.php +++ b/src/wp-includes/html-api/class-wp-html-processor.php @@ -252,7 +252,7 @@ public static function create_fragment( $html, $context = '', $encoding = $p->state->context_node = array( 'BODY', array() ); $p->state->insertion_mode = WP_HTML_Processor_State::INSERTION_MODE_IN_BODY; - // @TODO: Create "fake" bookmarks for non-existent but implied nodes. + // @todo: Create "fake" bookmarks for non-existent but implied nodes. $p->bookmarks['root-node'] = new WP_HTML_Span( 0, 0 ); $p->bookmarks['context-node'] = new WP_HTML_Span( 0, 0 ); @@ -506,7 +506,7 @@ public function step( $node_to_process = self::PROCESS_NEXT_NODE ) { * When moving on to the next node, therefore, if the bottom-most element * on the stack is a void element, it must be closed. * - * @TODO: Once self-closing foreign elements and BGSOUND are supported, + * @todo: Once self-closing foreign elements and BGSOUND are supported, * they must also be implicitly closed here too. BGSOUND is * special since it's only self-closing if the self-closing flag * is provided in the opening tag, otherwise it expects a tag closer. @@ -608,7 +608,7 @@ private function step_in_body() { */ case '+BUTTON': if ( $this->state->stack_of_open_elements->has_element_in_scope( 'BUTTON' ) ) { - // @TODO: Indicate a parse error once it's possible. This error does not impact the logic here. + // @todo: Indicate a parse error once it's possible. This error does not impact the logic here. $this->generate_implied_end_tags(); $this->state->stack_of_open_elements->pop_until( 'BUTTON' ); } @@ -685,14 +685,14 @@ private function step_in_body() { case '-SECTION': case '-SUMMARY': if ( ! $this->state->stack_of_open_elements->has_element_in_scope( $tag_name ) ) { - // @TODO: Report parse error. + // @todo: Report parse error. // Ignore the token. return $this->step(); } $this->generate_implied_end_tags(); if ( $this->state->stack_of_open_elements->current_node()->node_name !== $tag_name ) { - // @TODO: Record parse error: this error doesn't impact parsing. + // @todo: Record parse error: this error doesn't impact parsing. } $this->state->stack_of_open_elements->pop_until( $tag_name ); return true; @@ -717,7 +717,7 @@ private function step_in_body() { true ) ) { - // @TODO: Indicate a parse error once it's possible. + // @todo: Indicate a parse error once it's possible. $this->state->stack_of_open_elements->pop(); } @@ -737,7 +737,7 @@ private function step_in_body() { /* * This is a parse error; ignore the token. * - * @TODO: Indicate a parse error once it's possible. + * @todo: Indicate a parse error once it's possible. */ return $this->step(); } @@ -745,7 +745,7 @@ private function step_in_body() { $this->generate_implied_end_tags(); if ( $this->state->stack_of_open_elements->current_node()->node_name !== $tag_name ) { - // @TODO: Record parse error: this error doesn't impact parsing. + // @todo: Record parse error: this error doesn't impact parsing. } $this->state->stack_of_open_elements->pop_until( '(internal: H1 through H6 - do not use)' ); From 763c02b39a63e20cff4d0d0c2be7729082282105 Mon Sep 17 00:00:00 2001 From: Dennis Snell Date: Tue, 19 Dec 2023 14:21:43 -0600 Subject: [PATCH 2/2] To-done --- .../class-wp-html-active-formatting-elements.php | 2 +- .../html-api/class-wp-html-processor.php | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/wp-includes/html-api/class-wp-html-active-formatting-elements.php b/src/wp-includes/html-api/class-wp-html-active-formatting-elements.php index 95989914be030..9f7fee9076243 100644 --- a/src/wp-includes/html-api/class-wp-html-active-formatting-elements.php +++ b/src/wp-includes/html-api/class-wp-html-active-formatting-elements.php @@ -105,7 +105,7 @@ public function push( $token ) { * > paired such that the two attributes in each pair have identical names, namespaces, and values * > (the order of the attributes does not matter). * - * @TODO: Implement the "Noah's Ark clause" to only add up to three of any given kind of formatting elements to the stack. + * @todo Implement the "Noah's Ark clause" to only add up to three of any given kind of formatting elements to the stack. */ // > Add element to the list of active formatting elements. $this->stack[] = $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 0cc3aa9d24a18..e46c368c702d4 100644 --- a/src/wp-includes/html-api/class-wp-html-processor.php +++ b/src/wp-includes/html-api/class-wp-html-processor.php @@ -252,7 +252,7 @@ public static function create_fragment( $html, $context = '', $encoding = $p->state->context_node = array( 'BODY', array() ); $p->state->insertion_mode = WP_HTML_Processor_State::INSERTION_MODE_IN_BODY; - // @todo: Create "fake" bookmarks for non-existent but implied nodes. + // @todo Create "fake" bookmarks for non-existent but implied nodes. $p->bookmarks['root-node'] = new WP_HTML_Span( 0, 0 ); $p->bookmarks['context-node'] = new WP_HTML_Span( 0, 0 ); @@ -506,7 +506,7 @@ public function step( $node_to_process = self::PROCESS_NEXT_NODE ) { * When moving on to the next node, therefore, if the bottom-most element * on the stack is a void element, it must be closed. * - * @todo: Once self-closing foreign elements and BGSOUND are supported, + * @todo Once self-closing foreign elements and BGSOUND are supported, * they must also be implicitly closed here too. BGSOUND is * special since it's only self-closing if the self-closing flag * is provided in the opening tag, otherwise it expects a tag closer. @@ -608,7 +608,7 @@ private function step_in_body() { */ case '+BUTTON': if ( $this->state->stack_of_open_elements->has_element_in_scope( 'BUTTON' ) ) { - // @todo: Indicate a parse error once it's possible. This error does not impact the logic here. + // @todo Indicate a parse error once it's possible. This error does not impact the logic here. $this->generate_implied_end_tags(); $this->state->stack_of_open_elements->pop_until( 'BUTTON' ); } @@ -685,14 +685,14 @@ private function step_in_body() { case '-SECTION': case '-SUMMARY': if ( ! $this->state->stack_of_open_elements->has_element_in_scope( $tag_name ) ) { - // @todo: Report parse error. + // @todo Report parse error. // Ignore the token. return $this->step(); } $this->generate_implied_end_tags(); if ( $this->state->stack_of_open_elements->current_node()->node_name !== $tag_name ) { - // @todo: Record parse error: this error doesn't impact parsing. + // @todo Record parse error: this error doesn't impact parsing. } $this->state->stack_of_open_elements->pop_until( $tag_name ); return true; @@ -717,7 +717,7 @@ private function step_in_body() { true ) ) { - // @todo: Indicate a parse error once it's possible. + // @todo Indicate a parse error once it's possible. $this->state->stack_of_open_elements->pop(); } @@ -737,7 +737,7 @@ private function step_in_body() { /* * This is a parse error; ignore the token. * - * @todo: Indicate a parse error once it's possible. + * @todo Indicate a parse error once it's possible. */ return $this->step(); } @@ -745,7 +745,7 @@ private function step_in_body() { $this->generate_implied_end_tags(); if ( $this->state->stack_of_open_elements->current_node()->node_name !== $tag_name ) { - // @todo: Record parse error: this error doesn't impact parsing. + // @todo Record parse error: this error doesn't impact parsing. } $this->state->stack_of_open_elements->pop_until( '(internal: H1 through H6 - do not use)' );