Apply CSS Animations on color properties to visited and unvisited link computed styles

We must apply color animations to both the visited and unvisited
computed style colors when inside links as the animation must apply
in either case.

BUG=506898

Review URL: https://codereview.chromium.org/1312983003

git-svn-id: svn://svn.chromium.org/blink/trunk@201185 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent ec9c4388
<!DOCTYPE html>
<style>
a {
border: solid;
outline: solid;
background-color: rgba(0, 128, 0, 0.5);
border-color: green;
color: green;
fill: rgba(0, 128, 0, 0.5);
outline-color: green;
stroke: green;
text-decoration-color: green;
}
</style>
<a id="visited" href="">
This should be completely green.
<svg width="14" height="14">
<rect x="2" y="2" width="10" height="10" stroke-width="4"></rect>
</svg>
</a>
<br>
<br>
<a id="unvisited" href="#">
This should also be completely green.
<svg width="14" height="14">
<rect x="2" y="2" width="10" height="10" stroke-width="4"></rect>
</svg>
</a>
<!DOCTYPE html>
<style>
@keyframes test {
from {
background-color: rgba(0, 128, 0, 0.5);
border-color: green;
color: green;
fill: rgba(0, 128, 0, 0.5);
outline-color: green;
stroke: green;
text-decoration-color: green;
}
}
a {
animation-name: test;
animation-delay: 1e10s;
animation-duration: 1s;
animation-fill-mode: both;
border: solid;
outline: solid;
background-color: rgba(128, 0, 0, 0.5);
border-color: red;
color: red;
fill: rgba(128, 0, 0, 0.5);
outline-color: red;
stroke: red;
text-decoration-color: red;
}
</style>
<a id="visited" href="">
This should be completely green.
<svg width="14" height="14">
<rect x="2" y="2" width="10" height="10" stroke-width="4"></rect>
</svg>
</a>
<br>
<br>
<a id="unvisited" href="#">
This should also be completely green.
<svg width="14" height="14">
<rect x="2" y="2" width="10" height="10" stroke-width="4"></rect>
</svg>
</a>
...@@ -979,6 +979,11 @@ bool StyleResolver::applyAnimatedProperties(StyleResolverState& state, const Ele ...@@ -979,6 +979,11 @@ bool StyleResolver::applyAnimatedProperties(StyleResolverState& state, const Ele
if (state.animationUpdate().isEmpty()) if (state.animationUpdate().isEmpty())
return false; return false;
if (state.style()->insideLink() != NotInsideLink) {
ASSERT(state.applyPropertyToRegularStyle());
state.setApplyPropertyToVisitedLinkStyle(true);
}
const ActiveInterpolationMap& activeInterpolationsForAnimations = state.animationUpdate().activeInterpolationsForAnimations(); const ActiveInterpolationMap& activeInterpolationsForAnimations = state.animationUpdate().activeInterpolationsForAnimations();
const ActiveInterpolationMap& activeInterpolationsForTransitions = state.animationUpdate().activeInterpolationsForTransitions(); const ActiveInterpolationMap& activeInterpolationsForTransitions = state.animationUpdate().activeInterpolationsForTransitions();
applyAnimatedProperties<HighPropertyPriority>(state, activeInterpolationsForAnimations); applyAnimatedProperties<HighPropertyPriority>(state, activeInterpolationsForAnimations);
...@@ -994,6 +999,8 @@ bool StyleResolver::applyAnimatedProperties(StyleResolverState& state, const Ele ...@@ -994,6 +999,8 @@ bool StyleResolver::applyAnimatedProperties(StyleResolverState& state, const Ele
ASSERT(!state.fontBuilder().fontDirty()); ASSERT(!state.fontBuilder().fontDirty());
state.setApplyPropertyToVisitedLinkStyle(false);
return true; return true;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment