mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-13 11:42:38 +03:00
LibWeb: Invalidate styles after CSSImportRule loads
This replicates the behavior of StyleSheetList::add_sheet, making sure the rules added by the imported style sheet are applied.
This commit is contained in:
parent
1ed5e79478
commit
1f9d76c7b8
Notes:
sideshowbarker
2024-07-17 17:26:34 +09:00
Author: https://github.com/skyrising Commit: https://github.com/SerenityOS/serenity/commit/1f9d76c7b8 Pull-request: https://github.com/SerenityOS/serenity/pull/13048
1
Base/res/html/misc/css-import-relative/css-import-4a.css
Normal file
1
Base/res/html/misc/css-import-relative/css-import-4a.css
Normal file
@ -0,0 +1 @@
|
||||
@import "css-import-4b.css";
|
1
Base/res/html/misc/css-import-relative/css-import-4b.css
Normal file
1
Base/res/html/misc/css-import-relative/css-import-4b.css
Normal file
@ -0,0 +1 @@
|
||||
p.fourth { background-color: lime; }
|
@ -5,6 +5,7 @@
|
||||
@import "css-import-1.css";
|
||||
@import url("css-import-2.css");
|
||||
@import url(css-import-3.css);
|
||||
@import "css-import-relative/css-import-4a.css";
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
@ -12,6 +13,7 @@
|
||||
<p class="first">If this is green, <code>@import "string";</code> works!</p>
|
||||
<p class="second">If this is green, <code>@import url("string");</code> works!</p>
|
||||
<p class="third">If this is green, <code>@import url(unquoted-string);</code> works!</p>
|
||||
<p class="fourth">If this is green, relative <code>@import</code> resolves correctly!</p>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -84,6 +84,9 @@ void CSSImportRule::resource_did_load()
|
||||
}
|
||||
|
||||
m_style_sheet = move(sheet);
|
||||
|
||||
m_document->style_sheets().bump_generation();
|
||||
m_document->invalidate_style();
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user