mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
style: More fine-grained viewport units invalidation
This should speed up window resize significantly. Differential Revision: https://phabricator.services.mozilla.com/D118878
This commit is contained in:
parent
85b7a60a69
commit
25edb3c21b
6 changed files with 88 additions and 1 deletions
|
@ -175,6 +175,25 @@ impl ElementStyles {
|
|||
self.primary().get_box().clone_display().is_none()
|
||||
}
|
||||
|
||||
/// Whether this element uses viewport units.
|
||||
pub fn uses_viewport_units(&self) -> bool {
|
||||
use crate::computed_value_flags::ComputedValueFlags;
|
||||
|
||||
if self.primary().flags.intersects(ComputedValueFlags::USES_VIEWPORT_UNITS) {
|
||||
return true;
|
||||
}
|
||||
|
||||
for pseudo_style in self.pseudos.as_array() {
|
||||
if let Some(ref pseudo_style) = pseudo_style {
|
||||
if pseudo_style.flags.intersects(ComputedValueFlags::USES_VIEWPORT_UNITS) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
false
|
||||
}
|
||||
|
||||
#[cfg(feature = "gecko")]
|
||||
fn size_of_excluding_cvs(&self, _ops: &mut MallocSizeOfOps) -> usize {
|
||||
// As the method name suggests, we don't measures the ComputedValues
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue