Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(59)

Side by Side Diff: Source/core/css/resolver/StyleResolverState.h

Issue 16629006: Revert 151996 "Avoid N^2 walk placing renderers when building th..." (Closed) Base URL: svn://svn.chromium.org/blink/
Patch Set: Update to head Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 class StyledElement; 43 class StyledElement;
44 44
45 typedef HashMap<CSSPropertyID, RefPtr<CSSValue> > PendingImagePropertyMap; 45 typedef HashMap<CSSPropertyID, RefPtr<CSSValue> > PendingImagePropertyMap;
46 typedef HashMap<FilterOperation*, RefPtr<CSSSVGDocumentValue> > PendingSVGDocume ntMap; 46 typedef HashMap<FilterOperation*, RefPtr<CSSSVGDocumentValue> > PendingSVGDocume ntMap;
47 47
48 class StyleResolverState { 48 class StyleResolverState {
49 WTF_MAKE_NONCOPYABLE(StyleResolverState); 49 WTF_MAKE_NONCOPYABLE(StyleResolverState);
50 public: 50 public:
51 StyleResolverState() 51 StyleResolverState()
52 : m_element(0) 52 : m_element(0)
53 , m_childIndex(0)
54 , m_styledElement(0) 53 , m_styledElement(0)
55 , m_parentNode(0) 54 , m_parentNode(0)
56 , m_parentStyle(0) 55 , m_parentStyle(0)
57 , m_rootElementStyle(0) 56 , m_rootElementStyle(0)
58 , m_regionForStyling(0) 57 , m_regionForStyling(0)
59 , m_elementLinkState(NotInsideLink) 58 , m_elementLinkState(NotInsideLink)
60 , m_distributedToInsertionPoint(false) 59 , m_distributedToInsertionPoint(false)
61 , m_elementAffectedByClassRules(false) 60 , m_elementAffectedByClassRules(false)
62 , m_applyPropertyToRegularStyle(true) 61 , m_applyPropertyToRegularStyle(true)
63 , m_applyPropertyToVisitedLinkStyle(false) 62 , m_applyPropertyToVisitedLinkStyle(false)
64 , m_hasPendingShaders(false) 63 , m_hasPendingShaders(false)
65 , m_lineHeightValue(0) 64 , m_lineHeightValue(0)
66 , m_fontDirty(false) 65 , m_fontDirty(false)
67 , m_hasUAAppearance(false) 66 , m_hasUAAppearance(false)
68 , m_backgroundData(BackgroundFillLayer) { } 67 , m_backgroundData(BackgroundFillLayer) { }
69 68
70 public: 69 public:
71 void initElement(Element*, int childIndex); 70 void initElement(Element*);
72 void initForStyleResolve(Document*, Element*, RenderStyle* parentStyle = 0, RenderRegion* regionForStyling = 0); 71 void initForStyleResolve(Document*, Element*, RenderStyle* parentStyle = 0, RenderRegion* regionForStyling = 0);
73 void clear(); 72 void clear();
74 73
75 Color colorFromPrimitiveValue(CSSPrimitiveValue*, bool forVisitedLink = fals e) const; 74 Color colorFromPrimitiveValue(CSSPrimitiveValue*, bool forVisitedLink = fals e) const;
76 75
77 Document* document() const { return m_element->document(); } 76 Document* document() const { return m_element->document(); }
78 Element* element() const { return m_element; } 77 Element* element() const { return m_element; }
79 int childIndex() const { return m_childIndex; }
80 StyledElement* styledElement() const { return m_styledElement; } 78 StyledElement* styledElement() const { return m_styledElement; }
81 void setStyle(PassRefPtr<RenderStyle> style) { m_style = style; } 79 void setStyle(PassRefPtr<RenderStyle> style) { m_style = style; }
82 RenderStyle* style() const { return m_style.get(); } 80 RenderStyle* style() const { return m_style.get(); }
83 PassRefPtr<RenderStyle> takeStyle() { return m_style.release(); } 81 PassRefPtr<RenderStyle> takeStyle() { return m_style.release(); }
84 82
85 const ContainerNode* parentNode() const { return m_parentNode; } 83 const ContainerNode* parentNode() const { return m_parentNode; }
86 void setParentStyle(PassRefPtr<RenderStyle> parentStyle) { m_parentStyle = p arentStyle; } 84 void setParentStyle(PassRefPtr<RenderStyle> parentStyle) { m_parentStyle = p arentStyle; }
87 RenderStyle* parentStyle() const { return m_parentStyle.get(); } 85 RenderStyle* parentStyle() const { return m_parentStyle.get(); }
88 RenderStyle* rootElementStyle() const { return m_rootElementStyle; } 86 RenderStyle* rootElementStyle() const { return m_rootElementStyle; }
89 87
(...skipping 28 matching lines...) Expand all
118 void setFontDescription(const FontDescription& fontDescription) { m_fontDirt y |= m_style->setFontDescription(fontDescription); } 116 void setFontDescription(const FontDescription& fontDescription) { m_fontDirt y |= m_style->setFontDescription(fontDescription); }
119 void setZoom(float f) { m_fontDirty |= m_style->setZoom(f); } 117 void setZoom(float f) { m_fontDirty |= m_style->setZoom(f); }
120 void setEffectiveZoom(float f) { m_fontDirty |= m_style->setEffectiveZoom(f) ; } 118 void setEffectiveZoom(float f) { m_fontDirty |= m_style->setEffectiveZoom(f) ; }
121 void setWritingMode(WritingMode writingMode) { m_fontDirty |= m_style->setWr itingMode(writingMode); } 119 void setWritingMode(WritingMode writingMode) { m_fontDirty |= m_style->setWr itingMode(writingMode); }
122 void setTextOrientation(TextOrientation textOrientation) { m_fontDirty |= m_ style->setTextOrientation(textOrientation); } 120 void setTextOrientation(TextOrientation textOrientation) { m_fontDirty |= m_ style->setTextOrientation(textOrientation); }
123 121
124 bool useSVGZoomRules() const { return m_element && m_element->isSVGElement() ; } 122 bool useSVGZoomRules() const { return m_element && m_element->isSVGElement() ; }
125 123
126 private: 124 private:
127 Element* m_element; 125 Element* m_element;
128 int m_childIndex;
129 RefPtr<RenderStyle> m_style; 126 RefPtr<RenderStyle> m_style;
130 StyledElement* m_styledElement; 127 StyledElement* m_styledElement;
131 ContainerNode* m_parentNode; 128 ContainerNode* m_parentNode;
132 RefPtr<RenderStyle> m_parentStyle; 129 RefPtr<RenderStyle> m_parentStyle;
133 RenderStyle* m_rootElementStyle; 130 RenderStyle* m_rootElementStyle;
134 131
135 // Required to ASSERT in applyProperties. 132 // Required to ASSERT in applyProperties.
136 RenderRegion* m_regionForStyling; 133 RenderRegion* m_regionForStyling;
137 134
138 EInsideLink m_elementLinkState; 135 EInsideLink m_elementLinkState;
(...skipping 13 matching lines...) Expand all
152 149
153 bool m_hasUAAppearance; 150 bool m_hasUAAppearance;
154 BorderData m_borderData; 151 BorderData m_borderData;
155 FillLayer m_backgroundData; 152 FillLayer m_backgroundData;
156 Color m_backgroundColor; 153 Color m_backgroundColor;
157 }; 154 };
158 155
159 } // namespace WebCore 156 } // namespace WebCore
160 157
161 #endif // StyleResolverState_h 158 #endif // StyleResolverState_h
OLDNEW
« no previous file with comments | « Source/core/css/resolver/StyleResolver.cpp ('k') | Source/core/css/resolver/StyleResolverState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698