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

Closes #6901: LRC style is not added to used CSS when enable RUCSS #6912

Merged
merged 1 commit into from
Aug 28, 2024

Conversation

Miraeld
Copy link
Contributor

@Miraeld Miraeld commented Aug 27, 2024

Description

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

Fixes #6901
This code adds an ID Attribute to the <style> tag generated by LRC so the used CSS feature will contain the LRC css.

Type of change

  • New feature (non-breaking change which adds functionality).
  • Bug fix (non-breaking change which fixes an issue).
  • Enhancement (non-breaking change which improves an existing functionality).
  • Breaking change (fix or feature that would cause existing functionality to not work as before).
  • Sub-task of #(issue number)
  • Release

Detailed scenario

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;
} 

Technical description

Documentation

This code adds an ID Attribute to the <style> tag generated by LRC so the used CSS feature will contain the LRC css.

New dependencies

Risks

Mandatory Checklist

Code validation

  • I validated all the Acceptance Criteria. If possible, provide screenshots or videos.
  • I triggered all changed lines of code at least once without new errors/warnings/notices.
  • I implemented built-in tests to cover the new/changed code.

Code style

  • I wrote a self-explanatory code about what it does.
  • I protected entry points against unexpected inputs.
  • I did not introduce unnecessary complexity.
  • Output messages (errors, notices, logs) are explicit enough for users to understand the issue and are actionnable.

Additional Checks

  • In the case of complex code, I wrote comments to explain it.
  • When possible, I prepared ways to observe the implemented system (logs, data, etc.).
  • I added error handling logic when using functions that could throw errors (HTTP/API request, filesystem, etc.)

@Miraeld Miraeld added the module: ALR Issues related to the Automatic Lazy Rendering feature label Aug 27, 2024
@Miraeld Miraeld requested a review from a team August 27, 2024 02:59
@Miraeld Miraeld self-assigned this Aug 27, 2024
Copy link

codacy-production bot commented Aug 27, 2024

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.00% (target: -0.10%) 0.00% (target: 50.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (fb50ef3) 37955 9516 25.07%
Head commit (d17db72) 37955 (+0) 9516 (+0) 25.07% (+0.00%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#6912) 1 0 0.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

@Khadreal Khadreal linked an issue Aug 27, 2024 that may be closed by this pull request
@Miraeld
Copy link
Contributor Author

Miraeld commented Aug 28, 2024

While doing the scenario, we can see the new id attribute added to the <style> element.

Screenshot 2024-08-28 at 11 42 29

@Miraeld Miraeld merged commit e37d76f into feature/lrc Aug 28, 2024
12 of 13 checks passed
@Miraeld Miraeld deleted the fix/6901-add-style-attribute branch August 28, 2024 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: ALR Issues related to the Automatic Lazy Rendering feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3.17: LRC style isnot added to used CSS when enable RUCSS
2 participants