diff --git a/layout/style/ServoBindingList.h b/layout/style/ServoBindingList.h index 445b3c527e06..db33bd534f53 100644 --- a/layout/style/ServoBindingList.h +++ b/layout/style/ServoBindingList.h @@ -744,7 +744,8 @@ SERVO_BINDING_FUNC(Servo_ComputeColor, bool, RawServoStyleSetBorrowedOrNull set, nscolor current_color, const nsAString* value, - nscolor* result_color); + nscolor* result_color, + bool* was_current_color); SERVO_BINDING_FUNC(Servo_ParseIntersectionObserverRootMargin, bool, const nsAString* value, nsCSSRect* result); diff --git a/layout/style/ServoCSSParser.cpp b/layout/style/ServoCSSParser.cpp index 8bb9ae548fc4..b6004319394d 100644 --- a/layout/style/ServoCSSParser.cpp +++ b/layout/style/ServoCSSParser.cpp @@ -20,10 +20,12 @@ ServoCSSParser::IsValidCSSColor(const nsAString& aValue) ServoCSSParser::ComputeColor(ServoStyleSet* aStyleSet, nscolor aCurrentColor, const nsAString& aValue, - nscolor* aResultColor) + nscolor* aResultColor, + bool* aWasCurrentColor) { return Servo_ComputeColor(aStyleSet ? aStyleSet->RawSet() : nullptr, - aCurrentColor, &aValue, aResultColor); + aCurrentColor, &aValue, aResultColor, + aWasCurrentColor); } /* static */ bool diff --git a/layout/style/ServoCSSParser.h b/layout/style/ServoCSSParser.h index d846dfe5a75a..e3899889c6a0 100644 --- a/layout/style/ServoCSSParser.h +++ b/layout/style/ServoCSSParser.h @@ -32,12 +32,15 @@ public: * @param aCurrentColor The color value that currentcolor should compute to. * @param aValue The CSS value. * @param aResultColor The resulting computed color value. + * @param aWasCurrentColor Whether aValue was currentcolor. Can be nullptr + * if the caller doesn't care. * @return Whether aValue was successfully parsed and aResultColor was set. */ static bool ComputeColor(ServoStyleSet* aStyleSet, nscolor aCurrentColor, const nsAString& aValue, - nscolor* aResultColor); + nscolor* aResultColor, + bool* aWasCurrentColor = nullptr); /** * Parses a IntersectionObserver's initialization dictionary's rootMargin