Title: [158090] trunk/Source/WebCore
- Revision
- 158090
- Author
- akl...@apple.com
- Date
- 2013-10-26 11:59:27 -0700 (Sat, 26 Oct 2013)
Log Message
CTTE: RenderImageResourceStyleImage always has a StyleImage.
<https://webkit.org/b/123390>
Codify the fact that RenderImageResourceStyleImage always wraps an
existing StyleImage object.
Reviewed by Antti Koivisto.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (158089 => 158090)
--- trunk/Source/WebCore/ChangeLog 2013-10-26 18:45:36 UTC (rev 158089)
+++ trunk/Source/WebCore/ChangeLog 2013-10-26 18:59:27 UTC (rev 158090)
@@ -1,3 +1,13 @@
+2013-10-26 Andreas Kling <akl...@apple.com>
+
+ CTTE: RenderImageResourceStyleImage always has a StyleImage.
+ <https://webkit.org/b/123390>
+
+ Codify the fact that RenderImageResourceStyleImage always wraps an
+ existing StyleImage object.
+
+ Reviewed by Antti Koivisto.
+
2013-10-26 Antti Koivisto <an...@apple.com>
Revert some accidental changes.
Modified: trunk/Source/WebCore/rendering/RenderElement.cpp (158089 => 158090)
--- trunk/Source/WebCore/rendering/RenderElement.cpp 2013-10-26 18:45:36 UTC (rev 158089)
+++ trunk/Source/WebCore/rendering/RenderElement.cpp 2013-10-26 18:59:27 UTC (rev 158090)
@@ -130,7 +130,7 @@
// doesn't make sense as it should be run once at renderer creation.
image->setStyleInternal(style);
if (const StyleImage* styleImage = static_cast<const ImageContentData*>(contentData)->image()) {
- image->setImageResource(RenderImageResourceStyleImage::create(const_cast<StyleImage*>(styleImage)));
+ image->setImageResource(RenderImageResourceStyleImage::create(const_cast<StyleImage&>(*styleImage)));
image->setIsGeneratedContent();
} else
image->setImageResource(RenderImageResource::create());
Modified: trunk/Source/WebCore/rendering/RenderImageResourceStyleImage.cpp (158089 => 158090)
--- trunk/Source/WebCore/rendering/RenderImageResourceStyleImage.cpp 2013-10-26 18:45:36 UTC (rev 158089)
+++ trunk/Source/WebCore/rendering/RenderImageResourceStyleImage.cpp 2013-10-26 18:59:27 UTC (rev 158090)
@@ -34,10 +34,9 @@
namespace WebCore {
-RenderImageResourceStyleImage::RenderImageResourceStyleImage(StyleImage* styleImage)
+RenderImageResourceStyleImage::RenderImageResourceStyleImage(StyleImage& styleImage)
: m_styleImage(styleImage)
{
- ASSERT(m_styleImage);
}
RenderImageResourceStyleImage::~RenderImageResourceStyleImage()
@@ -49,7 +48,7 @@
RenderImageResource::initialize(renderer);
if (m_styleImage->isCachedImage())
- m_cachedImage = static_cast<StyleCachedImage*>(m_styleImage.get())->cachedImage();
+ m_cachedImage = m_styleImage.get().cachedImage();
m_styleImage->addClient(m_renderer);
}
Modified: trunk/Source/WebCore/rendering/RenderImageResourceStyleImage.h (158089 => 158090)
--- trunk/Source/WebCore/rendering/RenderImageResourceStyleImage.h 2013-10-26 18:45:36 UTC (rev 158089)
+++ trunk/Source/WebCore/rendering/RenderImageResourceStyleImage.h 2013-10-26 18:59:27 UTC (rev 158090)
@@ -38,7 +38,7 @@
public:
virtual ~RenderImageResourceStyleImage();
- static PassOwnPtr<RenderImageResource> create(StyleImage* styleImage)
+ static PassOwnPtr<RenderImageResource> create(StyleImage& styleImage)
{
return adoptPtr(new RenderImageResourceStyleImage(styleImage));
}
@@ -61,8 +61,8 @@
virtual WrappedImagePtr imagePtr() const OVERRIDE { return m_styleImage->data(); }
- explicit RenderImageResourceStyleImage(StyleImage*);
- RefPtr<StyleImage> m_styleImage;
+ explicit RenderImageResourceStyleImage(StyleImage&);
+ Ref<StyleImage> m_styleImage;
};
} // namespace WebCore
Modified: trunk/Source/WebCore/rendering/style/ContentData.cpp (158089 => 158090)
--- trunk/Source/WebCore/rendering/style/ContentData.cpp 2013-10-26 18:45:36 UTC (rev 158089)
+++ trunk/Source/WebCore/rendering/style/ContentData.cpp 2013-10-26 18:59:27 UTC (rev 158090)
@@ -52,7 +52,7 @@
RenderImage* image = new RenderImage(document);
image->setPseudoStyle(&pseudoStyle);
if (m_image)
- image->setImageResource(RenderImageResourceStyleImage::create(m_image.get()));
+ image->setImageResource(RenderImageResourceStyleImage::create(*m_image));
else
image->setImageResource(RenderImageResource::create());
return image;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes