mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01: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:
parent
b9d66df2f5
commit
80dee7a65f
5 changed files with 13 additions and 248 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue