| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008, 2010 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2008 David Smith <catfish.man@gmail.com> | 3 * Copyright (C) 2008 David Smith <catfish.man@gmail.com> |
| 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 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 { | 248 { |
| 249 m_connectedFrameCount += amount; | 249 m_connectedFrameCount += amount; |
| 250 } | 250 } |
| 251 void decrementConnectedSubframeCount(unsigned amount) | 251 void decrementConnectedSubframeCount(unsigned amount) |
| 252 { | 252 { |
| 253 ASSERT(m_connectedFrameCount); | 253 ASSERT(m_connectedFrameCount); |
| 254 ASSERT(amount <= m_connectedFrameCount); | 254 ASSERT(amount <= m_connectedFrameCount); |
| 255 m_connectedFrameCount -= amount; | 255 m_connectedFrameCount -= amount; |
| 256 } | 256 } |
| 257 | 257 |
| 258 bool hasFlag(ElementFlags mask) const { return m_elementFlags & mask; } | 258 bool hasElementFlag(ElementFlags mask) const { return m_elementFlags & mask;
} |
| 259 void setFlag(ElementFlags mask, bool value) { m_elementFlags = (m_elementFla
gs & ~mask) | (-(int32_t)value & mask); } | 259 void setElementFlag(ElementFlags mask, bool value) { m_elementFlags = (m_ele
mentFlags & ~mask) | (-(int32_t)value & mask); } |
| 260 void clearFlag(ElementFlags mask) { m_elementFlags &= ~mask; } | 260 void clearElementFlag(ElementFlags mask) { m_elementFlags &= ~mask; } |
| 261 |
| 262 bool hasRestyleFlag(DynamicRestyleFlags mask) const { return m_restyleFlags
& mask; } |
| 263 void setRestyleFlag(DynamicRestyleFlags mask) { m_restyleFlags |= mask; RELE
ASE_ASSERT(m_restyleFlags); } |
| 264 bool hasRestyleFlags() const { return m_restyleFlags; } |
| 265 void clearRestyleFlags() { m_restyleFlags = 0; } |
| 261 | 266 |
| 262 enum { | 267 enum { |
| 263 ConnectedFrameCountBits = 10, // Must fit Page::maxNumberOfFrames. | 268 ConnectedFrameCountBits = 10, // Must fit Page::maxNumberOfFrames. |
| 264 ElementFlagsBits = 17, // Must fit the ElementFlags enumeration. | |
| 265 }; | 269 }; |
| 266 | 270 |
| 267 protected: | 271 protected: |
| 268 NodeRareData(RenderObject* renderer) | 272 NodeRareData(RenderObject* renderer) |
| 269 : NodeRareDataBase(renderer) | 273 : NodeRareDataBase(renderer) |
| 270 , m_connectedFrameCount(0) | 274 , m_connectedFrameCount(0) |
| 271 , m_elementFlags(0) | 275 , m_elementFlags(0) |
| 276 , m_restyleFlags(0) |
| 272 { } | 277 { } |
| 273 | 278 |
| 274 private: | 279 private: |
| 275 OwnPtr<NodeListsNodeData> m_nodeLists; | 280 OwnPtr<NodeListsNodeData> m_nodeLists; |
| 276 OwnPtr<NodeMutationObserverData> m_mutationObserverData; | 281 OwnPtr<NodeMutationObserverData> m_mutationObserverData; |
| 277 | 282 |
| 278 unsigned m_connectedFrameCount : ConnectedFrameCountBits; | 283 unsigned m_connectedFrameCount : ConnectedFrameCountBits; |
| 279 unsigned m_elementFlags : ElementFlagsBits; | 284 unsigned m_elementFlags : NumberOfElementFlags; |
| 285 unsigned m_restyleFlags : NumberOfDynamicRestyleFlags; |
| 280 }; | 286 }; |
| 281 | 287 |
| 282 inline bool NodeListsNodeData::deleteThisAndUpdateNodeRareDataIfAboutToRemoveLas
tList(Node& ownerNode) | 288 inline bool NodeListsNodeData::deleteThisAndUpdateNodeRareDataIfAboutToRemoveLas
tList(Node& ownerNode) |
| 283 { | 289 { |
| 284 ASSERT(ownerNode.nodeLists() == this); | 290 ASSERT(ownerNode.nodeLists() == this); |
| 285 if ((m_childNodeList ? 1 : 0) + m_atomicNameCaches.size() + m_tagCollectionC
acheNS.size() != 1) | 291 if ((m_childNodeList ? 1 : 0) + m_atomicNameCaches.size() + m_tagCollectionC
acheNS.size() != 1) |
| 286 return false; | 292 return false; |
| 287 ownerNode.clearNodeLists(); | 293 ownerNode.clearNodeLists(); |
| 288 return true; | 294 return true; |
| 289 } | 295 } |
| 290 | 296 |
| 291 } // namespace WebCore | 297 } // namespace WebCore |
| 292 | 298 |
| 293 #endif // NodeRareData_h | 299 #endif // NodeRareData_h |
| OLD | NEW |