Skip to content

Commit

Permalink
stylo: Remove usage of ServoComputedValues from most Gecko code
Browse files Browse the repository at this point in the history
  • Loading branch information
Manishearth committed Jul 21, 2017
1 parent 3c3e439 commit cca0eac
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 23 deletions.
1 change: 0 additions & 1 deletion components/style/gecko/generated/bindings.rs
Expand Up @@ -8,7 +8,6 @@ type nsAString_internal = nsAString;
pub type ServoStyleContextBorrowed<'a> = &'a ::properties::ComputedValues;
pub type ServoStyleContextBorrowedOrNull<'a> = Option<&'a ::properties::ComputedValues>;
pub type ServoComputedValuesBorrowed<'a> = &'a ServoComputedValues;
pub type ServoComputedValuesBorrowedOrNull<'a> = Option<&'a ServoComputedValues>;
use gecko_bindings::structs::mozilla::css::GridTemplateAreasValue;
use gecko_bindings::structs::mozilla::css::ErrorReporter;
use gecko_bindings::structs::mozilla::css::ImageValue;
Expand Down
2 changes: 0 additions & 2 deletions components/style/gecko/generated/structs_debug.rs
Expand Up @@ -38456,8 +38456,6 @@ pub mod root {
pub type ServoStyleContextBorrowedOrNull =
*const root::mozilla::ServoStyleContext;
pub type ServoComputedValuesBorrowed = *const root::ServoComputedValues;
pub type ServoComputedValuesBorrowedOrNull =
*const root::ServoComputedValues;
pub type RawServoAnimationValueMapBorrowedMut =
*mut root::RawServoAnimationValueMap;
pub type RawGeckoNodeBorrowed = *const root::RawGeckoNode;
Expand Down
2 changes: 0 additions & 2 deletions components/style/gecko/generated/structs_release.rs
Expand Up @@ -37765,8 +37765,6 @@ pub mod root {
pub type ServoStyleContextBorrowedOrNull =
*const root::mozilla::ServoStyleContext;
pub type ServoComputedValuesBorrowed = *const root::ServoComputedValues;
pub type ServoComputedValuesBorrowedOrNull =
*const root::ServoComputedValues;
pub type RawServoAnimationValueMapBorrowedMut =
*mut root::RawServoAnimationValueMap;
pub type RawGeckoNodeBorrowed = *const root::RawGeckoNode;
Expand Down
4 changes: 2 additions & 2 deletions components/style/gecko/restyle_damage.rs
Expand Up @@ -53,8 +53,8 @@ impl GeckoRestyleDamage {
) -> StyleDifference {
let mut any_style_changed: bool = false;
let hint = unsafe {
bindings::Gecko_CalcStyleDifference(old_style.as_style_context(),
new_style.as_style_context(),
bindings::Gecko_CalcStyleDifference(old_style,
new_style,
source.mBits,
&mut any_style_changed)
};
Expand Down
16 changes: 0 additions & 16 deletions components/style/properties/gecko.mako.rs
Expand Up @@ -39,7 +39,6 @@ use gecko_bindings::bindings::Gecko_nsStyleFont_CopyLangFrom;
use gecko_bindings::bindings::Gecko_SetListStyleImageNone;
use gecko_bindings::bindings::Gecko_SetListStyleImageImageValue;
use gecko_bindings::bindings::Gecko_SetNullImageValue;
use gecko_bindings::bindings::ServoComputedValuesBorrowedOrNull;
use gecko_bindings::bindings::{Gecko_ResetFilters, Gecko_CopyFiltersFrom};
use gecko_bindings::bindings::RawGeckoPresContextBorrowed;
use gecko_bindings::structs;
Expand Down Expand Up @@ -137,10 +136,6 @@ impl ComputedValues {
let atom = Atom::from(atom);
PseudoElement::from_atom(&atom)
}

pub fn as_style_context(&self) -> &::gecko_bindings::structs::mozilla::ServoStyleContext {
&self.0
}
}

impl Drop for ComputedValues {
Expand Down Expand Up @@ -4974,23 +4969,12 @@ clip-path
}
</%self:impl_trait>

<%def name="define_ffi_struct_accessor(style_struct)">
#[no_mangle]
#[allow(non_snake_case, unused_variables)]
pub unsafe extern "C" fn Servo_GetStyle${style_struct.gecko_name}(computed_values:
ServoComputedValuesBorrowedOrNull) -> *const ${style_struct.gecko_ffi_name} {
computed_values.unwrap().get_${style_struct.name_lower}().get_gecko()
as *const ${style_struct.gecko_ffi_name}
}
</%def>

% for style_struct in data.style_structs:
${declare_style_struct(style_struct)}
${impl_style_struct(style_struct)}
% if not style_struct.name in data.manual_style_structs:
<%self:raw_impl_trait style_struct="${style_struct}"></%self:raw_impl_trait>
% endif
${define_ffi_struct_accessor(style_struct)}
% endfor

// This is only accessed from the Gecko main thread.
Expand Down

0 comments on commit cca0eac

Please sign in to comment.