Skip to content

Conversation

westonruter
Copy link
Member

@westonruter westonruter commented Feb 11, 2025

This deprecates the use of \OD_HTML_Tag_Processor::get_cursor_move_count() in favor of backporting an adaptation of the internal fix put in place for WP 6.8 in Core-62085.

This will facilitate eventually allowing the use of WP_HTML_Tag_Processor instead of WP_HTML_Tag_Processor, which will handles all of HTML's unique parsing conditions.

@westonruter westonruter added [Type] Enhancement A suggestion for improvement of an existing feature [Plugin] Optimization Detective Issues for the Optimization Detective plugin blocked labels Feb 11, 2025
@westonruter westonruter changed the title Remove cursor move counting from OD_HTML_Tag_Processor Eliminate use of cursor move counting from OD_HTML_Tag_Processor Feb 11, 2025
@westonruter westonruter changed the title Eliminate use of cursor move counting from OD_HTML_Tag_Processor Eliminate use of cursor move counting from OD_HTML_Tag_Processor Feb 11, 2025
@westonruter westonruter force-pushed the remove/cursor-move-counting branch from bc8a3f1 to 6d979f7 Compare February 11, 2025 23:40
Copy link

codecov bot commented Feb 11, 2025

Codecov Report

Attention: Patch coverage is 75.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 66.64%. Comparing base (d21b74d) to head (6d979f7).

Files with missing lines Patch % Lines
...mization-detective/class-od-html-tag-processor.php 71.42% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            trunk    #1861   +/-   ##
=======================================
  Coverage   66.64%   66.64%           
=======================================
  Files          88       88           
  Lines        7015     7018    +3     
=======================================
+ Hits         4675     4677    +2     
- Misses       2340     2341    +1     
Flag Coverage Δ
multisite 66.64% <75.00%> (+<0.01%) ⬆️
single 37.26% <0.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@westonruter
Copy link
Member Author

Interestingly, the attribute order changes in one of the snapshots with the backport in place:

-<video data-od-added-preload data-od-xpath="/HTML/BODY/DIV[@class=&#039;wp-site-blocks&#039;]/*[1][self::FIGURE]/*[1][self::DIV]/*[1][self::VIDEO]" preload="auto" src="https://example.com/video1.mp4" poster="https://example.com/poster1.jpg" width="640" height="480"></video>\n
+<video data-od-xpath="/HTML/BODY/DIV[@class=&#039;wp-site-blocks&#039;]/*[1][self::FIGURE]/*[1][self::DIV]/*[1][self::VIDEO]" data-od-added-preload preload="auto" src="https://example.com/video1.mp4" poster="https://example.com/poster1.jpg" width="640" height="480"></video>\n

The test is passing in trunk with the fix from Core-62085 in place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Plugin] Optimization Detective Issues for the Optimization Detective plugin [Type] Enhancement A suggestion for improvement of an existing feature
Projects
Status: Code Review 👀
Development

Successfully merging this pull request may close these issues.

1 participant