Bug 1321754 - Part 2: Pass SheetType to Servo FFI functions that create sheets. r?xidorn draft
authorCameron McCormack <cam@mcc.id.au>
Sun, 04 Dec 2016 23:15:23 -1000
changeset 447487 0f5a206029d4e18426bd0e6fc466426efdb44cc1
parent 447486 eeb3f434dd08435c6537f490360d73e769c9dbfa
child 447488 2db2b3ab35a030626e707861361e1f843ed4242d
push id38065
push userbmo:cam@mcc.id.au
push dateMon, 05 Dec 2016 09:22:59 +0000
reviewersxidorn
bugs1321754
milestone53.0a1
Bug 1321754 - Part 2: Pass SheetType to Servo FFI functions that create sheets. r?xidorn MozReview-Commit-ID: 2xWGZCUhjVZ
layout/style/ServoBindingList.h
layout/style/ServoStyleSheet.cpp
--- a/layout/style/ServoBindingList.h
+++ b/layout/style/ServoBindingList.h
@@ -19,20 +19,20 @@
  */
 
 // Element data
 SERVO_BINDING_FUNC(Servo_Element_ClearData, void, RawGeckoElementBorrowed node)
 SERVO_BINDING_FUNC(Servo_Element_ShouldTraverse, bool, RawGeckoElementBorrowed node)
 
 // Styleset and Stylesheet management
 SERVO_BINDING_FUNC(Servo_StyleSheet_Empty, RawServoStyleSheetStrong,
-                   mozilla::css::SheetParsingMode parsing_mode)
+                   mozilla::SheetType sheet_type)
 SERVO_BINDING_FUNC(Servo_StyleSheet_FromUTF8Bytes, RawServoStyleSheetStrong,
                    const nsACString* data,
-                   mozilla::css::SheetParsingMode parsing_mode,
+                   mozilla::SheetType sheet_type,
                    const nsACString* base_url,
                    ThreadSafeURIHolder* base,
                    ThreadSafeURIHolder* referrer,
                    ThreadSafePrincipalHolder* principal)
 SERVO_BINDING_FUNC(Servo_StyleSheet_HasRules, bool,
                    RawServoStyleSheetBorrowed sheet)
 SERVO_BINDING_FUNC(Servo_StyleSheet_GetRules, ServoCssRulesStrong,
                    RawServoStyleSheetBorrowed sheet)
--- a/layout/style/ServoStyleSheet.cpp
+++ b/layout/style/ServoStyleSheet.cpp
@@ -83,26 +83,26 @@ ServoStyleSheet::ParseSheet(const nsAStr
   RefPtr<ThreadSafePrincipalHolder> principal =
     new ThreadSafePrincipalHolder(aSheetPrincipal);
 
   nsCString baseString;
   nsresult rv = aBaseURI->GetSpec(baseString);
   NS_ENSURE_SUCCESS(rv, rv);
 
   NS_ConvertUTF16toUTF8 input(aInput);
-  mSheet = Servo_StyleSheet_FromUTF8Bytes(&input, mParsingMode, &baseString,
+  mSheet = Servo_StyleSheet_FromUTF8Bytes(&input, mSheetType, &baseString,
                                           base, referrer, principal).Consume();
 
   return NS_OK;
 }
 
 void
 ServoStyleSheet::LoadFailed()
 {
-  mSheet = Servo_StyleSheet_Empty(mParsingMode).Consume();
+  mSheet = Servo_StyleSheet_Empty(mSheetType).Consume();
 }
 
 void
 ServoStyleSheet::DropSheet()
 {
   mSheet = nullptr;
 }