From dbb638e4f9fbe3b726b67c9dc4f5944c676ae15b Mon Sep 17 00:00:00 2001 From: Brad Werth Date: Wed, 10 May 2017 11:13:05 -0700 Subject: [PATCH] Bug 1363572 Part 1: Servo-side change stylesheet_set entry unique_id to u64. MozReview-Commit-ID: 2QZGCbN9xc8 --- components/style/gecko/generated/bindings.rs | 10 +++++----- components/style/stylesheet_set.rs | 14 +++++++------- ports/geckolib/glue.rs | 10 +++++----- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/components/style/gecko/generated/bindings.rs b/components/style/gecko/generated/bindings.rs index c365ff677a1..7d0522b4e30 100644 --- a/components/style/gecko/generated/bindings.rs +++ b/components/style/gecko/generated/bindings.rs @@ -1638,24 +1638,24 @@ extern "C" { extern "C" { pub fn Servo_StyleSet_AppendStyleSheet(set: RawServoStyleSetBorrowed, sheet: RawServoStyleSheetBorrowed, - unique_id: u32); + unique_id: u64); } extern "C" { pub fn Servo_StyleSet_PrependStyleSheet(set: RawServoStyleSetBorrowed, sheet: RawServoStyleSheetBorrowed, - unique_id: u32); + unique_id: u64); } extern "C" { pub fn Servo_StyleSet_RemoveStyleSheet(set: RawServoStyleSetBorrowed, - unique_id: u32); + unique_id: u64); } extern "C" { pub fn Servo_StyleSet_InsertStyleSheetBefore(set: RawServoStyleSetBorrowed, sheet: RawServoStyleSheetBorrowed, - unique_id: u32, - before_unique_id: u32); + unique_id: u64, + before_unique_id: u64); } extern "C" { pub fn Servo_StyleSet_FlushStyleSheets(set: RawServoStyleSetBorrowed); diff --git a/components/style/stylesheet_set.rs b/components/style/stylesheet_set.rs index da4e75e5eca..c21084892a7 100644 --- a/components/style/stylesheet_set.rs +++ b/components/style/stylesheet_set.rs @@ -11,7 +11,7 @@ use stylesheets::Stylesheet; /// Entry for a StylesheetSet. We don't bother creating a constructor, because /// there's no sensible defaults for the member variables. pub struct StylesheetSetEntry { - unique_id: u32, + unique_id: u64, sheet: Arc, } @@ -58,13 +58,13 @@ impl StylesheetSet { self.author_style_disabled } - fn remove_stylesheet_if_present(&mut self, unique_id: u32) { + fn remove_stylesheet_if_present(&mut self, unique_id: u64) { self.entries.retain(|x| x.unique_id != unique_id); } /// Appends a new stylesheet to the current set. pub fn append_stylesheet(&mut self, sheet: &Arc, - unique_id: u32) { + unique_id: u64) { self.remove_stylesheet_if_present(unique_id); self.entries.push(StylesheetSetEntry { unique_id: unique_id, @@ -75,7 +75,7 @@ impl StylesheetSet { /// Prepend a new stylesheet to the current set. pub fn prepend_stylesheet(&mut self, sheet: &Arc, - unique_id: u32) { + unique_id: u64) { self.remove_stylesheet_if_present(unique_id); self.entries.insert(0, StylesheetSetEntry { unique_id: unique_id, @@ -87,8 +87,8 @@ impl StylesheetSet { /// Insert a given stylesheet before another stylesheet in the document. pub fn insert_stylesheet_before(&mut self, sheet: &Arc, - unique_id: u32, - before_unique_id: u32) { + unique_id: u64, + before_unique_id: u64) { self.remove_stylesheet_if_present(unique_id); let index = self.entries.iter().position(|x| { x.unique_id == before_unique_id @@ -101,7 +101,7 @@ impl StylesheetSet { } /// Remove a given stylesheet from the set. - pub fn remove_stylesheet(&mut self, unique_id: u32) { + pub fn remove_stylesheet(&mut self, unique_id: u64) { self.remove_stylesheet_if_present(unique_id); self.dirty = true; } diff --git a/ports/geckolib/glue.rs b/ports/geckolib/glue.rs index 0b209849aae..10342a17164 100644 --- a/ports/geckolib/glue.rs +++ b/ports/geckolib/glue.rs @@ -615,7 +615,7 @@ pub extern "C" fn Servo_StyleSheet_ClearAndUpdate(stylesheet: RawServoStyleSheet #[no_mangle] pub extern "C" fn Servo_StyleSet_AppendStyleSheet(raw_data: RawServoStyleSetBorrowed, raw_sheet: RawServoStyleSheetBorrowed, - unique_id: u32) { + unique_id: u64) { let mut data = PerDocumentStyleData::from_ffi(raw_data).borrow_mut(); let sheet = HasArcFFI::as_arc(&raw_sheet); data.stylesheets.append_stylesheet(sheet, unique_id); @@ -625,7 +625,7 @@ pub extern "C" fn Servo_StyleSet_AppendStyleSheet(raw_data: RawServoStyleSetBorr #[no_mangle] pub extern "C" fn Servo_StyleSet_PrependStyleSheet(raw_data: RawServoStyleSetBorrowed, raw_sheet: RawServoStyleSheetBorrowed, - unique_id: u32) { + unique_id: u64) { let mut data = PerDocumentStyleData::from_ffi(raw_data).borrow_mut(); let sheet = HasArcFFI::as_arc(&raw_sheet); data.stylesheets.prepend_stylesheet(sheet, unique_id); @@ -635,8 +635,8 @@ pub extern "C" fn Servo_StyleSet_PrependStyleSheet(raw_data: RawServoStyleSetBor #[no_mangle] pub extern "C" fn Servo_StyleSet_InsertStyleSheetBefore(raw_data: RawServoStyleSetBorrowed, raw_sheet: RawServoStyleSheetBorrowed, - unique_id: u32, - before_unique_id: u32) { + unique_id: u64, + before_unique_id: u64) { let mut data = PerDocumentStyleData::from_ffi(raw_data).borrow_mut(); let sheet = HasArcFFI::as_arc(&raw_sheet); data.stylesheets.insert_stylesheet_before(sheet, unique_id, before_unique_id); @@ -645,7 +645,7 @@ pub extern "C" fn Servo_StyleSet_InsertStyleSheetBefore(raw_data: RawServoStyleS #[no_mangle] pub extern "C" fn Servo_StyleSet_RemoveStyleSheet(raw_data: RawServoStyleSetBorrowed, - unique_id: u32) { + unique_id: u64) { let mut data = PerDocumentStyleData::from_ffi(raw_data).borrow_mut(); data.stylesheets.remove_stylesheet(unique_id); data.clear_stylist();