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

Side by Side Diff: Source/core/css/CSSToStyleMap.h

Issue 20112002: Have const StyleResolverState return const RenderStyle (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 5 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
« no previous file with comments | « no previous file | Source/core/css/CSSToStyleMap.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 * Copyright (C) 2012 Google Inc. All rights reserved. 4 * Copyright (C) 2012 Google Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 26 matching lines...) Expand all
37 class StyleResolverState; 37 class StyleResolverState;
38 class NinePieceImage; 38 class NinePieceImage;
39 39
40 // CSSToStyleMap is a short-lived helper object which 40 // CSSToStyleMap is a short-lived helper object which
41 // given the current StyleResolverState can map 41 // given the current StyleResolverState can map
42 // CSSValue objects into their RenderStyle equivalents. 42 // CSSValue objects into their RenderStyle equivalents.
43 43
44 class CSSToStyleMap { 44 class CSSToStyleMap {
45 WTF_MAKE_NONCOPYABLE(CSSToStyleMap); 45 WTF_MAKE_NONCOPYABLE(CSSToStyleMap);
46 public: 46 public:
47 // FIXME: This could be const StyleResolverState
48 // except styleImage can include a gradient, which
49 // may resolve a color and may need to flip bits
50 // on StyleResolverState.
51 CSSToStyleMap(const StyleResolverState& state, ElementStyleResources& elemen tStyleResources) : m_state(state), m_elementStyleResources(elementStyleResources ) { } 47 CSSToStyleMap(const StyleResolverState& state, ElementStyleResources& elemen tStyleResources) : m_state(state), m_elementStyleResources(elementStyleResources ) { }
52 48
53 void mapFillAttachment(CSSPropertyID, FillLayer*, CSSValue*) const; 49 void mapFillAttachment(CSSPropertyID, FillLayer*, CSSValue*) const;
54 void mapFillClip(CSSPropertyID, FillLayer*, CSSValue*) const; 50 void mapFillClip(CSSPropertyID, FillLayer*, CSSValue*) const;
55 void mapFillComposite(CSSPropertyID, FillLayer*, CSSValue*) const; 51 void mapFillComposite(CSSPropertyID, FillLayer*, CSSValue*) const;
56 void mapFillBlendMode(CSSPropertyID, FillLayer*, CSSValue*) const; 52 void mapFillBlendMode(CSSPropertyID, FillLayer*, CSSValue*) const;
57 void mapFillOrigin(CSSPropertyID, FillLayer*, CSSValue*) const; 53 void mapFillOrigin(CSSPropertyID, FillLayer*, CSSValue*) const;
58 void mapFillImage(CSSPropertyID, FillLayer*, CSSValue*); 54 void mapFillImage(CSSPropertyID, FillLayer*, CSSValue*);
59 void mapFillRepeatX(CSSPropertyID, FillLayer*, CSSValue*) const; 55 void mapFillRepeatX(CSSPropertyID, FillLayer*, CSSValue*) const;
60 void mapFillRepeatY(CSSPropertyID, FillLayer*, CSSValue*) const; 56 void mapFillRepeatY(CSSPropertyID, FillLayer*, CSSValue*) const;
61 void mapFillSize(CSSPropertyID, FillLayer*, CSSValue*) const; 57 void mapFillSize(CSSPropertyID, FillLayer*, CSSValue*) const;
62 void mapFillXPosition(CSSPropertyID, FillLayer*, CSSValue*) const; 58 void mapFillXPosition(CSSPropertyID, FillLayer*, CSSValue*) const;
63 void mapFillYPosition(CSSPropertyID, FillLayer*, CSSValue*) const; 59 void mapFillYPosition(CSSPropertyID, FillLayer*, CSSValue*) const;
64 60
65 void mapAnimationDelay(CSSAnimationData*, CSSValue*) const; 61 void mapAnimationDelay(CSSAnimationData*, CSSValue*) const;
66 void mapAnimationDirection(CSSAnimationData*, CSSValue*) const; 62 void mapAnimationDirection(CSSAnimationData*, CSSValue*) const;
67 void mapAnimationDuration(CSSAnimationData*, CSSValue*) const; 63 void mapAnimationDuration(CSSAnimationData*, CSSValue*) const;
68 void mapAnimationFillMode(CSSAnimationData*, CSSValue*) const; 64 void mapAnimationFillMode(CSSAnimationData*, CSSValue*) const;
69 void mapAnimationIterationCount(CSSAnimationData*, CSSValue*) const; 65 void mapAnimationIterationCount(CSSAnimationData*, CSSValue*) const;
70 void mapAnimationName(CSSAnimationData*, CSSValue*) const; 66 void mapAnimationName(CSSAnimationData*, CSSValue*) const;
71 void mapAnimationPlayState(CSSAnimationData*, CSSValue*) const; 67 void mapAnimationPlayState(CSSAnimationData*, CSSValue*) const;
72 void mapAnimationProperty(CSSAnimationData*, CSSValue*) const; 68 void mapAnimationProperty(CSSAnimationData*, CSSValue*) const;
73 void mapAnimationTimingFunction(CSSAnimationData*, CSSValue*) const; 69 void mapAnimationTimingFunction(CSSAnimationData*, CSSValue*) const;
74 70
75 void mapNinePieceImage(CSSPropertyID, CSSValue*, NinePieceImage&); 71 void mapNinePieceImage(RenderStyle* mutableStyle, CSSPropertyID, CSSValue*, NinePieceImage&);
76 void mapNinePieceImageSlice(CSSValue*, NinePieceImage&) const; 72 void mapNinePieceImageSlice(CSSValue*, NinePieceImage&) const;
77 LengthBox mapNinePieceImageQuad(CSSValue*) const; 73 LengthBox mapNinePieceImageQuad(CSSValue*) const;
78 void mapNinePieceImageRepeat(CSSValue*, NinePieceImage&) const; 74 void mapNinePieceImageRepeat(CSSValue*, NinePieceImage&) const;
79 75
80 private: 76 private:
81 RenderStyle* style() const; 77 const RenderStyle* style() const;
82 RenderStyle* rootElementStyle() const; 78 const RenderStyle* rootElementStyle() const;
83 bool useSVGZoomRules() const; 79 bool useSVGZoomRules() const;
84 80
85 PassRefPtr<StyleImage> styleImage(CSSPropertyID, CSSValue*); 81 PassRefPtr<StyleImage> styleImage(CSSPropertyID, CSSValue*);
86 82
87 // FIXME: Consider passing a StyleResolverState (or ElementResolveState) 83 // FIXME: Consider passing a StyleResolverState (or ElementResolveState)
88 // as an argument instead of caching it on this object. 84 // as an argument instead of caching it on this object.
89 const StyleResolverState& m_state; 85 const StyleResolverState& m_state;
90 ElementStyleResources& m_elementStyleResources; 86 ElementStyleResources& m_elementStyleResources;
91 }; 87 };
92 88
93 } 89 }
94 90
95 #endif 91 #endif
OLDNEW
« no previous file with comments | « no previous file | Source/core/css/CSSToStyleMap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698