mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
stylo: Remove usage of ServoComputedValues from most Gecko code
This commit is contained in:
parent
3c3e4399da
commit
cca0eacf80
5 changed files with 2 additions and 23 deletions
|
@ -8,7 +8,6 @@ type nsAString_internal = nsAString;
|
||||||
pub type ServoStyleContextBorrowed<'a> = &'a ::properties::ComputedValues;
|
pub type ServoStyleContextBorrowed<'a> = &'a ::properties::ComputedValues;
|
||||||
pub type ServoStyleContextBorrowedOrNull<'a> = Option<&'a ::properties::ComputedValues>;
|
pub type ServoStyleContextBorrowedOrNull<'a> = Option<&'a ::properties::ComputedValues>;
|
||||||
pub type ServoComputedValuesBorrowed<'a> = &'a ServoComputedValues;
|
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::GridTemplateAreasValue;
|
||||||
use gecko_bindings::structs::mozilla::css::ErrorReporter;
|
use gecko_bindings::structs::mozilla::css::ErrorReporter;
|
||||||
use gecko_bindings::structs::mozilla::css::ImageValue;
|
use gecko_bindings::structs::mozilla::css::ImageValue;
|
||||||
|
|
|
@ -38456,8 +38456,6 @@ pub mod root {
|
||||||
pub type ServoStyleContextBorrowedOrNull =
|
pub type ServoStyleContextBorrowedOrNull =
|
||||||
*const root::mozilla::ServoStyleContext;
|
*const root::mozilla::ServoStyleContext;
|
||||||
pub type ServoComputedValuesBorrowed = *const root::ServoComputedValues;
|
pub type ServoComputedValuesBorrowed = *const root::ServoComputedValues;
|
||||||
pub type ServoComputedValuesBorrowedOrNull =
|
|
||||||
*const root::ServoComputedValues;
|
|
||||||
pub type RawServoAnimationValueMapBorrowedMut =
|
pub type RawServoAnimationValueMapBorrowedMut =
|
||||||
*mut root::RawServoAnimationValueMap;
|
*mut root::RawServoAnimationValueMap;
|
||||||
pub type RawGeckoNodeBorrowed = *const root::RawGeckoNode;
|
pub type RawGeckoNodeBorrowed = *const root::RawGeckoNode;
|
||||||
|
|
|
@ -37765,8 +37765,6 @@ pub mod root {
|
||||||
pub type ServoStyleContextBorrowedOrNull =
|
pub type ServoStyleContextBorrowedOrNull =
|
||||||
*const root::mozilla::ServoStyleContext;
|
*const root::mozilla::ServoStyleContext;
|
||||||
pub type ServoComputedValuesBorrowed = *const root::ServoComputedValues;
|
pub type ServoComputedValuesBorrowed = *const root::ServoComputedValues;
|
||||||
pub type ServoComputedValuesBorrowedOrNull =
|
|
||||||
*const root::ServoComputedValues;
|
|
||||||
pub type RawServoAnimationValueMapBorrowedMut =
|
pub type RawServoAnimationValueMapBorrowedMut =
|
||||||
*mut root::RawServoAnimationValueMap;
|
*mut root::RawServoAnimationValueMap;
|
||||||
pub type RawGeckoNodeBorrowed = *const root::RawGeckoNode;
|
pub type RawGeckoNodeBorrowed = *const root::RawGeckoNode;
|
||||||
|
|
|
@ -53,8 +53,8 @@ impl GeckoRestyleDamage {
|
||||||
) -> StyleDifference {
|
) -> StyleDifference {
|
||||||
let mut any_style_changed: bool = false;
|
let mut any_style_changed: bool = false;
|
||||||
let hint = unsafe {
|
let hint = unsafe {
|
||||||
bindings::Gecko_CalcStyleDifference(old_style.as_style_context(),
|
bindings::Gecko_CalcStyleDifference(old_style,
|
||||||
new_style.as_style_context(),
|
new_style,
|
||||||
source.mBits,
|
source.mBits,
|
||||||
&mut any_style_changed)
|
&mut any_style_changed)
|
||||||
};
|
};
|
||||||
|
|
|
@ -39,7 +39,6 @@ use gecko_bindings::bindings::Gecko_nsStyleFont_CopyLangFrom;
|
||||||
use gecko_bindings::bindings::Gecko_SetListStyleImageNone;
|
use gecko_bindings::bindings::Gecko_SetListStyleImageNone;
|
||||||
use gecko_bindings::bindings::Gecko_SetListStyleImageImageValue;
|
use gecko_bindings::bindings::Gecko_SetListStyleImageImageValue;
|
||||||
use gecko_bindings::bindings::Gecko_SetNullImageValue;
|
use gecko_bindings::bindings::Gecko_SetNullImageValue;
|
||||||
use gecko_bindings::bindings::ServoComputedValuesBorrowedOrNull;
|
|
||||||
use gecko_bindings::bindings::{Gecko_ResetFilters, Gecko_CopyFiltersFrom};
|
use gecko_bindings::bindings::{Gecko_ResetFilters, Gecko_CopyFiltersFrom};
|
||||||
use gecko_bindings::bindings::RawGeckoPresContextBorrowed;
|
use gecko_bindings::bindings::RawGeckoPresContextBorrowed;
|
||||||
use gecko_bindings::structs;
|
use gecko_bindings::structs;
|
||||||
|
@ -137,10 +136,6 @@ impl ComputedValues {
|
||||||
let atom = Atom::from(atom);
|
let atom = Atom::from(atom);
|
||||||
PseudoElement::from_atom(&atom)
|
PseudoElement::from_atom(&atom)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn as_style_context(&self) -> &::gecko_bindings::structs::mozilla::ServoStyleContext {
|
|
||||||
&self.0
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Drop for ComputedValues {
|
impl Drop for ComputedValues {
|
||||||
|
@ -4974,23 +4969,12 @@ clip-path
|
||||||
}
|
}
|
||||||
</%self:impl_trait>
|
</%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:
|
% for style_struct in data.style_structs:
|
||||||
${declare_style_struct(style_struct)}
|
${declare_style_struct(style_struct)}
|
||||||
${impl_style_struct(style_struct)}
|
${impl_style_struct(style_struct)}
|
||||||
% if not style_struct.name in data.manual_style_structs:
|
% if not style_struct.name in data.manual_style_structs:
|
||||||
<%self:raw_impl_trait style_struct="${style_struct}"></%self:raw_impl_trait>
|
<%self:raw_impl_trait style_struct="${style_struct}"></%self:raw_impl_trait>
|
||||||
% endif
|
% endif
|
||||||
${define_ffi_struct_accessor(style_struct)}
|
|
||||||
% endfor
|
% endfor
|
||||||
|
|
||||||
// This is only accessed from the Gecko main thread.
|
// This is only accessed from the Gecko main thread.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue