| Index: Source/core/html/HTMLImageElement.cpp
|
| diff --git a/Source/core/html/HTMLImageElement.cpp b/Source/core/html/HTMLImageElement.cpp
|
| index a79a7be988dcae4eeadc310ec544dcba798f002b..f6d39f0c885c1a734ffba8092e779063de159c56 100644
|
| --- a/Source/core/html/HTMLImageElement.cpp
|
| +++ b/Source/core/html/HTMLImageElement.cpp
|
| @@ -46,6 +46,7 @@
|
| #include "core/layout/LayoutBlockFlow.h"
|
| #include "core/layout/LayoutImage.h"
|
| #include "core/page/Page.h"
|
| +#include "core/style/ContentData.h"
|
| #include "platform/ContentType.h"
|
| #include "platform/EventDispatchForbiddenScope.h"
|
| #include "platform/MIMETypeRegistry.h"
|
| @@ -330,12 +331,13 @@ ImageCandidate HTMLImageElement::findBestFitImageFromPictureParent()
|
|
|
| LayoutObject* HTMLImageElement::createLayoutObject(const ComputedStyle& style)
|
| {
|
| + const ContentData* contentData = style.contentData();
|
| + if (contentData && contentData->isImage() && !toImageContentData(contentData)->image()->cachedImage()->errorOccurred())
|
| + return LayoutObject::createObject(this, style);
|
| +
|
| if (m_useFallbackContent)
|
| return new LayoutBlockFlow(this);
|
|
|
| - if (style.hasContent())
|
| - return LayoutObject::createObject(this, style);
|
| -
|
| LayoutImage* image = new LayoutImage(this);
|
| image->setImageResource(LayoutImageResource::create());
|
| image->setImageDevicePixelRatio(m_imageDevicePixelRatio);
|
| @@ -699,6 +701,12 @@ void HTMLImageElement::didAddUserAgentShadowRoot(ShadowRoot&)
|
| HTMLImageFallbackHelper::createAltTextShadowTree(*this);
|
| }
|
|
|
| +void HTMLImageElement::ensureFallbackForGeneratedContent()
|
| +{
|
| + setUseFallbackContent();
|
| + reattachFallbackContent();
|
| +}
|
| +
|
| void HTMLImageElement::ensureFallbackContent()
|
| {
|
| if (m_useFallbackContent || m_isFallbackImage)
|
|
|