| OLD | NEW |
| 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, 2008, 2012 Apple Inc. All rights reserved. | 4 * Copyright (C) 2002, 2005, 2006, 2008, 2012 Apple Inc. All rights reserved. |
| 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 "sky/engine/config.h" | 22 #include "sky/engine/config.h" |
| 23 #include "sky/engine/core/css/StyleRule.h" | 23 #include "sky/engine/core/css/StyleRule.h" |
| 24 | 24 |
| 25 #include "sky/engine/core/css/StylePropertySet.h" | 25 #include "sky/engine/core/css/StylePropertySet.h" |
| 26 #include "sky/engine/core/css/StyleRuleKeyframes.h" | |
| 27 | 26 |
| 28 namespace blink { | 27 namespace blink { |
| 29 | 28 |
| 30 struct SameSizeAsStyleRuleBase : public RefCounted<SameSizeAsStyleRuleBase> { | 29 struct SameSizeAsStyleRuleBase : public RefCounted<SameSizeAsStyleRuleBase> { |
| 31 unsigned bitfields; | 30 unsigned bitfields; |
| 32 }; | 31 }; |
| 33 | 32 |
| 34 COMPILE_ASSERT(sizeof(StyleRuleBase) <= sizeof(SameSizeAsStyleRuleBase), StyleRu
leBase_should_stay_small); | 33 COMPILE_ASSERT(sizeof(StyleRuleBase) <= sizeof(SameSizeAsStyleRuleBase), StyleRu
leBase_should_stay_small); |
| 35 | 34 |
| 36 void StyleRuleBase::destroy() | 35 void StyleRuleBase::destroy() |
| 37 { | 36 { |
| 38 switch (type()) { | 37 switch (type()) { |
| 39 case Style: | 38 case Style: |
| 40 delete toStyleRule(this); | 39 delete toStyleRule(this); |
| 41 return; | 40 return; |
| 42 case FontFace: | 41 case FontFace: |
| 43 delete toStyleRuleFontFace(this); | 42 delete toStyleRuleFontFace(this); |
| 44 return; | 43 return; |
| 45 case Supports: | 44 case Supports: |
| 46 delete toStyleRuleSupports(this); | 45 delete toStyleRuleSupports(this); |
| 47 return; | 46 return; |
| 48 case Keyframes: | |
| 49 delete toStyleRuleKeyframes(this); | |
| 50 return; | |
| 51 case Unknown: | 47 case Unknown: |
| 52 ASSERT_NOT_REACHED(); | 48 ASSERT_NOT_REACHED(); |
| 53 return; | 49 return; |
| 54 } | 50 } |
| 55 ASSERT_NOT_REACHED(); | 51 ASSERT_NOT_REACHED(); |
| 56 } | 52 } |
| 57 | 53 |
| 58 unsigned StyleRule::averageSizeInBytes() | 54 unsigned StyleRule::averageSizeInBytes() |
| 59 { | 55 { |
| 60 return sizeof(StyleRule) + sizeof(CSSSelector) + StylePropertySet::averageSi
zeInBytes(); | 56 return sizeof(StyleRule) + sizeof(CSSSelector) + StylePropertySet::averageSi
zeInBytes(); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 } | 91 } |
| 96 | 92 |
| 97 StyleRuleSupports::StyleRuleSupports(const String& conditionText, bool condition
IsSupported, Vector<RefPtr<StyleRuleBase> >& adoptRules) | 93 StyleRuleSupports::StyleRuleSupports(const String& conditionText, bool condition
IsSupported, Vector<RefPtr<StyleRuleBase> >& adoptRules) |
| 98 : StyleRuleGroup(Supports, adoptRules) | 94 : StyleRuleGroup(Supports, adoptRules) |
| 99 , m_conditionText(conditionText) | 95 , m_conditionText(conditionText) |
| 100 , m_conditionIsSupported(conditionIsSupported) | 96 , m_conditionIsSupported(conditionIsSupported) |
| 101 { | 97 { |
| 102 } | 98 } |
| 103 | 99 |
| 104 } // namespace blink | 100 } // namespace blink |
| OLD | NEW |