| OLD | NEW |
| (Empty) |
| 1 /* | |
| 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org) | |
| 3 * (C) 2002-2003 Dirk Mueller (mueller@kde.org) | |
| 4 * Copyright (C) 2002, 2005, 2006, 2007, 2012 Apple Inc. All rights reserved. | |
| 5 * | |
| 6 * This library is free software; you can redistribute it and/or | |
| 7 * modify it under the terms of the GNU Library General Public | |
| 8 * License as published by the Free Software Foundation; either | |
| 9 * version 2 of the License, or (at your option) any later version. | |
| 10 * | |
| 11 * This library is distributed in the hope that it will be useful, | |
| 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 14 * Library General Public License for more details. | |
| 15 * | |
| 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 | |
| 18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | |
| 19 * Boston, MA 02110-1301, USA. | |
| 20 */ | |
| 21 | |
| 22 #include "sky/engine/config.h" | |
| 23 #include "sky/engine/core/css/CSSRule.h" | |
| 24 | |
| 25 #include "sky/engine/core/css/CSSStyleSheet.h" | |
| 26 #include "sky/engine/core/css/StyleRule.h" | |
| 27 #include "sky/engine/core/css/StyleSheetContents.h" | |
| 28 #include "sky/engine/platform/NotImplemented.h" | |
| 29 | |
| 30 namespace blink { | |
| 31 | |
| 32 // VC++ 2013 doesn't support EBCO (Empty Base Class Optimization), and having | |
| 33 // multiple empty base classes makes the size of CSSRule bloat (Note that both | |
| 34 // of GarbageCollectedFinalized and ScriptWrappableBase are empty classes). | |
| 35 // See the following article for details. | |
| 36 // http://social.msdn.microsoft.com/forums/vstudio/en-US/504c6598-6076-4acf-96b6
-e6acb475d302/vc-multiple-inheritance-empty-base-classes-bloats-object-size | |
| 37 // | |
| 38 // FIXME: Remove ScriptWrappableBase from the base class list once VC++'s issue | |
| 39 // gets fixed. | |
| 40 // Note that we're going to split CSSRule class into two classes; CSSOMRule | |
| 41 // (assumed name) which derives ScriptWrappable and CSSRule (new one) which | |
| 42 // doesn't derive ScriptWrappable or ScriptWrappableBase. Then, we can safely | |
| 43 // remove ScriptWrappableBase from the base class list. | |
| 44 struct SameSizeAsCSSRule : public RefCounted<SameSizeAsCSSRule>, public ScriptWr
appableBase { | |
| 45 virtual ~SameSizeAsCSSRule(); | |
| 46 unsigned char bitfields; | |
| 47 void* pointerUnion; | |
| 48 }; | |
| 49 | |
| 50 COMPILE_ASSERT(sizeof(CSSRule) == sizeof(SameSizeAsCSSRule), CSSRule_should_stay
_small); | |
| 51 | |
| 52 void CSSRule::setCSSText(const String&) | |
| 53 { | |
| 54 notImplemented(); | |
| 55 } | |
| 56 | |
| 57 const CSSParserContext& CSSRule::parserContext() const | |
| 58 { | |
| 59 CSSStyleSheet* styleSheet = parentStyleSheet(); | |
| 60 return styleSheet ? styleSheet->contents()->parserContext() : strictCSSParse
rContext(); | |
| 61 } | |
| 62 | |
| 63 } // namespace blink | |
| OLD | NEW |