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

Unified Diff: Source/core/dom/NodeRareData.cpp

Issue 201153006: Move element flags from ElementRareData to NodeRareData (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebased (another ElementFlag added upstream) Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/dom/NodeRareData.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/NodeRareData.cpp
diff --git a/Source/core/dom/NodeRareData.cpp b/Source/core/dom/NodeRareData.cpp
index 82717cb2afe01dc784acaa3294f96439ec904065..b5e31865c12efa35d53dc17d9c91622271283f02 100644
--- a/Source/core/dom/NodeRareData.cpp
+++ b/Source/core/dom/NodeRareData.cpp
@@ -30,12 +30,13 @@
#include "config.h"
#include "core/dom/NodeRareData.h"
+#include "core/dom/Element.h"
namespace WebCore {
struct SameSizeAsNodeRareData {
- unsigned m_bitfields : 20;
void* m_pointer[3];
+ unsigned m_bitfields;
};
COMPILE_ASSERT(sizeof(NodeRareData) == sizeof(SameSizeAsNodeRareData), NodeRareDataShouldStaySmall);
@@ -54,5 +55,10 @@ void NodeListsNodeData::invalidateCaches(const QualifiedName* attrName)
it->value->invalidateCache();
}
+// Ensure the 10 bits reserved for the m_connectedFrameCount cannot overflow
+COMPILE_ASSERT(Page::maxNumberOfFrames < (1 << NodeRareData::ConnectedFrameCountBits), Frame_limit_should_fit_in_rare_data_count);
+
+// Ensure all element flags fit in NodeRareData::m_elementFlags.
+COMPILE_ASSERT(static_cast<unsigned>(NumberOfElementFlags) == static_cast<unsigned>(NodeRareData::ElementFlagsBits), Element_flags_should_fit_in_node_rare_data);
} // namespace WebCore
« no previous file with comments | « Source/core/dom/NodeRareData.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698