Title: [103685] trunk/Source/WebCore
- Revision
- 103685
- Author
- [email protected]
- Date
- 2011-12-26 07:21:39 -0800 (Mon, 26 Dec 2011)
Log Message
Fix mutation observer build after didMoveToNewDocument change
https://bugs.webkit.org/show_bug.cgi?id=75224
Reviewed by Hajime Morita.
* dom/Node.cpp:
(WebCore::willCallDidMoveToNewDocument): Added.
(WebCore::didMoveToNewDocumentWasCalled): Added.
(WebCore::Node::setDocument): Call new debugging function.
(WebCore::Node::didMoveToNewDocument): Ditto. Also use ASSERT_UNUSED
unconditionally rather than UNUSED_PARAM inside and #if. Also added
a new assertion that checks that hte old document was passed through
properly.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (103684 => 103685)
--- trunk/Source/WebCore/ChangeLog 2011-12-26 14:59:42 UTC (rev 103684)
+++ trunk/Source/WebCore/ChangeLog 2011-12-26 15:21:39 UTC (rev 103685)
@@ -1,3 +1,19 @@
+2011-12-26 Darin Adler <[email protected]>
+
+ Fix mutation observer build after didMoveToNewDocument change
+ https://bugs.webkit.org/show_bug.cgi?id=75224
+
+ Reviewed by Hajime Morita.
+
+ * dom/Node.cpp:
+ (WebCore::willCallDidMoveToNewDocument): Added.
+ (WebCore::didMoveToNewDocumentWasCalled): Added.
+ (WebCore::Node::setDocument): Call new debugging function.
+ (WebCore::Node::didMoveToNewDocument): Ditto. Also use ASSERT_UNUSED
+ unconditionally rather than UNUSED_PARAM inside and #if. Also added
+ a new assertion that checks that hte old document was passed through
+ properly.
+
2011-12-26 Alexander Pavlov <[email protected]>
Web Inspector: [Scripts] Implement iterative match highlighting in the "Go to Function" dialog item list
Modified: trunk/Source/WebCore/dom/Node.cpp (103684 => 103685)
--- trunk/Source/WebCore/dom/Node.cpp 2011-12-26 14:59:42 UTC (rev 103684)
+++ trunk/Source/WebCore/dom/Node.cpp 2011-12-26 15:21:39 UTC (rev 103685)
@@ -2,7 +2,7 @@
* Copyright (C) 1999 Lars Knoll ([email protected])
* (C) 1999 Antti Koivisto ([email protected])
* (C) 2001 Dirk Mueller ([email protected])
- * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved.
+ * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
* Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
* Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
*
@@ -417,25 +417,11 @@
doc->guardDeref();
}
-#ifdef NDEBUG
+#ifndef NDEBUG
-static inline void setWillMoveToNewDocumentWasCalled(bool)
-{
-}
-
-static inline void setDidMoveToNewDocumentWasCalled(bool)
-{
-}
-
-#else
-
static bool didMoveToNewDocumentWasCalled;
+static Document* oldDocumentDidMoveToNewDocumentWasCalledWith;
-static void setDidMoveToNewDocumentWasCalled(bool wasCalled)
-{
- didMoveToNewDocumentWasCalled = wasCalled;
-}
-
#endif
void Node::setDocument(Document* document)
@@ -454,8 +440,13 @@
Document* oldDocument = m_document;
m_document = document;
- setDidMoveToNewDocumentWasCalled(false);
+#ifndef NDEBUG
+ didMoveToNewDocumentWasCalled = false;
+ oldDocumentDidMoveToNewDocumentWasCalledWith = oldDocument;
+#endif
+
didMoveToNewDocument(oldDocument);
+
ASSERT(didMoveToNewDocumentWasCalled);
}
@@ -2491,8 +2482,12 @@
void Node::didMoveToNewDocument(Document* oldDocument)
{
ASSERT(!didMoveToNewDocumentWasCalled);
- setDidMoveToNewDocumentWasCalled(true);
+ ASSERT_UNUSED(oldDocument, oldDocument == oldDocumentDidMoveToNewDocumentWasCalledWith);
+#ifndef NDEBUG
+ didMoveToNewDocumentWasCalled = true;
+#endif
+
// FIXME: Event listener types for this node should be set on the new owner document here.
#if ENABLE(MUTATION_OBSERVERS)
@@ -2507,8 +2502,6 @@
document()->addMutationObserverTypes((*iter)->mutationTypes());
}
}
-#else
- UNUSED_PARAM(oldDocument);
#endif
}
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes