Bug 1420026 - Part 1: Add aWasCurrentColor outparam to ServoCSSParser::ComputeColor. r=TYLin

MozReview-Commit-ID: CMv0LedpEfv

--HG--
extra : rebase_source : 98a491d4a9a9b14d7364501138ca83cd9ec5821c
This commit is contained in:
Cameron McCormack 2017-11-30 17:27:18 +08:00
Родитель 544acb33d3
Коммит 8ff908d39a
3 изменённых файлов: 10 добавлений и 4 удалений

Просмотреть файл

@ -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);

Просмотреть файл

@ -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

Просмотреть файл

@ -32,12 +32,15 @@ public:
* @param aCurrentColor The color value that currentcolor should compute to.
* @param aValue The CSS <color> 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