From 8e3832bacbbef4a549f64df5c978a5672e47ff2e Mon Sep 17 00:00:00 2001 From: athenian200 Date: Tue, 29 Sep 2020 11:31:46 -0500 Subject: 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 --- layout/generic/nsFrame.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'layout/generic/nsFrame.cpp') diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index 72923c4b7..7f67c7d68 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -1831,8 +1831,7 @@ nsIFrame::DisplayCaret(nsDisplayListBuilder* aBuilder, nscolor nsIFrame::GetCaretColorAt(int32_t aOffset) { - // Use text color. - return StyleColor()->mColor; + return StyleColor()->CalcComplexColor(StyleUserInterface()->mCaretColor); } bool -- cgit v1.2.3 From 1fc996152b7a1b0f61287c85ddc1698013ea63c0 Mon Sep 17 00:00:00 2001 From: athenian200 Date: Sun, 18 Oct 2020 10:12:53 -0500 Subject: Issue #1668 - Part 2: Visited color and auto support for caret-color property. Mozilla's original implementation of this failed a couple of tests, but this seems to solve all the problems. Basically, the caret-color wasn't able to be set differently based on whether a link was visited, and the auto value implementation was incomplete. The only test we fail now is the one where you have grey text on a grey background and the caret is supposed to be visible, but I think that may have been removed from the spec. Even if it wasn't, no other browser supports it anyway. --- layout/generic/nsFrame.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'layout/generic/nsFrame.cpp') diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index 7f67c7d68..a9e6354ab 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -1831,7 +1831,7 @@ nsIFrame::DisplayCaret(nsDisplayListBuilder* aBuilder, nscolor nsIFrame::GetCaretColorAt(int32_t aOffset) { - return StyleColor()->CalcComplexColor(StyleUserInterface()->mCaretColor); + return nsLayoutUtils::GetColor(this, eCSSProperty_caret_color); } bool -- cgit v1.2.3