Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
style: Remove unused parent parameter in ComputedValues::new.
Bug: 1475229
MozReview-Commit-ID: EBG0TS7tI4P
  • Loading branch information
upsuper authored and emilio committed Jul 16, 2018
1 parent a411271 commit db74d0c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 18 deletions.
19 changes: 9 additions & 10 deletions components/style/properties/gecko.mako.rs
Expand Up @@ -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,
Expand All @@ -105,7 +104,6 @@ impl ComputedValues {
% endfor
).to_outer(
device.pres_context(),
parent,
pseudo.map(|p| p.pseudo_info())
)
}
Expand All @@ -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> {
Expand Down Expand Up @@ -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>>,
Expand All @@ -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 {
Expand All @@ -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);
Expand Down
8 changes: 0 additions & 8 deletions components/style/properties/properties.mako.rs
Expand Up @@ -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,
Expand Down Expand Up @@ -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>,
Expand Down Expand Up @@ -3199,7 +3194,6 @@ impl<'a> StyleBuilder<'a> {

StyleBuilder {
device,
parent_style,
inherited_style,
inherited_style_ignoring_first_line,
reset_style,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit db74d0c

Please sign in to comment.