mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
style: remove ComputedStyle::do_cascade_property.
It's defined to be the same in both Servo and Gecko, so it's pointless right now.
This commit is contained in:
parent
32eca899e6
commit
577bd15277
2 changed files with 50 additions and 64 deletions
|
@ -50,7 +50,6 @@ use gecko::values::GeckoStyleCoordConvertible;
|
||||||
use gecko::values::round_border_to_device_pixels;
|
use gecko::values::round_border_to_device_pixels;
|
||||||
use gecko::values::StyleCoordHelpers;
|
use gecko::values::StyleCoordHelpers;
|
||||||
use logical_geometry::WritingMode;
|
use logical_geometry::WritingMode;
|
||||||
use properties::CascadePropertyFn;
|
|
||||||
use properties::longhands;
|
use properties::longhands;
|
||||||
use std::fmt::{self, Debug};
|
use std::fmt::{self, Debug};
|
||||||
use std::mem::{transmute, zeroed};
|
use std::mem::{transmute, zeroed};
|
||||||
|
@ -146,11 +145,6 @@ impl ComputedValues {
|
||||||
set_raw_initial_values(ptr::null_mut());
|
set_raw_initial_values(ptr::null_mut());
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
|
||||||
pub fn do_cascade_property<F: FnOnce(&[CascadePropertyFn])>(f: F) {
|
|
||||||
f(&CASCADE_PROPERTY)
|
|
||||||
}
|
|
||||||
|
|
||||||
% for style_struct in data.style_structs:
|
% for style_struct in data.style_structs:
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn clone_${style_struct.name_lower}(&self) -> Arc<style_structs::${style_struct.name}> {
|
pub fn clone_${style_struct.name_lower}(&self) -> Arc<style_structs::${style_struct.name}> {
|
||||||
|
@ -2663,9 +2657,3 @@ unsafe fn raw_initial_values() -> *mut ComputedValues {
|
||||||
unsafe fn set_raw_initial_values(v: *mut ComputedValues) {
|
unsafe fn set_raw_initial_values(v: *mut ComputedValues) {
|
||||||
INITIAL_VALUES_STORAGE.store(v as usize, Ordering::Relaxed);
|
INITIAL_VALUES_STORAGE.store(v as usize, Ordering::Relaxed);
|
||||||
}
|
}
|
||||||
|
|
||||||
static CASCADE_PROPERTY: [CascadePropertyFn; ${len(data.longhands)}] = [
|
|
||||||
% for property in data.longhands:
|
|
||||||
longhands::${property.ident}::cascade_property,
|
|
||||||
% endfor
|
|
||||||
];
|
|
||||||
|
|
|
@ -1691,7 +1691,6 @@ pub fn apply_declarations<'a, F, I>(viewport_size: Size2D<Au>,
|
||||||
//
|
//
|
||||||
// To improve i-cache behavior, we outline the individual functions and use
|
// To improve i-cache behavior, we outline the individual functions and use
|
||||||
// virtual dispatch instead.
|
// virtual dispatch instead.
|
||||||
ComputedValues::do_cascade_property(|cascade_property| {
|
|
||||||
% for category_to_cascade_now in ["early", "other"]:
|
% for category_to_cascade_now in ["early", "other"]:
|
||||||
for declaration in iter_declarations() {
|
for declaration in iter_declarations() {
|
||||||
let longhand_id = match declaration.id() {
|
let longhand_id = match declaration.id() {
|
||||||
|
@ -1731,7 +1730,7 @@ pub fn apply_declarations<'a, F, I>(viewport_size: Size2D<Au>,
|
||||||
}
|
}
|
||||||
|
|
||||||
let discriminant = longhand_id as usize;
|
let discriminant = longhand_id as usize;
|
||||||
(cascade_property[discriminant])(declaration,
|
(CASCADE_PROPERTY[discriminant])(declaration,
|
||||||
inherited_style,
|
inherited_style,
|
||||||
&mut context,
|
&mut context,
|
||||||
&mut seen,
|
&mut seen,
|
||||||
|
@ -1744,7 +1743,6 @@ pub fn apply_declarations<'a, F, I>(viewport_size: Size2D<Au>,
|
||||||
context.style.set_writing_mode(mode);
|
context.style.set_writing_mode(mode);
|
||||||
% endif
|
% endif
|
||||||
% endfor
|
% endfor
|
||||||
});
|
|
||||||
|
|
||||||
let mut style = context.style;
|
let mut style = context.style;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue