-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make INP XPath selector match the one in PHP #1
Comments
Note that given this XPath:
The <img src="...">
<p>...</p>
<p>...</p>
<p>...</p> and <p>...</p>
<p>...</p>
<p>...</p>
<img src="..."> In both examples, Take note that the XPath format is poised to further evolve with WordPress/performance#1797 |
So basically I need to make the same PHP changes also in JS here and keep them in sync Lines 42 to 81 in 96a6fa6
|
What if we added a |
That could make sense |
Then you wouldn't have to worry about maintaining this since it would be kept in one place, and conceivably other extensions may want to reuse this as well. Still, my concern with generating XPaths at runtime remains that JS can make changes to the DOM which immediately cause all XPaths to become invalid. Actually, the XPaths at the very beginning were computed client-side but this was eliminated in favor of server-side generation very early: WordPress/performance#892. The issue there was due to the skip link which was dynamically added to the page, but fortunately it is added as a preceding sibling to |
The alternative would be to revert the XPath change again and do everything in JS with selector queries. |
Except not the selector which was provided by web-vitals attribution build since it included |
Yes. Unless web-vitals somehow provides a way to get the selector from before the interaction / adding the .hide class |
Right now the XPath for an image block could look like this in in the tag visitor:
And the one created in the JS looks like this:
So when I try to compare the two in the tag visitor (to only add a dot when the matching element is found), there is no match.
The text was updated successfully, but these errors were encountered: