| 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, |
| 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 * Library General Public License for more details. | 13 * Library General Public License for more details. |
| 14 * | 14 * |
| 15 * You should have received a copy of the GNU Library General Public License | 15 * You should have received a copy of the GNU Library General Public License |
| 16 * along with this library; see the file COPYING.LIB. If not, write to | 16 * along with this library; see the file COPYING.LIB. If not, write to |
| 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 18 * Boston, MA 02110-1301, USA. | 18 * Boston, MA 02110-1301, USA. |
| 19 * | 19 * |
| 20 */ | 20 */ |
| 21 | 21 |
| 22 #ifndef StyleResolverState_h | 22 #ifndef StyleResolverState_h |
| 23 #define StyleResolverState_h | 23 #define StyleResolverState_h |
| 24 | 24 |
| 25 #include "core/CSSPropertyNames.h" | 25 #include "core/CSSPropertyNames.h" |
| 26 #include "core/CoreExport.h" | 26 #include "core/CoreExport.h" |
| 27 #include "core/animation/css/CSSAnimationUpdate.h" |
| 27 #include "core/css/CSSSVGDocumentValue.h" | 28 #include "core/css/CSSSVGDocumentValue.h" |
| 28 #include "core/css/CSSToLengthConversionData.h" | 29 #include "core/css/CSSToLengthConversionData.h" |
| 29 #include "core/css/resolver/CSSToStyleMap.h" | 30 #include "core/css/resolver/CSSToStyleMap.h" |
| 30 #include "core/css/resolver/ElementResolveContext.h" | 31 #include "core/css/resolver/ElementResolveContext.h" |
| 31 #include "core/css/resolver/ElementStyleResources.h" | 32 #include "core/css/resolver/ElementStyleResources.h" |
| 32 #include "core/css/resolver/FontBuilder.h" | 33 #include "core/css/resolver/FontBuilder.h" |
| 33 #include "core/dom/Document.h" | 34 #include "core/dom/Document.h" |
| 34 #include "core/dom/Element.h" | 35 #include "core/dom/Element.h" |
| 35 #include "core/style/CachedUAStyle.h" | 36 #include "core/style/CachedUAStyle.h" |
| 36 #include "core/style/ComputedStyle.h" | 37 #include "core/style/ComputedStyle.h" |
| 37 #include "core/style/StyleInheritedData.h" | 38 #include "core/style/StyleInheritedData.h" |
| 38 | 39 |
| 39 namespace blink { | 40 namespace blink { |
| 40 | 41 |
| 41 class CSSAnimationUpdate; | |
| 42 class FontDescription; | 42 class FontDescription; |
| 43 | 43 |
| 44 class CORE_EXPORT StyleResolverState { | 44 class CORE_EXPORT StyleResolverState { |
| 45 STACK_ALLOCATED(); | 45 STACK_ALLOCATED(); |
| 46 WTF_MAKE_NONCOPYABLE(StyleResolverState); | 46 WTF_MAKE_NONCOPYABLE(StyleResolverState); |
| 47 public: | 47 public: |
| 48 StyleResolverState(Document&, const ElementResolveContext&, const ComputedSt
yle* parentStyle); | 48 StyleResolverState(Document&, const ElementResolveContext&, const ComputedSt
yle* parentStyle); |
| 49 StyleResolverState(Document&, Element*, const ComputedStyle* parentStyle = 0
); | 49 StyleResolverState(Document&, Element*, const ComputedStyle* parentStyle = 0
); |
| 50 ~StyleResolverState(); | 50 ~StyleResolverState(); |
| 51 | 51 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 72 PassRefPtr<ComputedStyle> takeStyle() { return m_style.release(); } | 72 PassRefPtr<ComputedStyle> takeStyle() { return m_style.release(); } |
| 73 | 73 |
| 74 ComputedStyle& mutableStyleRef() const { return *m_style; } | 74 ComputedStyle& mutableStyleRef() const { return *m_style; } |
| 75 const ComputedStyle& styleRef() const { return mutableStyleRef(); } | 75 const ComputedStyle& styleRef() const { return mutableStyleRef(); } |
| 76 | 76 |
| 77 const CSSToLengthConversionData& cssToLengthConversionData() const { return
m_cssToLengthConversionData; } | 77 const CSSToLengthConversionData& cssToLengthConversionData() const { return
m_cssToLengthConversionData; } |
| 78 | 78 |
| 79 void setConversionFontSizes(const CSSToLengthConversionData::FontSizes& font
Sizes) { m_cssToLengthConversionData.setFontSizes(fontSizes); } | 79 void setConversionFontSizes(const CSSToLengthConversionData::FontSizes& font
Sizes) { m_cssToLengthConversionData.setFontSizes(fontSizes); } |
| 80 void setConversionZoom(float zoom) { m_cssToLengthConversionData.setZoom(zoo
m); } | 80 void setConversionZoom(float zoom) { m_cssToLengthConversionData.setZoom(zoo
m); } |
| 81 | 81 |
| 82 void setAnimationUpdate(PassOwnPtrWillBeRawPtr<CSSAnimationUpdate>); | 82 CSSAnimationUpdate& animationUpdate() { return m_animationUpdate; } |
| 83 const CSSAnimationUpdate* animationUpdate() { return m_animationUpdate.get()
; } | |
| 84 PassOwnPtrWillBeRawPtr<CSSAnimationUpdate> takeAnimationUpdate(); | |
| 85 | 83 |
| 86 void setParentStyle(PassRefPtr<ComputedStyle> parentStyle) { m_parentStyle =
parentStyle; } | 84 void setParentStyle(PassRefPtr<ComputedStyle> parentStyle) { m_parentStyle =
parentStyle; } |
| 87 const ComputedStyle* parentStyle() const { return m_parentStyle.get(); } | 85 const ComputedStyle* parentStyle() const { return m_parentStyle.get(); } |
| 88 ComputedStyle* parentStyle() { return m_parentStyle.get(); } | 86 ComputedStyle* parentStyle() { return m_parentStyle.get(); } |
| 89 | 87 |
| 90 // 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 |
| 91 // 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 |
| 92 // 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). |
| 93 // 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 |
| 94 // 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. |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 | 158 |
| 161 // m_style is the primary output for each element's style resolve. | 159 // m_style is the primary output for each element's style resolve. |
| 162 RefPtr<ComputedStyle> m_style; | 160 RefPtr<ComputedStyle> m_style; |
| 163 | 161 |
| 164 CSSToLengthConversionData m_cssToLengthConversionData; | 162 CSSToLengthConversionData m_cssToLengthConversionData; |
| 165 | 163 |
| 166 // m_parentStyle is not always just ElementResolveContext::parentStyle, | 164 // m_parentStyle is not always just ElementResolveContext::parentStyle, |
| 167 // so we keep it separate. | 165 // so we keep it separate. |
| 168 RefPtr<ComputedStyle> m_parentStyle; | 166 RefPtr<ComputedStyle> m_parentStyle; |
| 169 | 167 |
| 170 OwnPtrWillBeMember<CSSAnimationUpdate> m_animationUpdate; | 168 CSSAnimationUpdate m_animationUpdate; |
| 171 | 169 |
| 172 bool m_applyPropertyToRegularStyle; | 170 bool m_applyPropertyToRegularStyle; |
| 173 bool m_applyPropertyToVisitedLinkStyle; | 171 bool m_applyPropertyToVisitedLinkStyle; |
| 174 bool m_hasDirAutoAttribute; | 172 bool m_hasDirAutoAttribute; |
| 175 | 173 |
| 176 FontBuilder m_fontBuilder; | 174 FontBuilder m_fontBuilder; |
| 177 | 175 |
| 178 OwnPtr<CachedUAStyle> m_cachedUAStyle; | 176 OwnPtr<CachedUAStyle> m_cachedUAStyle; |
| 179 | 177 |
| 180 ElementStyleResources m_elementStyleResources; | 178 ElementStyleResources m_elementStyleResources; |
| 181 }; | 179 }; |
| 182 | 180 |
| 183 } // namespace blink | 181 } // namespace blink |
| 184 | 182 |
| 185 #endif // StyleResolverState_h | 183 #endif // StyleResolverState_h |
| OLD | NEW |