Title: [101321] trunk
Revision
101321
Author
[email protected]
Date
2011-11-28 20:06:18 -0800 (Mon, 28 Nov 2011)

Log Message

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.

Modified Paths

Added Paths

Property Changed

Diff

Modified: trunk/LayoutTests/ChangeLog (101320 => 101321)


--- trunk/LayoutTests/ChangeLog	2011-11-29 03:48:12 UTC (rev 101320)
+++ trunk/LayoutTests/ChangeLog	2011-11-29 04:06:18 UTC (rev 101321)
@@ -1,3 +1,15 @@
+2011-11-29  Roland Steiner  <[email protected]>
+
+        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  <[email protected]>
 
         js-test-pre: don't try to load stylesheet from a web worker
Property changes on: trunk/LayoutTests/ChangeLog
___________________________________________________________________

Deleted: svn:executable

Added: trunk/LayoutTests/animations/duplicated-keyframes-name-expected.txt (0 => 101321)


--- trunk/LayoutTests/animations/duplicated-keyframes-name-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/animations/duplicated-keyframes-name-expected.txt	2011-11-29 04:06:18 UTC (rev 101321)
@@ -0,0 +1,3 @@
+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
+

Added: trunk/LayoutTests/animations/duplicated-keyframes-name.html (0 => 101321)


--- trunk/LayoutTests/animations/duplicated-keyframes-name.html	                        (rev 0)
+++ trunk/LayoutTests/animations/duplicated-keyframes-name.html	2011-11-29 04:06:18 UTC (rev 101321)
@@ -0,0 +1,52 @@
+<!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="" 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>

Modified: trunk/Source/WebCore/ChangeLog (101320 => 101321)


--- trunk/Source/WebCore/ChangeLog	2011-11-29 03:48:12 UTC (rev 101320)
+++ trunk/Source/WebCore/ChangeLog	2011-11-29 04:06:18 UTC (rev 101321)
@@ -1,3 +1,17 @@
+2011-11-29  Roland Steiner  <[email protected]>
+
+        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  <[email protected]>
 
         Upstream BlackBerry porting of page.
Property changes on: trunk/Source/WebCore/ChangeLog
___________________________________________________________________

Deleted: svn:executable

Modified: trunk/Source/WebCore/css/CSSStyleSelector.cpp (101320 => 101321)


--- trunk/Source/WebCore/css/CSSStyleSelector.cpp	2011-11-29 03:48:12 UTC (rev 101320)
+++ trunk/Source/WebCore/css/CSSStyleSelector.cpp	2011-11-29 04:06:18 UTC (rev 101321)
@@ -434,7 +434,7 @@
 void CSSStyleSelector::addKeyframeStyle(PassRefPtr<WebKitCSSKeyframesRule> rule)
 {
     AtomicString s(rule->name());
-    m_keyframesRuleMap.add(s.impl(), rule);
+    m_keyframesRuleMap.set(s.impl(), rule);
 }
 
 CSSStyleSelector::~CSSStyleSelector()
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to