mirror of
https://github.com/servo/servo.git
synced 2025-08-10 16:05:43 +01:00
style: Add a StyleBuilder struct to avoid refcount and atomic CAS during the cascade.
This should fix most of the complaints that caused https://bugzilla.mozilla.org/show_bug.cgi?id=1360889 to be open, and also fix a bunch of other FIXMEs across the style system.
This commit is contained in:
parent
caa66a880a
commit
3b857f1c4e
11 changed files with 279 additions and 120 deletions
|
@ -11,7 +11,7 @@ use euclid::{Size2D, TypedSize2D};
|
|||
use font_metrics::ServoMetricsProvider;
|
||||
use media_queries::MediaType;
|
||||
use parser::ParserContext;
|
||||
use properties::ComputedValues;
|
||||
use properties::{ComputedValues, StyleBuilder};
|
||||
use std::fmt;
|
||||
use style_traits::{CSSPixel, ToCss};
|
||||
use style_traits::viewport::ViewportConstraints;
|
||||
|
@ -185,14 +185,13 @@ impl Range<specified::Length> {
|
|||
device: device,
|
||||
inherited_style: default_values,
|
||||
layout_parent_style: default_values,
|
||||
// This cloning business is kind of dumb.... It's because Context
|
||||
// insists on having an actual ComputedValues inside itself.
|
||||
style: default_values.clone(),
|
||||
style: StyleBuilder::for_derived_style(default_values),
|
||||
// Servo doesn't support font metrics
|
||||
// A real provider will be needed here once we do; since
|
||||
// ch units can exist in media queries.
|
||||
font_metrics_provider: &ServoMetricsProvider,
|
||||
in_media_query: true,
|
||||
cached_system_font: None,
|
||||
quirks_mode: quirks_mode,
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue