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

Side by Side Diff: Source/core/dom/shadow/ShadowRootRareData.h

Issue 192293002: Use new is*Element() helper functions in DOM code (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 99
100 unsigned m_childrenAffectedByDirectAdjacentRules : 1; 100 unsigned m_childrenAffectedByDirectAdjacentRules : 1;
101 unsigned m_childrenAffectedByForwardPositionalRules : 1; 101 unsigned m_childrenAffectedByForwardPositionalRules : 1;
102 unsigned m_childrenAffectedByBackwardPositionalRules : 1; 102 unsigned m_childrenAffectedByBackwardPositionalRules : 1;
103 unsigned m_childrenAffectedByFirstChildRules : 1; 103 unsigned m_childrenAffectedByFirstChildRules : 1;
104 unsigned m_childrenAffectedByLastChildRules : 1; 104 unsigned m_childrenAffectedByLastChildRules : 1;
105 }; 105 };
106 106
107 inline void ShadowRootRareData::didAddInsertionPoint(InsertionPoint* point) 107 inline void ShadowRootRareData::didAddInsertionPoint(InsertionPoint* point)
108 { 108 {
109 if (point->hasTagName(HTMLNames::shadowTag)) 109 ASSERT(point);
110 if (isHTMLShadowElement(*point))
110 ++m_descendantShadowElementCount; 111 ++m_descendantShadowElementCount;
111 else if (point->hasTagName(HTMLNames::contentTag)) 112 else if (isHTMLContentElement(*point))
112 ++m_descendantContentElementCount; 113 ++m_descendantContentElementCount;
113 else 114 else
114 ASSERT_NOT_REACHED(); 115 ASSERT_NOT_REACHED();
115 } 116 }
116 117
117 inline void ShadowRootRareData::didRemoveInsertionPoint(InsertionPoint* point) 118 inline void ShadowRootRareData::didRemoveInsertionPoint(InsertionPoint* point)
118 { 119 {
119 if (point->hasTagName(HTMLNames::shadowTag)) 120 ASSERT(point);
121 if (isHTMLShadowElement(*point))
120 --m_descendantShadowElementCount; 122 --m_descendantShadowElementCount;
121 else if (point->hasTagName(HTMLNames::contentTag)) 123 else if (isHTMLContentElement(*point))
122 --m_descendantContentElementCount; 124 --m_descendantContentElementCount;
123 else 125 else
124 ASSERT_NOT_REACHED(); 126 ASSERT_NOT_REACHED();
125 127
126 ASSERT(m_descendantContentElementCount >= 0); 128 ASSERT(m_descendantContentElementCount >= 0);
127 ASSERT(m_descendantShadowElementCount >= 0); 129 ASSERT(m_descendantShadowElementCount >= 0);
128 } 130 }
129 131
130 } // namespace WebCore 132 } // namespace WebCore
131 133
132 #endif 134 #endif
OLDNEW
« Source/core/dom/ScriptLoader.cpp ('K') | « Source/core/dom/shadow/InsertionPoint.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698