| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 12 matching lines...) Expand all Loading... |
| 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 #include "core/dom/NodeRareData.h" | 32 #include "core/dom/NodeRareData.h" |
| 33 #include "core/dom/Element.h" |
| 33 | 34 |
| 34 namespace WebCore { | 35 namespace WebCore { |
| 35 | 36 |
| 36 struct SameSizeAsNodeRareData { | 37 struct SameSizeAsNodeRareData { |
| 37 unsigned m_bitfields : 20; | |
| 38 void* m_pointer[3]; | 38 void* m_pointer[3]; |
| 39 unsigned m_bitfields; |
| 39 }; | 40 }; |
| 40 | 41 |
| 41 COMPILE_ASSERT(sizeof(NodeRareData) == sizeof(SameSizeAsNodeRareData), NodeRareD
ataShouldStaySmall); | 42 COMPILE_ASSERT(sizeof(NodeRareData) == sizeof(SameSizeAsNodeRareData), NodeRareD
ataShouldStaySmall); |
| 42 | 43 |
| 43 void NodeListsNodeData::invalidateCaches(const QualifiedName* attrName) | 44 void NodeListsNodeData::invalidateCaches(const QualifiedName* attrName) |
| 44 { | 45 { |
| 45 NodeListAtomicNameCacheMap::const_iterator atomicNameCacheEnd = m_atomicName
Caches.end(); | 46 NodeListAtomicNameCacheMap::const_iterator atomicNameCacheEnd = m_atomicName
Caches.end(); |
| 46 for (NodeListAtomicNameCacheMap::const_iterator it = m_atomicNameCaches.begi
n(); it != atomicNameCacheEnd; ++it) | 47 for (NodeListAtomicNameCacheMap::const_iterator it = m_atomicNameCaches.begi
n(); it != atomicNameCacheEnd; ++it) |
| 47 it->value->invalidateCache(attrName); | 48 it->value->invalidateCache(attrName); |
| 48 | 49 |
| 49 if (attrName) | 50 if (attrName) |
| 50 return; | 51 return; |
| 51 | 52 |
| 52 TagCollectionCacheNS::iterator tagCacheEnd = m_tagCollectionCacheNS.end(); | 53 TagCollectionCacheNS::iterator tagCacheEnd = m_tagCollectionCacheNS.end(); |
| 53 for (TagCollectionCacheNS::iterator it = m_tagCollectionCacheNS.begin(); it
!= tagCacheEnd; ++it) | 54 for (TagCollectionCacheNS::iterator it = m_tagCollectionCacheNS.begin(); it
!= tagCacheEnd; ++it) |
| 54 it->value->invalidateCache(); | 55 it->value->invalidateCache(); |
| 55 } | 56 } |
| 56 | 57 |
| 58 // Ensure the 10 bits reserved for the m_connectedFrameCount cannot overflow |
| 59 COMPILE_ASSERT(Page::maxNumberOfFrames < (1 << NodeRareData::ConnectedFrameCount
Bits), Frame_limit_should_fit_in_rare_data_count); |
| 60 |
| 61 // Ensure all element flags fit in NodeRareData::m_elementFlags. |
| 62 COMPILE_ASSERT(static_cast<unsigned>(NumberOfElementFlags) == static_cast<unsign
ed>(NodeRareData::ElementFlagsBits), Element_flags_should_fit_in_node_rare_data)
; |
| 57 | 63 |
| 58 } // namespace WebCore | 64 } // namespace WebCore |
| OLD | NEW |