| 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 29 matching lines...) Expand all Loading... |
| 40 class Node; | 40 class Node; |
| 41 class LayoutObject; | 41 class LayoutObject; |
| 42 class ComputedStyle; | 42 class ComputedStyle; |
| 43 class ShadowData; | 43 class ShadowData; |
| 44 class ShadowList; | 44 class ShadowList; |
| 45 class StyleColor; | 45 class StyleColor; |
| 46 class StylePropertyShorthand; | 46 class StylePropertyShorthand; |
| 47 | 47 |
| 48 class CORE_EXPORT CSSComputedStyleDeclaration final : public CSSStyleDeclaration
{ | 48 class CORE_EXPORT CSSComputedStyleDeclaration final : public CSSStyleDeclaration
{ |
| 49 public: | 49 public: |
| 50 static RawPtr<CSSComputedStyleDeclaration> create(RawPtr<Node> node, bool al
lowVisitedStyle = false, const String& pseudoElementName = String()) | 50 static CSSComputedStyleDeclaration* create(Node* node, bool allowVisitedStyl
e = false, const String& pseudoElementName = String()) |
| 51 { | 51 { |
| 52 return new CSSComputedStyleDeclaration(node, allowVisitedStyle, pseudoEl
ementName); | 52 return new CSSComputedStyleDeclaration(node, allowVisitedStyle, pseudoEl
ementName); |
| 53 } | 53 } |
| 54 ~CSSComputedStyleDeclaration() override; | 54 ~CSSComputedStyleDeclaration() override; |
| 55 | 55 |
| 56 #if !ENABLE(OILPAN) | 56 #if !ENABLE(OILPAN) |
| 57 void ref() override; | 57 void ref() override; |
| 58 void deref() override; | 58 void deref() override; |
| 59 #endif | 59 #endif |
| 60 | 60 |
| 61 String getPropertyValue(CSSPropertyID) const; | 61 String getPropertyValue(CSSPropertyID) const; |
| 62 bool getPropertyPriority(CSSPropertyID) const; | 62 bool getPropertyPriority(CSSPropertyID) const; |
| 63 | 63 |
| 64 RawPtr<MutableStylePropertySet> copyProperties() const; | 64 MutableStylePropertySet* copyProperties() const; |
| 65 | 65 |
| 66 RawPtr<CSSValue> getPropertyCSSValue(CSSPropertyID) const; | 66 CSSValue* getPropertyCSSValue(CSSPropertyID) const; |
| 67 RawPtr<CSSValue> getPropertyCSSValue(AtomicString customPropertyName) const; | 67 CSSValue* getPropertyCSSValue(AtomicString customPropertyName) const; |
| 68 const HashMap<AtomicString, RefPtr<CSSVariableData>>* getVariables() const; | 68 const HashMap<AtomicString, RefPtr<CSSVariableData>>* getVariables() const; |
| 69 | 69 |
| 70 RawPtr<CSSValue> getFontSizeCSSValuePreferringKeyword() const; | 70 CSSValue* getFontSizeCSSValuePreferringKeyword() const; |
| 71 bool isMonospaceFont() const; | 71 bool isMonospaceFont() const; |
| 72 | 72 |
| 73 RawPtr<MutableStylePropertySet> copyPropertiesInSet(const Vector<CSSProperty
ID>&) const; | 73 MutableStylePropertySet* copyPropertiesInSet(const Vector<CSSPropertyID>&) c
onst; |
| 74 | 74 |
| 75 DECLARE_VIRTUAL_TRACE(); | 75 DECLARE_VIRTUAL_TRACE(); |
| 76 | 76 |
| 77 private: | 77 private: |
| 78 CSSComputedStyleDeclaration(RawPtr<Node>, bool allowVisitedStyle, const Stri
ng&); | 78 CSSComputedStyleDeclaration(Node*, bool allowVisitedStyle, const String&); |
| 79 | 79 |
| 80 // The styled node is either the node passed into getComputedStyle, or the | 80 // The styled node is either the node passed into getComputedStyle, or the |
| 81 // PseudoElement for :before and :after if they exist. | 81 // PseudoElement for :before and :after if they exist. |
| 82 // FIXME: This should be styledElement since in JS getComputedStyle only wor
ks | 82 // FIXME: This should be styledElement since in JS getComputedStyle only wor
ks |
| 83 // on Elements, but right now editing creates these for text nodes. We shoul
d fix | 83 // on Elements, but right now editing creates these for text nodes. We shoul
d fix |
| 84 // that. | 84 // that. |
| 85 Node* styledNode() const; | 85 Node* styledNode() const; |
| 86 | 86 |
| 87 // CSSOM functions. Don't make these public. | 87 // CSSOM functions. Don't make these public. |
| 88 CSSRule* parentRule() const override; | 88 CSSRule* parentRule() const override; |
| 89 unsigned length() const override; | 89 unsigned length() const override; |
| 90 String item(unsigned index) const override; | 90 String item(unsigned index) const override; |
| 91 const ComputedStyle* computeComputedStyle() const; | 91 const ComputedStyle* computeComputedStyle() const; |
| 92 String getPropertyValue(const String& propertyName) override; | 92 String getPropertyValue(const String& propertyName) override; |
| 93 String getPropertyPriority(const String& propertyName) override; | 93 String getPropertyPriority(const String& propertyName) override; |
| 94 String getPropertyShorthand(const String& propertyName) override; | 94 String getPropertyShorthand(const String& propertyName) override; |
| 95 bool isPropertyImplicit(const String& propertyName) override; | 95 bool isPropertyImplicit(const String& propertyName) override; |
| 96 void setProperty(const String& propertyName, const String& value, const Stri
ng& priority, ExceptionState&) override; | 96 void setProperty(const String& propertyName, const String& value, const Stri
ng& priority, ExceptionState&) override; |
| 97 String removeProperty(const String& propertyName, ExceptionState&) override; | 97 String removeProperty(const String& propertyName, ExceptionState&) override; |
| 98 String cssFloat() const; | 98 String cssFloat() const; |
| 99 void setCSSFloat(const String&, ExceptionState&); | 99 void setCSSFloat(const String&, ExceptionState&); |
| 100 String cssText() const override; | 100 String cssText() const override; |
| 101 void setCSSText(const String&, ExceptionState&) override; | 101 void setCSSText(const String&, ExceptionState&) override; |
| 102 RawPtr<CSSValue> getPropertyCSSValueInternal(CSSPropertyID) override; | 102 CSSValue* getPropertyCSSValueInternal(CSSPropertyID) override; |
| 103 String getPropertyValueInternal(CSSPropertyID) override; | 103 String getPropertyValueInternal(CSSPropertyID) override; |
| 104 void setPropertyInternal(CSSPropertyID, const String& customPropertyName, co
nst String& value, bool important, ExceptionState&) override; | 104 void setPropertyInternal(CSSPropertyID, const String& customPropertyName, co
nst String& value, bool important, ExceptionState&) override; |
| 105 | 105 |
| 106 bool cssPropertyMatches(CSSPropertyID, const CSSValue*) const override; | 106 bool cssPropertyMatches(CSSPropertyID, const CSSValue*) const override; |
| 107 | 107 |
| 108 Member<Node> m_node; | 108 Member<Node> m_node; |
| 109 PseudoId m_pseudoElementSpecifier; | 109 PseudoId m_pseudoElementSpecifier; |
| 110 bool m_allowVisitedStyle; | 110 bool m_allowVisitedStyle; |
| 111 #if !ENABLE(OILPAN) | 111 #if !ENABLE(OILPAN) |
| 112 unsigned m_refCount; | 112 unsigned m_refCount; |
| 113 #endif | 113 #endif |
| 114 }; | 114 }; |
| 115 | 115 |
| 116 } // namespace blink | 116 } // namespace blink |
| 117 | 117 |
| 118 #endif // CSSComputedStyleDeclaration_h | 118 #endif // CSSComputedStyleDeclaration_h |
| OLD | NEW |