stylo: Remove usage of ServoComputedValues from most Gecko code

This commit is contained in:
Manish Goregaokar 2017-07-20 17:27:05 -07:00 committed by Manish Goregaokar
parent 3c3e4399da
commit cca0eacf80
5 changed files with 2 additions and 23 deletions

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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)
};

View file

@ -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;
@ -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 {
@ -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.