mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Allow loading multiple stylesheets for the same link element.
This commit is contained in:
parent
ca3cd64d6b
commit
3c3311b16a
7 changed files with 76 additions and 6 deletions
|
@ -24,6 +24,7 @@ use dom::virtualmethods::VirtualMethods;
|
|||
use dom_struct::dom_struct;
|
||||
use html5ever_atoms::LocalName;
|
||||
use net_traits::ReferrerPolicy;
|
||||
use script_layout_interface::message::Msg;
|
||||
use script_traits::{MozBrowserEvent, ScriptMsg as ConstellationMsg};
|
||||
use std::ascii::AsciiExt;
|
||||
use std::borrow::ToOwned;
|
||||
|
@ -96,8 +97,9 @@ impl HTMLLinkElement {
|
|||
}
|
||||
|
||||
pub fn set_stylesheet(&self, s: Arc<Stylesheet>) {
|
||||
assert!(self.stylesheet.borrow().is_none()); // Useful for catching timing issues.
|
||||
*self.stylesheet.borrow_mut() = Some(s);
|
||||
*self.stylesheet.borrow_mut() = Some(s.clone());
|
||||
window_from_node(self).layout_chan().send(Msg::AddStylesheet(s)).unwrap();
|
||||
document_from_node(self).invalidate_stylesheets();
|
||||
}
|
||||
|
||||
pub fn get_stylesheet(&self) -> Option<Arc<Stylesheet>> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue