| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc.
All rights reserved. | 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 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 Library General Public | 6 * modify it under the terms of the GNU Library 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 , m_styledElement(0) | 49 , m_styledElement(0) |
| 50 , m_parentNode(0) | 50 , m_parentNode(0) |
| 51 , m_parentStyle(0) | 51 , m_parentStyle(0) |
| 52 , m_rootElementStyle(0) | 52 , m_rootElementStyle(0) |
| 53 , m_regionForStyling(0) | 53 , m_regionForStyling(0) |
| 54 , m_elementLinkState(NotInsideLink) | 54 , m_elementLinkState(NotInsideLink) |
| 55 , m_distributedToInsertionPoint(false) | 55 , m_distributedToInsertionPoint(false) |
| 56 , m_elementAffectedByClassRules(false) | 56 , m_elementAffectedByClassRules(false) |
| 57 , m_applyPropertyToRegularStyle(true) | 57 , m_applyPropertyToRegularStyle(true) |
| 58 , m_applyPropertyToVisitedLinkStyle(false) | 58 , m_applyPropertyToVisitedLinkStyle(false) |
| 59 , m_isMatchedPropertiesCacheable(true) | |
| 60 , m_lineHeightValue(0) | 59 , m_lineHeightValue(0) |
| 61 , m_fontDirty(false) | 60 , m_fontDirty(false) |
| 62 , m_hasUAAppearance(false) | 61 , m_hasUAAppearance(false) |
| 63 , m_backgroundData(BackgroundFillLayer) | 62 , m_backgroundData(BackgroundFillLayer) |
| 64 , m_styleMap(*this) | 63 , m_styleMap(*this) |
| 65 { } | 64 { } |
| 66 | 65 |
| 67 public: | 66 public: |
| 68 void initForStyleResolve(Document*, Element*, RenderStyle* parentStyle = 0,
RenderRegion* regionForStyling = 0); | 67 void initForStyleResolve(Document*, Element*, RenderStyle* parentStyle = 0,
RenderRegion* regionForStyling = 0); |
| 69 void clear(); | 68 void clear(); |
| 70 | 69 |
| 71 // FIXME: This function should live on TextLinkColors (or be passed a TextLi
nkColors), | |
| 72 // but it has dependencies that need to be untangled first. | |
| 73 // This method might change an internal state, i.e. m_isMatchedPropertiesCac
hable. | |
| 74 Color resolveColorFromPrimitiveValue(CSSPrimitiveValue*, bool forVisitedLink
= false); | |
| 75 | |
| 76 Document* document() const { return m_element->document(); } | 70 Document* document() const { return m_element->document(); } |
| 77 Element* element() const { return m_element; } | 71 Element* element() const { return m_element; } |
| 78 Element* styledElement() const { return m_styledElement; } | 72 Element* styledElement() const { return m_styledElement; } |
| 79 void setStyle(PassRefPtr<RenderStyle> style) { m_style = style; } | 73 void setStyle(PassRefPtr<RenderStyle> style) { m_style = style; } |
| 80 RenderStyle* style() const { return m_style.get(); } | 74 RenderStyle* style() const { return m_style.get(); } |
| 81 PassRefPtr<RenderStyle> takeStyle() { return m_style.release(); } | 75 PassRefPtr<RenderStyle> takeStyle() { return m_style.release(); } |
| 82 | 76 |
| 83 const ContainerNode* parentNode() const { return m_parentNode; } | 77 const ContainerNode* parentNode() const { return m_parentNode; } |
| 84 void setParentStyle(PassRefPtr<RenderStyle> parentStyle) { m_parentStyle = p
arentStyle; } | 78 void setParentStyle(PassRefPtr<RenderStyle> parentStyle) { m_parentStyle = p
arentStyle; } |
| 85 RenderStyle* parentStyle() const { return m_parentStyle.get(); } | 79 RenderStyle* parentStyle() const { return m_parentStyle.get(); } |
| 86 RenderStyle* rootElementStyle() const { return m_rootElementStyle; } | 80 RenderStyle* rootElementStyle() const { return m_rootElementStyle; } |
| 87 | 81 |
| 88 const RenderRegion* regionForStyling() const { return m_regionForStyling; } | 82 const RenderRegion* regionForStyling() const { return m_regionForStyling; } |
| 89 EInsideLink elementLinkState() const { return m_elementLinkState; } | 83 EInsideLink elementLinkState() const { return m_elementLinkState; } |
| 90 bool distributedToInsertionPoint() const { return m_distributedToInsertionPo
int; } | 84 bool distributedToInsertionPoint() const { return m_distributedToInsertionPo
int; } |
| 91 void setElementAffectedByClassRules(bool isAffected) { m_elementAffectedByCl
assRules = isAffected; } | 85 void setElementAffectedByClassRules(bool isAffected) { m_elementAffectedByCl
assRules = isAffected; } |
| 92 bool elementAffectedByClassRules() const { return m_elementAffectedByClassRu
les; } | 86 bool elementAffectedByClassRules() const { return m_elementAffectedByClassRu
les; } |
| 93 | 87 |
| 94 // FIXME: These are effectively side-channel "out parameters" for the variou
s | 88 // FIXME: These are effectively side-channel "out parameters" for the variou
s |
| 95 // map functions. When we map from CSS to style objects we use this state ob
ject | 89 // map functions. When we map from CSS to style objects we use this state ob
ject |
| 96 // to track various meta-data about that mapping (e.g. if it's cache-able). | 90 // to track various meta-data about that mapping (e.g. if it's cache-able). |
| 97 // We need to move this data off of StyleResolverState and closer to the | 91 // We need to move this data off of StyleResolverState and closer to the |
| 98 // objects it applies to. Possibly separating (immutable) inputs from (mutab
le) outputs. | 92 // objects it applies to. Possibly separating (immutable) inputs from (mutab
le) outputs. |
| 99 void setApplyPropertyToRegularStyle(bool isApply) { m_applyPropertyToRegular
Style = isApply; } | 93 void setApplyPropertyToRegularStyle(bool isApply) { m_applyPropertyToRegular
Style = isApply; } |
| 100 void setApplyPropertyToVisitedLinkStyle(bool isApply) { m_applyPropertyToVis
itedLinkStyle = isApply; } | 94 void setApplyPropertyToVisitedLinkStyle(bool isApply) { m_applyPropertyToVis
itedLinkStyle = isApply; } |
| 101 bool applyPropertyToRegularStyle() const { return m_applyPropertyToRegularSt
yle; } | 95 bool applyPropertyToRegularStyle() const { return m_applyPropertyToRegularSt
yle; } |
| 102 bool applyPropertyToVisitedLinkStyle() const { return m_applyPropertyToVisit
edLinkStyle; } | 96 bool applyPropertyToVisitedLinkStyle() const { return m_applyPropertyToVisit
edLinkStyle; } |
| 103 bool isMatchedPropertiesCacheable() const { return m_isMatchedPropertiesCach
eable; } | |
| 104 | 97 |
| 105 void setLineHeightValue(CSSValue* value) { m_lineHeightValue = value; } | 98 void setLineHeightValue(CSSValue* value) { m_lineHeightValue = value; } |
| 106 CSSValue* lineHeightValue() { return m_lineHeightValue; } | 99 CSSValue* lineHeightValue() { return m_lineHeightValue; } |
| 107 | 100 |
| 108 void cacheBorderAndBackground(); | 101 void cacheBorderAndBackground(); |
| 109 bool hasUAAppearance() const { return m_hasUAAppearance; } | 102 bool hasUAAppearance() const { return m_hasUAAppearance; } |
| 110 BorderData borderData() const { return m_borderData; } | 103 BorderData borderData() const { return m_borderData; } |
| 111 FillLayer backgroundData() const { return m_backgroundData; } | 104 FillLayer backgroundData() const { return m_backgroundData; } |
| 112 Color backgroundColor() const { return m_backgroundColor; } | 105 Color backgroundColor() const { return m_backgroundColor; } |
| 113 ElementStyleResources& elementStyleResources() { return m_elementStyleResour
ces; } | 106 ElementStyleResources& elementStyleResources() { return m_elementStyleResour
ces; } |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 RenderRegion* m_regionForStyling; | 153 RenderRegion* m_regionForStyling; |
| 161 | 154 |
| 162 EInsideLink m_elementLinkState; | 155 EInsideLink m_elementLinkState; |
| 163 | 156 |
| 164 bool m_distributedToInsertionPoint; | 157 bool m_distributedToInsertionPoint; |
| 165 | 158 |
| 166 bool m_elementAffectedByClassRules; | 159 bool m_elementAffectedByClassRules; |
| 167 | 160 |
| 168 bool m_applyPropertyToRegularStyle; | 161 bool m_applyPropertyToRegularStyle; |
| 169 bool m_applyPropertyToVisitedLinkStyle; | 162 bool m_applyPropertyToVisitedLinkStyle; |
| 170 bool m_isMatchedPropertiesCacheable; | |
| 171 | 163 |
| 172 CSSValue* m_lineHeightValue; | 164 CSSValue* m_lineHeightValue; |
| 173 bool m_fontDirty; | 165 bool m_fontDirty; |
| 174 | 166 |
| 175 bool m_hasUAAppearance; | 167 bool m_hasUAAppearance; |
| 176 BorderData m_borderData; | 168 BorderData m_borderData; |
| 177 FillLayer m_backgroundData; | 169 FillLayer m_backgroundData; |
| 178 Color m_backgroundColor; | 170 Color m_backgroundColor; |
| 179 ElementStyleResources m_elementStyleResources; | 171 ElementStyleResources m_elementStyleResources; |
| 180 // CSSToStyleMap is a pure-logic class and only contains | 172 // CSSToStyleMap is a pure-logic class and only contains |
| 181 // a back-pointer to this object. | 173 // a back-pointer to this object. |
| 182 CSSToStyleMap m_styleMap; | 174 CSSToStyleMap m_styleMap; |
| 183 }; | 175 }; |
| 184 | 176 |
| 185 } // namespace WebCore | 177 } // namespace WebCore |
| 186 | 178 |
| 187 #endif // StyleResolverState_h | 179 #endif // StyleResolverState_h |
| OLD | NEW |