Title: [226802] trunk
Revision
226802
Author
commit-qu...@webkit.org
Date
2018-01-11 13:45:58 -0800 (Thu, 11 Jan 2018)

Log Message

window.visualViewport should behave as [SameObject]
https://bugs.webkit.org/show_bug.cgi?id=181548

Patch by Ali Juma <aj...@chromium.org> on 2018-01-11
Reviewed by Chris Dumez.

Source/WebCore:

Add 'GenerateIsReachable' to VisualViewport so that window.visualViewport's
JS wrapper object doesn't get garbage collected too soon.

Test: fast/visual-viewport/visual-viewport-same-object.html

* page/VisualViewport.idl:

LayoutTests:

* fast/visual-viewport/visual-viewport-same-object-expected.txt: Added.
* fast/visual-viewport/visual-viewport-same-object.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (226801 => 226802)


--- trunk/LayoutTests/ChangeLog	2018-01-11 21:42:04 UTC (rev 226801)
+++ trunk/LayoutTests/ChangeLog	2018-01-11 21:45:58 UTC (rev 226802)
@@ -1,3 +1,13 @@
+2018-01-11  Ali Juma  <aj...@chromium.org>
+
+        window.visualViewport should behave as [SameObject]
+        https://bugs.webkit.org/show_bug.cgi?id=181548
+
+        Reviewed by Chris Dumez.
+
+        * fast/visual-viewport/visual-viewport-same-object-expected.txt: Added.
+        * fast/visual-viewport/visual-viewport-same-object.html: Added.
+
 2018-01-11  Youenn Fablet  <you...@apple.com>
 
         imported/w3c/web-platform-tests/service-workers/service-worker/multiple-update.https.html is slow on Debug

Added: trunk/LayoutTests/fast/visual-viewport/visual-viewport-same-object-expected.txt (0 => 226802)


--- trunk/LayoutTests/fast/visual-viewport/visual-viewport-same-object-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/visual-viewport/visual-viewport-same-object-expected.txt	2018-01-11 21:45:58 UTC (rev 226802)
@@ -0,0 +1,3 @@
+
+PASS window.visualViewport is SameObject 
+

Added: trunk/LayoutTests/fast/visual-viewport/visual-viewport-same-object.html (0 => 226802)


--- trunk/LayoutTests/fast/visual-viewport/visual-viewport-same-object.html	                        (rev 0)
+++ trunk/LayoutTests/fast/visual-viewport/visual-viewport-same-object.html	2018-01-11 21:45:58 UTC (rev 226802)
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<script src=""
+<script src=""
+<script src=""
+<script>
+if (window.internals)
+    internals.settings.setVisualViewportEnabled(true);
+
+test(() => {
+    window.visualViewport.newValue = 23;
+    gc();
+    assert_equals(window.visualViewport.newValue, 23);
+}, "window.visualViewport is SameObject");
+</script>

Modified: trunk/Source/WebCore/ChangeLog (226801 => 226802)


--- trunk/Source/WebCore/ChangeLog	2018-01-11 21:42:04 UTC (rev 226801)
+++ trunk/Source/WebCore/ChangeLog	2018-01-11 21:45:58 UTC (rev 226802)
@@ -1,3 +1,17 @@
+2018-01-11  Ali Juma  <aj...@chromium.org>
+
+        window.visualViewport should behave as [SameObject]
+        https://bugs.webkit.org/show_bug.cgi?id=181548
+
+        Reviewed by Chris Dumez.
+
+        Add 'GenerateIsReachable' to VisualViewport so that window.visualViewport's
+        JS wrapper object doesn't get garbage collected too soon.
+
+        Test: fast/visual-viewport/visual-viewport-same-object.html
+
+        * page/VisualViewport.idl:
+
 2018-01-11  Basuke Suzuki  <basuke.suz...@sony.com>
 
         [Curl] Extract multipart handling from ResourceHandle to CurlRequest.

Modified: trunk/Source/WebCore/page/VisualViewport.idl (226801 => 226802)


--- trunk/Source/WebCore/page/VisualViewport.idl	2018-01-11 21:42:04 UTC (rev 226801)
+++ trunk/Source/WebCore/page/VisualViewport.idl	2018-01-11 21:45:58 UTC (rev 226802)
@@ -25,7 +25,8 @@
 
 // https://wicg.github.io/ViewportAPI/spec.html
 [
-EnabledBySetting=VisualViewportAPI
+EnabledBySetting=VisualViewportAPI,
+GenerateIsReachable=ImplFrame
 ]
 interface VisualViewport : EventTarget {
     readonly attribute double offsetLeft;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to