Skip to content

Commit fe79692

Browse files
committed
Rename INCOMPLETE state to INCOMPLETE_INPUT
1 parent 1098c19 commit fe79692

1 file changed

Lines changed: 25 additions & 25 deletions

File tree

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

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ class WP_HTML_Tag_Processor {
492492
*
493493
* @see WP_HTML_Tag_Processor::STATE_READY
494494
* @see WP_HTML_Tag_Processor::STATE_COMPLETE
495-
* @see WP_HTML_Tag_Processor::STATE_INCOMPLETE
495+
* @see WP_HTML_Tag_Processor::STATE_INCOMPLETE_INPUT
496496
* @see WP_HTML_Tag_Processor::STATE_MATCHED_TAG
497497
* @see WP_HTML_Tag_Processor::STATE_TEXT_NODE
498498
* @see WP_HTML_Tag_Processor::STATE_CDATA_NODE
@@ -821,7 +821,7 @@ public function next_token() {
821821
// Don't proceed if there's nothing more to scan.
822822
if (
823823
self::STATE_COMPLETE === $this->parser_state ||
824-
self::STATE_INCOMPLETE === $this->parser_state
824+
self::STATE_INCOMPLETE_INPUT === $this->parser_state
825825
) {
826826
return false;
827827
}
@@ -839,7 +839,7 @@ public function next_token() {
839839

840840
// Find the next tag if it exists.
841841
if ( false === $this->parse_next_tag() ) {
842-
if ( self::STATE_INCOMPLETE === $this->parser_state ) {
842+
if ( self::STATE_INCOMPLETE_INPUT === $this->parser_state ) {
843843
$this->bytes_already_parsed = $was_at;
844844
}
845845

@@ -853,7 +853,7 @@ public function next_token() {
853853
* attempting to process tag-specific syntax.
854854
*/
855855
if (
856-
self::STATE_INCOMPLETE !== $this->parser_state &&
856+
self::STATE_INCOMPLETE_INPUT !== $this->parser_state &&
857857
self::STATE_COMPLETE !== $this->parser_state &&
858858
self::STATE_MATCHED_TAG !== $this->parser_state
859859
) {
@@ -867,19 +867,19 @@ public function next_token() {
867867

868868
// Ensure that the tag closes before the end of the document.
869869
if (
870-
self::STATE_INCOMPLETE === $this->parser_state ||
870+
self::STATE_INCOMPLETE_INPUT === $this->parser_state ||
871871
$this->bytes_already_parsed >= strlen( $this->html )
872872
) {
873873
// Does this appropriately clear state (parsed attributes)?
874-
$this->parser_state = self::STATE_INCOMPLETE;
874+
$this->parser_state = self::STATE_INCOMPLETE_INPUT;
875875
$this->bytes_already_parsed = $was_at;
876876

877877
return false;
878878
}
879879

880880
$tag_ends_at = strpos( $this->html, '>', $this->bytes_already_parsed );
881881
if ( false === $tag_ends_at ) {
882-
$this->parser_state = self::STATE_INCOMPLETE;
882+
$this->parser_state = self::STATE_INCOMPLETE_INPUT;
883883
$this->bytes_already_parsed = $was_at;
884884

885885
return false;
@@ -958,7 +958,7 @@ public function next_token() {
958958
}
959959

960960
if ( ! $found_closer ) {
961-
$this->parser_state = self::STATE_INCOMPLETE;
961+
$this->parser_state = self::STATE_INCOMPLETE_INPUT;
962962
$this->bytes_already_parsed = $was_at;
963963
return false;
964964
}
@@ -997,7 +997,7 @@ public function next_token() {
997997
* @return bool Whether the parse paused at the start of an incomplete token.
998998
*/
999999
public function paused_at_incomplete_token() {
1000-
return self::STATE_INCOMPLETE === $this->parser_state;
1000+
return self::STATE_INCOMPLETE_INPUT === $this->parser_state;
10011001
}
10021002

10031003
/**
@@ -1176,7 +1176,7 @@ public function set_bookmark( $name ) {
11761176
// It only makes sense to set a bookmark if the parser has paused on a concrete token.
11771177
if (
11781178
self::STATE_COMPLETE === $this->parser_state ||
1179-
self::STATE_INCOMPLETE === $this->parser_state
1179+
self::STATE_INCOMPLETE_INPUT === $this->parser_state
11801180
) {
11811181
return false;
11821182
}
@@ -1449,7 +1449,7 @@ private function skip_script_data() {
14491449
}
14501450

14511451
if ( $this->bytes_already_parsed >= $doc_length ) {
1452-
$this->parser_state = self::STATE_INCOMPLETE;
1452+
$this->parser_state = self::STATE_INCOMPLETE_INPUT;
14531453

14541454
return false;
14551455
}
@@ -1552,7 +1552,7 @@ private function parse_next_tag() {
15521552
* the document. There is nothing left to parse.
15531553
*/
15541554
if ( $at + 1 >= $doc_length ) {
1555-
$this->parser_state = self::STATE_INCOMPLETE;
1555+
$this->parser_state = self::STATE_INCOMPLETE_INPUT;
15561556

15571557
return false;
15581558
}
@@ -1574,7 +1574,7 @@ private function parse_next_tag() {
15741574
$closer_at = $at + 4;
15751575
// If it's not possible to close the comment then there is nothing more to scan.
15761576
if ( $doc_length <= $closer_at ) {
1577-
$this->parser_state = self::STATE_INCOMPLETE;
1577+
$this->parser_state = self::STATE_INCOMPLETE_INPUT;
15781578

15791579
return false;
15801580
}
@@ -1608,7 +1608,7 @@ private function parse_next_tag() {
16081608
while ( ++$closer_at < $doc_length ) {
16091609
$closer_at = strpos( $html, '--', $closer_at );
16101610
if ( false === $closer_at ) {
1611-
$this->parser_state = self::STATE_INCOMPLETE;
1611+
$this->parser_state = self::STATE_INCOMPLETE_INPUT;
16121612

16131613
return false;
16141614
}
@@ -1654,7 +1654,7 @@ private function parse_next_tag() {
16541654
) {
16551655
$closer_at = strpos( $html, '>', $at + 9 );
16561656
if ( false === $closer_at ) {
1657-
$this->parser_state = self::STATE_INCOMPLETE;
1657+
$this->parser_state = self::STATE_INCOMPLETE_INPUT;
16581658

16591659
return false;
16601660
}
@@ -1674,7 +1674,7 @@ private function parse_next_tag() {
16741674
*/
16751675
$closer_at = strpos( $html, '>', $at + 1 );
16761676
if ( false === $closer_at ) {
1677-
$this->parser_state = self::STATE_INCOMPLETE;
1677+
$this->parser_state = self::STATE_INCOMPLETE_INPUT;
16781678

16791679
return false;
16801680
}
@@ -1742,7 +1742,7 @@ private function parse_next_tag() {
17421742
if ( '?' === $html[ $at + 1 ] ) {
17431743
$closer_at = strpos( $html, '>', $at + 2 );
17441744
if ( false === $closer_at ) {
1745-
$this->parser_state = self::STATE_INCOMPLETE;
1745+
$this->parser_state = self::STATE_INCOMPLETE_INPUT;
17461746

17471747
return false;
17481748
}
@@ -1812,7 +1812,7 @@ private function parse_next_tag() {
18121812

18131813
$closer_at = strpos( $html, '>', $at + 3 );
18141814
if ( false === $closer_at ) {
1815-
$this->parser_state = self::STATE_INCOMPLETE;
1815+
$this->parser_state = self::STATE_INCOMPLETE_INPUT;
18161816

18171817
return false;
18181818
}
@@ -1842,7 +1842,7 @@ private function parse_next_attribute() {
18421842
// Skip whitespace and slashes.
18431843
$this->bytes_already_parsed += strspn( $this->html, " \t\f\r\n/", $this->bytes_already_parsed );
18441844
if ( $this->bytes_already_parsed >= strlen( $this->html ) ) {
1845-
$this->parser_state = self::STATE_INCOMPLETE;
1845+
$this->parser_state = self::STATE_INCOMPLETE_INPUT;
18461846

18471847
return false;
18481848
}
@@ -1866,14 +1866,14 @@ private function parse_next_attribute() {
18661866
$attribute_name = substr( $this->html, $attribute_start, $name_length );
18671867
$this->bytes_already_parsed += $name_length;
18681868
if ( $this->bytes_already_parsed >= strlen( $this->html ) ) {
1869-
$this->parser_state = self::STATE_INCOMPLETE;
1869+
$this->parser_state = self::STATE_INCOMPLETE_INPUT;
18701870

18711871
return false;
18721872
}
18731873

18741874
$this->skip_whitespace();
18751875
if ( $this->bytes_already_parsed >= strlen( $this->html ) ) {
1876-
$this->parser_state = self::STATE_INCOMPLETE;
1876+
$this->parser_state = self::STATE_INCOMPLETE_INPUT;
18771877

18781878
return false;
18791879
}
@@ -1883,7 +1883,7 @@ private function parse_next_attribute() {
18831883
++$this->bytes_already_parsed;
18841884
$this->skip_whitespace();
18851885
if ( $this->bytes_already_parsed >= strlen( $this->html ) ) {
1886-
$this->parser_state = self::STATE_INCOMPLETE;
1886+
$this->parser_state = self::STATE_INCOMPLETE_INPUT;
18871887

18881888
return false;
18891889
}
@@ -1911,7 +1911,7 @@ private function parse_next_attribute() {
19111911
}
19121912

19131913
if ( $attribute_end >= strlen( $this->html ) ) {
1914-
$this->parser_state = self::STATE_INCOMPLETE;
1914+
$this->parser_state = self::STATE_INCOMPLETE_INPUT;
19151915

19161916
return false;
19171917
}
@@ -3213,7 +3213,7 @@ private function matches() {
32133213
const STATE_COMPLETE = 'STATE_COMPLETE';
32143214

32153215
/**
3216-
* Parser Incomplete State.
3216+
* Parser Incomplete Input State.
32173217
*
32183218
* Indicates that the parser has reached the end of the document before finishing
32193219
* a token. It started parsing a token but there is a possibility that the input
@@ -3226,7 +3226,7 @@ private function matches() {
32263226
*
32273227
* @access private
32283228
*/
3229-
const STATE_INCOMPLETE = 'STATE_INCOMPLETE';
3229+
const STATE_INCOMPLETE_INPUT = 'STATE_INCOMPLETE_INPUT';
32303230

32313231
/**
32323232
* Parser Matched Tag State.

0 commit comments

Comments
 (0)