Unreviewed, rolling out r220048.
authorjlewis3@apple.com <jlewis3@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 31 Jul 2017 20:31:05 +0000 (20:31 +0000)
committerjlewis3@apple.com <jlewis3@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 31 Jul 2017 20:31:05 +0000 (20:31 +0000)
This revision caused multiple crashes in fast/images. See
webkit.org/b/174990

Reverted changeset:

"RenderImageResourceStyleImage::image() should return the
nullImage() if the image is not available"
https://bugs.webkit.org/show_bug.cgi?id=174874
http://trac.webkit.org/changeset/220048

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

14 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/images/image-element-image-content-data-expected.txt [deleted file]
LayoutTests/fast/images/image-element-image-content-data.html [deleted file]
Source/WebCore/ChangeLog
Source/WebCore/css/CSSCrossfadeValue.cpp
Source/WebCore/css/CSSFilterImageValue.cpp
Source/WebCore/page/EventHandler.cpp
Source/WebCore/page/PageSerializer.cpp
Source/WebCore/rendering/RenderElement.cpp
Source/WebCore/rendering/RenderImageResource.cpp
Source/WebCore/rendering/RenderImageResourceStyleImage.cpp
Source/WebCore/rendering/style/ContentData.cpp
Source/WebCore/rendering/style/StyleCachedImage.cpp
Source/WebCore/style/StylePendingResources.cpp

index 707472b..2ea75be 100644 (file)
@@ -1,3 +1,17 @@
+2017-07-31  Matt Lewis  <jlewis3@apple.com>
+
+        Unreviewed, rolling out r220048.
+
+        This revision caused multiple crashes in fast/images. See
+        webkit.org/b/174990
+
+        Reverted changeset:
+
+        "RenderImageResourceStyleImage::image() should return the
+        nullImage() if the image is not available"
+        https://bugs.webkit.org/show_bug.cgi?id=174874
+        http://trac.webkit.org/changeset/220048
+
 2017-07-31  Per Arne Vollan  <pvollan@apple.com>
 
         Do not mark all web-platform tests as slow, as this increases time spent on layout tests.
diff --git a/LayoutTests/fast/images/image-element-image-content-data-expected.txt b/LayoutTests/fast/images/image-element-image-content-data-expected.txt
deleted file mode 100644 (file)
index 6640c22..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-PASS if no crash happens.
-
-
diff --git a/LayoutTests/fast/images/image-element-image-content-data.html b/LayoutTests/fast/images/image-element-image-content-data.html
deleted file mode 100644 (file)
index 9e27a91..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-<style>
-    img {
-        width: 100px;
-        height: 100px;
-        border: 2px solid black;
-        content: -webkit-named-image(apple-pay-logo-white);
-    }
-</style>
-<body>
-    <p>PASS if no crash happens.</p>
-    <img src='resources/green-400x400.png'>
-    <script>
-        if (window.testRunner)
-            testRunner.dumpAsText(true);
-        setTimeout(function() {
-            var image = document.querySelector('img');
-            image.remove();
-        }, 0);
-    </script>
-</body>
index 761676e..2ae7177 100644 (file)
@@ -1,3 +1,17 @@
+2017-07-31  Matt Lewis  <jlewis3@apple.com>
+
+        Unreviewed, rolling out r220048.
+
+        This revision caused multiple crashes in fast/images. See
+        webkit.org/b/174990
+
+        Reverted changeset:
+
+        "RenderImageResourceStyleImage::image() should return the
+        nullImage() if the image is not available"
+        https://bugs.webkit.org/show_bug.cgi?id=174874
+        http://trac.webkit.org/changeset/220048
+
 2017-07-31  Sam Weinig  <sam@webkit.org>
 
         Remove unnecessary exceptions from storage code
index 706af08..9eb6f0f 100644 (file)
@@ -33,6 +33,7 @@
 #include "CachedResourceLoader.h"
 #include "CrossfadeGeneratedImage.h"
 #include "RenderElement.h"
+#include "StyleCachedImage.h"
 #include <wtf/text/StringBuilder.h>
 
 namespace WebCore {
index ac23aaf..a8b0b14 100644 (file)
@@ -33,6 +33,7 @@
 #include "GraphicsContext.h"
 #include "ImageBuffer.h"
 #include "RenderElement.h"
+#include "StyleCachedImage.h"
 #include "StyleResolver.h"
 #include <wtf/text/StringBuilder.h>
 
index 721c6b1..816ebb2 100644 (file)
@@ -86,6 +86,7 @@
 #include "Settings.h"
 #include "ShadowRoot.h"
 #include "SpatialNavigation.h"
+#include "StyleCachedImage.h"
 #include "TextEvent.h"
 #include "TextIterator.h"
 #include "UserGestureIndicator.h"
index bc3abf1..ec10cd5 100644 (file)
@@ -52,6 +52,7 @@
 #include "MarkupAccumulator.h"
 #include "Page.h"
 #include "RenderElement.h"
+#include "StyleCachedImage.h"
 #include "StyleImage.h"
 #include "StyleProperties.h"
 #include "StyleRule.h"
index 86a18be..c9dc5d6 100644 (file)
@@ -50,6 +50,7 @@
 #include "RenderDescendantIterator.h"
 #include "RenderFlexibleBox.h"
 #include "RenderImage.h"
+#include "RenderImageResourceStyleImage.h"
 #include "RenderInline.h"
 #include "RenderIterator.h"
 #include "RenderLayer.h"
index f269da6..d8de5f9 100644 (file)
@@ -32,6 +32,7 @@
 #include "Image.h"
 #include "RenderElement.h"
 #include "RenderImage.h"
+#include "RenderImageResourceStyleImage.h"
 
 namespace WebCore {
 
index 61f85cb..5c37cab 100644 (file)
@@ -30,6 +30,7 @@
 
 #include "CachedImage.h"
 #include "RenderElement.h"
+#include "StyleCachedImage.h"
 
 namespace WebCore {
 
@@ -47,7 +48,7 @@ void RenderImageResourceStyleImage::initialize(RenderElement* renderer)
     RenderImageResource::initialize(renderer);
 
     if (m_styleImage->isCachedImage())
-        m_cachedImage = m_styleImage->cachedImage();
+        m_cachedImage = m_styleImage.get().cachedImage();
 
     m_styleImage->addClient(m_renderer);
 }
@@ -55,19 +56,17 @@ void RenderImageResourceStyleImage::initialize(RenderElement* renderer)
 void RenderImageResourceStyleImage::shutdown()
 {
     ASSERT(m_renderer);
-    image()->stopAnimation();
     m_styleImage->removeClient(m_renderer);
-    m_cachedImage = nullptr;
+    if (m_cachedImage) {
+        image()->stopAnimation();
+        m_cachedImage = nullptr;
+    }
 }
 
 RefPtr<Image> RenderImageResourceStyleImage::image(const IntSize& size) const
 {
     // Generated content may trigger calls to image() while we're still pending, don't assert but gracefully exit.
-    if (m_styleImage->isPending())
-        return &Image::nullImage();
-    if (auto image = m_styleImage->image(m_renderer, size))
-        return image;
-    return &Image::nullImage();
+    return !m_styleImage->isPending() ? m_styleImage->image(m_renderer, size) : &Image::nullImage();
 }
 
 void RenderImageResourceStyleImage::setContainerSizeForRenderer(const IntSize& size)
index d802818..c6c0224 100644 (file)
@@ -25,6 +25,7 @@
 #include "RenderCounter.h"
 #include "RenderImage.h"
 #include "RenderImageResource.h"
+#include "RenderImageResourceStyleImage.h"
 #include "RenderQuote.h"
 #include "RenderStyle.h"
 #include "RenderTextFragment.h"
index eb27664..9428c4e 100644 (file)
@@ -29,6 +29,7 @@
 #include "CSSImageValue.h"
 #include "CachedImage.h"
 #include "RenderElement.h"
+#include "RenderView.h"
 
 namespace WebCore {
 
index df1a2af..10319f8 100644 (file)
@@ -34,6 +34,7 @@
 #include "Document.h"
 #include "RenderStyle.h"
 #include "SVGURIReference.h"
+#include "StyleCachedImage.h"
 #include "StyleGeneratedImage.h"
 #include "TransformFunctions.h"