mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-04 23:08:39 +09:00
Issue #1668 - Part 1: Implement support for caret-color property.
This CSS property allows input carets (that blinking input cursor you see in text fields), to be given a custom color. This was implemented in Firefox 53, and it was such a minor feature that no one ever missed it, but I don't see any harm in implementing this. https://bugzilla.mozilla.org/show_bug.cgi?id=1063162
This commit is contained in:
parent
e3f6690ee7
commit
33e50615d9
13 changed files with 118 additions and 11 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -5209,6 +5212,14 @@ nsRuleNode::ComputeUserInterfaceData(void* aStartStruct,
|
|||
parentUI->mPointerEvents,
|
||||
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);
|
||||
|
||||
COMPUTE_END_INHERITED(UserInterface, ui)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue