Only restyle viewport-relative nodes on viewport size change

This commit is contained in:
Shing Lyu 2016-06-22 16:44:04 +08:00
parent e7a55ae55e
commit f754cacbd5
28 changed files with 515 additions and 11 deletions

View file

@ -32,6 +32,7 @@ use parser::{ParserContext, ParserContextExtraData, log_css_error};
use selectors::matching::DeclarationBlock;
use stylesheets::Origin;
use values::LocalToCss;
use values::HasViewportPercentage;
use values::computed::{self, TContext, ToComputedValue};
use values::specified::BorderStyle;
@ -825,6 +826,19 @@ impl ToCss for PropertyDeclaration {
}
}
impl HasViewportPercentage for PropertyDeclaration {
fn has_viewport_percentage(&self) -> bool {
match *self {
% for property in data.longhands:
PropertyDeclaration::${property.camel_case}(DeclaredValue::Value(ref val)) => {
val.has_viewport_percentage()
},
% endfor
_ => false
}
}
}
impl PropertyDeclaration {
pub fn name(&self) -> PropertyDeclarationName {
match *self {