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

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

Issue 184853009: Revert of Move all RefPtr's to CSSValue to oilpan transition types (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 | « Source/core/animation/AnimatableUnknownTest.cpp ('k') | Source/core/css/CSSProperty.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 * (C) 1999-2003 Lars Knoll (knoll@kde.org) 2 * (C) 1999-2003 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. 3 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc.
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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 46
47 uint16_t m_propertyID : 10; 47 uint16_t m_propertyID : 10;
48 uint16_t m_isSetFromShorthand : 1; 48 uint16_t m_isSetFromShorthand : 1;
49 uint16_t m_indexInShorthandsVector : 2; // If this property was set as part of an ambiguous shorthand, gives the index in the shorthands vector. 49 uint16_t m_indexInShorthandsVector : 2; // If this property was set as part of an ambiguous shorthand, gives the index in the shorthands vector.
50 uint16_t m_important : 1; 50 uint16_t m_important : 1;
51 uint16_t m_implicit : 1; // Whether or not the property was set implicitly a s the result of a shorthand. 51 uint16_t m_implicit : 1; // Whether or not the property was set implicitly a s the result of a shorthand.
52 uint16_t m_inherited : 1; 52 uint16_t m_inherited : 1;
53 }; 53 };
54 54
55 class CSSProperty { 55 class CSSProperty {
56 ALLOW_ONLY_INLINE_ALLOCATION();
57 public: 56 public:
58 CSSProperty(CSSPropertyID propertyID, PassRefPtrWillBeRawPtr<CSSValue> value , bool important = false, bool isSetFromShorthand = false, int indexInShorthands Vector = 0, bool implicit = false) 57 CSSProperty(CSSPropertyID propertyID, PassRefPtrWillBeRawPtr<CSSValue> value , bool important = false, bool isSetFromShorthand = false, int indexInShorthands Vector = 0, bool implicit = false)
59 : m_metadata(propertyID, isSetFromShorthand, indexInShorthandsVector, im portant, implicit, isInheritedProperty(propertyID)) 58 : m_metadata(propertyID, isSetFromShorthand, indexInShorthandsVector, im portant, implicit, isInheritedProperty(propertyID))
60 , m_value(value) 59 , m_value(value)
61 { 60 {
62 } 61 }
63 62
64 // FIXME: Remove this. 63 // FIXME: Remove this.
65 CSSProperty(StylePropertyMetadata metadata, CSSValue* value) 64 CSSProperty(StylePropertyMetadata metadata, CSSValue* value)
66 : m_metadata(metadata) 65 : m_metadata(metadata)
67 , m_value(value) 66 , m_value(value)
68 { 67 {
69 } 68 }
70 69
71 CSSPropertyID id() const { return static_cast<CSSPropertyID>(m_metadata.m_pr opertyID); } 70 CSSPropertyID id() const { return static_cast<CSSPropertyID>(m_metadata.m_pr opertyID); }
72 bool isSetFromShorthand() const { return m_metadata.m_isSetFromShorthand; }; 71 bool isSetFromShorthand() const { return m_metadata.m_isSetFromShorthand; };
73 CSSPropertyID shorthandID() const { return m_metadata.shorthandID(); }; 72 CSSPropertyID shorthandID() const { return m_metadata.shorthandID(); };
74 bool isImportant() const { return m_metadata.m_important; } 73 bool isImportant() const { return m_metadata.m_important; }
75 74
76 CSSValue* value() const { return m_value.get(); } 75 CSSValue* value() const { return m_value.get(); }
77 76
78 void wrapValueInCommaSeparatedList(); 77 void wrapValueInCommaSeparatedList();
79 78
80 static CSSPropertyID resolveDirectionAwareProperty(CSSPropertyID, TextDirect ion, WritingMode); 79 static CSSPropertyID resolveDirectionAwareProperty(CSSPropertyID, TextDirect ion, WritingMode);
81 static bool isInheritedProperty(CSSPropertyID); 80 static bool isInheritedProperty(CSSPropertyID);
82 81
83 const StylePropertyMetadata& metadata() const { return m_metadata; } 82 const StylePropertyMetadata& metadata() const { return m_metadata; }
84 83
85 void trace(Visitor* visitor) { visitor->trace(m_value); }
86
87 private: 84 private:
88 StylePropertyMetadata m_metadata; 85 StylePropertyMetadata m_metadata;
89 RefPtrWillBeMember<CSSValue> m_value; 86 RefPtr<CSSValue> m_value;
90 }; 87 };
91 88
92 inline CSSPropertyID prefixingVariantForPropertyId(CSSPropertyID propId) 89 inline CSSPropertyID prefixingVariantForPropertyId(CSSPropertyID propId)
93 { 90 {
94 if (!RuntimeEnabledFeatures::cssAnimationUnprefixedEnabled() && (propId >= C SSPropertyWebkitAnimation && propId <= CSSPropertyAnimationTimingFunction)) 91 if (!RuntimeEnabledFeatures::cssAnimationUnprefixedEnabled() && (propId >= C SSPropertyWebkitAnimation && propId <= CSSPropertyAnimationTimingFunction))
95 return propId; 92 return propId;
96 93
97 CSSPropertyID propertyId = CSSPropertyInvalid; 94 CSSPropertyID propertyId = CSSPropertyInvalid;
98 switch (propId) { 95 switch (propId) {
99 case CSSPropertyAnimation: 96 case CSSPropertyAnimation:
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 } // namespace WebCore 188 } // namespace WebCore
192 189
193 namespace WTF { 190 namespace WTF {
194 template <> struct VectorTraits<WebCore::CSSProperty> : VectorTraitsBase<WebCore ::CSSProperty> { 191 template <> struct VectorTraits<WebCore::CSSProperty> : VectorTraitsBase<WebCore ::CSSProperty> {
195 static const bool canInitializeWithMemset = true; 192 static const bool canInitializeWithMemset = true;
196 static const bool canMoveWithMemcpy = true; 193 static const bool canMoveWithMemcpy = true;
197 }; 194 };
198 } 195 }
199 196
200 #endif // CSSProperty_h 197 #endif // CSSProperty_h
OLDNEW
« no previous file with comments | « Source/core/animation/AnimatableUnknownTest.cpp ('k') | Source/core/css/CSSProperty.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698