Skip to content
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

3.17: LRC style isnot added to used CSS when enable RUCSS #6901

Closed
Mai-Saad opened this issue Aug 23, 2024 · 2 comments · Fixed by #6912
Closed

3.17: LRC style isnot added to used CSS when enable RUCSS #6901

Mai-Saad opened this issue Aug 23, 2024 · 2 comments · Fixed by #6912
Assignees
Labels
effort: [XS] < 1 day of estimated development time module: ALR Issues related to the Automatic Lazy Rendering feature noQA priority: high Issues which should be resolved as quickly as possible severity: major Feature is not working as expected and no work around available type: bug Indicates an unexpected problem or unintended behavior
Milestone

Comments

@Mai-Saad
Copy link
Contributor

Before submitting an issue please check that you’ve completed the following steps:

  • Made sure you’re on the latest version => feature/6840-lcr-frontend-subtask
  • Used the search feature to ensure that the bug hasn’t been reported before

Describe the bug
When enabling RUCSS while LRC is already created, the used CSS does not contain the LRC CSS

To Reproduce
Steps to reproduce the behavior:

  1. Visit a page => LRC added to DB
  2. Clear cache and revisit the page => LRC style added to the page
  3. Enable RUCSS
  4. revisit the page and wait till the used CSS is created then revisit the page => LRC style is not in the source
[data-wpr-lazyrender] {
content-visibility: auto;
} 

Expected behavior
LRC style is preserved in used CSS

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

Acceptance Criteria (for WP Media team use only)
Clear instructions for developers, to be added before the grooming

@Mai-Saad Mai-Saad added type: bug Indicates an unexpected problem or unintended behavior priority: high Issues which should be resolved as quickly as possible severity: major Feature is not working as expected and no work around available module: ALR Issues related to the Automatic Lazy Rendering feature labels Aug 23, 2024
@MathieuLamiot MathieuLamiot added this to the 3.17 milestone Aug 23, 2024
@Khadreal
Copy link
Contributor

Reproduce the issue ✅

Yes

Identify the root cause ✅

This is happening in

private function remove_internal_styles_from_html( string $clean_html, string $html ) {
at its remove internal styles from the page.

Scope a solution ✅

Add rocket-lazyrender-inline-css as an attribute to LazyRenderContent CSS here

$css = '<style>[data-wpr-lazyrender] {content-visibility: auto;}</style>';
for backend to exclude it from being remove during RUCSS process

Estimate the effort ✅

[XS]

@Khadreal Khadreal removed their assignment Aug 26, 2024
@Khadreal Khadreal added the effort: [XS] < 1 day of estimated development time label Aug 26, 2024
@jeawhanlee
Copy link
Contributor

For clarity sake, we're adding and id attribute to the style tag like so: <style id="rocket-lazyrender-inline-css">
LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort: [XS] < 1 day of estimated development time module: ALR Issues related to the Automatic Lazy Rendering feature noQA priority: high Issues which should be resolved as quickly as possible severity: major Feature is not working as expected and no work around available type: bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants