mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
style: Kill SharedStyleContext::default_computed_values.
Now that cascade() gets a Device, we can use the default computed values from there to avoid propagating that state all over the place. Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
This commit is contained in:
parent
16e318d055
commit
eaf27ccfa0
14 changed files with 41 additions and 47 deletions
|
@ -39,7 +39,10 @@ impl Device {
|
|||
}
|
||||
|
||||
/// Return the default computed values for this device.
|
||||
pub fn default_values(&self) -> &ComputedValues {
|
||||
pub fn default_computed_values(&self) -> &ComputedValues {
|
||||
// FIXME(bz): This isn't really right, but it's no more wrong
|
||||
// than what we used to do. See
|
||||
// https://github.com/servo/servo/issues/14773 for fixing it properly.
|
||||
ComputedValues::initial_values()
|
||||
}
|
||||
|
||||
|
@ -171,7 +174,7 @@ pub enum Range<T> {
|
|||
|
||||
impl Range<specified::Length> {
|
||||
fn to_computed_range(&self, device: &Device) -> Range<Au> {
|
||||
let default_values = device.default_values();
|
||||
let default_values = device.default_computed_values();
|
||||
// http://dev.w3.org/csswg/mediaqueries3/#units
|
||||
// em units are relative to the initial font-size.
|
||||
let context = computed::Context {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue