summaryrefslogtreecommitdiff
path: root/layout/style/nsRuleNode.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'layout/style/nsRuleNode.cpp')
-rw-r--r--layout/style/nsRuleNode.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/layout/style/nsRuleNode.cpp b/layout/style/nsRuleNode.cpp
index fb592abdd0..c32369e9bb 100644
--- a/layout/style/nsRuleNode.cpp
+++ b/layout/style/nsRuleNode.cpp
@@ -1151,13 +1151,16 @@ SetComplexColor(const nsCSSValue& aValue,
aResult = StyleComplexColor::CurrentColor();
} else if (unit == eCSSUnit_ComplexColor) {
aResult = aValue.GetStyleComplexColorValue();
+ } else if (unit == eCSSUnit_Auto) {
+ aResult = StyleComplexColor::Auto();
} else {
+ nscolor resultColor;
if (!SetColor(aValue, aParentColor.mColor, aPresContext,
- nullptr, aResult.mColor, aConditions)) {
+ nullptr, resultColor, aConditions)) {
MOZ_ASSERT_UNREACHABLE("Unknown color value");
return;
}
- aResult.mForegroundRatio = 0;
+ aResult = StyleComplexColor::FromColor(resultColor);
}
}
@@ -5138,6 +5141,13 @@ nsRuleNode::ComputeUserInterfaceData(void* aStartStruct,
{
COMPUTE_START_INHERITED(UserInterface, ui, parentUI)
+ auto setComplexColor = [&](const nsCSSValue* aValue,
+ StyleComplexColor nsStyleUserInterface::* aField) {
+ SetComplexColor<eUnsetInherit>(*aValue, parentUI->*aField,
+ StyleComplexColor::Auto(),
+ mPresContext, ui->*aField, conditions);
+ };
+
// cursor: enum, url, inherit
const nsCSSValue* cursorValue = aRuleData->ValueForCursor();
nsCSSUnit cursorUnit = cursorValue->GetUnit();
@@ -5209,6 +5219,10 @@ nsRuleNode::ComputeUserInterfaceData(void* aStartStruct,
parentUI->mPointerEvents,
NS_STYLE_POINTER_EVENTS_AUTO);
+ // caret-color: auto, color, inherit
+ setComplexColor(aRuleData->ValueForCaretColor(),
+ &nsStyleUserInterface::mCaretColor);
+
COMPUTE_END_INHERITED(UserInterface, ui)
}