From @keyframes rules with the same name, the last rule should be used

https://bugs.webkit.org/show_bug.cgi?id=73113

Source/WebCore:

Have later rules override previously stored rules.

Reviewed by Simon Fraser.

Test: animations/duplicated-keyframes-name.html

* css/CSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::addKeyframeStyle):

LayoutTests:

Verify that the last @keyframe rule is used.

Reviewed by Simon Fraser.

* animations/duplicated-keyframes-name-expected.txt: Added.
* animations/duplicated-keyframes-name.html: Added.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@101321 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 54363c74
2011-11-29 Roland Steiner <rolandsteiner@chromium.org>
From @keyframes rules with the same name, the last rule should be used
https://bugs.webkit.org/show_bug.cgi?id=73113
Verify that the last @keyframe rule is used.
Reviewed by Simon Fraser.
* animations/duplicated-keyframes-name-expected.txt: Added.
* animations/duplicated-keyframes-name.html: Added.
2011-11-28 David Grogan <dgrogan@chromium.org>
js-test-pre: don't try to load stylesheet from a web worker
This test verifies that the last @keyframes rule with a given name is the one used.
PASS - "left" property for "box" element at 1s saw something close to: 300
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Keyframes test</title>
<style type="text/css" media="screen">
#box {
position: absolute;
left: 0;
top: 100px;
height: 100px;
width: 100px;
background-color: blue;
-webkit-animation-duration: 1s;
-webkit-animation-timing-function: linear;
-webkit-animation-name: anim;
}
@-webkit-keyframes anim {
from { left: 50px; }
to { left: 100px; }
}
@-webkit-keyframes irrelevant {
from { left: 150px; }
to { left: 2500px; }
}
@-webkit-keyframes anim {
from { left: 200px; }
to { left: 300px; }
}
</style>
<script src="resources/animation-test-helpers.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" charset="utf-8">
const expectedValues = [
// [animation-name, time, element-id, property, expected-value, tolerance]
["anim", 1, "box", "left", 300, 1],
];
runAnimationTest(expectedValues);
</script>
</head>
<body>
This test verifies that the last @keyframes rule with a given name is the one used.
<div id="box">
</div>
<div id="result">
</div>
</body>
</html>
2011-11-29 Roland Steiner <rolandsteiner@chromium.org>
From @keyframes rules with the same name, the last rule should be used
https://bugs.webkit.org/show_bug.cgi?id=73113
Have later rules override previously stored rules.
Reviewed by Simon Fraser.
Test: animations/duplicated-keyframes-name.html
* css/CSSStyleSelector.cpp:
(WebCore::CSSStyleSelector::addKeyframeStyle):
2011-11-28 Jacky Jiang <zhajiang@rim.com>
Upstream BlackBerry porting of page.
......@@ -434,7 +434,7 @@ void CSSStyleSelector::addRegionStyleRule(PassRefPtr<CSSRegionStyleRule> regionS
void CSSStyleSelector::addKeyframeStyle(PassRefPtr<WebKitCSSKeyframesRule> rule)
{
AtomicString s(rule->name());
m_keyframesRuleMap.add(s.impl(), rule);
m_keyframesRuleMap.set(s.impl(), rule);
}
CSSStyleSelector::~CSSStyleSelector()
......
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