2009-10-01 Simon Fraser <simon.fraser@apple.com>

        Reviewed by Dave Hyatt.

        Odd color transitions on anchors with transition-property: all
        https://bugs.webkit.org/show_bug.cgi?id=29911

        When transitioning maybe-invalid colors, if the source and destination
        color are both invalid, then don't animate.

        This fixes an issue where a child element of an element running a color
        transition, with -webkit-transition-property:all, would show a color change.
        This happened because the "maybe invalid color" logic copied the color style
        into -webkit-text-fill-color for both endpoints, causing -webkit-text-fill-color
        to animate while the transition ran, and to then to disappear when the transition
        finished.

        Test: transitions/color-transition-all.html

        * page/animation/AnimationBase.cpp:
        (WebCore::PropertyWrapperMaybeInvalidColor::equals):
        (WebCore::PropertyWrapperMaybeInvalidColor::blend):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48982 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent fb4d844b
2009-10-01 Simon Fraser <simon.fraser@apple.com>
Reviewed by Dave Hyatt.
Odd color transitions on anchors with transition-property: all
https://bugs.webkit.org/show_bug.cgi?id=29911
Testcase for 'color' changing with -webkit-transition-property: all,
to test whether -webkit-text-fill-color animates.
* transitions/color-transition-all-expected.txt: Added.
* transitions/color-transition-all.html: Added.
2009-10-01 Victor Wang <victorw@chromium.org>
Reviewed by Oliver Hunt.
......
inner
outer
PASS - "color" property for "outer" element at 0.5s saw something close to: 0,127,127
PASS - "color" property for "inner" element at 0.5s saw something close to: 255,0,0
PASS - "-webkit-text-fill-color" property for "inner" element at 0.5s saw something close to: 255,0,0
<!DOCTYPE>
<html lang="en">
<head>
<title>Color transition with transition-property: all</title>
<style type="text/css" media="screen">
#outer {
font-size: 200%;
color: #00F;
-webkit-transition: all 1s linear;
}
#inner {
color: #F00;
}
#outer.changed {
color: #0F0;
}
</style>
<script src="transition-test-helpers.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
const expectedValues = [
// [time, element-id, property, expected-value, tolerance]
[0.5, 'outer', 'color', [0, 127, 127], 2],
[0.5, 'inner', 'color', [255, 0, 0], 2],
[0.5, 'inner', '-webkit-text-fill-color', [255, 0, 0], 2],
];
function setupTest()
{
document.getElementById('outer').className = 'changed';
}
runTransitionTest(expectedValues, setupTest, true);
</script>
</head>
<body>
<div id="outer">
<div id="inner">
inner
</div>
outer
</div>
<div id="result">
</div>
</body>
</html>
\ No newline at end of file
2009-10-01 Simon Fraser <simon.fraser@apple.com>
Reviewed by Dave Hyatt.
Odd color transitions on anchors with transition-property: all
https://bugs.webkit.org/show_bug.cgi?id=29911
When transitioning maybe-invalid colors, if the source and destination
color are both invalid, then don't animate.
This fixes an issue where a child element of an element running a color
transition, with -webkit-transition-property:all, would show a color change.
This happened because the "maybe invalid color" logic copied the color style
into -webkit-text-fill-color for both endpoints, causing -webkit-text-fill-color
to animate while the transition ran, and to then to disappear when the transition
finished.
Test: transitions/color-transition-all.html
* page/animation/AnimationBase.cpp:
(WebCore::PropertyWrapperMaybeInvalidColor::equals):
(WebCore::PropertyWrapperMaybeInvalidColor::blend):
2009-10-01 Victor Wang <victorw@chromium.org>
Reviewed by Oliver Hunt.
......@@ -361,6 +361,10 @@ public:
{
Color fromColor = (a->*m_getter)();
Color toColor = (b->*m_getter)();
if (!fromColor.isValid() && !toColor.isValid())
return true;
if (!fromColor.isValid())
fromColor = a->color();
if (!toColor.isValid())
......@@ -373,6 +377,10 @@ public:
{
Color fromColor = (a->*m_getter)();
Color toColor = (b->*m_getter)();
if (!fromColor.isValid() && !toColor.isValid())
return;
if (!fromColor.isValid())
fromColor = a->color();
if (!toColor.isValid())
......
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