| 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 13 matching lines...) Expand all Loading... |
| 24 #include "core/css/CSSStyleDeclaration.h" | 24 #include "core/css/CSSStyleDeclaration.h" |
| 25 #include "core/rendering/style/RenderStyleConstants.h" | 25 #include "core/rendering/style/RenderStyleConstants.h" |
| 26 #include <wtf/RefPtr.h> | 26 #include <wtf/RefPtr.h> |
| 27 #include <wtf/text/WTFString.h> | 27 #include <wtf/text/WTFString.h> |
| 28 | 28 |
| 29 namespace WebCore { | 29 namespace WebCore { |
| 30 | 30 |
| 31 class CSSPrimitiveValue; | 31 class CSSPrimitiveValue; |
| 32 class CSSValueList; | 32 class CSSValueList; |
| 33 class Color; | 33 class Color; |
| 34 class MutableStylePropertySet; |
| 34 class Node; | 35 class Node; |
| 35 class RenderObject; | 36 class RenderObject; |
| 36 class RenderStyle; | 37 class RenderStyle; |
| 37 class SVGPaint; | 38 class SVGPaint; |
| 38 class ShadowData; | 39 class ShadowData; |
| 39 class StylePropertySet; | 40 class StylePropertySet; |
| 40 class StylePropertyShorthand; | 41 class StylePropertyShorthand; |
| 41 | 42 |
| 42 class CustomFilterNumberParameter; | 43 class CustomFilterNumberParameter; |
| 43 class CustomFilterParameter; | 44 class CustomFilterParameter; |
| 44 | 45 |
| 45 enum EUpdateLayout { DoNotUpdateLayout = false, UpdateLayout = true }; | 46 enum EUpdateLayout { DoNotUpdateLayout = false, UpdateLayout = true }; |
| 46 | 47 |
| 47 class CSSComputedStyleDeclaration : public CSSStyleDeclaration { | 48 class CSSComputedStyleDeclaration : public CSSStyleDeclaration { |
| 48 public: | 49 public: |
| 49 static PassRefPtr<CSSComputedStyleDeclaration> create(PassRefPtr<Node> node,
bool allowVisitedStyle = false, const String& pseudoElementName = String()) | 50 static PassRefPtr<CSSComputedStyleDeclaration> create(PassRefPtr<Node> node,
bool allowVisitedStyle = false, const String& pseudoElementName = String()) |
| 50 { | 51 { |
| 51 return adoptRef(new CSSComputedStyleDeclaration(node, allowVisitedStyle,
pseudoElementName)); | 52 return adoptRef(new CSSComputedStyleDeclaration(node, allowVisitedStyle,
pseudoElementName)); |
| 52 } | 53 } |
| 53 virtual ~CSSComputedStyleDeclaration(); | 54 virtual ~CSSComputedStyleDeclaration(); |
| 54 | 55 |
| 55 virtual void ref() OVERRIDE; | 56 virtual void ref() OVERRIDE; |
| 56 virtual void deref() OVERRIDE; | 57 virtual void deref() OVERRIDE; |
| 57 | 58 |
| 58 PassRefPtr<CSSValue> getPropertyCSSValue(CSSPropertyID) const; | 59 PassRefPtr<CSSValue> getPropertyCSSValue(CSSPropertyID) const; |
| 59 String getPropertyValue(CSSPropertyID) const; | 60 String getPropertyValue(CSSPropertyID) const; |
| 60 bool getPropertyPriority(CSSPropertyID) const; | 61 bool getPropertyPriority(CSSPropertyID) const; |
| 61 | 62 |
| 62 virtual PassRefPtr<StylePropertySet> copy() const; | 63 virtual PassRefPtr<MutableStylePropertySet> copyProperties() const OVERRIDE; |
| 63 | 64 |
| 64 PassRefPtr<CSSValue> getPropertyCSSValue(CSSPropertyID, EUpdateLayout) const
; | 65 PassRefPtr<CSSValue> getPropertyCSSValue(CSSPropertyID, EUpdateLayout) const
; |
| 65 PassRefPtr<CSSValue> getFontSizeCSSValuePreferringKeyword() const; | 66 PassRefPtr<CSSValue> getFontSizeCSSValuePreferringKeyword() const; |
| 66 bool useFixedFontDefaultSize() const; | 67 bool useFixedFontDefaultSize() const; |
| 67 PassRefPtr<CSSValue> getSVGPropertyCSSValue(CSSPropertyID, EUpdateLayout) co
nst; | 68 PassRefPtr<CSSValue> getSVGPropertyCSSValue(CSSPropertyID, EUpdateLayout) co
nst; |
| 68 | 69 |
| 69 PassRefPtr<StylePropertySet> copyPropertiesInSet(const Vector<CSSPropertyID>
&) const; | 70 PassRefPtr<MutableStylePropertySet> copyPropertiesInSet(const Vector<CSSProp
ertyID>&) const; |
| 70 | 71 |
| 71 virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; | 72 virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE; |
| 72 | 73 |
| 73 private: | 74 private: |
| 74 CSSComputedStyleDeclaration(PassRefPtr<Node>, bool allowVisitedStyle, const
String&); | 75 CSSComputedStyleDeclaration(PassRefPtr<Node>, bool allowVisitedStyle, const
String&); |
| 75 | 76 |
| 76 // The styled node is either the node passed into getComputedStyle, or the | 77 // The styled node is either the node passed into getComputedStyle, or the |
| 77 // PseudoElement for :before and :after if they exist. | 78 // PseudoElement for :before and :after if they exist. |
| 78 // FIXME: This should be styledElement since in JS getComputedStyle only wor
ks | 79 // 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 | 80 // on Elements, but right now editing creates these for text nodes. We shoul
d fix |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 | 113 |
| 113 RefPtr<Node> m_node; | 114 RefPtr<Node> m_node; |
| 114 PseudoId m_pseudoElementSpecifier; | 115 PseudoId m_pseudoElementSpecifier; |
| 115 bool m_allowVisitedStyle; | 116 bool m_allowVisitedStyle; |
| 116 unsigned m_refCount; | 117 unsigned m_refCount; |
| 117 }; | 118 }; |
| 118 | 119 |
| 119 } // namespace WebCore | 120 } // namespace WebCore |
| 120 | 121 |
| 121 #endif // CSSComputedStyleDeclaration_h | 122 #endif // CSSComputedStyleDeclaration_h |
| OLD | NEW |