-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cherry-pick 3651419. rdar://problem/110629287
[CSSOM] Fix insertion of rule into orphaned style rule https://bugs.webkit.org/show_bug.cgi?id=258017 rdar://110629287 Reviewed by Antti Koivisto. When a StyleRule is orphaned, we don't need any specific mechanism (such as RuleMutationScope) and convert it directly to a StyleRuleWithNesting. * LayoutTests/fast/css/cssom-mutation-stylerule-expected.html: Added. * LayoutTests/fast/css/cssom-mutation-stylerule.html: Added. * Source/WebCore/css/CSSStyleRule.cpp: (WebCore::CSSStyleRule::insertRule): Canonical link: https://commits.webkit.org/265154@main Identifier: 259548.836@safari-7615-branch
- Loading branch information
Showing
3 changed files
with
24 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
Test passes if no crash. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<style> | ||
aaa { | ||
color: red; | ||
} | ||
</style> | ||
<script> | ||
onload = () => { | ||
let cssStyleRule = document.styleSheets[0].cssRules[0]; | ||
document.styleSheets[0].deleteRule(0); | ||
cssStyleRule.insertRule(`.bar { color: black; }`); | ||
}; | ||
</script> | ||
|
||
Test passes if no crash. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters