summaryrefslogtreecommitdiff
path: root/layout/style/nsStyleContext.cpp
diff options
context:
space:
mode:
authorathenian200 <athenian200@outlook.com>2020-10-18 10:12:53 -0500
committerathenian200 <athenian200@outlook.com>2020-10-18 10:12:53 -0500
commit1fc996152b7a1b0f61287c85ddc1698013ea63c0 (patch)
tree1c5df7412fb07f6cff2bb5785c8663b38e5b8f64 /layout/style/nsStyleContext.cpp
parent8e3832bacbbef4a549f64df5c978a5672e47ff2e (diff)
downloaduxp-1fc996152b7a1b0f61287c85ddc1698013ea63c0.tar.gz
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.
Diffstat (limited to 'layout/style/nsStyleContext.cpp')
-rw-r--r--layout/style/nsStyleContext.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/layout/style/nsStyleContext.cpp b/layout/style/nsStyleContext.cpp
index 4b1a14897a..38b422bd73 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 ||