Skip to content

Commit

Permalink
Revert "Revert renames in method names and comments"
Browse files Browse the repository at this point in the history
This reverts commit b24d6c7.
  • Loading branch information
ockham committed Jan 16, 2023
1 parent e48f067 commit 46e2794
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions lib/experimental/html/class-wp-html-tag-processor.php
Original file line number Diff line number Diff line change
Expand Up @@ -1096,15 +1096,15 @@ private function skip_whitespace() {
}

/**
* Applies attribute updates and cleans up once a tag is fully parsed.
* Applies lexical updates and cleans up once a tag is fully parsed.
*
* @since 6.2.0
*
* @return void
*/
private function after_tag() {
$this->class_name_updates_to_attributes_updates();
$this->apply_attributes_updates();
$this->class_name_updates_to_lexical_updates();
$this->apply_lexical_updates();
$this->tag_name_starts_at = null;
$this->tag_name_length = null;
$this->tag_ends_at = null;
Expand All @@ -1113,10 +1113,10 @@ private function after_tag() {
}

/**
* Converts class name updates into tag attributes updates
* Converts class name updates into tag lexical updates
* (they are accumulated in different data formats for performance).
*
* This method is only meant to run right before the attribute updates are applied.
* This method is only meant to run right before the lexical updates are applied.
* The behavior in all other cases is undefined.
*
* @return void
Expand All @@ -1125,7 +1125,7 @@ private function after_tag() {
* @see $classname_updates
* @see $lexical_updates
*/
private function class_name_updates_to_attributes_updates() {
private function class_name_updates_to_lexical_updates() {
if ( count( $this->classname_updates ) === 0 || isset( $this->lexical_updates['class'] ) ) {
$this->classname_updates = array();
return;
Expand Down Expand Up @@ -1246,13 +1246,13 @@ private function class_name_updates_to_attributes_updates() {
*
* @since 6.2.0
*/
private function apply_attributes_updates() {
private function apply_lexical_updates() {
if ( ! count( $this->lexical_updates ) ) {
return;
}

/**
* Attribute updates can be enqueued in any order but as we
* Lexical updates can be enqueued in any order but as we
* progress through the document to replace them we have to
* make our replacements in the order in which they are found
* in that document.
Expand Down Expand Up @@ -1345,8 +1345,8 @@ public function seek( $bookmark_name ) {
*
* @since 6.2.0
*
* @param WP_HTML_Text_Replacement $a First attribute update.
* @param WP_HTML_Text_Replacement $b Second attribute update.
* @param WP_HTML_Text_Replacement $a First lexical update.
* @param WP_HTML_Text_Replacement $b Second lexical update.
* @return integer
*/
private static function sort_start_ascending( $a, $b ) {
Expand Down Expand Up @@ -1737,8 +1737,8 @@ public function get_updated_html() {
$updated_html_up_to_current_tag_name_end = $this->updated_html . $delta_between_updated_html_end_and_current_tag_end;

// 1. Apply the attributes updates to the original HTML
$this->class_name_updates_to_attributes_updates();
$this->apply_attributes_updates();
$this->class_name_updates_to_lexical_updates();
$this->apply_lexical_updates();

// 2. Replace the original HTML with the updated HTML
$this->html = $this->updated_html . substr( $this->html, $this->updated_bytes );
Expand Down

0 comments on commit 46e2794

Please sign in to comment.