mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-20 03:25:13 +00:00
LibWeb/CSS: Only try to fetch @import
s with a parent style sheet
When `CSSRuleList::remove_a_css_rule()` is called, the removed rule has its parent style sheet set to null. We shouldn't try to fetch an import in this case.
This commit is contained in:
parent
1d9902e22c
commit
ca0890ce16
Notes:
github-actions[bot]
2025-04-09 17:47:18 +00:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/LadybirdBrowser/ladybird/commit/ca0890ce164 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4285 Reviewed-by: https://github.com/tcl3 ✅
1 changed files with 4 additions and 1 deletions
|
@ -56,7 +56,10 @@ void CSSImportRule::set_parent_style_sheet(CSSStyleSheet* parent_style_sheet)
|
|||
// Crude detection of whether we're already fetching.
|
||||
if (m_style_sheet || m_document_load_event_delayer.has_value())
|
||||
return;
|
||||
fetch();
|
||||
|
||||
// Only try to fetch if we now have a parent
|
||||
if (parent_style_sheet)
|
||||
fetch();
|
||||
}
|
||||
|
||||
// https://www.w3.org/TR/cssom/#serialize-a-css-rule
|
||||
|
|
Loading…
Add table
Reference in a new issue