Don't go through the layout thread to retrieve a node's primary style

This commit is contained in:
Anthony Ramine 2020-04-07 13:13:33 +02:00
parent 030a1cf8fb
commit c10e839924
10 changed files with 38 additions and 79 deletions

View file

@ -122,7 +122,7 @@ pub enum QueryMsg {
// garbage values such as `0xdeadbeef as *const _`, this is unsound.
NodeScrollIdQuery(TrustedNodeAddress),
ResolvedStyleQuery(TrustedNodeAddress, Option<PseudoElement>, PropertyId),
StyleQuery(TrustedNodeAddress),
StyleQuery,
ElementInnerTextQuery(TrustedNodeAddress),
InnerWindowDimensionsQuery(BrowsingContextId),
}
@ -153,7 +153,7 @@ impl ReflowGoal {
QueryMsg::NodeScrollIdQuery(_) |
QueryMsg::ResolvedStyleQuery(..) |
QueryMsg::OffsetParentQuery(_) |
QueryMsg::StyleQuery(_) => false,
QueryMsg::StyleQuery => false,
},
}
}
@ -175,7 +175,7 @@ impl ReflowGoal {
QueryMsg::ResolvedStyleQuery(..) |
QueryMsg::OffsetParentQuery(_) |
QueryMsg::InnerWindowDimensionsQuery(_) |
QueryMsg::StyleQuery(_) => false,
QueryMsg::StyleQuery => false,
},
}
}

View file

@ -6,8 +6,6 @@ use app_units::Au;
use euclid::default::Rect;
use euclid::Size2D;
use script_traits::UntrustedNodeAddress;
use servo_arc::Arc;
use style::properties::ComputedValues;
use style_traits::CSSPixel;
use webrender_api::ExternalScrollId;
@ -33,9 +31,6 @@ pub trait LayoutRPC {
/// Query layout for the resolved value of a given CSS property
fn resolved_style(&self) -> ResolvedStyleResponse;
fn offset_parent(&self) -> OffsetParentResponse;
/// Requests the styles for an element. Contains a `None` value if the element is in a `display:
/// none` subtree.
fn style(&self) -> StyleResponse;
fn text_index(&self) -> TextIndexResponse;
/// Requests the list of nodes from the given point.
fn nodes_from_point_response(&self) -> Vec<UntrustedNodeAddress>;
@ -72,8 +67,5 @@ impl OffsetParentResponse {
}
}
#[derive(Clone)]
pub struct StyleResponse(pub Option<Arc<ComputedValues>>);
#[derive(Clone)]
pub struct TextIndexResponse(pub Option<usize>);