diff options
author | Bobby Holley <bobbyholley@gmail.com> | 2016-11-30 19:36:08 -0800 |
---|---|---|
committer | Bobby Holley <bobbyholley@gmail.com> | 2016-12-09 14:46:40 -1000 |
commit | 80460cc5498c3c6e2f95ecaf9f4c0e14c8c62428 (patch) | |
tree | 79682f7a68d6be5649642f3a45b7fddf981822ae /components/layout/context.rs | |
parent | 4cb3404c09d0b6a5a19a2c842d2e8809fae31e87 (diff) | |
download | servo-80460cc5498c3c6e2f95ecaf9f4c0e14c8c62428.tar.gz servo-80460cc5498c3c6e2f95ecaf9f4c0e14c8c62428.zip |
Make Restyle tracking more granular.
The primary idea of this patch is to ditch the rigid enum of Previous/Current
styles, and replace it with a series of indicators for the various types of
work that needs to be performed (expanding snapshots, rematching, recascading,
and damage processing). This loses us a little bit of sanity checking (since
the up-to-date-ness of our style is no longer baked into the type system), but
gives us a lot more flexibility that we'll need going forward (especially when
we separate matching from cascading). We also eliminate get_styling_mode in
favor of a method on the traversal.
This patch does a few other things as ridealongs:
* Temporarily eliminates the handling for transfering ownership of styles to the
frame. We'll need this again at some point, but for now it's causing too much
complexity for a half-implemented feature.
* Ditches TRestyleDamage, which is no longer necessary post-crate-merge, and is
a constant source of compilation failures from either needing to be imported
or being unnecessarily imported (which varies between gecko and servo).
* Expands Snapshots for the traversal root, which was missing before.
* Fixes up the skip_root stuff to avoid visiting the skipped root.
* Unifies parallel traversal and avoids spawning for a single work item.
* Adds an explicit pre_traverse step do any pre-processing and determine whether
we need to traverse at all.
MozReview-Commit-ID: IKhLAkAigXE
Diffstat (limited to 'components/layout/context.rs')
-rw-r--r-- | components/layout/context.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/components/layout/context.rs b/components/layout/context.rs index cb5b9efb0ef..b8d7c8680df 100644 --- a/components/layout/context.rs +++ b/components/layout/context.rs @@ -18,6 +18,7 @@ use net_traits::image_cache_thread::{ImageCacheChan, ImageCacheThread, ImageResp use net_traits::image_cache_thread::{ImageOrMetadataAvailable, UsePlaceholder}; use parking_lot::RwLock; use servo_url::ServoUrl; +use std::borrow::Borrow; use std::cell::{RefCell, RefMut}; use std::collections::HashMap; use std::hash::BuildHasherDefault; @@ -88,6 +89,12 @@ pub struct SharedLayoutContext { BuildHasherDefault<FnvHasher>>>>, } +impl Borrow<SharedStyleContext> for SharedLayoutContext { + fn borrow(&self) -> &SharedStyleContext { + &self.style_context + } +} + pub struct LayoutContext<'a> { pub shared: &'a SharedLayoutContext, cached_local_layout_context: Rc<LocalLayoutContext>, |