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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 CSSKeyframeRule* CSSKeyframesRule::findRule(const String& s) | 146 CSSKeyframeRule* CSSKeyframesRule::findRule(const String& s) |
147 { | 147 { |
148 int i = m_keyframesRule->findKeyframeIndex(s); | 148 int i = m_keyframesRule->findKeyframeIndex(s); |
149 return (i >= 0) ? item(i) : nullptr; | 149 return (i >= 0) ? item(i) : nullptr; |
150 } | 150 } |
151 | 151 |
152 String CSSKeyframesRule::cssText() const | 152 String CSSKeyframesRule::cssText() const |
153 { | 153 { |
154 StringBuilder result; | 154 StringBuilder result; |
155 if (isVendorPrefixed()) | 155 if (isVendorPrefixed()) |
156 result.append("@-webkit-keyframes "); | 156 result.appendLiteral("@-webkit-keyframes "); |
157 else | 157 else |
158 result.append("@keyframes "); | 158 result.appendLiteral("@keyframes "); |
159 result.append(name()); | 159 result.append(name()); |
160 result.append(" { \n"); | 160 result.appendLiteral(" { \n"); |
161 | 161 |
162 unsigned size = length(); | 162 unsigned size = length(); |
163 for (unsigned i = 0; i < size; ++i) { | 163 for (unsigned i = 0; i < size; ++i) { |
164 result.append(" "); | 164 result.appendLiteral(" "); |
165 result.append(m_keyframesRule->keyframes()[i]->cssText()); | 165 result.append(m_keyframesRule->keyframes()[i]->cssText()); |
166 result.append('\n'); | 166 result.append('\n'); |
167 } | 167 } |
168 result.append('}'); | 168 result.append('}'); |
169 return result.toString(); | 169 return result.toString(); |
170 } | 170 } |
171 | 171 |
172 unsigned CSSKeyframesRule::length() const | 172 unsigned CSSKeyframesRule::length() const |
173 { | 173 { |
174 return m_keyframesRule->keyframes().size(); | 174 return m_keyframesRule->keyframes().size(); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 | 209 |
210 DEFINE_TRACE(CSSKeyframesRule) | 210 DEFINE_TRACE(CSSKeyframesRule) |
211 { | 211 { |
212 CSSRule::trace(visitor); | 212 CSSRule::trace(visitor); |
213 visitor->trace(m_childRuleCSSOMWrappers); | 213 visitor->trace(m_childRuleCSSOMWrappers); |
214 visitor->trace(m_keyframesRule); | 214 visitor->trace(m_keyframesRule); |
215 visitor->trace(m_ruleListCSSOMWrapper); | 215 visitor->trace(m_ruleListCSSOMWrapper); |
216 } | 216 } |
217 | 217 |
218 } // namespace blink | 218 } // namespace blink |
OLD | NEW |