REGRESSION (r262366): [ Mac wk1 ] webgl/webgl-backing-store-size-update.html is failing
authordino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 5 Jun 2020 20:55:29 +0000 (20:55 +0000)
committerdino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 5 Jun 2020 20:55:29 +0000 (20:55 +0000)
https://bugs.webkit.org/show_bug.cgi?id=212647
<rdar://problem/63882960>

Address post-commit feedback from Darin Adler.

Source/WebCore:

* dom/Document.cpp:
(WebCore::Document::prepareCanvasesForDisplayIfNeeded): Use a Ref<>.

LayoutTests:
* webgl/webgl-backing-store-size-update.html: Don't need window for requestAnimationFrame.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262652 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/webgl/webgl-backing-store-size-update.html
Source/WebCore/dom/Document.cpp

index b70693d..36d0d7b 100644 (file)
@@ -3,16 +3,16 @@
     if (window.testRunner)
         testRunner.waitUntilDone();
 
-    var canvas = document.querySelector("canvas");
+    const canvas = document.querySelector("canvas");
 
     function draw() {
         // For the purpose of this test, we want the backing store metrics to
         // not match the layout metrics.
-        var scaleFactor = 2;
+        const scaleFactor = 2;
         canvas.width = canvas.clientWidth * scaleFactor;
         canvas.height = canvas.clientHeight * scaleFactor;
 
-        var gl = canvas.getContext("webgl");
+        const gl = canvas.getContext("webgl");
         gl.clearColor(0, 0, 0, 1);
         gl.clear(gl.COLOR_BUFFER_BIT);
     }
     // size of the backing store.
     canvas.style.width = "50px";
     canvas.style.height = "50px";
-    window.requestAnimationFrame(function() {
+    requestAnimationFrame(function() {
         draw();
         if (window.testRunner) {
             // Need to give the test system at least a frame to paint
             // after the draw() command, because notifyDone forces a
             // dump() and we're inside a rAF (which means it won't
             // do any of the post-layout/drawing work in Page::doAfterUpdateRendering)
-            window.requestAnimationFrame(function() {
+            requestAnimationFrame(function() {
                 testRunner.notifyDone();
             });
         }
index ec8b86b..aa57196 100644 (file)
@@ -8594,7 +8594,7 @@ void Document::prepareCanvasesForDisplayIfNeeded()
         if (!canvas->isInTreeScope())
             continue;
 
-        auto protectedCanvas = makeRefPtr(canvas);
+        auto protectedCanvas = makeRef(*canvas);
         protectedCanvas->prepareForDisplay();
     }
     m_canvasesNeedingDisplayPreparation.clear();