mirror of
https://github.com/servo/servo.git
synced 2025-07-03 21:43:41 +01:00
style: Remove unused parent parameter in ComputedValues::new.
Bug: 1475229 MozReview-Commit-ID: EBG0TS7tI4P
This commit is contained in:
parent
a41127152b
commit
db74d0c579
2 changed files with 9 additions and 18 deletions
|
@ -83,7 +83,6 @@ pub struct ComputedValues(::gecko_bindings::structs::mozilla::ComputedStyle);
|
||||||
impl ComputedValues {
|
impl ComputedValues {
|
||||||
pub fn new(
|
pub fn new(
|
||||||
device: &Device,
|
device: &Device,
|
||||||
parent: Option<<&ComputedValues>,
|
|
||||||
pseudo: Option<<&PseudoElement>,
|
pseudo: Option<<&PseudoElement>,
|
||||||
custom_properties: Option<Arc<CustomPropertiesMap>>,
|
custom_properties: Option<Arc<CustomPropertiesMap>>,
|
||||||
writing_mode: WritingMode,
|
writing_mode: WritingMode,
|
||||||
|
@ -105,7 +104,6 @@ impl ComputedValues {
|
||||||
% endfor
|
% endfor
|
||||||
).to_outer(
|
).to_outer(
|
||||||
device.pres_context(),
|
device.pres_context(),
|
||||||
parent,
|
|
||||||
pseudo.map(|p| p.pseudo_info())
|
pseudo.map(|p| p.pseudo_info())
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
@ -120,7 +118,7 @@ impl ComputedValues {
|
||||||
% for style_struct in data.style_structs:
|
% for style_struct in data.style_structs:
|
||||||
style_structs::${style_struct.name}::default(pres_context),
|
style_structs::${style_struct.name}::default(pres_context),
|
||||||
% endfor
|
% endfor
|
||||||
).to_outer(pres_context, None, None)
|
).to_outer(pres_context, None)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn pseudo(&self) -> Option<PseudoElement> {
|
pub fn pseudo(&self) -> Option<PseudoElement> {
|
||||||
|
@ -195,7 +193,6 @@ impl Clone for ComputedValuesInner {
|
||||||
}
|
}
|
||||||
|
|
||||||
type PseudoInfo = (*mut structs::nsAtom, structs::CSSPseudoElementType);
|
type PseudoInfo = (*mut structs::nsAtom, structs::CSSPseudoElementType);
|
||||||
type ParentComputedStyleInfo<'a> = Option< &'a ComputedValues>;
|
|
||||||
|
|
||||||
impl ComputedValuesInner {
|
impl ComputedValuesInner {
|
||||||
pub fn new(custom_properties: Option<Arc<CustomPropertiesMap>>,
|
pub fn new(custom_properties: Option<Arc<CustomPropertiesMap>>,
|
||||||
|
@ -222,7 +219,6 @@ impl ComputedValuesInner {
|
||||||
fn to_outer(
|
fn to_outer(
|
||||||
self,
|
self,
|
||||||
pres_context: RawGeckoPresContextBorrowed,
|
pres_context: RawGeckoPresContextBorrowed,
|
||||||
parent: ParentComputedStyleInfo,
|
|
||||||
info: Option<PseudoInfo>
|
info: Option<PseudoInfo>
|
||||||
) -> Arc<ComputedValues> {
|
) -> Arc<ComputedValues> {
|
||||||
let (tag, ty) = if let Some(info) = info {
|
let (tag, ty) = if let Some(info) = info {
|
||||||
|
@ -231,21 +227,24 @@ impl ComputedValuesInner {
|
||||||
(ptr::null_mut(), structs::CSSPseudoElementType::NotPseudo)
|
(ptr::null_mut(), structs::CSSPseudoElementType::NotPseudo)
|
||||||
};
|
};
|
||||||
|
|
||||||
unsafe { self.to_outer_helper(pres_context, parent, ty, tag) }
|
unsafe { self.to_outer_helper(pres_context, ty, tag) }
|
||||||
}
|
}
|
||||||
|
|
||||||
unsafe fn to_outer_helper(
|
unsafe fn to_outer_helper(
|
||||||
self,
|
self,
|
||||||
pres_context: bindings::RawGeckoPresContextBorrowed,
|
pres_context: bindings::RawGeckoPresContextBorrowed,
|
||||||
parent: ParentComputedStyleInfo,
|
|
||||||
pseudo_ty: structs::CSSPseudoElementType,
|
pseudo_ty: structs::CSSPseudoElementType,
|
||||||
pseudo_tag: *mut structs::nsAtom
|
pseudo_tag: *mut structs::nsAtom
|
||||||
) -> Arc<ComputedValues> {
|
) -> Arc<ComputedValues> {
|
||||||
let arc = {
|
let arc = {
|
||||||
let arc: Arc<ComputedValues> = Arc::new(uninitialized());
|
let arc: Arc<ComputedValues> = Arc::new(uninitialized());
|
||||||
bindings::Gecko_ComputedStyle_Init(&arc.0 as *const _ as *mut _,
|
bindings::Gecko_ComputedStyle_Init(
|
||||||
parent, pres_context,
|
&arc.0 as *const _ as *mut _,
|
||||||
&self, pseudo_ty, pseudo_tag);
|
pres_context,
|
||||||
|
&self,
|
||||||
|
pseudo_ty,
|
||||||
|
pseudo_tag
|
||||||
|
);
|
||||||
// We're simulating a move by having C++ do a memcpy and then forgetting
|
// We're simulating a move by having C++ do a memcpy and then forgetting
|
||||||
// it on this end.
|
// it on this end.
|
||||||
forget(self);
|
forget(self);
|
||||||
|
|
|
@ -2720,7 +2720,6 @@ impl ComputedValues {
|
||||||
/// Create a new refcounted `ComputedValues`
|
/// Create a new refcounted `ComputedValues`
|
||||||
pub fn new(
|
pub fn new(
|
||||||
_: &Device,
|
_: &Device,
|
||||||
_: Option<<&ComputedValues>,
|
|
||||||
_: Option<<&PseudoElement>,
|
_: Option<<&PseudoElement>,
|
||||||
custom_properties: Option<Arc<::custom_properties::CustomPropertiesMap>>,
|
custom_properties: Option<Arc<::custom_properties::CustomPropertiesMap>>,
|
||||||
writing_mode: WritingMode,
|
writing_mode: WritingMode,
|
||||||
|
@ -3128,10 +3127,6 @@ pub struct StyleBuilder<'a> {
|
||||||
/// The style we're getting reset structs from.
|
/// The style we're getting reset structs from.
|
||||||
reset_style: &'a ComputedValues,
|
reset_style: &'a ComputedValues,
|
||||||
|
|
||||||
/// The style we're inheriting from explicitly, or none if we're the root of
|
|
||||||
/// a subtree.
|
|
||||||
parent_style: Option<<&'a ComputedValues>,
|
|
||||||
|
|
||||||
/// The rule node representing the ordered list of rules matched for this
|
/// The rule node representing the ordered list of rules matched for this
|
||||||
/// node.
|
/// node.
|
||||||
pub rules: Option<StrongRuleNode>,
|
pub rules: Option<StrongRuleNode>,
|
||||||
|
@ -3199,7 +3194,6 @@ impl<'a> StyleBuilder<'a> {
|
||||||
|
|
||||||
StyleBuilder {
|
StyleBuilder {
|
||||||
device,
|
device,
|
||||||
parent_style,
|
|
||||||
inherited_style,
|
inherited_style,
|
||||||
inherited_style_ignoring_first_line,
|
inherited_style_ignoring_first_line,
|
||||||
reset_style,
|
reset_style,
|
||||||
|
@ -3243,7 +3237,6 @@ impl<'a> StyleBuilder<'a> {
|
||||||
parent_style.unwrap().pseudo() != Some(PseudoElement::FirstLine));
|
parent_style.unwrap().pseudo() != Some(PseudoElement::FirstLine));
|
||||||
StyleBuilder {
|
StyleBuilder {
|
||||||
device,
|
device,
|
||||||
parent_style,
|
|
||||||
inherited_style,
|
inherited_style,
|
||||||
// None of our callers pass in ::first-line parent styles.
|
// None of our callers pass in ::first-line parent styles.
|
||||||
inherited_style_ignoring_first_line: inherited_style,
|
inherited_style_ignoring_first_line: inherited_style,
|
||||||
|
@ -3485,7 +3478,6 @@ impl<'a> StyleBuilder<'a> {
|
||||||
pub fn build(self) -> Arc<ComputedValues> {
|
pub fn build(self) -> Arc<ComputedValues> {
|
||||||
ComputedValues::new(
|
ComputedValues::new(
|
||||||
self.device,
|
self.device,
|
||||||
self.parent_style,
|
|
||||||
self.pseudo,
|
self.pseudo,
|
||||||
self.custom_properties,
|
self.custom_properties,
|
||||||
self.writing_mode,
|
self.writing_mode,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue