mirror of
https://github.com/servo/servo
synced 2026-05-05 06:32:13 +02:00
Force HTMLStyleElement to create a new CSSStyleSheet when re-parsing.
We already call Document::invalidate_style_sheets and set the stylesheet member to a new Stylesheet. This matches the behavior of Firefox, and means the new CSSStyleSheet you get from accessing .sheet from JS will be correct instead of stale. (::get_cssom_stylesheet already tries to use the new Stylesheet, but MutNullableJS::or_init is called, so if we already created a CSSStyleSheet we will continue to return that one).
This commit is contained in:
@@ -111,6 +111,7 @@ impl HTMLStyleElement {
|
||||
|
||||
win.layout_chan().send(Msg::AddStylesheet(sheet.clone())).unwrap();
|
||||
*self.stylesheet.borrow_mut() = Some(sheet);
|
||||
self.cssom_stylesheet.set(None);
|
||||
doc.invalidate_stylesheets();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user