diff options
Diffstat (limited to 'layout/style/nsRuleNode.cpp')
-rw-r--r-- | layout/style/nsRuleNode.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/layout/style/nsRuleNode.cpp b/layout/style/nsRuleNode.cpp index 66345390e5..1136edee22 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) } |