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, |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 class ShadowList; | 43 class ShadowList; |
44 class StyleColor; | 44 class StyleColor; |
45 class StylePropertyShorthand; | 45 class StylePropertyShorthand; |
46 | 46 |
47 class CORE_EXPORT CSSComputedStyleDeclaration final : public CSSStyleDeclaration
{ | 47 class CORE_EXPORT 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)); |
52 } | 52 } |
53 virtual ~CSSComputedStyleDeclaration(); | 53 ~CSSComputedStyleDeclaration() override; |
54 | 54 |
55 #if !ENABLE(OILPAN) | 55 #if !ENABLE(OILPAN) |
56 virtual void ref() override; | 56 void ref() override; |
57 virtual void deref() override; | 57 void deref() override; |
58 #endif | 58 #endif |
59 | 59 |
60 String getPropertyValue(CSSPropertyID) const; | 60 String getPropertyValue(CSSPropertyID) const; |
61 bool getPropertyPriority(CSSPropertyID) const; | 61 bool getPropertyPriority(CSSPropertyID) const; |
62 | 62 |
63 PassRefPtrWillBeRawPtr<MutableStylePropertySet> copyProperties() const; | 63 PassRefPtrWillBeRawPtr<MutableStylePropertySet> copyProperties() const; |
64 | 64 |
65 PassRefPtrWillBeRawPtr<CSSValue> getPropertyCSSValue(CSSPropertyID) const; | 65 PassRefPtrWillBeRawPtr<CSSValue> getPropertyCSSValue(CSSPropertyID) const; |
66 PassRefPtrWillBeRawPtr<CSSValue> getFontSizeCSSValuePreferringKeyword() cons
t; | 66 PassRefPtrWillBeRawPtr<CSSValue> getFontSizeCSSValuePreferringKeyword() cons
t; |
67 bool isMonospaceFont() const; | 67 bool isMonospaceFont() const; |
68 | 68 |
69 PassRefPtrWillBeRawPtr<MutableStylePropertySet> copyPropertiesInSet(const Ve
ctor<CSSPropertyID>&) const; | 69 PassRefPtrWillBeRawPtr<MutableStylePropertySet> copyPropertiesInSet(const Ve
ctor<CSSPropertyID>&) const; |
70 | 70 |
71 DECLARE_VIRTUAL_TRACE(); | 71 DECLARE_VIRTUAL_TRACE(); |
72 | 72 |
73 private: | 73 private: |
74 CSSComputedStyleDeclaration(PassRefPtrWillBeRawPtr<Node>, bool allowVisitedS
tyle, const String&); | 74 CSSComputedStyleDeclaration(PassRefPtrWillBeRawPtr<Node>, bool allowVisitedS
tyle, const String&); |
75 | 75 |
76 // The styled node is either the node passed into getComputedStyle, or the | 76 // The styled node is either the node passed into getComputedStyle, or the |
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 CSSRule* parentRule() const override; |
85 virtual unsigned length() const override; | 85 unsigned length() const override; |
86 virtual String item(unsigned index) const override; | 86 String item(unsigned index) const override; |
87 const ComputedStyle* computeComputedStyle() const; | 87 const ComputedStyle* computeComputedStyle() const; |
88 virtual String getPropertyValue(const String& propertyName) override; | 88 String getPropertyValue(const String& propertyName) override; |
89 virtual String getPropertyPriority(const String& propertyName) override; | 89 String getPropertyPriority(const String& propertyName) override; |
90 virtual String getPropertyShorthand(const String& propertyName) override; | 90 String getPropertyShorthand(const String& propertyName) override; |
91 virtual bool isPropertyImplicit(const String& propertyName) override; | 91 bool isPropertyImplicit(const String& propertyName) override; |
92 virtual void setProperty(const String& propertyName, const String& value, co
nst String& priority, ExceptionState&) override; | 92 void setProperty(const String& propertyName, const String& value, const Stri
ng& priority, ExceptionState&) override; |
93 virtual String removeProperty(const String& propertyName, ExceptionState&) o
verride; | 93 String removeProperty(const String& propertyName, ExceptionState&) override; |
94 virtual String cssText() const override; | 94 String cssText() const override; |
95 virtual void setCSSText(const String&, ExceptionState&) override; | 95 void setCSSText(const String&, ExceptionState&) override; |
96 virtual PassRefPtrWillBeRawPtr<CSSValue> getPropertyCSSValueInternal(CSSProp
ertyID) override; | 96 PassRefPtrWillBeRawPtr<CSSValue> getPropertyCSSValueInternal(CSSPropertyID)
override; |
97 virtual String getPropertyValueInternal(CSSPropertyID) override; | 97 String getPropertyValueInternal(CSSPropertyID) override; |
98 virtual void setPropertyInternal(CSSPropertyID, const String& value, bool im
portant, ExceptionState&) override; | 98 void setPropertyInternal(CSSPropertyID, const String& value, bool important,
ExceptionState&) override; |
99 | 99 |
100 virtual bool cssPropertyMatches(CSSPropertyID, const CSSValue*) const overri
de; | 100 bool cssPropertyMatches(CSSPropertyID, const CSSValue*) const override; |
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 |