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

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

Issue 1238943004: CSSValue Immediates: Replace CSSValue usage with const references (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@cssvalue_patch_1
Patch Set: Rebase Created 5 years, 4 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
« no previous file with comments | « Source/core/css/CSSCursorImageValue.cpp ('k') | Source/core/css/CSSStyleDeclaration.h » ('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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 uint16_t m_isSetFromShorthand : 1; 49 uint16_t m_isSetFromShorthand : 1;
50 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_indexInShorthandsVector : 2; // If this property was set as part of an ambiguous shorthand, gives the index in the shorthands vector.
51 uint16_t m_important : 1; 51 uint16_t m_important : 1;
52 uint16_t m_implicit : 1; // Whether or not the property was set implicitly a s the result of a shorthand. 52 uint16_t m_implicit : 1; // Whether or not the property was set implicitly a s the result of a shorthand.
53 uint16_t m_inherited : 1; 53 uint16_t m_inherited : 1;
54 }; 54 };
55 55
56 class CSSProperty { 56 class CSSProperty {
57 ALLOW_ONLY_INLINE_ALLOCATION(); 57 ALLOW_ONLY_INLINE_ALLOCATION();
58 public: 58 public:
59 CSSProperty(CSSPropertyID propertyID, CSSValue value, bool important = false , bool isSetFromShorthand = false, int indexInShorthandsVector = 0, bool implici t = false) 59 CSSProperty(CSSPropertyID propertyID, const CSSValue& value, bool important = false, bool isSetFromShorthand = false, int indexInShorthandsVector = 0, bool implicit = false)
60 : m_metadata(propertyID, isSetFromShorthand, indexInShorthandsVector, im portant, implicit, CSSPropertyMetadata::isInheritedProperty(propertyID)) 60 : m_metadata(propertyID, isSetFromShorthand, indexInShorthandsVector, im portant, implicit, CSSPropertyMetadata::isInheritedProperty(propertyID))
61 , m_value(value) 61 , m_value(value)
62 { 62 {
63 } 63 }
64 64
65 // FIXME: Remove this. 65 // FIXME: Remove this.
66 CSSProperty(StylePropertyMetadata metadata, CSSValue value) 66 CSSProperty(StylePropertyMetadata metadata, const CSSValue& value)
67 : m_metadata(metadata) 67 : m_metadata(metadata)
68 , m_value(value) 68 , m_value(value)
69 { 69 {
70 } 70 }
71 71
72 CSSPropertyID id() const { return static_cast<CSSPropertyID>(m_metadata.m_pr opertyID); } 72 CSSPropertyID id() const { return static_cast<CSSPropertyID>(m_metadata.m_pr opertyID); }
73 bool isSetFromShorthand() const { return m_metadata.m_isSetFromShorthand; } 73 bool isSetFromShorthand() const { return m_metadata.m_isSetFromShorthand; }
74 CSSPropertyID shorthandID() const { return m_metadata.shorthandID(); } 74 CSSPropertyID shorthandID() const { return m_metadata.shorthandID(); }
75 bool isImportant() const { return m_metadata.m_important; } 75 bool isImportant() const { return m_metadata.m_important; }
76 76
(...skipping 12 matching lines...) Expand all
89 StylePropertyMetadata m_metadata; 89 StylePropertyMetadata m_metadata;
90 CSSValue m_value; 90 CSSValue m_value;
91 }; 91 };
92 92
93 } // namespace blink 93 } // namespace blink
94 94
95 // TODO(sashab): Shouldn't initialize CSSProperty with null, since it contains a CSSValue. 95 // TODO(sashab): Shouldn't initialize CSSProperty with null, since it contains a CSSValue.
96 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::CSSProperty); 96 WTF_ALLOW_MOVE_AND_INIT_WITH_MEM_FUNCTIONS(blink::CSSProperty);
97 97
98 #endif // CSSProperty_h 98 #endif // CSSProperty_h
OLDNEW
« no previous file with comments | « Source/core/css/CSSCursorImageValue.cpp ('k') | Source/core/css/CSSStyleDeclaration.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698