Before submitting an issue please check that you’ve completed the following steps:
Made sure you’re on the latest version [x]
Used the search feature to ensure that the bug hasn’t been reported before [x]
Describe the bug
In some edge cases, discovered LCP will be inaccurate and getting the proper element will require extensive logic and comparison, or will just not be possible.
We need a filter to help exclude LCP element depending on their selector or image path fragment.
Before submitting an issue please check that you’ve completed the following steps:
Describe the bug In some edge cases, discovered LCP will be inaccurate and getting the proper element will require extensive logic and comparison, or will just not be possible.
We need a filter to help exclude LCP element depending on their
selector
orimage path fragment
.The following worked on a website with the issue:
Replacing:
Under
_initWithFirstElementWithInfo(elements) { ... }
with:To Reproduce For testing, you can simulate it using:
https://woodmart.xtemos.com/blog/category/wooden-accessories/?opt=blog_default
By adding the following style to simulate the issue:
and test excluding either:
Expected behavior Customers, support, product (for known layouts), should be able to exclude inaccurate LCP element when needed.
Screenshots N/A
Additional context Slack discussion - https://wp-media.slack.com/archives/C08N8J6VC/p1719941962200769?thread_ts=1719857870.817579&cid=C08N8J6VC
Acceptance Criteria (for WP Media team use only) Clear instructions for developers, to be added before the grooming