From 68d9d89340d67315fed2a863a889af45699fbbf2 Mon Sep 17 00:00:00 2001 From: Benjamin Bouvier Date: Thu, 22 Sep 2016 18:19:28 +0200 Subject: [PATCH 01/52] Bug 1300380: Fix undefined behavior under WasmTruncate functions; r=h4writer MozReview-Commit-ID: I3lbWLKHO4g --HG-- extra : rebase_source : 870752aae0022baaf9a9b31ee5e196b022fa4518 extra : histedit_source : 9353b1f4828cfd73a1102c190e090d6726aa3506 --- js/src/asmjs/WasmTypes.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/js/src/asmjs/WasmTypes.cpp b/js/src/asmjs/WasmTypes.cpp index cbbe18987534..4133d034c206 100644 --- a/js/src/asmjs/WasmTypes.cpp +++ b/js/src/asmjs/WasmTypes.cpp @@ -36,6 +36,8 @@ using namespace js; using namespace js::jit; using namespace js::wasm; +using mozilla::IsNaN; + void Val::writePayload(uint8_t* dst) const { @@ -206,11 +208,9 @@ UModI64(uint32_t x_hi, uint32_t x_lo, uint32_t y_hi, uint32_t y_lo) static int64_t TruncateDoubleToInt64(double input) { - // Note: INT64_MAX is not representable in double. It is actually INT64_MAX + 1. - // Therefore also sending the failure value. - if (input >= double(INT64_MAX)) - return 0x8000000000000000; - if (input < double(INT64_MIN)) + // Note: INT64_MAX is not representable in double. It is actually + // INT64_MAX + 1. Therefore also sending the failure value. + if (input >= double(INT64_MAX) || input < double(INT64_MIN) || IsNaN(input)) return 0x8000000000000000; return int64_t(input); } @@ -220,9 +220,7 @@ TruncateDoubleToUint64(double input) { // Note: UINT64_MAX is not representable in double. It is actually UINT64_MAX + 1. // Therefore also sending the failure value. - if (input >= double(UINT64_MAX)) - return 0x8000000000000000; - if (input <= -1.0) + if (input >= double(UINT64_MAX) || input <= -1.0 || IsNaN(input)) return 0x8000000000000000; return uint64_t(input); } From 8bd74b039eb6dd916ef7a1317324a5a161677c77 Mon Sep 17 00:00:00 2001 From: Benjamin Bouvier Date: Thu, 22 Sep 2016 18:21:36 +0200 Subject: [PATCH 02/52] Bug 1300380: Build the ARM simulator under macosx with sse2 too; r=jandem And workaround a small oversight of clang in Simulator::canonicalizeNaN(float), which does a float->double->float conversion messing up with the signal/quiet bit of NaN values. MozReview-Commit-ID: 9izzAfPpP3b --HG-- extra : rebase_source : 646603c182eee90ffa925f08cdfc4d879ab80e71 extra : amend_source : 60ee8d3e5c7053f14193dc60de87530e512e04cd extra : histedit_source : 3977dce49fdc590c6552a086bac598e8ee1e4c37 --- js/src/jit/arm/Simulator-arm.cpp | 10 ++++------ js/src/moz.build | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/js/src/jit/arm/Simulator-arm.cpp b/js/src/jit/arm/Simulator-arm.cpp index 364622790b69..9ea9bfe059ab 100644 --- a/js/src/jit/arm/Simulator-arm.cpp +++ b/js/src/jit/arm/Simulator-arm.cpp @@ -2687,17 +2687,15 @@ Simulator::softwareInterrupt(SimInstruction* instr) void Simulator::canonicalizeNaN(double* value) { - *value = !JitOptions.wasmTestMode && FPSCR_default_NaN_mode_ - ? JS::CanonicalizeNaN(*value) - : *value; + if (!JitOptions.wasmTestMode && FPSCR_default_NaN_mode_) + *value = JS::CanonicalizeNaN(*value); } void Simulator::canonicalizeNaN(float* value) { - *value = !JitOptions.wasmTestMode && FPSCR_default_NaN_mode_ - ? JS::CanonicalizeNaN(*value) - : *value; + if (!JitOptions.wasmTestMode && FPSCR_default_NaN_mode_) + *value = JS::CanonicalizeNaN(*value); } // Stop helper functions. diff --git a/js/src/moz.build b/js/src/moz.build index 6acfcbd47f72..9b36547dc261 100644 --- a/js/src/moz.build +++ b/js/src/moz.build @@ -484,7 +484,7 @@ elif CONFIG['JS_CODEGEN_ARM']: 'jit/arm/Simulator-arm.cpp' ] # Configuration used only for testing. - if CONFIG['OS_ARCH'] == 'Linux': + if CONFIG['OS_ARCH'] == 'Linux' or CONFIG['OS_ARCH'] == 'Darwin': CXXFLAGS += [ '-msse2', '-mfpmath=sse' ] elif CONFIG['OS_ARCH'] == 'Darwin': SOURCES += [ From 31ba17fbcbd678bbab6707fd7499317f9ff66288 Mon Sep 17 00:00:00 2001 From: Benjamin Bouvier Date: Mon, 26 Sep 2016 10:33:06 +0200 Subject: [PATCH 03/52] Bug 1305097: Enhance error reporting from the ToAST transformation; r=luke --- js/src/asmjs/WasmBinary.cpp | 1 + js/src/asmjs/WasmBinary.h | 2 +- js/src/asmjs/WasmBinaryToAST.cpp | 28 +++++++++++-------- js/src/asmjs/WasmBinaryToAST.h | 3 +- js/src/asmjs/WasmBinaryToExperimentalText.cpp | 3 +- .../tests/wasm/to-text-experimental.js | 2 ++ js/src/jit-test/tests/wasm/to-text.js | 2 ++ 7 files changed, 27 insertions(+), 14 deletions(-) diff --git a/js/src/asmjs/WasmBinary.cpp b/js/src/asmjs/WasmBinary.cpp index 56e3bfb15dda..a3ece8f23088 100644 --- a/js/src/asmjs/WasmBinary.cpp +++ b/js/src/asmjs/WasmBinary.cpp @@ -40,6 +40,7 @@ Decoder::fail(const char* msg, ...) { bool Decoder::fail(UniqueChars msg) { + MOZ_ASSERT(error_); UniqueChars strWithOffset(JS_smprintf("at offset %zu: %s", currentOffset(), msg.get())); if (!strWithOffset) return false; diff --git a/js/src/asmjs/WasmBinary.h b/js/src/asmjs/WasmBinary.h index 0875fe72084b..b537dccb38f7 100644 --- a/js/src/asmjs/WasmBinary.h +++ b/js/src/asmjs/WasmBinary.h @@ -770,7 +770,7 @@ class Decoder static const size_t ExprLimit = 2 * UINT8_MAX - 1; public: - Decoder(const uint8_t* begin, const uint8_t* end, UniqueChars* error = nullptr) + Decoder(const uint8_t* begin, const uint8_t* end, UniqueChars* error) : beg_(begin), end_(end), cur_(begin), diff --git a/js/src/asmjs/WasmBinaryToAST.cpp b/js/src/asmjs/WasmBinaryToAST.cpp index d1cf1a9f4c86..61f89aa9b538 100644 --- a/js/src/asmjs/WasmBinaryToAST.cpp +++ b/js/src/asmjs/WasmBinaryToAST.cpp @@ -46,16 +46,20 @@ struct AstDecodeStackItem ExprType type; explicit AstDecodeStackItem() - : expr(nullptr), - terminationKind(AstDecodeTerminationKind::Unknown), - type(ExprType::Limit) {} - explicit AstDecodeStackItem(AstDecodeTerminationKind terminationKind, - ExprType type) - : expr(nullptr), terminationKind(terminationKind), type(type) {} + : expr(nullptr), + terminationKind(AstDecodeTerminationKind::Unknown), + type(ExprType::Limit) + {} + explicit AstDecodeStackItem(AstDecodeTerminationKind terminationKind, ExprType type) + : expr(nullptr), + terminationKind(terminationKind), + type(type) + {} explicit AstDecodeStackItem(AstExpr* expr) - : expr(expr), - terminationKind(AstDecodeTerminationKind::Unknown), - type(ExprType::Limit) {} + : expr(expr), + terminationKind(AstDecodeTerminationKind::Unknown), + type(ExprType::Limit) + {} }; // We don't define a Value type because ExprIter doesn't push void values, which @@ -97,7 +101,8 @@ class AstDecodeContext ExprType retType_; public: - AstDecodeContext(JSContext* cx, LifoAlloc& lifo, Decoder& d, AstModule& module, bool generateNames) + AstDecodeContext(JSContext* cx, LifoAlloc& lifo, Decoder& d, AstModule& module, + bool generateNames) : cx(cx), lifo(lifo), d(d), @@ -1469,7 +1474,6 @@ AstDecodeFunctionSection(AstDecodeContext& c) if (numDecls > MaxFuncs) return c.d.fail("too many functions"); - if (!c.funcSigs().resize(numDecls)) return false; @@ -2147,6 +2151,8 @@ wasm::BinaryToAst(JSContext* cx, const uint8_t* bytes, uint32_t length, return false; } + MOZ_ASSERT(!error, "unreported error in decoding"); + *module = result; return true; } diff --git a/js/src/asmjs/WasmBinaryToAST.h b/js/src/asmjs/WasmBinaryToAST.h index 8994f1c30b7d..79607d97ba33 100644 --- a/js/src/asmjs/WasmBinaryToAST.h +++ b/js/src/asmjs/WasmBinaryToAST.h @@ -28,7 +28,8 @@ namespace js { namespace wasm { bool -BinaryToAst(JSContext* cx, const uint8_t* bytes, uint32_t length, LifoAlloc& lifo, AstModule** module); +BinaryToAst(JSContext* cx, const uint8_t* bytes, uint32_t length, LifoAlloc& lifo, + AstModule** module); } // end wasm namespace } // end js namespace diff --git a/js/src/asmjs/WasmBinaryToExperimentalText.cpp b/js/src/asmjs/WasmBinaryToExperimentalText.cpp index a78aa51dbcf2..07083ee6153e 100644 --- a/js/src/asmjs/WasmBinaryToExperimentalText.cpp +++ b/js/src/asmjs/WasmBinaryToExperimentalText.cpp @@ -129,7 +129,8 @@ struct WasmPrintContext uint32_t currentFuncIndex; PrintOperatorPrecedence currentPrecedence; - WasmPrintContext(JSContext* cx, AstModule* module, WasmPrintBuffer& buffer, const ExperimentalTextFormatting& f, GeneratedSourceMap* wasmSourceMap_) + WasmPrintContext(JSContext* cx, AstModule* module, WasmPrintBuffer& buffer, + const ExperimentalTextFormatting& f, GeneratedSourceMap* wasmSourceMap_) : cx(cx), module(module), buffer(buffer), diff --git a/js/src/jit-test/tests/wasm/to-text-experimental.js b/js/src/jit-test/tests/wasm/to-text-experimental.js index 06967bfc819c..6b90435659d8 100644 --- a/js/src/jit-test/tests/wasm/to-text-experimental.js +++ b/js/src/jit-test/tests/wasm/to-text-experimental.js @@ -1,6 +1,8 @@ // |jit-test| test-also-wasm-baseline load(libdir + "wasm.js"); +assertErrorMessage(() => wasmBinaryToText(wasmTextToBinary(`(module (func (result i32) (f32.const 13.37)))`), 'experimental'), WebAssembly.CompileError, /type mismatch/); + function runTest(code, expected) { var binary = wasmTextToBinary(code); var s = wasmBinaryToText(binary, "experimental"); diff --git a/js/src/jit-test/tests/wasm/to-text.js b/js/src/jit-test/tests/wasm/to-text.js index 0caa61ca44e1..706ed1900383 100644 --- a/js/src/jit-test/tests/wasm/to-text.js +++ b/js/src/jit-test/tests/wasm/to-text.js @@ -9,6 +9,8 @@ try { } assertEq(caught, true); +assertErrorMessage(() => wasmBinaryToText(wasmTextToBinary(`(module (func (result i32) (f32.const 13.37)))`)), WebAssembly.CompileError, /type mismatch/); + function runTest(code) { var expected = wasmTextToBinary(code); var s = wasmBinaryToText(expected); From 2c4a3e97687e421d651a8ec5f3a4bf250fb275b6 Mon Sep 17 00:00:00 2001 From: Edwin Flores Date: Mon, 26 Sep 2016 09:54:13 +0100 Subject: [PATCH 04/52] Bug 1304704 - Add fudge factor to asserts in ClampColorStops() - r=mstange --- layout/base/nsCSSRendering.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/layout/base/nsCSSRendering.cpp b/layout/base/nsCSSRendering.cpp index a05631e0e531..586e07f74dbb 100644 --- a/layout/base/nsCSSRendering.cpp +++ b/layout/base/nsCSSRendering.cpp @@ -2583,8 +2583,8 @@ ClampColorStops(nsTArray& aStops) } } - MOZ_ASSERT(aStops[0].mPosition >= 0); - MOZ_ASSERT(aStops.LastElement().mPosition <= 1); + MOZ_ASSERT(aStops[0].mPosition >= -1e6); + MOZ_ASSERT(aStops.LastElement().mPosition - 1 <= 1e6); // The end points won't exist yet if they don't fall in the original range of // |aStops|. Create them if needed. From e8488364fed15f02c9a62f005196da182d395f12 Mon Sep 17 00:00:00 2001 From: Xidorn Quan Date: Mon, 26 Sep 2016 22:03:25 +1000 Subject: [PATCH 05/52] Bug 1304302 part 1 - Add const version of AsGecko/AsServo to StyleSheet. r=heycam MozReview-Commit-ID: LGQQjmkTWsO --HG-- extra : source : 337342b3376bdaff444ed1c3887d8eee80cfa9ee --- layout/style/StyleSheet.h | 2 ++ layout/style/StyleSheetInlines.h | 14 ++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/layout/style/StyleSheet.h b/layout/style/StyleSheet.h index 53fe13fefd24..d7955998ee30 100644 --- a/layout/style/StyleSheet.h +++ b/layout/style/StyleSheet.h @@ -72,6 +72,8 @@ public: inline CSSStyleSheet& AsGecko(); inline ServoStyleSheet& AsServo(); inline StyleSheetHandle AsHandle(); + inline const CSSStyleSheet& AsGecko() const; + inline const ServoStyleSheet& AsServo() const; protected: nsIDocument* mDocument; // weak ref; parents maintain this for their children diff --git a/layout/style/StyleSheetInlines.h b/layout/style/StyleSheetInlines.h index 417ea6bd5888..08f95999841e 100644 --- a/layout/style/StyleSheetInlines.h +++ b/layout/style/StyleSheetInlines.h @@ -35,6 +35,20 @@ StyleSheet::AsHandle() return &AsGecko(); } +const CSSStyleSheet& +StyleSheet::AsGecko() const +{ + MOZ_ASSERT(IsGecko()); + return *static_cast(this); +} + +const ServoStyleSheet& +StyleSheet::AsServo() const +{ + MOZ_ASSERT(IsServo()); + return *static_cast(this); +} + } #endif // mozilla_StyleSheetInlines_h From e981c7e9be0258c803a01ac10ec6a878d7de34bc Mon Sep 17 00:00:00 2001 From: Xidorn Quan Date: Mon, 26 Sep 2016 22:03:25 +1000 Subject: [PATCH 06/52] Bug 1304302 part 2 - Some small fixes. r=heycam MozReview-Commit-ID: 7rnl4wkMorC --HG-- extra : source : d3319119916b7ca8e36627cc086150f799481d97 --- layout/style/Loader.cpp | 2 +- layout/style/ServoStyleSheet.cpp | 2 +- layout/style/StyleSheetHandleInlines.h | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/layout/style/Loader.cpp b/layout/style/Loader.cpp index 1240a29daf16..9e956768f15f 100644 --- a/layout/style/Loader.cpp +++ b/layout/style/Loader.cpp @@ -1121,7 +1121,7 @@ Loader::CreateSheet(nsIURI* aURI, // Then our per-document complete sheets. URIPrincipalReferrerPolicyAndCORSModeHashKey key(aURI, aLoaderPrincipal, aCORSMode, aReferrerPolicy); - StyleSheetHandle completeSheet; + StyleSheetHandle completeSheet = nullptr; mSheets->mCompleteSheets.Get(&key, &completeSheet); sheet = completeSheet; LOG((" From completed: %p", sheet->AsVoidPtr())); diff --git a/layout/style/ServoStyleSheet.cpp b/layout/style/ServoStyleSheet.cpp index 852d406e7718..ddbf93b80dcd 100644 --- a/layout/style/ServoStyleSheet.cpp +++ b/layout/style/ServoStyleSheet.cpp @@ -32,7 +32,7 @@ ServoStyleSheet::IsApplicable() const bool ServoStyleSheet::HasRules() const { - return Servo_StyleSheet_HasRules(RawSheet()); + return mSheet && Servo_StyleSheet_HasRules(mSheet); } nsIDocument* diff --git a/layout/style/StyleSheetHandleInlines.h b/layout/style/StyleSheetHandleInlines.h index b6339a92356f..6515c0e3f384 100644 --- a/layout/style/StyleSheetHandleInlines.h +++ b/layout/style/StyleSheetHandleInlines.h @@ -171,6 +171,7 @@ StyleSheetHandle::Ptr::List(FILE* aOut, int32_t aIndex) const #endif #undef FORWARD +#undef FORWARD_CONCRETE inline void ImplCycleCollectionTraverse(nsCycleCollectionTraversalCallback& aCallback, From 17e476532e17fc84dd7f2e8dc7256be39b5b7eba Mon Sep 17 00:00:00 2001 From: Xidorn Quan Date: Mon, 26 Sep 2016 22:03:25 +1000 Subject: [PATCH 07/52] Bug 1304302 part 3 - Use ServoStyleSheet* instead of Handle in ServoStyleSheet. r=heycam MozReview-Commit-ID: WV8eRxSOnp --HG-- extra : source : 1d1c23f2cf6dbc2a3fbfa8a74b401c8464e113cf --- layout/style/ServoStyleSheet.cpp | 4 ++-- layout/style/ServoStyleSheet.h | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/layout/style/ServoStyleSheet.cpp b/layout/style/ServoStyleSheet.cpp index ddbf93b80dcd..07d39e19ae15 100644 --- a/layout/style/ServoStyleSheet.cpp +++ b/layout/style/ServoStyleSheet.cpp @@ -50,7 +50,7 @@ ServoStyleSheet::SetOwningDocument(nsIDocument* aDocument) mDocument = aDocument; } -StyleSheetHandle +ServoStyleSheet* ServoStyleSheet::GetParentSheet() const { // XXXheycam: When we implement support for child sheets, we'll have @@ -60,7 +60,7 @@ ServoStyleSheet::GetParentSheet() const } void -ServoStyleSheet::AppendStyleSheet(StyleSheetHandle aSheet) +ServoStyleSheet::AppendStyleSheet(ServoStyleSheet* aSheet) { // XXXheycam: When we implement support for child sheets, we'll have // to fix SetOwningDocument to propagate the owning document down diff --git a/layout/style/ServoStyleSheet.h b/layout/style/ServoStyleSheet.h index 04e7ce47ed6c..a32e1f111834 100644 --- a/layout/style/ServoStyleSheet.h +++ b/layout/style/ServoStyleSheet.h @@ -11,7 +11,6 @@ #include "mozilla/RefPtr.h" #include "mozilla/ServoBindingHelpers.h" #include "mozilla/StyleSheet.h" -#include "mozilla/StyleSheetHandle.h" #include "mozilla/StyleSheetInfo.h" #include "nsStringFwd.h" @@ -37,8 +36,8 @@ public: nsIDocument* GetOwningDocument() const; void SetOwningDocument(nsIDocument* aDocument); - StyleSheetHandle GetParentSheet() const; - void AppendStyleSheet(StyleSheetHandle aSheet); + ServoStyleSheet* GetParentSheet() const; + void AppendStyleSheet(ServoStyleSheet* aSheet); MOZ_MUST_USE nsresult ParseSheet(const nsAString& aInput, nsIURI* aSheetURI, From 4d65721d5983f7d2309e834dfcb478e6cd4ea905 Mon Sep 17 00:00:00 2001 From: Xidorn Quan Date: Mon, 26 Sep 2016 22:03:25 +1000 Subject: [PATCH 08/52] Bug 1304302 part 4 - Add all methods StyleSheetHandle needs to StyleSheet. r=heycam The methods are written in the same order as in StyleSheetHandle::Ptr. MozReview-Commit-ID: 6b4311ailNj --HG-- extra : source : 9cea4a56fc487dd21a8739d4d9be8f01d5fdc93c --- layout/style/CSSStyleSheet.cpp | 39 -------- layout/style/CSSStyleSheet.h | 46 +--------- layout/style/ServoStyleSheet.cpp | 12 --- layout/style/ServoStyleSheet.h | 2 - layout/style/StyleSheet.h | 59 +++++++++++- layout/style/StyleSheetInfo.cpp | 25 ------ layout/style/StyleSheetInfo.h | 18 +--- layout/style/StyleSheetInlines.h | 148 +++++++++++++++++++++++++++++++ 8 files changed, 208 insertions(+), 141 deletions(-) diff --git a/layout/style/CSSStyleSheet.cpp b/layout/style/CSSStyleSheet.cpp index 8acbc4f3c6b9..391d13105397 100644 --- a/layout/style/CSSStyleSheet.cpp +++ b/layout/style/CSSStyleSheet.cpp @@ -1323,33 +1323,6 @@ CSSStyleSheet::DropStyleSet(nsStyleSet* aStyleSet) NS_ASSERTION(found, "didn't find style set"); } -void -CSSStyleSheet::SetURIs(nsIURI* aSheetURI, nsIURI* aOriginalSheetURI, - nsIURI* aBaseURI) -{ - NS_ASSERTION(mInner->mOrderedRules.Count() == 0 && !mInner->mComplete, - "Can't call SetURIs on sheets that are complete or have rules"); - mInner->SetURIs(aSheetURI, aOriginalSheetURI, aBaseURI); -} - -void -CSSStyleSheet::SetPrincipal(nsIPrincipal* aPrincipal) -{ - mInner->SetPrincipal(aPrincipal); -} - -nsIURI* -CSSStyleSheet::GetSheetURI() const -{ - return mInner->mSheetURI; -} - -nsIURI* -CSSStyleSheet::GetBaseURI() const -{ - return mInner->mBaseURI; -} - void CSSStyleSheet::GetType(nsString& aType) const { @@ -1379,12 +1352,6 @@ CSSStyleSheet::HasRules() const return StyleRuleCount() != 0; } -bool -CSSStyleSheet::IsApplicable() const -{ - return !mDisabled && mInner->mComplete; -} - void CSSStyleSheet::SetEnabled(bool aEnabled) { @@ -1407,12 +1374,6 @@ CSSStyleSheet::GetParentSheet() const return mParent; } -nsIDocument* -CSSStyleSheet::GetOwningDocument() const -{ - return mDocument; -} - void CSSStyleSheet::SetOwningDocument(nsIDocument* aDocument) { // not ref counted diff --git a/layout/style/CSSStyleSheet.h b/layout/style/CSSStyleSheet.h index 14a308c0e44e..24e68f4ed35a 100644 --- a/layout/style/CSSStyleSheet.h +++ b/layout/style/CSSStyleSheet.h @@ -125,20 +125,10 @@ public: NS_DECLARE_STATIC_IID_ACCESSOR(NS_CSS_STYLE_SHEET_IMPL_CID) - nsIURI* GetSheetURI() const; - nsIURI* GetBaseURI() const; void GetTitle(nsString& aTitle) const; void GetType(nsString& aType) const; bool HasRules() const; - /** - * Whether the sheet is applicable. A sheet that is not applicable - * should never be inserted into a style set. A sheet may not be - * applicable for a variety of reasons including being disabled and - * being incomplete. - */ - bool IsApplicable() const; - /** * Set the stylesheet to be enabled. This may or may not make it * applicable. Note that this WILL inform the sheet's document of @@ -152,7 +142,6 @@ public: // style sheet owner info CSSStyleSheet* GetParentSheet() const; // may be null - nsIDocument* GetOwningDocument() const; // may be null void SetOwningDocument(nsIDocument* aDocument); // Find the ID of the owner inner window. @@ -172,23 +161,6 @@ public: nsresult DeleteRuleFromGroup(css::GroupRule* aGroup, uint32_t aIndex); nsresult InsertRuleIntoGroup(const nsAString& aRule, css::GroupRule* aGroup, uint32_t aIndex, uint32_t* _retval); - /** - * SetURIs must be called on all sheets before parsing into them. - * SetURIs may only be called while the sheet is 1) incomplete and 2) - * has no rules in it - */ - void SetURIs(nsIURI* aSheetURI, nsIURI* aOriginalSheetURI, nsIURI* aBaseURI); - - /** - * SetPrincipal should be called on all sheets before parsing into them. - * This can only be called once with a non-null principal. Calling this with - * a null pointer is allowed and is treated as a no-op. - */ - void SetPrincipal(nsIPrincipal* aPrincipal); - - // Principal() never returns a null pointer. - nsIPrincipal* Principal() const { return mInner->mPrincipal; } - void SetTitle(const nsAString& aTitle) { mTitle = aTitle; } void SetMedia(nsMediaList* aMedia); @@ -222,13 +194,6 @@ public: nsresult InsertRuleInternal(const nsAString& aRule, uint32_t aIndex, uint32_t* aReturn); - /* Get the URI this sheet was originally loaded from, if any. Can - return null */ - nsIURI* GetOriginalURI() const { return mInner->mOriginalSheetURI; } - - // Whether the sheet is for an inline