diff options
author | Moonchild <moonchild@palemoon.org> | 2020-10-24 10:42:23 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2020-10-24 10:42:23 +0000 |
commit | e1db27e19989db11fef70f439cf95821316535b3 (patch) | |
tree | abac2c9f5115323a8816d3ef600d8cb2bca5a33e /layout/style/nsRuleNode.cpp | |
parent | a98d06380fe706e3b1b602411c597b9882516b3e (diff) | |
parent | a5203631d8cded437c05243cde17cddeba13e3ec (diff) | |
download | UXP-e1db27e19989db11fef70f439cf95821316535b3.tar UXP-e1db27e19989db11fef70f439cf95821316535b3.tar.gz UXP-e1db27e19989db11fef70f439cf95821316535b3.tar.lz UXP-e1db27e19989db11fef70f439cf95821316535b3.tar.xz UXP-e1db27e19989db11fef70f439cf95821316535b3.zip |
Merge branch 'redwood' into releaseRELBASE_20201024RC_20201024
Diffstat (limited to 'layout/style/nsRuleNode.cpp')
-rw-r--r-- | layout/style/nsRuleNode.cpp | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/layout/style/nsRuleNode.cpp b/layout/style/nsRuleNode.cpp index 036d97f86..1136edee2 100644 --- a/layout/style/nsRuleNode.cpp +++ b/layout/style/nsRuleNode.cpp @@ -1152,13 +1152,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); } } @@ -5139,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(); @@ -5210,6 +5220,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) } |