| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 static_assert(sizeof(ElementData) == sizeof(SameSizeAsElementData), "ElementData
should stay small"); | 45 static_assert(sizeof(ElementData) == sizeof(SameSizeAsElementData), "ElementData
should stay small"); |
| 46 | 46 |
| 47 static size_t sizeForShareableElementDataWithAttributeCount(unsigned count) | 47 static size_t sizeForShareableElementDataWithAttributeCount(unsigned count) |
| 48 { | 48 { |
| 49 return sizeof(ShareableElementData) + sizeof(Attribute) * count; | 49 return sizeof(ShareableElementData) + sizeof(Attribute) * count; |
| 50 } | 50 } |
| 51 | 51 |
| 52 ElementData::ElementData() | 52 ElementData::ElementData() |
| 53 : m_isUnique(true) | 53 : m_isUnique(true) |
| 54 , m_arraySize(0) | 54 , m_arraySize(0) |
| 55 , m_directionality(static_cast<int>(CachedTextDirection::NotAutoOrNotCached)
) |
| 55 , m_presentationAttributeStyleIsDirty(false) | 56 , m_presentationAttributeStyleIsDirty(false) |
| 56 , m_styleAttributeIsDirty(false) | 57 , m_styleAttributeIsDirty(false) |
| 57 , m_animatedSVGAttributesAreDirty(false) | 58 , m_animatedSVGAttributesAreDirty(false) |
| 58 { | 59 { |
| 59 } | 60 } |
| 60 | 61 |
| 61 ElementData::ElementData(unsigned arraySize) | 62 ElementData::ElementData(unsigned arraySize) |
| 62 : m_isUnique(false) | 63 : m_isUnique(false) |
| 63 , m_arraySize(arraySize) | 64 , m_arraySize(arraySize) |
| 65 , m_directionality(static_cast<int>(CachedTextDirection::NotAutoOrNotCached)
) |
| 64 , m_presentationAttributeStyleIsDirty(false) | 66 , m_presentationAttributeStyleIsDirty(false) |
| 65 , m_styleAttributeIsDirty(false) | 67 , m_styleAttributeIsDirty(false) |
| 66 , m_animatedSVGAttributesAreDirty(false) | 68 , m_animatedSVGAttributesAreDirty(false) |
| 67 { | 69 { |
| 68 } | 70 } |
| 69 | 71 |
| 70 ElementData::ElementData(const ElementData& other, bool isUnique) | 72 ElementData::ElementData(const ElementData& other, bool isUnique) |
| 71 : m_isUnique(isUnique) | 73 : m_isUnique(isUnique) |
| 72 , m_arraySize(isUnique ? 0 : other.attributes().size()) | 74 , m_arraySize(isUnique ? 0 : other.attributes().size()) |
| 75 , m_directionality(other.m_directionality) |
| 73 , m_presentationAttributeStyleIsDirty(other.m_presentationAttributeStyleIsDi
rty) | 76 , m_presentationAttributeStyleIsDirty(other.m_presentationAttributeStyleIsDi
rty) |
| 74 , m_styleAttributeIsDirty(other.m_styleAttributeIsDirty) | 77 , m_styleAttributeIsDirty(other.m_styleAttributeIsDirty) |
| 75 , m_animatedSVGAttributesAreDirty(other.m_animatedSVGAttributesAreDirty) | 78 , m_animatedSVGAttributesAreDirty(other.m_animatedSVGAttributesAreDirty) |
| 76 , m_classNames(other.m_classNames) | 79 , m_classNames(other.m_classNames) |
| 77 , m_idForStyleResolution(other.m_idForStyleResolution) | 80 , m_idForStyleResolution(other.m_idForStyleResolution) |
| 78 { | 81 { |
| 79 // NOTE: The inline style is copied by the subclass copy constructor since w
e don't know what to do with it here. | 82 // NOTE: The inline style is copied by the subclass copy constructor since w
e don't know what to do with it here. |
| 80 } | 83 } |
| 81 | 84 |
| 82 void ElementData::finalizeGarbageCollectedObject() | 85 void ElementData::finalizeGarbageCollectedObject() |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 return new (slot) ShareableElementData(*this); | 196 return new (slot) ShareableElementData(*this); |
| 194 } | 197 } |
| 195 | 198 |
| 196 DEFINE_TRACE_AFTER_DISPATCH(UniqueElementData) | 199 DEFINE_TRACE_AFTER_DISPATCH(UniqueElementData) |
| 197 { | 200 { |
| 198 visitor->trace(m_presentationAttributeStyle); | 201 visitor->trace(m_presentationAttributeStyle); |
| 199 ElementData::traceAfterDispatch(visitor); | 202 ElementData::traceAfterDispatch(visitor); |
| 200 } | 203 } |
| 201 | 204 |
| 202 } // namespace blink | 205 } // namespace blink |
| OLD | NEW |