mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
layout: Add a new cascading mode that inherits all properties, even
non-inheritable ones. This works like the `modify_style_for_*` functions and will allow us to easily migrate from them to real cascading.
This commit is contained in:
parent
93e41ba4aa
commit
fb2d1e1020
6 changed files with 86 additions and 43 deletions
|
@ -37,7 +37,7 @@ use style::gecko_bindings::sugar::ownership::{HasSimpleFFI, Strong};
|
|||
use style::gecko_bindings::sugar::refptr::{GeckoArcPrincipal, GeckoArcURI};
|
||||
use style::parallel;
|
||||
use style::parser::{ParserContext, ParserContextExtraData};
|
||||
use style::properties::{ComputedValues, Importance, PropertyDeclaration};
|
||||
use style::properties::{CascadeFlags, ComputedValues, Importance, PropertyDeclaration};
|
||||
use style::properties::{PropertyDeclarationParseResult, PropertyDeclarationBlock};
|
||||
use style::properties::{cascade, parse_one_declaration};
|
||||
use style::selector_impl::PseudoElementCascadeType;
|
||||
|
@ -143,11 +143,11 @@ pub extern "C" fn Servo_RestyleWithAddedDeclaration(declarations: RawServoDeclar
|
|||
// FIXME (bug 1303229): Use the actual viewport size here
|
||||
let (computed, _) = cascade(Size2D::new(Au(0), Au(0)),
|
||||
&[declaration_block],
|
||||
false,
|
||||
Some(previous_style),
|
||||
None,
|
||||
None,
|
||||
Box::new(StdoutErrorReporter));
|
||||
Box::new(StdoutErrorReporter),
|
||||
CascadeFlags::empty());
|
||||
Arc::new(computed).into_strong()
|
||||
}
|
||||
|
||||
|
@ -282,7 +282,7 @@ pub extern "C" fn Servo_ComputedValues_GetForAnonymousBox(parent_style_or_null:
|
|||
|
||||
|
||||
let maybe_parent = ComputedValues::arc_from_borrowed(&parent_style_or_null);
|
||||
let new_computed = data.stylist.precomputed_values_for_pseudo(&pseudo, maybe_parent);
|
||||
let new_computed = data.stylist.precomputed_values_for_pseudo(&pseudo, maybe_parent, false);
|
||||
new_computed.map_or(Strong::null(), |c| c.into_strong())
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue