| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008, 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008, 2012 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 | 144 |
| 145 CSSKeyframeRule* CSSKeyframesRule::findRule(const String& s) | 145 CSSKeyframeRule* CSSKeyframesRule::findRule(const String& s) |
| 146 { | 146 { |
| 147 int i = m_keyframesRule->findKeyframeIndex(s); | 147 int i = m_keyframesRule->findKeyframeIndex(s); |
| 148 return (i >= 0) ? item(i) : 0; | 148 return (i >= 0) ? item(i) : 0; |
| 149 } | 149 } |
| 150 | 150 |
| 151 String CSSKeyframesRule::cssText() const | 151 String CSSKeyframesRule::cssText() const |
| 152 { | 152 { |
| 153 StringBuilder result; | 153 StringBuilder result; |
| 154 result.append("@-webkit-keyframes "); | 154 if (isVendorPrefixed()) |
| 155 result.append("@-webkit-keyframes "); |
| 156 else |
| 157 result.append("@keyframes "); |
| 155 result.append(name()); | 158 result.append(name()); |
| 156 result.append(" { \n"); | 159 result.append(" { \n"); |
| 157 | 160 |
| 158 unsigned size = length(); | 161 unsigned size = length(); |
| 159 for (unsigned i = 0; i < size; ++i) { | 162 for (unsigned i = 0; i < size; ++i) { |
| 160 result.append(" "); | 163 result.append(" "); |
| 161 result.append(m_keyframesRule->keyframes()[i]->cssText()); | 164 result.append(m_keyframesRule->keyframes()[i]->cssText()); |
| 162 result.append("\n"); | 165 result.append("\n"); |
| 163 } | 166 } |
| 164 result.append("}"); | 167 result.append("}"); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 191 } | 194 } |
| 192 | 195 |
| 193 void CSSKeyframesRule::reattach(StyleRuleBase* rule) | 196 void CSSKeyframesRule::reattach(StyleRuleBase* rule) |
| 194 { | 197 { |
| 195 ASSERT(rule); | 198 ASSERT(rule); |
| 196 ASSERT_WITH_SECURITY_IMPLICATION(rule->isKeyframesRule()); | 199 ASSERT_WITH_SECURITY_IMPLICATION(rule->isKeyframesRule()); |
| 197 m_keyframesRule = static_cast<StyleRuleKeyframes*>(rule); | 200 m_keyframesRule = static_cast<StyleRuleKeyframes*>(rule); |
| 198 } | 201 } |
| 199 | 202 |
| 200 } // namespace WebCore | 203 } // namespace WebCore |
| OLD | NEW |