OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004 Zack Rusin <zack@kde.org> | 2 * Copyright (C) 2004 Zack Rusin <zack@kde.org> |
3 * Copyright (C) 2004, 2005, 2006, 2008, 2012 Apple Inc. All rights reserved. | 3 * Copyright (C) 2004, 2005, 2006, 2008, 2012 Apple Inc. All rights reserved. |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Lesser General Public | 6 * modify it under the terms of the GNU Lesser General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 * Lesser General Public License for more details. | 13 * Lesser General Public License for more details. |
14 * | 14 * |
15 * You should have received a copy of the GNU Lesser General Public | 15 * You should have received a copy of the GNU Lesser General Public |
16 * License along with this library; if not, write to the Free Software | 16 * License along with this library; if not, write to the Free Software |
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA | 17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
18 * 02110-1301 USA | 18 * 02110-1301 USA |
19 */ | 19 */ |
20 | 20 |
21 #ifndef CSSComputedStyleDeclaration_h | 21 #ifndef CSSComputedStyleDeclaration_h |
22 #define CSSComputedStyleDeclaration_h | 22 #define CSSComputedStyleDeclaration_h |
23 | 23 |
24 #include "core/css/CSSStyleDeclaration.h" | 24 #include "core/css/CSSStyleDeclaration.h" |
25 #include "core/layout/style/LayoutStyleConstants.h" | 25 #include "core/layout/style/ComputedStyleConstants.h" |
26 #include "platform/fonts/FixedPitchFontType.h" | 26 #include "platform/fonts/FixedPitchFontType.h" |
27 #include "wtf/HashMap.h" | 27 #include "wtf/HashMap.h" |
28 #include "wtf/RefPtr.h" | 28 #include "wtf/RefPtr.h" |
29 #include "wtf/text/AtomicString.h" | 29 #include "wtf/text/AtomicString.h" |
30 #include "wtf/text/AtomicStringHash.h" | 30 #include "wtf/text/AtomicStringHash.h" |
31 #include "wtf/text/WTFString.h" | 31 #include "wtf/text/WTFString.h" |
32 | 32 |
33 namespace blink { | 33 namespace blink { |
34 | 34 |
35 class CSSPrimitiveValue; | 35 class CSSPrimitiveValue; |
36 class CSSValueList; | 36 class CSSValueList; |
37 class ExceptionState; | 37 class ExceptionState; |
38 class MutableStylePropertySet; | 38 class MutableStylePropertySet; |
39 class Node; | 39 class Node; |
40 class LayoutObject; | 40 class LayoutObject; |
41 class LayoutStyle; | 41 class ComputedStyle; |
42 class ShadowData; | 42 class ShadowData; |
43 class ShadowList; | 43 class ShadowList; |
44 class StyleColor; | 44 class StyleColor; |
45 class StylePropertyShorthand; | 45 class StylePropertyShorthand; |
46 | 46 |
47 class CSSComputedStyleDeclaration final : public CSSStyleDeclaration { | 47 class CSSComputedStyleDeclaration final : public CSSStyleDeclaration { |
48 public: | 48 public: |
49 static PassRefPtrWillBeRawPtr<CSSComputedStyleDeclaration> create(PassRefPtr
WillBeRawPtr<Node> node, bool allowVisitedStyle = false, const String& pseudoEle
mentName = String()) | 49 static PassRefPtrWillBeRawPtr<CSSComputedStyleDeclaration> create(PassRefPtr
WillBeRawPtr<Node> node, bool allowVisitedStyle = false, const String& pseudoEle
mentName = String()) |
50 { | 50 { |
51 return adoptRefWillBeNoop(new CSSComputedStyleDeclaration(node, allowVis
itedStyle, pseudoElementName)); | 51 return adoptRefWillBeNoop(new CSSComputedStyleDeclaration(node, allowVis
itedStyle, pseudoElementName)); |
(...skipping 25 matching lines...) Expand all Loading... |
77 // PseudoElement for :before and :after if they exist. | 77 // PseudoElement for :before and :after if they exist. |
78 // FIXME: This should be styledElement since in JS getComputedStyle only wor
ks | 78 // FIXME: This should be styledElement since in JS getComputedStyle only wor
ks |
79 // on Elements, but right now editing creates these for text nodes. We shoul
d fix | 79 // on Elements, but right now editing creates these for text nodes. We shoul
d fix |
80 // that. | 80 // that. |
81 Node* styledNode() const; | 81 Node* styledNode() const; |
82 | 82 |
83 // CSSOM functions. Don't make these public. | 83 // CSSOM functions. Don't make these public. |
84 virtual CSSRule* parentRule() const override; | 84 virtual CSSRule* parentRule() const override; |
85 virtual unsigned length() const override; | 85 virtual unsigned length() const override; |
86 virtual String item(unsigned index) const override; | 86 virtual String item(unsigned index) const override; |
87 const LayoutStyle* computeLayoutStyle() const; | 87 const ComputedStyle* computeComputedStyle() const; |
88 virtual String getPropertyValue(const String& propertyName) override; | 88 virtual String getPropertyValue(const String& propertyName) override; |
89 virtual String getPropertyPriority(const String& propertyName) override; | 89 virtual String getPropertyPriority(const String& propertyName) override; |
90 virtual String getPropertyShorthand(const String& propertyName) override; | 90 virtual String getPropertyShorthand(const String& propertyName) override; |
91 virtual bool isPropertyImplicit(const String& propertyName) override; | 91 virtual bool isPropertyImplicit(const String& propertyName) override; |
92 virtual void setProperty(const String& propertyName, const String& value, co
nst String& priority, ExceptionState&) override; | 92 virtual void setProperty(const String& propertyName, const String& value, co
nst String& priority, ExceptionState&) override; |
93 virtual String removeProperty(const String& propertyName, ExceptionState&) o
verride; | 93 virtual String removeProperty(const String& propertyName, ExceptionState&) o
verride; |
94 virtual String cssText() const override; | 94 virtual String cssText() const override; |
95 virtual void setCSSText(const String&, ExceptionState&) override; | 95 virtual void setCSSText(const String&, ExceptionState&) override; |
96 virtual PassRefPtrWillBeRawPtr<CSSValue> getPropertyCSSValueInternal(CSSProp
ertyID) override; | 96 virtual PassRefPtrWillBeRawPtr<CSSValue> getPropertyCSSValueInternal(CSSProp
ertyID) override; |
97 virtual String getPropertyValueInternal(CSSPropertyID) override; | 97 virtual String getPropertyValueInternal(CSSPropertyID) override; |
98 virtual void setPropertyInternal(CSSPropertyID, const String& value, bool im
portant, ExceptionState&) override; | 98 virtual void setPropertyInternal(CSSPropertyID, const String& value, bool im
portant, ExceptionState&) override; |
99 | 99 |
100 virtual bool cssPropertyMatches(CSSPropertyID, const CSSValue*) const overri
de; | 100 virtual bool cssPropertyMatches(CSSPropertyID, const CSSValue*) const overri
de; |
101 | 101 |
102 RefPtrWillBeMember<Node> m_node; | 102 RefPtrWillBeMember<Node> m_node; |
103 PseudoId m_pseudoElementSpecifier; | 103 PseudoId m_pseudoElementSpecifier; |
104 bool m_allowVisitedStyle; | 104 bool m_allowVisitedStyle; |
105 #if !ENABLE(OILPAN) | 105 #if !ENABLE(OILPAN) |
106 unsigned m_refCount; | 106 unsigned m_refCount; |
107 #endif | 107 #endif |
108 }; | 108 }; |
109 | 109 |
110 } // namespace blink | 110 } // namespace blink |
111 | 111 |
112 #endif // CSSComputedStyleDeclaration_h | 112 #endif // CSSComputedStyleDeclaration_h |
OLD | NEW |