style: Remove unused parent parameter in ComputedValues::new.

Bug: 1475229
MozReview-Commit-ID: EBG0TS7tI4P
This commit is contained in:
Xidorn Quan 2018-07-13 22:06:05 +10:00 committed by Emilio Cobos Álvarez
parent a41127152b
commit db74d0c579
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
2 changed files with 9 additions and 18 deletions

View file

@ -83,7 +83,6 @@ pub struct ComputedValues(::gecko_bindings::structs::mozilla::ComputedStyle);
impl ComputedValues {
pub fn new(
device: &Device,
parent: Option<<&ComputedValues>,
pseudo: Option<<&PseudoElement>,
custom_properties: Option<Arc<CustomPropertiesMap>>,
writing_mode: WritingMode,
@ -105,7 +104,6 @@ impl ComputedValues {
% endfor
).to_outer(
device.pres_context(),
parent,
pseudo.map(|p| p.pseudo_info())
)
}
@ -120,7 +118,7 @@ impl ComputedValues {
% for style_struct in data.style_structs:
style_structs::${style_struct.name}::default(pres_context),
% endfor
).to_outer(pres_context, None, None)
).to_outer(pres_context, None)
}
pub fn pseudo(&self) -> Option<PseudoElement> {
@ -195,7 +193,6 @@ impl Clone for ComputedValuesInner {
}
type PseudoInfo = (*mut structs::nsAtom, structs::CSSPseudoElementType);
type ParentComputedStyleInfo<'a> = Option< &'a ComputedValues>;
impl ComputedValuesInner {
pub fn new(custom_properties: Option<Arc<CustomPropertiesMap>>,
@ -222,7 +219,6 @@ impl ComputedValuesInner {
fn to_outer(
self,
pres_context: RawGeckoPresContextBorrowed,
parent: ParentComputedStyleInfo,
info: Option<PseudoInfo>
) -> Arc<ComputedValues> {
let (tag, ty) = if let Some(info) = info {
@ -231,21 +227,24 @@ impl ComputedValuesInner {
(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(
self,
pres_context: bindings::RawGeckoPresContextBorrowed,
parent: ParentComputedStyleInfo,
pseudo_ty: structs::CSSPseudoElementType,
pseudo_tag: *mut structs::nsAtom
) -> Arc<ComputedValues> {
let arc = {
let arc: Arc<ComputedValues> = Arc::new(uninitialized());
bindings::Gecko_ComputedStyle_Init(&arc.0 as *const _ as *mut _,
parent, pres_context,
&self, pseudo_ty, pseudo_tag);
bindings::Gecko_ComputedStyle_Init(
&arc.0 as *const _ as *mut _,
pres_context,
&self,
pseudo_ty,
pseudo_tag
);
// We're simulating a move by having C++ do a memcpy and then forgetting
// it on this end.
forget(self);

View file

@ -2720,7 +2720,6 @@ impl ComputedValues {
/// Create a new refcounted `ComputedValues`
pub fn new(
_: &Device,
_: Option<<&ComputedValues>,
_: Option<<&PseudoElement>,
custom_properties: Option<Arc<::custom_properties::CustomPropertiesMap>>,
writing_mode: WritingMode,
@ -3128,10 +3127,6 @@ pub struct StyleBuilder<'a> {
/// The style we're getting reset structs from.
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
/// node.
pub rules: Option<StrongRuleNode>,
@ -3199,7 +3194,6 @@ impl<'a> StyleBuilder<'a> {
StyleBuilder {
device,
parent_style,
inherited_style,
inherited_style_ignoring_first_line,
reset_style,
@ -3243,7 +3237,6 @@ impl<'a> StyleBuilder<'a> {
parent_style.unwrap().pseudo() != Some(PseudoElement::FirstLine));
StyleBuilder {
device,
parent_style,
inherited_style,
// None of our callers pass in ::first-line parent styles.
inherited_style_ignoring_first_line: inherited_style,
@ -3485,7 +3478,6 @@ impl<'a> StyleBuilder<'a> {
pub fn build(self) -> Arc<ComputedValues> {
ComputedValues::new(
self.device,
self.parent_style,
self.pseudo,
self.custom_properties,
self.writing_mode,