Cache the result of retrieving an element's client rectangle from layout.

This commit is contained in:
Josh Matthews 2020-03-26 16:07:29 -04:00
parent 148c24c29c
commit 6ab7a50b31
5 changed files with 125 additions and 22 deletions

View file

@ -9,6 +9,8 @@ use crate::dom::customelementregistry::{
use crate::dom::mutationobserver::RegisteredObserver;
use crate::dom::node::UniqueId;
use crate::dom::shadowroot::ShadowRoot;
use crate::dom::window::LayoutValue;
use euclid::default::Rect;
use servo_atoms::Atom;
use std::rc::Rc;
@ -46,4 +48,6 @@ pub struct ElementRareData {
/// The "name" content attribute; not used as frequently as id, but used
/// in named getter loops so it's worth looking up quickly when present
pub name_attribute: Option<Atom>,
/// The client rect reported by layout.
pub client_rect: Option<LayoutValue<Rect<i32>>>,
}