mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
style: Add infrastructure for non-eagerly-cascaded pseudo-elements
This commit also removes StylistWrapper and uses Arc::get_mut instead.
This commit is contained in:
parent
2dacbc6fb3
commit
b6402a81d0
11 changed files with 188 additions and 78 deletions
|
@ -123,13 +123,13 @@ pub fn recalc_style_at<'a, N, C>(context: &'a C,
|
|||
root: OpaqueNode,
|
||||
node: N)
|
||||
where N: TNode,
|
||||
C: StyleContext<'a, <N::ConcreteElement as Element>::Impl, N::ConcreteComputedValues>,
|
||||
<N::ConcreteElement as Element>::Impl: SelectorImplExt + 'a {
|
||||
C: StyleContext<'a, <N::ConcreteElement as Element>::Impl>,
|
||||
<N::ConcreteElement as Element>::Impl: SelectorImplExt<ComputedValues=N::ConcreteComputedValues> + 'a {
|
||||
// Initialize layout data.
|
||||
//
|
||||
// FIXME(pcwalton): Stop allocating here. Ideally this should just be done by the HTML
|
||||
// parser.
|
||||
node.initialize_data();
|
||||
node.initialize_data(context.shared_context().stylist.get_precomputed_data());
|
||||
|
||||
// Get the parent node.
|
||||
let parent_opt = node.layout_parent_node(root);
|
||||
|
@ -167,8 +167,9 @@ pub fn recalc_style_at<'a, N, C>(context: &'a C,
|
|||
let shareable_element = match node.as_element() {
|
||||
Some(element) => {
|
||||
// Perform the CSS selector matching.
|
||||
let stylist = unsafe { &*context.shared_context().stylist.0 };
|
||||
if element.match_element(stylist,
|
||||
let stylist = &context.shared_context().stylist;
|
||||
|
||||
if element.match_element(&**stylist,
|
||||
Some(&*bf),
|
||||
&mut applicable_declarations) {
|
||||
Some(element)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue