diff --git a/dom/animation/AnimationEffect.cpp b/dom/animation/AnimationEffect.cpp index 7f961620f131..d2db86563c29 100644 --- a/dom/animation/AnimationEffect.cpp +++ b/dom/animation/AnimationEffect.cpp @@ -321,7 +321,7 @@ void AnimationEffect::GetComputedTimingAsDict( void AnimationEffect::UpdateTiming(const OptionalEffectTiming& aTiming, ErrorResult& aRv) { TimingParams timing = - TimingParams::MergeOptionalEffectTiming(mTiming, aTiming, mDocument, aRv); + TimingParams::MergeOptionalEffectTiming(mTiming, aTiming, aRv); if (aRv.Failed()) { return; } diff --git a/dom/animation/KeyframeEffect.cpp b/dom/animation/KeyframeEffect.cpp index a709705f4980..ce11a5d54d99 100644 --- a/dom/animation/KeyframeEffect.cpp +++ b/dom/animation/KeyframeEffect.cpp @@ -835,8 +835,7 @@ already_AddRefed KeyframeEffect::ConstructKeyframeEffect( return nullptr; } - TimingParams timingParams = - TimingParams::FromOptionsUnion(aOptions, doc, aRv); + TimingParams timingParams = TimingParams::FromOptionsUnion(aOptions, aRv); if (aRv.Failed()) { return nullptr; } diff --git a/dom/animation/KeyframeUtils.cpp b/dom/animation/KeyframeUtils.cpp index 1f8f4295df7e..e138a5d0c88a 100644 --- a/dom/animation/KeyframeUtils.cpp +++ b/dom/animation/KeyframeUtils.cpp @@ -444,8 +444,8 @@ static bool ConvertKeyframeSequence(JSContext* aCx, dom::Document* aDocument, } if (!parseEasingResult.Failed()) { - keyframe->mTimingFunction = TimingParams::ParseEasing( - keyframeDict.mEasing, aDocument, parseEasingResult); + keyframe->mTimingFunction = + TimingParams::ParseEasing(keyframeDict.mEasing, parseEasingResult); // Even if the above fails, we still need to continue reading off all the // properties since checking the validity of easing should be treated as // a separate step that happens *after* all the other processing in this @@ -1099,7 +1099,7 @@ static void GetKeyframeListFromPropertyIndexedKeyframe( FallibleTArray> easings; auto parseAndAppendEasing = [&](const nsString& easingString, ErrorResult& aRv) { - auto easing = TimingParams::ParseEasing(easingString, aDocument, aRv); + auto easing = TimingParams::ParseEasing(easingString, aRv); if (!aRv.Failed() && !easings.AppendElement(std::move(easing), fallible)) { aRv.Throw(NS_ERROR_OUT_OF_MEMORY); } diff --git a/dom/animation/TimingParams.cpp b/dom/animation/TimingParams.cpp index b1ef12f622d7..cc50a6920181 100644 --- a/dom/animation/TimingParams.cpp +++ b/dom/animation/TimingParams.cpp @@ -38,7 +38,6 @@ const dom::EffectTiming& GetTimingProperties( template /* static */ TimingParams TimingParams::FromOptionsType(const OptionsType& aOptions, - dom::Document* aDocument, ErrorResult& aRv) { TimingParams result; @@ -55,7 +54,7 @@ TimingParams TimingParams::FromOptionsType(const OptionsType& aOptions, result.Update(); } else { const dom::EffectTiming& timing = GetTimingProperties(aOptions); - result = FromEffectTiming(timing, aDocument, aRv); + result = FromEffectTiming(timing, aRv); } return result; @@ -64,21 +63,20 @@ TimingParams TimingParams::FromOptionsType(const OptionsType& aOptions, /* static */ TimingParams TimingParams::FromOptionsUnion( const dom::UnrestrictedDoubleOrKeyframeEffectOptions& aOptions, - dom::Document* aDocument, ErrorResult& aRv) { - return FromOptionsType(aOptions, aDocument, aRv); + ErrorResult& aRv) { + return FromOptionsType(aOptions, aRv); } /* static */ TimingParams TimingParams::FromOptionsUnion( const dom::UnrestrictedDoubleOrKeyframeAnimationOptions& aOptions, - dom::Document* aDocument, ErrorResult& aRv) { - return FromOptionsType(aOptions, aDocument, aRv); + ErrorResult& aRv) { + return FromOptionsType(aOptions, aRv); } /* static */ TimingParams TimingParams::FromEffectTiming( - const dom::EffectTiming& aEffectTiming, dom::Document* aDocument, - ErrorResult& aRv) { + const dom::EffectTiming& aEffectTiming, ErrorResult& aRv) { TimingParams result; Maybe duration = @@ -95,7 +93,7 @@ TimingParams TimingParams::FromEffectTiming( return result; } Maybe easing = - TimingParams::ParseEasing(aEffectTiming.mEasing, aDocument, aRv); + TimingParams::ParseEasing(aEffectTiming.mEasing, aRv); if (aRv.Failed()) { return result; } @@ -117,7 +115,7 @@ TimingParams TimingParams::FromEffectTiming( /* static */ TimingParams TimingParams::MergeOptionalEffectTiming( const TimingParams& aSource, const dom::OptionalEffectTiming& aEffectTiming, - dom::Document* aDocument, ErrorResult& aRv) { + ErrorResult& aRv) { MOZ_ASSERT(!aRv.Failed(), "Initially return value should be ok"); TimingParams result = aSource; @@ -150,8 +148,7 @@ TimingParams TimingParams::MergeOptionalEffectTiming( Maybe easing; if (aEffectTiming.mEasing.WasPassed()) { - easing = TimingParams::ParseEasing(aEffectTiming.mEasing.Value(), aDocument, - aRv); + easing = TimingParams::ParseEasing(aEffectTiming.mEasing.Value(), aRv); if (aRv.Failed()) { return result; } @@ -193,12 +190,9 @@ TimingParams TimingParams::MergeOptionalEffectTiming( /* static */ Maybe TimingParams::ParseEasing( - const nsAString& aEasing, dom::Document* aDocument, ErrorResult& aRv) { - MOZ_ASSERT(aDocument); - + const nsAString& aEasing, ErrorResult& aRv) { nsTimingFunction timingFunction; - RefPtr url = ServoCSSParser::GetURLExtraData(aDocument); - if (!ServoCSSParser::ParseEasing(aEasing, url, timingFunction)) { + if (!ServoCSSParser::ParseEasing(aEasing, timingFunction)) { aRv.ThrowTypeError( NS_ConvertUTF16toUTF8(aEasing)); return Nothing(); diff --git a/dom/animation/TimingParams.h b/dom/animation/TimingParams.h index 93921f683fb0..d676df28409f 100644 --- a/dom/animation/TimingParams.h +++ b/dom/animation/TimingParams.h @@ -23,7 +23,6 @@ namespace mozilla { namespace dom { -class Document; class UnrestrictedDoubleOrKeyframeEffectOptions; class UnrestrictedDoubleOrKeyframeAnimationOptions; } // namespace dom @@ -57,16 +56,14 @@ struct TimingParams { template static TimingParams FromOptionsType(const OptionsType& aOptions, - dom::Document* aDocument, ErrorResult& aRv); static TimingParams FromOptionsUnion( const dom::UnrestrictedDoubleOrKeyframeEffectOptions& aOptions, - dom::Document* aDocument, ErrorResult& aRv); + ErrorResult& aRv); static TimingParams FromOptionsUnion( const dom::UnrestrictedDoubleOrKeyframeAnimationOptions& aOptions, - dom::Document* aDocument, ErrorResult& aRv); + ErrorResult& aRv); static TimingParams FromEffectTiming(const dom::EffectTiming& aEffectTiming, - dom::Document* aDocument, ErrorResult& aRv); // Returns a copy of |aSource| where each timing property in |aSource| that // is also specified in |aEffectTiming| is replaced with the value from @@ -76,8 +73,7 @@ struct TimingParams { // true and an unmodified copy of |aSource| will be returned. static TimingParams MergeOptionalEffectTiming( const TimingParams& aSource, - const dom::OptionalEffectTiming& aEffectTiming, dom::Document* aDocument, - ErrorResult& aRv); + const dom::OptionalEffectTiming& aEffectTiming, ErrorResult& aRv); // Range-checks and validates an UnrestrictedDoubleOrString or // OwningUnrestrictedDoubleOrString object and converts to a @@ -123,7 +119,6 @@ struct TimingParams { } static Maybe ParseEasing(const nsAString& aEasing, - dom::Document* aDocument, ErrorResult& aRv); static StickyTimeDuration CalcActiveDuration( diff --git a/dom/serviceworkers/ServiceWorkerCloneData.h b/dom/serviceworkers/ServiceWorkerCloneData.h index 8532cf92231c..1adf7102a3e5 100644 --- a/dom/serviceworkers/ServiceWorkerCloneData.h +++ b/dom/serviceworkers/ServiceWorkerCloneData.h @@ -13,9 +13,9 @@ class nsISerialEventTarget; namespace mozilla { namespace ipc { - class PBackgroundChild; - class PBackgroundParent; -} // namespace ipc +class PBackgroundChild; +class PBackgroundParent; +} // namespace ipc namespace dom { diff --git a/layout/style/ServoCSSParser.cpp b/layout/style/ServoCSSParser.cpp index 258418cbc2f9..06554c5b621c 100644 --- a/layout/style/ServoCSSParser.cpp +++ b/layout/style/ServoCSSParser.cpp @@ -44,9 +44,9 @@ already_AddRefed ServoCSSParser::ParseProperty( } /* static */ -bool ServoCSSParser::ParseEasing(const nsAString& aValue, URLExtraData* aUrl, +bool ServoCSSParser::ParseEasing(const nsAString& aValue, nsTimingFunction& aResult) { - return Servo_ParseEasing(&aValue, aUrl, &aResult); + return Servo_ParseEasing(&aValue, &aResult); } /* static */ diff --git a/layout/style/ServoCSSParser.h b/layout/style/ServoCSSParser.h index b49c31ab5021..8bc2a5d869af 100644 --- a/layout/style/ServoCSSParser.h +++ b/layout/style/ServoCSSParser.h @@ -89,12 +89,10 @@ class ServoCSSParser { * Parse a animation timing function. * * @param aValue The specified value. - * @param aUrl The parser url extra data. * @param aResult The output timing function. (output) * @return Whether the value was successfully parsed. */ - static bool ParseEasing(const nsAString& aValue, URLExtraData* aUrl, - nsTimingFunction& aResult); + static bool ParseEasing(const nsAString& aValue, nsTimingFunction& aResult); /** * Parse a specified transform list into a gfx matrix. diff --git a/servo/ports/geckolib/glue.rs b/servo/ports/geckolib/glue.rs index 34a15d25e08d..076b7b4578e8 100644 --- a/servo/ports/geckolib/glue.rs +++ b/servo/ports/geckolib/glue.rs @@ -4124,16 +4124,13 @@ pub unsafe extern "C" fn Servo_ParseProperty( #[no_mangle] pub extern "C" fn Servo_ParseEasing( easing: &nsAString, - data: *mut URLExtraData, output: &mut nsTimingFunction, ) -> bool { use style::properties::longhands::transition_timing_function; - // FIXME Dummy URL data would work fine here. - let url_data = unsafe { UrlExtraData::from_ptr_ref(&data) }; let context = ParserContext::new( Origin::Author, - url_data, + unsafe { dummy_url_data() }, Some(CssRuleType::Style), ParsingMode::DEFAULT, QuirksMode::NoQuirks,