Title: [174469] trunk
Revision
174469
Author
[email protected]
Date
2014-10-08 12:24:43 -0700 (Wed, 08 Oct 2014)

Log Message

Add deprecation warning for CSSKeyframesRule::appendRule
https://bugs.webkit.org/show_bug.cgi?id=137532
<rdar://problem/18585745>

Reviewed by Brent Fulgham.

Source/WebCore:

In r173982 (webkit.org/b/57910) we added insertRule to match
the spec. We should print a warning to the JS console suggesting
users move to insertRule.

* css/WebKitCSSKeyframesRule.cpp:
(WebCore::WebKitCSSKeyframesRule::appendRule): Add a message to the system
console.
* css/WebKitCSSKeyframesRule.h:

LayoutTests:

Update test expectations to include console message.

* animations/change-keyframes-expected.txt:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (174468 => 174469)


--- trunk/LayoutTests/ChangeLog	2014-10-08 19:21:58 UTC (rev 174468)
+++ trunk/LayoutTests/ChangeLog	2014-10-08 19:24:43 UTC (rev 174469)
@@ -1,3 +1,15 @@
+2014-10-08  Dean Jackson  <[email protected]>
+
+        Add deprecation warning for CSSKeyframesRule::appendRule
+        https://bugs.webkit.org/show_bug.cgi?id=137532
+        <rdar://problem/18585745>
+
+        Reviewed by Brent Fulgham.
+
+        Update test expectations to include console message.
+
+        * animations/change-keyframes-expected.txt:
+
 2014-10-08  Myles C. Maxfield  <[email protected]>
 
         Text drawn with an SVG font has no spaces when word-rounding hacks are enabled

Modified: trunk/LayoutTests/animations/change-keyframes-expected.txt (174468 => 174469)


--- trunk/LayoutTests/animations/change-keyframes-expected.txt	2014-10-08 19:21:58 UTC (rev 174468)
+++ trunk/LayoutTests/animations/change-keyframes-expected.txt	2014-10-08 19:24:43 UTC (rev 174469)
@@ -1,3 +1,5 @@
+CONSOLE MESSAGE: CSSKeyframesRule 'appendRule' function is deprecated.  Use 'insertRule' instead.
+CONSOLE MESSAGE: CSSKeyframesRule 'appendRule' function is deprecated.  Use 'insertRule' instead.
 This test performs an animation of the left property and makes sure it is animating. Then it stops the animation, changes the keyframes to an animation of the top property, restarts the animation and makes sure top is animating.
 PASS - "left" property for "box" element at 0.5s saw something close to: 200
 PASS - "top" property for "box" element at 1s saw something close to: 100

Modified: trunk/Source/WebCore/ChangeLog (174468 => 174469)


--- trunk/Source/WebCore/ChangeLog	2014-10-08 19:21:58 UTC (rev 174468)
+++ trunk/Source/WebCore/ChangeLog	2014-10-08 19:24:43 UTC (rev 174469)
@@ -1,3 +1,20 @@
+2014-10-08  Dean Jackson  <[email protected]>
+
+        Add deprecation warning for CSSKeyframesRule::appendRule
+        https://bugs.webkit.org/show_bug.cgi?id=137532
+        <rdar://problem/18585745>
+
+        Reviewed by Brent Fulgham.
+
+        In r173982 (webkit.org/b/57910) we added insertRule to match
+        the spec. We should print a warning to the JS console suggesting
+        users move to insertRule.
+
+        * css/WebKitCSSKeyframesRule.cpp:
+        (WebCore::WebKitCSSKeyframesRule::appendRule): Add a message to the system
+        console.
+        * css/WebKitCSSKeyframesRule.h:
+
 2014-10-08  Myles C. Maxfield  <[email protected]>
 
         Text drawn with an SVG font has no spaces when word-rounding hacks are enabled

Modified: trunk/Source/WebCore/css/WebKitCSSKeyframesRule.cpp (174468 => 174469)


--- trunk/Source/WebCore/css/WebKitCSSKeyframesRule.cpp	2014-10-08 19:21:58 UTC (rev 174468)
+++ trunk/Source/WebCore/css/WebKitCSSKeyframesRule.cpp	2014-10-08 19:24:43 UTC (rev 174469)
@@ -29,6 +29,7 @@
 #include "CSSParser.h"
 #include "CSSRuleList.h"
 #include "CSSStyleSheet.h"
+#include "Document.h"
 #include "StyleProperties.h"
 #include "StyleSheet.h"
 #include "WebKitCSSKeyframeRule.h"
@@ -110,6 +111,15 @@
     m_keyframesRule->setName(name);
 }
 
+void WebKitCSSKeyframesRule::appendRule(const String& ruleText)
+{
+    if (CSSStyleSheet* parent = parentStyleSheet()) {
+        if (Document* ownerDocument = parent->ownerDocument())
+            ownerDocument->addConsoleMessage(MessageSource::JS, MessageLevel::Warning, ASCIILiteral("CSSKeyframesRule 'appendRule' function is deprecated.  Use 'insertRule' instead."));
+    }
+    insertRule(ruleText);
+}
+
 void WebKitCSSKeyframesRule::insertRule(const String& ruleText)
 {
     ASSERT(m_childRuleCSSOMWrappers.size() == m_keyframesRule->keyframes().size());

Modified: trunk/Source/WebCore/css/WebKitCSSKeyframesRule.h (174468 => 174469)


--- trunk/Source/WebCore/css/WebKitCSSKeyframesRule.h	2014-10-08 19:21:58 UTC (rev 174468)
+++ trunk/Source/WebCore/css/WebKitCSSKeyframesRule.h	2014-10-08 19:24:43 UTC (rev 174469)
@@ -81,7 +81,7 @@
     CSSRuleList& cssRules();
 
     void insertRule(const String& rule);
-    void appendRule(const String& rule) { insertRule(rule); }
+    void appendRule(const String& rule);
     void deleteRule(const String& key);
     WebKitCSSKeyframeRule* findRule(const String& key);
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to