mirror of
https://github.com/servo/servo.git
synced 2025-07-24 15:50:21 +01:00
stylo: Use ComputedValuesInner instead of ComputedValues when we don't need it
This commit is contained in:
parent
04b0ae64f2
commit
808b1f509b
38 changed files with 302 additions and 316 deletions
|
@ -22,7 +22,7 @@ use style::data::ElementData;
|
|||
use style::dom::{LayoutIterator, NodeInfo, PresentationalHintsSynthesizer, TNode};
|
||||
use style::dom::OpaqueNode;
|
||||
use style::font_metrics::ServoMetricsProvider;
|
||||
use style::properties::{CascadeFlags, ServoComputedValues};
|
||||
use style::properties::{CascadeFlags, ComputedValues};
|
||||
use style::selector_parser::{PseudoElement, PseudoElementCascadeType, SelectorImpl};
|
||||
use style::stylearc::Arc;
|
||||
use style::stylist::RuleInclusion;
|
||||
|
@ -181,7 +181,7 @@ pub trait ThreadSafeLayoutNode: Clone + Copy + Debug + GetLayoutData + NodeInfo
|
|||
/// it can be used to reach siblings and cousins. A simple immutable borrow
|
||||
/// of the parent data is fine, since the bottom-up traversal will not process
|
||||
/// the parent until all the children have been processed.
|
||||
fn parent_style(&self) -> Arc<ServoComputedValues>;
|
||||
fn parent_style(&self) -> Arc<ComputedValues>;
|
||||
|
||||
#[inline]
|
||||
fn is_element_or_elements_pseudo(&self) -> bool {
|
||||
|
@ -223,7 +223,7 @@ pub trait ThreadSafeLayoutNode: Clone + Copy + Debug + GetLayoutData + NodeInfo
|
|||
|
||||
fn get_style_and_layout_data(&self) -> Option<OpaqueStyleAndLayoutData>;
|
||||
|
||||
fn style(&self, context: &SharedStyleContext) -> Arc<ServoComputedValues> {
|
||||
fn style(&self, context: &SharedStyleContext) -> Arc<ComputedValues> {
|
||||
if let Some(el) = self.as_element() {
|
||||
el.style(context)
|
||||
} else {
|
||||
|
@ -234,7 +234,7 @@ pub trait ThreadSafeLayoutNode: Clone + Copy + Debug + GetLayoutData + NodeInfo
|
|||
}
|
||||
}
|
||||
|
||||
fn selected_style(&self) -> Arc<ServoComputedValues> {
|
||||
fn selected_style(&self) -> Arc<ComputedValues> {
|
||||
if let Some(el) = self.as_element() {
|
||||
el.selected_style()
|
||||
} else {
|
||||
|
@ -393,7 +393,7 @@ pub trait ThreadSafeLayoutElement: Clone + Copy + Sized + Debug +
|
|||
///
|
||||
/// Unlike the version on TNode, this handles pseudo-elements.
|
||||
#[inline]
|
||||
fn style(&self, context: &SharedStyleContext) -> Arc<ServoComputedValues> {
|
||||
fn style(&self, context: &SharedStyleContext) -> Arc<ComputedValues> {
|
||||
let data = self.style_data();
|
||||
match self.get_pseudo_element_type() {
|
||||
PseudoElementType::Normal => {
|
||||
|
@ -438,7 +438,7 @@ pub trait ThreadSafeLayoutElement: Clone + Copy + Sized + Debug +
|
|||
}
|
||||
|
||||
#[inline]
|
||||
fn selected_style(&self) -> Arc<ServoComputedValues> {
|
||||
fn selected_style(&self) -> Arc<ComputedValues> {
|
||||
let data = self.style_data();
|
||||
data.styles.pseudos
|
||||
.get(&PseudoElement::Selection).map(|s| s)
|
||||
|
@ -454,7 +454,7 @@ pub trait ThreadSafeLayoutElement: Clone + Copy + Sized + Debug +
|
|||
/// This should be used just for querying layout, or when we know the
|
||||
/// element style is precomputed, not from general layout itself.
|
||||
#[inline]
|
||||
fn resolved_style(&self) -> Arc<ServoComputedValues> {
|
||||
fn resolved_style(&self) -> Arc<ComputedValues> {
|
||||
let data = self.style_data();
|
||||
match self.get_pseudo_element_type() {
|
||||
PseudoElementType::Normal
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue