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

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

Issue 6469008: Merge 76828 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/648/
Patch Set: Created 9 years, 10 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
OLDNEW
1 /** 1 /**
2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org)
3 * (C) 2002-2003 Dirk Mueller (mueller@kde.org) 3 * (C) 2002-2003 Dirk Mueller (mueller@kde.org)
4 * Copyright (C) 2002, 2005, 2006 Apple Computer, Inc. 4 * Copyright (C) 2002, 2005, 2006 Apple Computer, Inc.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
11 * This library is distributed in the hope that it will be useful, 11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details. 14 * Library General Public License for more details.
15 * 15 *
16 * You should have received a copy of the GNU Library General Public License 16 * You should have received a copy of the GNU Library General Public License
17 * along with this library; see the file COPYING.LIB. If not, write to 17 * along with this library; see the file COPYING.LIB. If not, write to
18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA. 19 * Boston, MA 02110-1301, USA.
20 */ 20 */
21 21
22 #include "config.h" 22 #include "config.h"
23 #include "CSSRuleList.h" 23 #include "CSSRuleList.h"
24 24
25 #include "CSSMutableStyleDeclaration.h"
25 #include "CSSRule.h" 26 #include "CSSRule.h"
26 #include "StyleList.h" 27 #include "StyleList.h"
28 #include "WebKitCSSKeyframeRule.h"
27 29
28 namespace WebCore { 30 namespace WebCore {
29 31
30 CSSRuleList::CSSRuleList() 32 CSSRuleList::CSSRuleList()
31 { 33 {
32 } 34 }
33 35
34 CSSRuleList::CSSRuleList(StyleList* list, bool omitCharsetRules) 36 CSSRuleList::CSSRuleList(StyleList* list, bool omitCharsetRules)
35 { 37 {
36 m_list = list; 38 m_list = list;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 71
70 void CSSRuleList::deleteRule(unsigned index) 72 void CSSRuleList::deleteRule(unsigned index)
71 { 73 {
72 ASSERT(!m_list); 74 ASSERT(!m_list);
73 75
74 if (index >= m_lstCSSRules.size()) { 76 if (index >= m_lstCSSRules.size()) {
75 // FIXME: Should we throw an INDEX_SIZE_ERR exception here? 77 // FIXME: Should we throw an INDEX_SIZE_ERR exception here?
76 return; 78 return;
77 } 79 }
78 80
81 if (m_lstCSSRules[index]->isKeyframeRule()) {
82 if (CSSMutableStyleDeclaration* style = static_cast<WebKitCSSKeyframeRul e*>(m_lstCSSRules[index].get())->style())
83 style->setParent(0);
84 }
85
79 m_lstCSSRules[index]->setParent(0); 86 m_lstCSSRules[index]->setParent(0);
80 m_lstCSSRules.remove(index); 87 m_lstCSSRules.remove(index);
81 } 88 }
82 89
83 void CSSRuleList::append(CSSRule* rule) 90 void CSSRuleList::append(CSSRule* rule)
84 { 91 {
85 ASSERT(!m_list); 92 ASSERT(!m_list);
86 if (!rule) { 93 if (!rule) {
87 // FIXME: Should we throw an exception? 94 // FIXME: Should we throw an exception?
88 return; 95 return;
(...skipping 13 matching lines...) Expand all
102 if (index > m_lstCSSRules.size()) { 109 if (index > m_lstCSSRules.size()) {
103 // FIXME: Should we throw an INDEX_SIZE_ERR exception here? 110 // FIXME: Should we throw an INDEX_SIZE_ERR exception here?
104 return 0; 111 return 0;
105 } 112 }
106 113
107 m_lstCSSRules.insert(index, rule); 114 m_lstCSSRules.insert(index, rule);
108 return index; 115 return index;
109 } 116 }
110 117
111 } // namespace WebCore 118 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/fast/css/css-keyframe-style-crash-expected.txt ('k') | Source/WebCore/css/WebKitCSSKeyframesRule.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698