summaryrefslogtreecommitdiffstats
path: root/layout/style
diff options
context:
space:
mode:
Diffstat (limited to 'layout/style')
-rw-r--r--layout/style/nsRuleNode.cpp15
-rw-r--r--layout/style/nsStyleContext.cpp17
2 files changed, 25 insertions, 7 deletions
diff --git a/layout/style/nsRuleNode.cpp b/layout/style/nsRuleNode.cpp
index 66345390e..1136edee2 100644
--- a/layout/style/nsRuleNode.cpp
+++ b/layout/style/nsRuleNode.cpp
@@ -5142,6 +5142,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();
@@ -5214,12 +5221,8 @@ nsRuleNode::ComputeUserInterfaceData(void* aStartStruct,
NS_STYLE_POINTER_EVENTS_AUTO);
// caret-color: auto, color, inherit
- const nsCSSValue* caretColorValue = aRuleData->ValueForCaretColor();
- SetComplexColor<eUnsetInherit>(*caretColorValue,
- parentUI->mCaretColor,
- StyleComplexColor::Auto(),
- mPresContext,
- ui->mCaretColor, conditions);
+ setComplexColor(aRuleData->ValueForCaretColor(),
+ &nsStyleUserInterface::mCaretColor);
COMPUTE_END_INHERITED(UserInterface, ui)
}
diff --git a/layout/style/nsStyleContext.cpp b/layout/style/nsStyleContext.cpp
index 4b1a14897..38b422bd7 100644
--- a/layout/style/nsStyleContext.cpp
+++ b/layout/style/nsStyleContext.cpp
@@ -1255,6 +1255,17 @@ nsStyleContext::CalcStyleDifferenceInternal(StyleContextLike* aNewContext,
}
}
+ // NB: Calling Peek on |this|, not |thisVis| (see above).
+ if (!change && PeekStyleUserInterface()) {
+ const nsStyleUserInterface *thisVisUserInterface = thisVis->StyleUserInterface();
+ const nsStyleUserInterface *otherVisUserInterface = otherVis->StyleUserInterface();
+ if (thisVisUserInterface->mCaretColor !=
+ otherVisUserInterface->mCaretColor) {
+ change = true;
+ }
+ }
+
+
if (change) {
hint |= nsChangeHint_RepaintFrame;
}
@@ -1487,6 +1498,9 @@ ExtractColor(nsCSSPropertyID aProperty,
case StyleAnimationValue::eUnit_ComplexColor:
return Some(aStyleContext->StyleColor()->
CalcComplexColor(val.GetStyleComplexColorValue()));
+ case StyleAnimationValue::eUnit_Auto:
+ return Some(aStyleContext->StyleColor()->
+ CalcComplexColor(StyleComplexColor::Auto()));
default:
return Nothing();
}
@@ -1508,7 +1522,8 @@ static const ColorIndexSet gVisitedIndices[2] = { { 0, 0 }, { 1, 0 } };
nscolor
nsStyleContext::GetVisitedDependentColor(nsCSSPropertyID aProperty)
{
- NS_ASSERTION(aProperty == eCSSProperty_color ||
+ NS_ASSERTION(aProperty == eCSSProperty_caret_color ||
+ aProperty == eCSSProperty_color ||
aProperty == eCSSProperty_background_color ||
aProperty == eCSSProperty_border_top_color ||
aProperty == eCSSProperty_border_right_color ||