mirror of
https://github.com/servo/servo.git
synced 2025-08-09 07:25:35 +01:00
style: Support lazy pseudo-elements
These can't be supported in Servo as of right now, because I'm not totally sure the accesses that should be done in layout would be thread-safe. It can be revisited later though.
This commit is contained in:
parent
3f2ceeff5d
commit
9caaa6004e
7 changed files with 206 additions and 72 deletions
|
@ -117,6 +117,13 @@ impl Device {
|
|||
viewport_size: viewport_size,
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn au_viewport_size(&self) -> Size2D<Au> {
|
||||
Size2D::new(Au::from_f32_px(self.viewport_size.width.get()),
|
||||
Au::from_f32_px(self.viewport_size.height.get()))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
impl Expression {
|
||||
|
@ -203,8 +210,7 @@ pub fn parse_media_query_list(input: &mut Parser) -> MediaQueryList {
|
|||
|
||||
impl MediaQueryList {
|
||||
pub fn evaluate(&self, device: &Device) -> bool {
|
||||
let viewport_size = Size2D::new(Au::from_f32_px(device.viewport_size.width.get()),
|
||||
Au::from_f32_px(device.viewport_size.height.get()));
|
||||
let viewport_size = device.au_viewport_size();
|
||||
|
||||
// Check if any queries match (OR condition)
|
||||
self.media_queries.iter().any(|mq| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue