mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Remove shareable boolean from ComputedValues and simplify code.
This code is all vestigial at this point, presumably after a refactoring. MozReview-Commit-ID: CV0lKMStq13
This commit is contained in:
parent
f9de1dedd8
commit
42f5aea76a
4 changed files with 14 additions and 52 deletions
|
@ -77,7 +77,6 @@ pub struct ComputedValues {
|
|||
% endfor
|
||||
|
||||
custom_properties: Option<Arc<ComputedValuesMap>>,
|
||||
shareable: bool,
|
||||
pub writing_mode: WritingMode,
|
||||
pub root_font_size: Au,
|
||||
pub font_size_keyword: Option<longhands::font_size::KeywordSize>,
|
||||
|
@ -87,7 +86,6 @@ impl ComputedValues {
|
|||
pub fn inherit_from(parent: &Self, default: &Self) -> Arc<Self> {
|
||||
Arc::new(ComputedValues {
|
||||
custom_properties: parent.custom_properties.clone(),
|
||||
shareable: parent.shareable,
|
||||
writing_mode: parent.writing_mode,
|
||||
root_font_size: parent.root_font_size,
|
||||
font_size_keyword: parent.font_size_keyword,
|
||||
|
@ -102,7 +100,6 @@ impl ComputedValues {
|
|||
}
|
||||
|
||||
pub fn new(custom_properties: Option<Arc<ComputedValuesMap>>,
|
||||
shareable: bool,
|
||||
writing_mode: WritingMode,
|
||||
root_font_size: Au,
|
||||
font_size_keyword: Option<longhands::font_size::KeywordSize>,
|
||||
|
@ -112,7 +109,6 @@ impl ComputedValues {
|
|||
) -> Self {
|
||||
ComputedValues {
|
||||
custom_properties: custom_properties,
|
||||
shareable: shareable,
|
||||
writing_mode: writing_mode,
|
||||
root_font_size: root_font_size,
|
||||
font_size_keyword: font_size_keyword,
|
||||
|
@ -125,7 +121,6 @@ impl ComputedValues {
|
|||
pub fn default_values(pres_context: RawGeckoPresContextBorrowed) -> Arc<Self> {
|
||||
Arc::new(ComputedValues {
|
||||
custom_properties: None,
|
||||
shareable: true,
|
||||
writing_mode: WritingMode::empty(), // FIXME(bz): This seems dubious
|
||||
root_font_size: longhands::font_size::get_initial_value(), // FIXME(bz): Also seems dubious?
|
||||
font_size_keyword: Some(Default::default()),
|
||||
|
|
|
@ -1542,7 +1542,6 @@ pub struct ComputedValues {
|
|||
${style_struct.ident}: Arc<style_structs::${style_struct.name}>,
|
||||
% endfor
|
||||
custom_properties: Option<Arc<::custom_properties::ComputedValuesMap>>,
|
||||
shareable: bool,
|
||||
/// The writing mode of this computed values struct.
|
||||
pub writing_mode: WritingMode,
|
||||
/// The root element's computed font size.
|
||||
|
@ -1555,7 +1554,6 @@ pub struct ComputedValues {
|
|||
impl ComputedValues {
|
||||
/// Construct a `ComputedValues` instance.
|
||||
pub fn new(custom_properties: Option<Arc<::custom_properties::ComputedValuesMap>>,
|
||||
shareable: bool,
|
||||
writing_mode: WritingMode,
|
||||
root_font_size: Au,
|
||||
font_size_keyword: Option<longhands::font_size::KeywordSize>,
|
||||
|
@ -1565,7 +1563,6 @@ impl ComputedValues {
|
|||
) -> Self {
|
||||
ComputedValues {
|
||||
custom_properties: custom_properties,
|
||||
shareable: shareable,
|
||||
writing_mode: writing_mode,
|
||||
root_font_size: root_font_size,
|
||||
font_size_keyword: font_size_keyword,
|
||||
|
@ -1889,7 +1886,6 @@ mod lazy_static_module {
|
|||
}),
|
||||
% endfor
|
||||
custom_properties: None,
|
||||
shareable: true,
|
||||
writing_mode: WritingMode::empty(),
|
||||
root_font_size: longhands::font_size::get_initial_value(),
|
||||
font_size_keyword: Some(Default::default()),
|
||||
|
@ -1918,15 +1914,12 @@ static CASCADE_PROPERTY: [CascadePropertyFn; ${len(data.longhands)}] = [
|
|||
bitflags! {
|
||||
/// A set of flags to tweak the behavior of the `cascade` function.
|
||||
pub flags CascadeFlags: u8 {
|
||||
/// Whether the `ComputedValues` structure to be constructed should be
|
||||
/// considered shareable.
|
||||
const SHAREABLE = 0x01,
|
||||
/// Whether to inherit all styles from the parent. If this flag is not
|
||||
/// present, non-inherited styles are reset to their initial values.
|
||||
const INHERIT_ALL = 0x02,
|
||||
const INHERIT_ALL = 0x01,
|
||||
/// Whether to skip any root element and flex/grid item display style
|
||||
/// fixup.
|
||||
const SKIP_ROOT_AND_ITEM_BASED_DISPLAY_FIXUP = 0x04,
|
||||
const SKIP_ROOT_AND_ITEM_BASED_DISPLAY_FIXUP = 0x02,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2033,7 +2026,6 @@ pub fn apply_declarations<'a, F, I>(device: &Device,
|
|||
|
||||
let starting_style = if !flags.contains(INHERIT_ALL) {
|
||||
ComputedValues::new(custom_properties,
|
||||
flags.contains(SHAREABLE),
|
||||
WritingMode::empty(),
|
||||
inherited_style.root_font_size,
|
||||
inherited_style.font_size_keyword,
|
||||
|
@ -2047,7 +2039,6 @@ pub fn apply_declarations<'a, F, I>(device: &Device,
|
|||
)
|
||||
} else {
|
||||
ComputedValues::new(custom_properties,
|
||||
flags.contains(SHAREABLE),
|
||||
WritingMode::empty(),
|
||||
inherited_style.root_font_size,
|
||||
inherited_style.font_size_keyword,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue