Title: [208785] trunk/Source/WebCore
- Revision
- 208785
- Author
- [email protected]
- Date
- 2016-11-15 22:18:16 -0800 (Tue, 15 Nov 2016)
Log Message
Add more assertions to ElementQueue diagnose a bug
https://bugs.webkit.org/show_bug.cgi?id=164814
Reviewed by Yusuke Suzuki.
Add more assertions to check the sanity of the element queue.
Also made them all release assertions so that we can catch them better.
* dom/CustomElementReactionQueue.cpp:
(WebCore::CustomElementReactionStack::ElementQueue::add):
(WebCore::CustomElementReactionStack::ElementQueue::invokeAll):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (208784 => 208785)
--- trunk/Source/WebCore/ChangeLog 2016-11-16 06:11:29 UTC (rev 208784)
+++ trunk/Source/WebCore/ChangeLog 2016-11-16 06:18:16 UTC (rev 208785)
@@ -1,3 +1,17 @@
+2016-11-15 Ryosuke Niwa <[email protected]>
+
+ Add more assertions to ElementQueue diagnose a bug
+ https://bugs.webkit.org/show_bug.cgi?id=164814
+
+ Reviewed by Yusuke Suzuki.
+
+ Add more assertions to check the sanity of the element queue.
+ Also made them all release assertions so that we can catch them better.
+
+ * dom/CustomElementReactionQueue.cpp:
+ (WebCore::CustomElementReactionStack::ElementQueue::add):
+ (WebCore::CustomElementReactionStack::ElementQueue::invokeAll):
+
2016-11-15 Chris Dumez <[email protected]>
Simplify Element::stripScriptingAttributes()
Modified: trunk/Source/WebCore/dom/CustomElementReactionQueue.cpp (208784 => 208785)
--- trunk/Source/WebCore/dom/CustomElementReactionQueue.cpp 2016-11-16 06:11:29 UTC (rev 208784)
+++ trunk/Source/WebCore/dom/CustomElementReactionQueue.cpp 2016-11-16 06:18:16 UTC (rev 208785)
@@ -205,7 +205,7 @@
inline void CustomElementReactionStack::ElementQueue::add(Element& element)
{
- ASSERT(!m_invoking);
+ RELEASE_ASSERT(!m_invoking);
// FIXME: Avoid inserting the same element multiple times.
m_elements.append(element);
}
@@ -213,16 +213,18 @@
inline void CustomElementReactionStack::ElementQueue::invokeAll()
{
#if !ASSERT_DISABLED
- TemporaryChange<bool> invoking(m_invoking);
+ RELEASE_ASSERT(!m_invoking);
+ TemporaryChange<bool> invoking(m_invoking, true);
#endif
Vector<Ref<Element>> elements;
elements.swap(m_elements);
+ RELEASE_ASSERT(m_elements.isEmpty());
for (auto& element : elements) {
auto* queue = element->reactionQueue();
ASSERT(queue);
queue->invokeAll(element.get());
}
- ASSERT(m_elements.isEmpty());
+ RELEASE_ASSERT(m_elements.isEmpty());
}
CustomElementReactionQueue& CustomElementReactionStack::ensureCurrentQueue(Element& element)
Modified: trunk/Source/WebCore/dom/CustomElementReactionQueue.h (208784 => 208785)
--- trunk/Source/WebCore/dom/CustomElementReactionQueue.h 2016-11-16 06:11:29 UTC (rev 208784)
+++ trunk/Source/WebCore/dom/CustomElementReactionQueue.h 2016-11-16 06:18:16 UTC (rev 208785)
@@ -89,9 +89,7 @@
private:
Vector<Ref<Element>> m_elements;
-#if !ASSERT_DISABLED
bool m_invoking { false };
-#endif
};
WEBCORE_EXPORT void processQueue();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes