Title: [135337] trunk
Revision
135337
Author
ad...@chromium.org
Date
2012-11-20 17:35:49 -0800 (Tue, 20 Nov 2012)

Log Message

[JSC] MutationObserver wrapper should not be collected while still observing
https://bugs.webkit.org/show_bug.cgi?id=102744

Reviewed by Adam Barth.

Source/WebCore:

This is the JSC side of the change landed for V8 in r135228.
It ensures MutationObserver wrapper objects are kept alive as long as
any observed nodes.

* bindings/js/JSMutationObserverCustom.cpp:
(WebCore::JSMutationObserverOwner::isReachableFromOpaqueRoots): Keep MutationObserver wrappers alive
if any of their observed nodes' roots is an opaque root.
* dom/MutationObserver.idl: Add JSCustomIsReachable

LayoutTests:

Remove suppressions for wrapper dropoff tests.

* platform/efl/TestExpectations:
* platform/gtk/TestExpectations:
* platform/mac/TestExpectations:
* platform/qt/TestExpectations:
* platform/win/TestExpectations:
* platform/wincairo/TestExpectations:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (135336 => 135337)


--- trunk/LayoutTests/ChangeLog	2012-11-21 01:29:52 UTC (rev 135336)
+++ trunk/LayoutTests/ChangeLog	2012-11-21 01:35:49 UTC (rev 135337)
@@ -1,3 +1,19 @@
+2012-11-20  Adam Klein  <ad...@chromium.org>
+
+        [JSC] MutationObserver wrapper should not be collected while still observing
+        https://bugs.webkit.org/show_bug.cgi?id=102744
+
+        Reviewed by Adam Barth.
+
+        Remove suppressions for wrapper dropoff tests.
+
+        * platform/efl/TestExpectations:
+        * platform/gtk/TestExpectations:
+        * platform/mac/TestExpectations:
+        * platform/qt/TestExpectations:
+        * platform/win/TestExpectations:
+        * platform/wincairo/TestExpectations:
+
 2012-11-20  Ryosuke Niwa  <rn...@webkit.org>
 
         REGRESSION(r131106): magnitude-perf.js calls bind on undefined

Modified: trunk/LayoutTests/platform/efl/TestExpectations (135336 => 135337)


--- trunk/LayoutTests/platform/efl/TestExpectations	2012-11-21 01:29:52 UTC (rev 135336)
+++ trunk/LayoutTests/platform/efl/TestExpectations	2012-11-21 01:35:49 UTC (rev 135337)
@@ -1706,6 +1706,3 @@
 webkit.org/b/102367 fast/forms/zoomed-controls.html [ ImageOnlyFailure Missing ]
 
 webkit.org/b/102493 fast/events/mouse-cursor.html [ Failure ]
-
-webkit.org/b/102744 fast/mutation/observer-wrapper-dropoff.html [ Skip ]
-webkit.org/b/102744 fast/mutation/observer-wrapper-dropoff-transient.html [ Skip ]

Modified: trunk/LayoutTests/platform/gtk/TestExpectations (135336 => 135337)


--- trunk/LayoutTests/platform/gtk/TestExpectations	2012-11-21 01:29:52 UTC (rev 135336)
+++ trunk/LayoutTests/platform/gtk/TestExpectations	2012-11-21 01:35:49 UTC (rev 135337)
@@ -1385,9 +1385,6 @@
 
 webkit.org/b/102586 media/video-src-blob.html [ Failure ]
 
-webkit.org/b/102744 fast/mutation/observer-wrapper-dropoff.html [ Skip ]
-webkit.org/b/102744 fast/mutation/observer-wrapper-dropoff-transient.html [ Skip ]
-
 # Fix for https://bugs.webkit.org/show_bug.cgi?id=97192 introduces these regressions
 webkit.org/b/102776 media/media-document-audio-repaint.html [ Failure ]
 webkit.org/b/102776 media/track/track-cue-container-rendering-position.html [ Failure ]

Modified: trunk/LayoutTests/platform/mac/TestExpectations (135336 => 135337)


--- trunk/LayoutTests/platform/mac/TestExpectations	2012-11-21 01:29:52 UTC (rev 135336)
+++ trunk/LayoutTests/platform/mac/TestExpectations	2012-11-21 01:35:49 UTC (rev 135337)
@@ -1190,6 +1190,3 @@
 
 # Hangs safari apparently due to an issue with weird multi-frame CUR image files
 webkit.org/b/101811 fast/events/mouse-cursor-multiframecur.html [ Skip ]
-
-webkit.org/b/102744 fast/mutation/observer-wrapper-dropoff.html [ Skip ]
-webkit.org/b/102744 fast/mutation/observer-wrapper-dropoff-transient.html [ Skip ]

Modified: trunk/LayoutTests/platform/qt/TestExpectations (135336 => 135337)


--- trunk/LayoutTests/platform/qt/TestExpectations	2012-11-21 01:29:52 UTC (rev 135336)
+++ trunk/LayoutTests/platform/qt/TestExpectations	2012-11-21 01:35:49 UTC (rev 135337)
@@ -2386,6 +2386,3 @@
 
 # [Qt] fast/block/float/overhanging-tall-block.html asserts after r135025
 webkit.org/b/102675 [ Debug ] fast/block/float/overhanging-tall-block.html
-
-webkit.org/b/102744 fast/mutation/observer-wrapper-dropoff.html [ Skip ]
-webkit.org/b/102744 fast/mutation/observer-wrapper-dropoff-transient.html [ Skip ]

Modified: trunk/LayoutTests/platform/win/TestExpectations (135336 => 135337)


--- trunk/LayoutTests/platform/win/TestExpectations	2012-11-21 01:29:52 UTC (rev 135336)
+++ trunk/LayoutTests/platform/win/TestExpectations	2012-11-21 01:35:49 UTC (rev 135337)
@@ -2427,6 +2427,3 @@
 fast/css3-text/css3-text-align-last/getComputedStyle/getComputedStyle-text-align-last-inherited.html
 fast/css3-text/css3-text-align-last/getComputedStyle/getComputedStyle-text-align-last.html
 fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-line.html
-
-webkit.org/b/102744 fast/mutation/observer-wrapper-dropoff.html [ Skip ]
-webkit.org/b/102744 fast/mutation/observer-wrapper-dropoff-transient.html [ Skip ]

Modified: trunk/LayoutTests/platform/wincairo/TestExpectations (135336 => 135337)


--- trunk/LayoutTests/platform/wincairo/TestExpectations	2012-11-21 01:29:52 UTC (rev 135336)
+++ trunk/LayoutTests/platform/wincairo/TestExpectations	2012-11-21 01:35:49 UTC (rev 135337)
@@ -2958,6 +2958,3 @@
 fast/css3-text/css3-text-align-last/getComputedStyle/getComputedStyle-text-align-last-inherited.html
 fast/css3-text/css3-text-align-last/getComputedStyle/getComputedStyle-text-align-last.html
 fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-line.html
-
-webkit.org/b/102744 fast/mutation/observer-wrapper-dropoff.html [ Skip ]
-webkit.org/b/102744 fast/mutation/observer-wrapper-dropoff-transient.html [ Skip ]

Modified: trunk/Source/WebCore/ChangeLog (135336 => 135337)


--- trunk/Source/WebCore/ChangeLog	2012-11-21 01:29:52 UTC (rev 135336)
+++ trunk/Source/WebCore/ChangeLog	2012-11-21 01:35:49 UTC (rev 135337)
@@ -1,3 +1,19 @@
+2012-11-20  Adam Klein  <ad...@chromium.org>
+
+        [JSC] MutationObserver wrapper should not be collected while still observing
+        https://bugs.webkit.org/show_bug.cgi?id=102744
+
+        Reviewed by Adam Barth.
+
+        This is the JSC side of the change landed for V8 in r135228.
+        It ensures MutationObserver wrapper objects are kept alive as long as
+        any observed nodes.
+
+        * bindings/js/JSMutationObserverCustom.cpp:
+        (WebCore::JSMutationObserverOwner::isReachableFromOpaqueRoots): Keep MutationObserver wrappers alive
+        if any of their observed nodes' roots is an opaque root.
+        * dom/MutationObserver.idl: Add JSCustomIsReachable
+
 2012-11-20  Joshua Bell  <jsb...@chromium.org>
 
         IndexedDB: Move control of transaction completion to front end

Modified: trunk/Source/WebCore/bindings/js/JSMutationObserverCustom.cpp (135336 => 135337)


--- trunk/Source/WebCore/bindings/js/JSMutationObserverCustom.cpp	2012-11-21 01:29:52 UTC (rev 135336)
+++ trunk/Source/WebCore/bindings/js/JSMutationObserverCustom.cpp	2012-11-21 01:35:49 UTC (rev 135337)
@@ -58,6 +58,17 @@
     return JSValue::encode(asObject(toJS(exec, jsConstructor->globalObject(), MutationObserver::create(callback.release()))));
 }
 
+bool JSMutationObserverOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
+{
+    MutationObserver* observer = jsCast<JSMutationObserver*>(handle.get().asCell())->impl();
+    HashSet<Node*> observedNodes = observer->getObservedNodes();
+    for (HashSet<Node*>::iterator it = observedNodes.begin(); it != observedNodes.end(); ++it) {
+        if (visitor.containsOpaqueRoot(root(*it)))
+            return true;
+    }
+    return false;
+}
+
 } // namespace WebCore
 
 #endif // ENABLE(MUTATION_OBSERVERS)

Modified: trunk/Source/WebCore/dom/MutationObserver.idl (135336 => 135337)


--- trunk/Source/WebCore/dom/MutationObserver.idl	2012-11-21 01:29:52 UTC (rev 135336)
+++ trunk/Source/WebCore/dom/MutationObserver.idl	2012-11-21 01:35:49 UTC (rev 135337)
@@ -31,7 +31,8 @@
 [
     Conditional=MUTATION_OBSERVERS,
     CustomConstructor,
-    ConstructorParameters=1
+    ConstructorParameters=1,
+    JSCustomIsReachable
 ] interface MutationObserver {
     void observe(in Node target, in Dictionary options)
         raises(DOMException);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to