mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
style: Rewrite the restyle hints code to allow different kinds of element snapshots, and use it for Gecko.
This is a rewrite for how style interfaces with its consumers in order to allow different representations for an element snapshot. This also changes the requirements of an element snapshot, requiring them to only implement MatchAttr, instead of MatchAttrGeneric. This is important for stylo since implementing MatchAttrGeneric is way more difficult for us given the atom limitations. This also allows for more performant implementations in the Gecko side of things.
This commit is contained in:
parent
ca9bc23b39
commit
611e611215
15 changed files with 565 additions and 246 deletions
|
@ -11,7 +11,7 @@ use data::PrivateStyleData;
|
|||
use element_state::ElementState;
|
||||
use properties::{ComputedValues, PropertyDeclaration, PropertyDeclarationBlock};
|
||||
use refcell::{Ref, RefMut};
|
||||
use restyle_hints::{ElementSnapshot, RESTYLE_DESCENDANTS, RESTYLE_LATER_SIBLINGS, RESTYLE_SELF, RestyleHint};
|
||||
use restyle_hints::{RESTYLE_DESCENDANTS, RESTYLE_LATER_SIBLINGS, RESTYLE_SELF, RestyleHint};
|
||||
use selector_impl::{ElementExt, SelectorImplExt};
|
||||
use selectors::Element;
|
||||
use selectors::matching::DeclarationBlock;
|
||||
|
@ -192,7 +192,8 @@ pub trait TDocument : Sized + Copy + Clone {
|
|||
|
||||
fn root_node(&self) -> Option<Self::ConcreteNode>;
|
||||
|
||||
fn drain_modified_elements(&self) -> Vec<(Self::ConcreteElement, ElementSnapshot)>;
|
||||
fn drain_modified_elements(&self) -> Vec<(Self::ConcreteElement,
|
||||
<Self::ConcreteElement as ElementExt>::Snapshot)>;
|
||||
}
|
||||
|
||||
pub trait PresentationalHintsSynthetizer {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue