diff --git a/components/style/gecko/generated/bindings.rs b/components/style/gecko/generated/bindings.rs index 41ae49a43b1..4a06048525a 100644 --- a/components/style/gecko/generated/bindings.rs +++ b/components/style/gecko/generated/bindings.rs @@ -2866,9 +2866,6 @@ extern "C" { index: u32, name: *mut nsAString) -> bool; } -extern "C" { - pub fn Servo_GetEmptyVariables() -> *const nsStyleVariables; -} extern "C" { pub fn Gecko_CreateCSSErrorReporter(sheet: *mut ServoStyleSheet, loader: *mut Loader, uri: *mut nsIURI) diff --git a/components/style/properties/gecko.mako.rs b/components/style/properties/gecko.mako.rs index 3b92e207129..89a0514351e 100644 --- a/components/style/properties/gecko.mako.rs +++ b/components/style/properties/gecko.mako.rs @@ -19,13 +19,11 @@ use gecko_bindings::bindings::Gecko_Construct_Default_${style_struct.gecko_ffi_n use gecko_bindings::bindings::Gecko_CopyConstruct_${style_struct.gecko_ffi_name}; use gecko_bindings::bindings::Gecko_Destroy_${style_struct.gecko_ffi_name}; % endfor -use gecko_bindings::bindings::Gecko_Construct_nsStyleVariables; use gecko_bindings::bindings::Gecko_CopyCounterStyle; use gecko_bindings::bindings::Gecko_CopyCursorArrayFrom; use gecko_bindings::bindings::Gecko_CopyFontFamilyFrom; use gecko_bindings::bindings::Gecko_CopyImageValueFrom; use gecko_bindings::bindings::Gecko_CopyListStyleImageFrom; -use gecko_bindings::bindings::Gecko_Destroy_nsStyleVariables; use gecko_bindings::bindings::Gecko_EnsureImageLayersLength; use gecko_bindings::bindings::Gecko_FontFamilyList_AppendGeneric; use gecko_bindings::bindings::Gecko_FontFamilyList_AppendNamed; @@ -43,7 +41,6 @@ use gecko_bindings::bindings::{Gecko_ResetFilters, Gecko_CopyFiltersFrom}; use gecko_bindings::bindings::RawGeckoPresContextBorrowed; use gecko_bindings::structs; use gecko_bindings::structs::nsCSSPropertyID; -use gecko_bindings::structs::nsStyleVariables; use gecko_bindings::sugar::ns_style_coord::{CoordDataValue, CoordData, CoordDataMut}; use gecko::values::convert_nscolor_to_rgba; use gecko::values::convert_rgba_to_nscolor; @@ -5030,26 +5027,3 @@ ${impl_style_struct(style_struct)} <%self:raw_impl_trait style_struct="${style_struct}"> % endif % endfor - -// This is only accessed from the Gecko main thread. -static mut EMPTY_VARIABLES_STRUCT: Option = None; - -#[no_mangle] -#[allow(non_snake_case)] -pub unsafe extern "C" fn Servo_GetEmptyVariables() - -> *const nsStyleVariables { - EMPTY_VARIABLES_STRUCT.as_ref().unwrap() -} - -pub fn initialize() { - unsafe { - EMPTY_VARIABLES_STRUCT = Some(zeroed()); - Gecko_Construct_nsStyleVariables(EMPTY_VARIABLES_STRUCT.as_mut().unwrap()); - } -} - -pub fn shutdown() { - unsafe { - EMPTY_VARIABLES_STRUCT.take().as_mut().map(|v| Gecko_Destroy_nsStyleVariables(v)); - } -} diff --git a/ports/geckolib/glue.rs b/ports/geckolib/glue.rs index c9335a8663b..a92ea59a2c3 100644 --- a/ports/geckolib/glue.rs +++ b/ports/geckolib/glue.rs @@ -90,7 +90,7 @@ use style::gecko_bindings::structs::nsresult; use style::gecko_bindings::sugar::ownership::{FFIArcHelpers, HasFFI, HasArcFFI, HasBoxFFI}; use style::gecko_bindings::sugar::ownership::{HasSimpleFFI, Strong}; use style::gecko_bindings::sugar::refptr::RefPtr; -use style::gecko_properties::{self, style_structs}; +use style::gecko_properties::style_structs; use style::invalidation::element::restyle_hints::{self, RestyleHint}; use style::media_queries::{MediaList, parse_media_query_list}; use style::parallel; @@ -158,18 +158,12 @@ pub extern "C" fn Servo_Initialize(dummy_url_data: *mut URLExtraData) { parser::assert_parsing_mode_match(); traversal_flags::assert_traversal_flags_match(); - // Initialize some static data. - gecko_properties::initialize(); - // Initialize the dummy url data unsafe { DUMMY_URL_DATA = dummy_url_data; } } #[no_mangle] pub extern "C" fn Servo_Shutdown() { - // Clear some static data to avoid shutdown leaks. - gecko_properties::shutdown(); - // The dummy url will be released after shutdown, so clear the // reference to avoid use-after-free. unsafe { DUMMY_URL_DATA = ptr::null_mut(); } diff --git a/tests/unit/stylo/check_bindings.py b/tests/unit/stylo/check_bindings.py index f4cdc5b6655..b337aa7665a 100755 --- a/tests/unit/stylo/check_bindings.py +++ b/tests/unit/stylo/check_bindings.py @@ -24,10 +24,7 @@ with open(INPUT_FILE, "r") as bindings, open(OUTPUT_FILE, "w+") as tests: for line in bindings: match = pattern.search(line) - - # GetStyleVariables is a Servo_* function, but temporarily defined on - # the gecko side - if match and match.group(1) != "GetStyleVariables": + if match: tests.write(TEMPLATE.format(name=match.group(1))) tests.write("}\n")