Title: [171261] trunk/Source/WebCore
- Revision
- 171261
- Author
- [email protected]
- Date
- 2014-07-19 03:08:55 -0700 (Sat, 19 Jul 2014)
Log Message
Document::unregisterNodeListforInvalidation() and Document::unregisterCollection() have incorrect assertions
https://bugs.webkit.org/show_bug.cgi?id=134869
Reviewed by Darin Adler.
Both methods should assert that the relevant HashMap is either empty if invalidation originates
from Document::invalidateNodeListAndCollectionCaches() or acutally contains the element that is
being invalidated. In the first case the HashMap is empty because its entries were moved out in
the Document::invalidateNodeListAndCollectionCaches().
This was exposed by r170995 (later rolled out in r170999) which introduced move constructor and
move assignment operators for HashTable. The assertions in the titular methods won't be passing
until r170995 relands.
* dom/Document.cpp:
(WebCore::Document::unregisterNodeListForInvalidation):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (171260 => 171261)
--- trunk/Source/WebCore/ChangeLog 2014-07-19 10:02:06 UTC (rev 171260)
+++ trunk/Source/WebCore/ChangeLog 2014-07-19 10:08:55 UTC (rev 171261)
@@ -1,3 +1,22 @@
+2014-07-19 Zan Dobersek <[email protected]>
+
+ Document::unregisterNodeListforInvalidation() and Document::unregisterCollection() have incorrect assertions
+ https://bugs.webkit.org/show_bug.cgi?id=134869
+
+ Reviewed by Darin Adler.
+
+ Both methods should assert that the relevant HashMap is either empty if invalidation originates
+ from Document::invalidateNodeListAndCollectionCaches() or acutally contains the element that is
+ being invalidated. In the first case the HashMap is empty because its entries were moved out in
+ the Document::invalidateNodeListAndCollectionCaches().
+
+ This was exposed by r170995 (later rolled out in r170999) which introduced move constructor and
+ move assignment operators for HashTable. The assertions in the titular methods won't be passing
+ until r170995 relands.
+
+ * dom/Document.cpp:
+ (WebCore::Document::unregisterNodeListForInvalidation):
+
2014-07-18 Eric Carlson <[email protected]>
[iOS] ignore requests to set volume
Modified: trunk/Source/WebCore/dom/Document.cpp (171260 => 171261)
--- trunk/Source/WebCore/dom/Document.cpp 2014-07-19 10:02:06 UTC (rev 171260)
+++ trunk/Source/WebCore/dom/Document.cpp 2014-07-19 10:08:55 UTC (rev 171261)
@@ -3491,13 +3491,12 @@
m_nodeListAndCollectionCounts[list.invalidationType()]--;
if (!list.isRegisteredForInvalidationAtDocument())
return;
- if (!m_listsInvalidatedAtDocument.size()) {
- ASSERT(m_inInvalidateNodeListAndCollectionCaches);
- return;
- }
- ASSERT(m_listsInvalidatedAtDocument.contains(&list));
- m_listsInvalidatedAtDocument.remove(&list);
+
list.setRegisteredForInvalidationAtDocument(false);
+ ASSERT(m_inInvalidateNodeListAndCollectionCaches
+ ? m_listsInvalidatedAtDocument.isEmpty()
+ : m_listsInvalidatedAtDocument.contains(&list));
+ m_listsInvalidatedAtDocument.remove(&list);
}
void Document::registerCollection(HTMLCollection& collection)
@@ -3511,14 +3510,13 @@
{
ASSERT(m_nodeListAndCollectionCounts[collection.invalidationType()]);
m_nodeListAndCollectionCounts[collection.invalidationType()]--;
- if (collection.isRootedAtDocument()) {
- if (!m_collectionsInvalidatedAtDocument.size()) {
- ASSERT(m_inInvalidateNodeListAndCollectionCaches);
- return;
- }
- ASSERT(m_collectionsInvalidatedAtDocument.contains(&collection));
- m_collectionsInvalidatedAtDocument.remove(&collection);
- }
+ if (!collection.isRootedAtDocument())
+ return;
+
+ ASSERT(m_inInvalidateNodeListAndCollectionCaches
+ ? m_collectionsInvalidatedAtDocument.isEmpty()
+ : m_collectionsInvalidatedAtDocument.contains(&collection));
+ m_collectionsInvalidatedAtDocument.remove(&collection);
}
void Document::collectionCachedIdNameMap(const HTMLCollection& collection)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes