Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(147)

Side by Side Diff: Source/WebCore/css/WebKitCSSKeyframesRule.cpp

Issue 6711030: Merge 80144 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/648/
Patch Set: Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « LayoutTests/fast/css/css-keyframe-parent-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 } 81 }
82 82
83 const WebKitCSSKeyframeRule* WebKitCSSKeyframesRule::item(unsigned index) const 83 const WebKitCSSKeyframeRule* WebKitCSSKeyframesRule::item(unsigned index) const
84 { 84 {
85 CSSRule* rule = m_lstCSSRules.get()->item(index); 85 CSSRule* rule = m_lstCSSRules.get()->item(index);
86 return (rule && rule->isKeyframeRule()) ? static_cast<const WebKitCSSKeyfram eRule*>(rule) : 0; 86 return (rule && rule->isKeyframeRule()) ? static_cast<const WebKitCSSKeyfram eRule*>(rule) : 0;
87 } 87 }
88 88
89 void WebKitCSSKeyframesRule::append(WebKitCSSKeyframeRule* rule) 89 void WebKitCSSKeyframesRule::append(WebKitCSSKeyframeRule* rule)
90 { 90 {
91 m_lstCSSRules.get()->append(rule); 91 if (!rule)
92 return;
93
94 m_lstCSSRules->append(rule);
95 rule->setParent(this);
96
97 if (CSSMutableStyleDeclaration* style = rule->style())
98 style->setParent(this);
92 } 99 }
93 100
94 void WebKitCSSKeyframesRule::insertRule(const String& rule) 101 void WebKitCSSKeyframesRule::insertRule(const String& rule)
95 { 102 {
96 CSSParser p(useStrictParsing()); 103 CSSParser p(useStrictParsing());
97 RefPtr<CSSRule> newRule = p.parseKeyframeRule(parentStyleSheet(), rule); 104 RefPtr<CSSRule> newRule = p.parseKeyframeRule(parentStyleSheet(), rule);
98 if (newRule.get() && newRule.get()->isKeyframeRule()) 105 if (newRule.get() && newRule.get()->isKeyframeRule())
99 append(static_cast<WebKitCSSKeyframeRule*>(newRule.get())); 106 append(static_cast<WebKitCSSKeyframeRule*>(newRule.get()));
100 } 107 }
101 108
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 result += m_lstCSSRules->item(i)->cssText(); 150 result += m_lstCSSRules->item(i)->cssText();
144 result += "\n"; 151 result += "\n";
145 } 152 }
146 } 153 }
147 154
148 result += "}"; 155 result += "}";
149 return result; 156 return result;
150 } 157 }
151 158
152 } // namespace WebCore 159 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/fast/css/css-keyframe-parent-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698