[CherryPick] flex-grow should be 1 when flex:auto
[framework/web/webkit-efl.git] / Source / WebCore / css / CSSStyleDeclaration.h
1 /*
2  * (C) 1999-2003 Lars Knoll (knoll@kde.org)
3  * Copyright (C) 2004, 2005, 2006, 2008, 2012 Apple Inc. All rights reserved.
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public License
16  * along with this library; see the file COPYING.LIB.  If not, write to
17  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18  * Boston, MA 02110-1301, USA.
19  */
20
21 #ifndef CSSStyleDeclaration_h
22 #define CSSStyleDeclaration_h
23
24 #include "CSSPropertyNames.h"
25 #include "CSSRule.h"
26 #include <wtf/Forward.h>
27
28 namespace WebCore {
29
30 class CSSProperty;
31 class CSSStyleSheet;
32 class CSSValue;
33 class StylePropertySet;
34 class StyledElement;
35
36 typedef int ExceptionCode;
37
38 class CSSStyleDeclaration {
39     WTF_MAKE_NONCOPYABLE(CSSStyleDeclaration); WTF_MAKE_FAST_ALLOCATED;
40 public:
41     virtual ~CSSStyleDeclaration() { }
42
43     virtual void ref() = 0;
44     virtual void deref() = 0;
45
46     virtual CSSRule* parentRule() const = 0;
47     virtual String cssText() const = 0;
48     virtual void setCssText(const String&, ExceptionCode&) = 0;
49     virtual unsigned length() const = 0;
50     virtual String item(unsigned index) const = 0;
51     virtual PassRefPtr<CSSValue> getPropertyCSSValue(const String& propertyName) = 0;
52     virtual String getPropertyValue(const String& propertyName) = 0;
53     virtual String getPropertyPriority(const String& propertyName) = 0;
54     virtual String getPropertyShorthand(const String& propertyName) = 0;
55     virtual bool isPropertyImplicit(const String& propertyName) = 0;
56     virtual void setProperty(const String& propertyName, const String& value, const String& priority, ExceptionCode&) = 0;
57     virtual String removeProperty(const String& propertyName, ExceptionCode&) = 0;
58
59     // CSSPropertyID versions of the CSSOM functions to support bindings and editing.
60     // Use the non-virtual methods in the concrete subclasses when possible.
61     // The CSSValue returned by this function should not be exposed to the web as it may be used by multiple documents at the same time.
62     virtual PassRefPtr<CSSValue> getPropertyCSSValueInternal(CSSPropertyID) = 0;
63     virtual String getPropertyValueInternal(CSSPropertyID) = 0;
64     virtual void setPropertyInternal(CSSPropertyID, const String& value, bool important, ExceptionCode&) = 0;
65
66     virtual PassRefPtr<StylePropertySet> copy() const = 0;
67     virtual PassRefPtr<StylePropertySet> makeMutable() = 0;
68
69     virtual bool cssPropertyMatches(const CSSProperty*) const = 0;
70     virtual CSSStyleSheet* parentStyleSheet() const { return 0; }
71
72 protected:
73     CSSStyleDeclaration() { }
74 };
75
76 } // namespace WebCore
77
78 #endif // CSSStyleDeclaration_h