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

🐛 do not ignore @import rules pointing to inaccessible stylesheets #2398

Merged
merged 3 commits into from
Aug 31, 2023

Conversation

BenoitZugmeyer
Copy link
Member

Motivation

We follow @import rules and inline their content so the player can uses its strategy to emulate :hover states. But if the external stylesheet is inaccessible, we should still take the @import rule into account, so the external stylesheet can be loaded in the player.

Changes

If we fail to get the external stylesheet rule, use the @import rule cssText as a fallback

Testing

  • Local
  • Staging
  • Unit
  • End to end

I have gone over the contributing documentation.

We follow @import rules and inline their content so the player can uses
its strategy to emulate :hover states. But if the external stylesheet is
inaccessible, we should still take the @import rule into account, so the
external stylesheet can be loaded in the player.
@BenoitZugmeyer BenoitZugmeyer requested review from a team as code owners August 29, 2023 16:16
@BenoitZugmeyer
Copy link
Member Author

/to-staging

@codecov-commenter
Copy link

codecov-commenter commented Aug 29, 2023

Codecov Report

Merging #2398 (465a7bd) into main (ef8f6ca) will increase coverage by 0.01%.
Report is 2 commits behind head on main.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main    #2398      +/-   ##
==========================================
+ Coverage   93.99%   94.01%   +0.01%     
==========================================
  Files         212      212              
  Lines        6298     6299       +1     
  Branches     1405     1405              
==========================================
+ Hits         5920     5922       +2     
+ Misses        378      377       -1     
Files Changed Coverage Δ
...domain/record/serialization/serializeAttributes.ts 98.64% <100.00%> (+1.38%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@dd-devflow
Copy link

dd-devflow bot commented Aug 29, 2023

🚂 Branch Integration: starting soon, merge in < 7m

commit 98431dde7e will soon be integrated into staging-35.

This build is going to start soon! (estimated merge in less than 7m)

you can cancel this operation by commenting your pull request with /to-staging -c!

@dd-devflow
Copy link

dd-devflow bot commented Aug 29, 2023

🚂 Branch Integration: this commit was successfully integrated

Commit 98431dde7e has been merged into staging-35 in merge commit 2c2997766d.

Check out the triggered pipeline on Gitlab 🦊

@@ -144,7 +144,7 @@ function getCssRulesString(cssStyleSheet: CSSStyleSheet | undefined | null): str
}

function getCssRuleString(rule: CSSRule): string {
return isCSSImportRule(rule) ? getCssRulesString(rule.styleSheet) || '' : rule.cssText
return (isCSSImportRule(rule) && getCssRulesString(rule.styleSheet)) || rule.cssText
Copy link
Contributor

@bcaudan bcaudan Aug 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💬 suggestion: ‏a comment here could be helpful as well

@BenoitZugmeyer BenoitZugmeyer merged commit 64e2ff1 into main Aug 31, 2023
@BenoitZugmeyer BenoitZugmeyer deleted the benoit/replay--fix-css-import-rule-serialization branch August 31, 2023 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants