mirror of
https://github.com/servo/servo.git
synced 2025-08-04 05:00:08 +01:00
style: Derive debug for CascadeInputs.
It no longer has anything than rules.
This commit is contained in:
parent
5ac12b5df4
commit
104f5c2553
4 changed files with 24 additions and 24 deletions
|
@ -860,6 +860,7 @@ impl<'ln> NodeInfo for ServoThreadSafeLayoutNode<'ln> {
|
||||||
impl<'ln> ThreadSafeLayoutNode for ServoThreadSafeLayoutNode<'ln> {
|
impl<'ln> ThreadSafeLayoutNode for ServoThreadSafeLayoutNode<'ln> {
|
||||||
type ConcreteNode = ServoLayoutNode<'ln>;
|
type ConcreteNode = ServoLayoutNode<'ln>;
|
||||||
type ConcreteThreadSafeLayoutElement = ServoThreadSafeLayoutElement<'ln>;
|
type ConcreteThreadSafeLayoutElement = ServoThreadSafeLayoutElement<'ln>;
|
||||||
|
type ConcreteElement = ServoLayoutElement<'ln>;
|
||||||
type ChildrenIterator = ThreadSafeLayoutNodeChildrenIterator<Self>;
|
type ChildrenIterator = ThreadSafeLayoutNodeChildrenIterator<Self>;
|
||||||
|
|
||||||
fn opaque(&self) -> OpaqueNode {
|
fn opaque(&self) -> OpaqueNode {
|
||||||
|
@ -1084,6 +1085,7 @@ pub struct ServoThreadSafeLayoutElement<'le> {
|
||||||
|
|
||||||
impl<'le> ThreadSafeLayoutElement for ServoThreadSafeLayoutElement<'le> {
|
impl<'le> ThreadSafeLayoutElement for ServoThreadSafeLayoutElement<'le> {
|
||||||
type ConcreteThreadSafeLayoutNode = ServoThreadSafeLayoutNode<'le>;
|
type ConcreteThreadSafeLayoutNode = ServoThreadSafeLayoutNode<'le>;
|
||||||
|
type ConcreteElement = ServoLayoutElement<'le>;
|
||||||
|
|
||||||
fn as_node(&self) -> ServoThreadSafeLayoutNode<'le> {
|
fn as_node(&self) -> ServoThreadSafeLayoutNode<'le> {
|
||||||
ServoThreadSafeLayoutNode {
|
ServoThreadSafeLayoutNode {
|
||||||
|
|
|
@ -1491,8 +1491,11 @@ impl LayoutThread {
|
||||||
self.profiler_metadata(),
|
self.profiler_metadata(),
|
||||||
self.time_profiler_chan.clone(),
|
self.time_profiler_chan.clone(),
|
||||||
|| {
|
|| {
|
||||||
animation::recalc_style_for_animations(
|
animation::recalc_style_for_animations::<ServoLayoutElement>(
|
||||||
&layout_context, FlowRef::deref_mut(&mut root_flow), &animations)
|
&layout_context,
|
||||||
|
FlowRef::deref_mut(&mut root_flow),
|
||||||
|
&animations,
|
||||||
|
)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
self.perform_post_style_recalc_layout_passes(&mut root_flow,
|
self.perform_post_style_recalc_layout_passes(&mut root_flow,
|
||||||
|
@ -1522,14 +1525,16 @@ impl LayoutThread {
|
||||||
.as_mut()
|
.as_mut()
|
||||||
.map(|nodes| &mut **nodes);
|
.map(|nodes| &mut **nodes);
|
||||||
// Kick off animations if any were triggered, expire completed ones.
|
// Kick off animations if any were triggered, expire completed ones.
|
||||||
animation::update_animation_state(&self.constellation_chan,
|
animation::update_animation_state::<ServoLayoutElement>(
|
||||||
|
&self.constellation_chan,
|
||||||
&self.script_chan,
|
&self.script_chan,
|
||||||
&mut *self.running_animations.write(),
|
&mut *self.running_animations.write(),
|
||||||
&mut *self.expired_animations.write(),
|
&mut *self.expired_animations.write(),
|
||||||
newly_transitioning_nodes,
|
newly_transitioning_nodes,
|
||||||
&self.new_animations_receiver,
|
&self.new_animations_receiver,
|
||||||
self.id,
|
self.id,
|
||||||
&self.timer);
|
&self.timer,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
profile(time::ProfilerCategory::LayoutRestyleDamagePropagation,
|
profile(time::ProfilerCategory::LayoutRestyleDamagePropagation,
|
||||||
|
|
|
@ -148,7 +148,7 @@ impl<ConcreteNode> Iterator for TreeIterator<ConcreteNode>
|
||||||
/// node does not allow any parents or siblings of nodes to be accessed, to avoid races.
|
/// node does not allow any parents or siblings of nodes to be accessed, to avoid races.
|
||||||
pub trait ThreadSafeLayoutNode: Clone + Copy + Debug + GetLayoutData + NodeInfo + PartialEq + Sized {
|
pub trait ThreadSafeLayoutNode: Clone + Copy + Debug + GetLayoutData + NodeInfo + PartialEq + Sized {
|
||||||
type ConcreteNode: LayoutNode<ConcreteThreadSafeLayoutNode = Self>;
|
type ConcreteNode: LayoutNode<ConcreteThreadSafeLayoutNode = Self>;
|
||||||
type ConcreteElement: TElement = <Self::ConcreteNode as TNode>::ConcreteElement;
|
type ConcreteElement: TElement;
|
||||||
|
|
||||||
type ConcreteThreadSafeLayoutElement:
|
type ConcreteThreadSafeLayoutElement:
|
||||||
ThreadSafeLayoutElement<ConcreteThreadSafeLayoutNode = Self>
|
ThreadSafeLayoutElement<ConcreteThreadSafeLayoutNode = Self>
|
||||||
|
@ -293,9 +293,11 @@ pub trait ThreadSafeLayoutElement
|
||||||
{
|
{
|
||||||
type ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode<ConcreteThreadSafeLayoutElement = Self>;
|
type ConcreteThreadSafeLayoutNode: ThreadSafeLayoutNode<ConcreteThreadSafeLayoutElement = Self>;
|
||||||
|
|
||||||
/// This type alias is just a hack to avoid writing the monstrosity after it
|
/// This type alias is just a work-around to avoid writing
|
||||||
/// twice.
|
///
|
||||||
type ConcreteElement: TElement = <Self::ConcreteThreadSafeLayoutNode as ThreadSafeLayoutNode>::ConcreteElement;
|
/// <Self::ConcreteThreadSafeLayoutNode as ThreadSafeLayoutNode>::ConcreteElement
|
||||||
|
///
|
||||||
|
type ConcreteElement: TElement;
|
||||||
|
|
||||||
fn as_node(&self) -> Self::ConcreteThreadSafeLayoutNode;
|
fn as_node(&self) -> Self::ConcreteThreadSafeLayoutNode;
|
||||||
|
|
||||||
|
|
|
@ -203,7 +203,7 @@ impl<'a> SharedStyleContext<'a> {
|
||||||
/// within the `CurrentElementInfo`. At the end of the cascade, they are folded
|
/// within the `CurrentElementInfo`. At the end of the cascade, they are folded
|
||||||
/// down into the main `ComputedValues` to reduce memory usage per element while
|
/// down into the main `ComputedValues` to reduce memory usage per element while
|
||||||
/// still remaining accessible.
|
/// still remaining accessible.
|
||||||
#[derive(Clone, Default)]
|
#[derive(Clone, Debug, Default)]
|
||||||
pub struct CascadeInputs {
|
pub struct CascadeInputs {
|
||||||
/// The rule node representing the ordered list of rules matched for this
|
/// The rule node representing the ordered list of rules matched for this
|
||||||
/// node.
|
/// node.
|
||||||
|
@ -226,15 +226,6 @@ impl CascadeInputs {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// We manually implement Debug for CascadeInputs so that we can avoid the
|
|
||||||
// verbose stringification of ComputedValues for normal logging.
|
|
||||||
impl fmt::Debug for CascadeInputs {
|
|
||||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
|
||||||
write!(f, "CascadeInputs {{ rules: {:?}, visited_rules: {:?}, .. }}",
|
|
||||||
self.rules, self.visited_rules)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// A list of cascade inputs for eagerly-cascaded pseudo-elements.
|
/// A list of cascade inputs for eagerly-cascaded pseudo-elements.
|
||||||
/// The list is stored inline.
|
/// The list is stored inline.
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue