[cssom] Disabling imported styleSheet
Nobody has claimed this yet.
- Dominant language
- Bikeshed
- Stars
- 4.9k
- Forks
- 816
- PR merge metrics
- PR metrics pending
Description
Is it expected behavior for a styleSheet that has been imported with @import and subsequently disabled to act as though it is still enabled?
Given the following document and external CSS file, I would expect the imported style to be disabled and the body text to not be red, however that does not seem to be the case.
/* red.css */
body {
color: red;
}
<!DOCTYPE html>
<html>
<head>
<style>@import 'red.css'</style>
<script>
const importedStyleSheet = document.styleSheets[0].cssRules[0].styleSheet;
importedStyleSheet.disabled = true;
console.log(importedStyleSheet.disabled) // logs true, but body remains red
</script>
</head>
<body>Should not be red</body>
</html
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the CSSOM specification sections covering imported style sheets and the CSSStyleSheet.disabled attribute. Reproduce the supplied @import example and compare the specified behavior with the observed result. Done means the expected behavior is clarified in the specification or the issue is resolved with a documented testable conclusion.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css
- Domain
- web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100