-
Notifications
You must be signed in to change notification settings - Fork 220
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
Closes #6269: Lazyload CSS background image compatibility issue with Chrome 119+ #6300
Closes #6269: Lazyload CSS background image compatibility issue with Chrome 119+ #6300
Conversation
@Miraeld Thanks for the PR. |
Test plan |
1- This repo is broken for me, but I've successfully tested it manually. |
@Miraeld Thanks for the update. Please note that some images are not displayed now using the test page https://new.rocketlabsqa.ovh/ll-bgi-oct-ar/ (some have console error) => this is a regression and working fine on the trunk. can you please check 🙏 |
77d5cc3
to
1710d1e
Compare
1710d1e
to
8f28fe8
Compare
@@ -178,9 +178,6 @@ public function has( $key ) { | |||
*/ | |||
public function generate_url( string $url ): string { | |||
$path = $this->generate_path( $url ); | |||
if ( ! $this->filesystem->exists( $path ) ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Miraeld is it intended to remove this check? (it seems was here to guard against error)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was an intentional decision.
While addressing the URL problem you mentioned earlier, I encountered another issue. The url
I received turned out to be a relative path. In other words, it was attempting to load images using URLs like https://domain.com/var/www/html/wp-content/rocket-test-data/image.jpg
.
To resolve this, I introduced the transform_relative_to_absolute
function. Its purpose is to convert a relative path to an absolute one. However, constructing an absolute path requires knowledge of the source URL. In my case, the URL doesn't originate from the original CSS file but rather from the cached version. Unfortunately, the function responsible for this process was bailing out prematurely, making it impossible to obtain the URL of the cached version, which is saved at the end of the process.
If the function doesn't bail out, you can retrieve the URL of the cached version CSS. Subsequently, you can build an absolute URL and, consequently, display the image with the correct URL.
@Miraeld Thanks for the update. from the smoke test, no console errors now 🎉 , but the image (mentioned here https://new.rocketlabsqa.ovh/wp-content/rocket-test-data/images/butterfly.avif ) isnot displayed on the optimized page compared to nowprocket. can you please check? |
@Mai-Saad , well, I found out why that image wasn't displayed. I've changed it back so it's working fine now, and e2e tests are all passing & green for me. |
@piotrbak & @Mai-Saad , as we've been checking with @CrochetFeve0251 , it seems like on Firefox & Safari, each time there is a global CSS selector, it will reload / recompile the CSS which cause multiple 404 messages on these browsers. In our case and on the test page, that statement is |
I've performed
|
Description
Fix the issue of compatibility with several browser including Chrome 119+
Fixes #6269
Type of change
Please delete options that are not relevant.
Is the solution different from the one proposed during the grooming?
No
Checklists
Generic development checklist
Test summary