Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 23 matching lines...) Expand all Loading... | |
| 34 StylePropertyMetadata(CSSPropertyID propertyID, bool isSetFromShorthand, int indexInShorthandsVector, bool important, bool implicit, bool inherited) | 34 StylePropertyMetadata(CSSPropertyID propertyID, bool isSetFromShorthand, int indexInShorthandsVector, bool important, bool implicit, bool inherited) |
| 35 : m_propertyID(propertyID) | 35 : m_propertyID(propertyID) |
| 36 , m_isSetFromShorthand(isSetFromShorthand) | 36 , m_isSetFromShorthand(isSetFromShorthand) |
| 37 , m_indexInShorthandsVector(indexInShorthandsVector) | 37 , m_indexInShorthandsVector(indexInShorthandsVector) |
| 38 , m_important(important) | 38 , m_important(important) |
| 39 , m_implicit(implicit) | 39 , m_implicit(implicit) |
| 40 , m_inherited(inherited) | 40 , m_inherited(inherited) |
| 41 { | 41 { |
| 42 } | 42 } |
| 43 | 43 |
| 44 StylePropertyMetadata(uint32_t data) | |
| 45 { | |
| 46 memcpy(this, &data, sizeof(StylePropertyMetadata)); | |
|
Jeffrey Yasskin
2013/06/21 19:56:27
memcpy is dangerous because of endian-ness issues,
| |
| 47 } | |
| 48 | |
| 44 CSSPropertyID shorthandID() const; | 49 CSSPropertyID shorthandID() const; |
| 45 | 50 |
| 46 unsigned m_propertyID : 10; | 51 unsigned m_propertyID : 10; |
|
Jeffrey Yasskin
2013/06/21 19:56:27
If you change the type of these fields to uint16_t
| |
| 47 unsigned m_isSetFromShorthand : 1; | 52 unsigned m_isSetFromShorthand : 1; |
| 48 unsigned m_indexInShorthandsVector : 2; // If this property was set as part of an ambiguous shorthand, gives the index in the shorthands vector. | 53 unsigned m_indexInShorthandsVector : 2; // If this property was set as part of an ambiguous shorthand, gives the index in the shorthands vector. |
| 49 unsigned m_important : 1; | 54 unsigned m_important : 1; |
| 50 unsigned m_implicit : 1; // Whether or not the property was set implicitly a s the result of a shorthand. | 55 unsigned m_implicit : 1; // Whether or not the property was set implicitly a s the result of a shorthand. |
| 51 unsigned m_inherited : 1; | 56 unsigned m_inherited : 1; |
| 52 }; | 57 }; |
| 53 | 58 |
| 54 class CSSProperty { | 59 class CSSProperty { |
| 55 public: | 60 public: |
| 56 CSSProperty(CSSPropertyID propertyID, PassRefPtr<CSSValue> value, bool impor tant = false, bool isSetFromShorthand = false, int indexInShorthandsVector = 0, bool implicit = false) | 61 CSSProperty(CSSPropertyID propertyID, PassRefPtr<CSSValue> value, bool impor tant = false, bool isSetFromShorthand = false, int indexInShorthandsVector = 0, bool implicit = false) |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 134 } // namespace WebCore | 139 } // namespace WebCore |
| 135 | 140 |
| 136 namespace WTF { | 141 namespace WTF { |
| 137 template <> struct VectorTraits<WebCore::CSSProperty> : VectorTraitsBase<false, WebCore::CSSProperty> { | 142 template <> struct VectorTraits<WebCore::CSSProperty> : VectorTraitsBase<false, WebCore::CSSProperty> { |
| 138 static const bool canInitializeWithMemset = true; | 143 static const bool canInitializeWithMemset = true; |
| 139 static const bool canMoveWithMemcpy = true; | 144 static const bool canMoveWithMemcpy = true; |
| 140 }; | 145 }; |
| 141 } | 146 } |
| 142 | 147 |
| 143 #endif // CSSProperty_h | 148 #endif // CSSProperty_h |
| OLD | NEW |