Unreviewed, rolling out r234187.
authordavid_fenton@apple.com <david_fenton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Jul 2018 17:10:10 +0000 (17:10 +0000)
committerdavid_fenton@apple.com <david_fenton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Jul 2018 17:10:10 +0000 (17:10 +0000)
the layout test added with this change is flaky on the bots

Reverted changeset:

"Animation stops with object-fit:contain on an animated 2d
canvas"
https://bugs.webkit.org/show_bug.cgi?id=187840
https://trac.webkit.org/changeset/234187

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

LayoutTests/ChangeLog
LayoutTests/fast/repaint/canvas-object-fit-expected.txt [deleted file]
LayoutTests/fast/repaint/canvas-object-fit.html [deleted file]
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLCanvasElement.cpp
Source/WebCore/rendering/RenderHTMLCanvas.cpp
Source/WebCore/rendering/RenderImage.cpp
Source/WebCore/rendering/RenderLayerBacking.cpp
Source/WebCore/rendering/RenderReplaced.h
Source/WebCore/rendering/shapes/ShapeOutsideInfo.cpp

index 3b46f0e..17621f0 100644 (file)
@@ -1,3 +1,16 @@
+2018-07-25  David Fenton  <david_fenton@apple.com>
+
+        Unreviewed, rolling out r234187.
+
+        the layout test added with this change is flaky on the bots
+
+        Reverted changeset:
+
+        "Animation stops with object-fit:contain on an animated 2d
+        canvas"
+        https://bugs.webkit.org/show_bug.cgi?id=187840
+        https://trac.webkit.org/changeset/234187
+
 2018-07-25  Andy VanWagoner  <andy@vanwagoner.family>
 
         [INTL] Intl constructor lengths should be configurable
diff --git a/LayoutTests/fast/repaint/canvas-object-fit-expected.txt b/LayoutTests/fast/repaint/canvas-object-fit-expected.txt
deleted file mode 100644 (file)
index bf4fb5a..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
- (GraphicsLayer
-  (anchor 0.00 0.00)
-  (bounds 800.00 600.00)
-  (children 1
-    (GraphicsLayer
-      (bounds 800.00 600.00)
-      (contentsOpaque 1)
-      (children 1
-        (GraphicsLayer
-          (position 8.00 8.00)
-          (bounds 202.00 102.00)
-          (drawsContent 1)
-          (repaint rects
-            (rect 70.00 20.00 7.00 7.00)
-          )
-        )
-      )
-    )
-  )
-)
-
diff --git a/LayoutTests/fast/repaint/canvas-object-fit.html b/LayoutTests/fast/repaint/canvas-object-fit.html
deleted file mode 100644 (file)
index 7b09863..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-<head>
-    <style>
-        canvas {
-            object-fit: contain;
-            border: 1px solid black;
-            width: 200px;
-            height: 100px;
-        }
-    </style>
-</head>
-<body>
-    <canvas id="canvas" width="200" height="200"></canvas> 
-<pre id="layers"></pre>
-    <script>
-        if (window.testRunner) {
-            testRunner.dumpAsText();
-            testRunner.waitUntilDone();
-        }
-            
-        var canvas = document.getElementById('canvas');
-        var ctx = canvas.getContext('2d');
-
-        ctx.fillStyle = "rgb(0, 128, 0)";
-        ctx.fillRect(0, 0, 200, 200);
-        
-        function repaintTest()
-        {
-            if (window.internals)
-                window.internals.startTrackingRepaints();
-
-            ctx.fillStyle = "rgb(0, 0, 128)";
-            ctx.fillRect(40, 40, 10, 10);
-
-            if (window.internals)
-                document.getElementById('layers').textContent = window.internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_REPAINT_RECTS);
-
-            if (window.testRunner)
-                testRunner.notifyDone();
-        }
-        
-        function startTest()
-        {
-            setTimeout(function() {
-                repaintTest();
-            }, 0)
-        }
-        window.addEventListener('load', startTest, false);
-    </script>
-</body>
index 28fb29f..1e643d5 100644 (file)
@@ -1,3 +1,16 @@
+2018-07-25  David Fenton  <david_fenton@apple.com>
+
+        Unreviewed, rolling out r234187.
+
+        the layout test added with this change is flaky on the bots
+
+        Reverted changeset:
+
+        "Animation stops with object-fit:contain on an animated 2d
+        canvas"
+        https://bugs.webkit.org/show_bug.cgi?id=187840
+        https://trac.webkit.org/changeset/234187
+
 2018-07-25  Chris Dumez  <cdumez@apple.com>
 
         Turn assertion preventing removal of ActiveDOMObjects while we iterate over them into a RELEASE_ASSERT
index 6298643..b885ed8 100644 (file)
@@ -508,23 +508,16 @@ void HTMLCanvasElement::didDraw(const FloatRect& rect)
     clearCopiedImage();
 
     FloatRect dirtyRect = rect;
-    if (auto* renderer = renderBox()) {
-        FloatRect destRect;
-        if (is<RenderReplaced>(renderer))
-            destRect = downcast<RenderReplaced>(renderer)->replacedContentRect();
-        else
-            destRect = renderer->contentBoxRect();
-
+    if (RenderBox* ro = renderBox()) {
+        FloatRect destRect = ro->contentBoxRect();
         // Inflate dirty rect to cover antialiasing on image buffers.
         if (drawingContext() && drawingContext()->shouldAntialias())
             dirtyRect.inflate(1);
-
         FloatRect r = mapRect(dirtyRect, FloatRect(0, 0, size().width(), size().height()), destRect);
         r.intersect(destRect);
-
         if (!r.isEmpty() && !m_dirtyRect.contains(r)) {
             m_dirtyRect.unite(r);
-            renderer->repaintRectangle(enclosingIntRect(m_dirtyRect));
+            ro->repaintRectangle(enclosingIntRect(m_dirtyRect));
         }
     }
     notifyObserversCanvasChanged(dirtyRect);
index e968e61..986defe 100644 (file)
@@ -74,7 +74,7 @@ void RenderHTMLCanvas::paintReplaced(PaintInfo& paintInfo, const LayoutPoint& pa
 
     LayoutRect contentBoxRect = this->contentBoxRect();
     contentBoxRect.moveBy(paintOffset);
-    LayoutRect replacedContentRect = this->replacedContentRect();
+    LayoutRect replacedContentRect = this->replacedContentRect(intrinsicSize());
     replacedContentRect.moveBy(paintOffset);
 
     // Not allowed to overflow the content box.
index 6c093a4..973fa01 100644 (file)
@@ -285,7 +285,7 @@ void RenderImage::updateIntrinsicSizeIfNeeded(const LayoutSize& newSize)
 void RenderImage::updateInnerContentRect()
 {
     // Propagate container size to image resource.
-    IntSize containerSize(replacedContentRect().size());
+    IntSize containerSize(replacedContentRect(intrinsicSize()).size());
     if (!containerSize.isEmpty()) {
         URL imageSourceURL;
         if (HTMLImageElement* imageElement = is<HTMLImageElement>(element()) ? downcast<HTMLImageElement>(element()) : nullptr)
@@ -497,7 +497,7 @@ void RenderImage::paintReplaced(PaintInfo& paintInfo, const LayoutPoint& paintOf
 
     LayoutRect contentBoxRect = this->contentBoxRect();
     contentBoxRect.moveBy(paintOffset);
-    LayoutRect replacedContentRect = this->replacedContentRect();
+    LayoutRect replacedContentRect = this->replacedContentRect(intrinsicSize());
     replacedContentRect.moveBy(paintOffset);
     bool clip = !contentBoxRect.contains(replacedContentRect);
     GraphicsContextStateSaver stateSaver(context, clip);
index 34aaf88..1c62551 100644 (file)
@@ -2344,7 +2344,7 @@ LayoutRect RenderLayerBacking::contentsBox() const
 #endif
     if (is<RenderReplaced>(renderBox)) {
         RenderReplaced& renderReplaced = downcast<RenderReplaced>(renderBox);
-        contentsRect = renderReplaced.replacedContentRect();
+        contentsRect = renderReplaced.replacedContentRect(renderBox.intrinsicSize());
     } else
         contentsRect = renderBox.contentBoxRect();
 
index 0de1526..ae5d954 100644 (file)
@@ -34,7 +34,6 @@ public:
     LayoutUnit computeReplacedLogicalHeight(std::optional<LayoutUnit> estimatedUsedWidth = std::nullopt) const override;
 
     LayoutRect replacedContentRect(const LayoutSize& intrinsicSize) const;
-    LayoutRect replacedContentRect() const { return replacedContentRect(intrinsicSize()); }
 
     bool hasReplacedLogicalWidth() const;
     bool hasReplacedLogicalHeight() const;
index 01aa855..2866d81 100644 (file)
@@ -151,7 +151,7 @@ std::unique_ptr<Shape> ShapeOutsideInfo::createShapeForImage(StyleImage* styleIm
 
     const LayoutRect& marginRect = getShapeImageMarginRect(m_renderer, m_referenceBoxLogicalSize);
     const LayoutRect& imageRect = is<RenderImage>(m_renderer)
-        ? downcast<RenderImage>(m_renderer).replacedContentRect()
+        ? downcast<RenderImage>(m_renderer).replacedContentRect(m_renderer.intrinsicSize())
         : LayoutRect(LayoutPoint(), imageSize);
 
     ASSERT(!styleImage->isPending());