mirror of
https://github.com/servo/servo.git
synced 2025-08-08 06:55:31 +01:00
Derive HeapSizeOf on more Stylesheet-related types
In preparation of storing `Stylesheet`s on nodes.
This commit is contained in:
parent
f1b6c7cc99
commit
068e6a8e9f
5 changed files with 25 additions and 21 deletions
|
@ -18,10 +18,11 @@ use std::str::Chars;
|
|||
use style_traits::viewport::{Orientation, UserZoom, ViewportConstraints, Zoom};
|
||||
use stylesheets::Origin;
|
||||
use util::geometry::ViewportPx;
|
||||
use util::mem::HeapSizeOf;
|
||||
use values::computed::{Context, ToComputedValue};
|
||||
use values::specified::{Length, LengthOrPercentageOrAuto, ViewportPercentageLength};
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq)]
|
||||
#[derive(Copy, Clone, Debug, HeapSizeOf, PartialEq)]
|
||||
pub enum ViewportDescriptor {
|
||||
MinWidth(ViewportLength),
|
||||
MaxWidth(ViewportLength),
|
||||
|
@ -133,7 +134,7 @@ struct ViewportRuleParser<'a, 'b: 'a> {
|
|||
context: &'a ParserContext<'b>
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq)]
|
||||
#[derive(Copy, Clone, Debug, HeapSizeOf, PartialEq)]
|
||||
pub struct ViewportDescriptorDeclaration {
|
||||
pub origin: Origin,
|
||||
pub descriptor: ViewportDescriptor,
|
||||
|
@ -228,7 +229,7 @@ impl<'a, 'b> DeclarationParser for ViewportRuleParser<'a, 'b> {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
#[derive(Debug, HeapSizeOf, PartialEq)]
|
||||
pub struct ViewportRule {
|
||||
pub declarations: Vec<ViewportDescriptorDeclaration>
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue