mirror of
https://github.com/servo/servo.git
synced 2025-07-24 15:50:21 +01:00
Consider media attribute on link and style tags
Don't add a stylesheet if the current device does not match the media query specified in a link or style tag.
This commit is contained in:
parent
1e1c97adb3
commit
e7a06cd241
4 changed files with 48 additions and 17 deletions
|
@ -17,6 +17,7 @@ use std::any::Any;
|
|||
use std::sync::mpsc::{channel, Receiver, Sender};
|
||||
use std::boxed::BoxAny;
|
||||
use style::stylesheets::Stylesheet;
|
||||
use style::media_queries::MediaQueryList;
|
||||
use url::Url;
|
||||
|
||||
pub use dom::node::TrustedNodeAddress;
|
||||
|
@ -24,10 +25,10 @@ pub use dom::node::TrustedNodeAddress;
|
|||
/// Asynchronous messages that script can send to layout.
|
||||
pub enum Msg {
|
||||
/// Adds the given stylesheet to the document.
|
||||
AddStylesheet(Stylesheet),
|
||||
AddStylesheet(Stylesheet, MediaQueryList),
|
||||
|
||||
/// Adds the given stylesheet to the document.
|
||||
LoadStylesheet(Url),
|
||||
LoadStylesheet(Url, MediaQueryList),
|
||||
|
||||
/// Puts a document into quirks mode, causing the quirks mode stylesheet to be loaded.
|
||||
SetQuirksMode,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue