Ignore:
Timestamp:
Oct 8, 2014, 12:24:43 PM (11 years ago)
Author:
[email protected]
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:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/css/WebKitCSSKeyframesRule.cpp

    r174256 r174469  
    3030#include "CSSRuleList.h"
    3131#include "CSSStyleSheet.h"
     32#include "Document.h"
    3233#include "StyleProperties.h"
    3334#include "StyleSheet.h"
     
    111112}
    112113
     114void WebKitCSSKeyframesRule::appendRule(const String& ruleText)
     115{
     116    if (CSSStyleSheet* parent = parentStyleSheet()) {
     117        if (Document* ownerDocument = parent->ownerDocument())
     118            ownerDocument->addConsoleMessage(MessageSource::JS, MessageLevel::Warning, ASCIILiteral("CSSKeyframesRule 'appendRule' function is deprecated.  Use 'insertRule' instead."));
     119    }
     120    insertRule(ruleText);
     121}
     122
    113123void WebKitCSSKeyframesRule::insertRule(const String& ruleText)
    114124{
Note: See TracChangeset for help on using the changeset viewer.