Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(635)

Unified Diff: Source/core/html/HTMLImageElement.h

Issue 481753002: Use Shadow DOM to display fallback content for images (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Updated Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/html/HTMLImageElement.h
diff --git a/Source/core/html/HTMLImageElement.h b/Source/core/html/HTMLImageElement.h
index 7b5d9a21699042b08fd862ba27b99ce2463e743d..e904c36f94b2a920fa6c20ef7faedc4a81c10567 100644
--- a/Source/core/html/HTMLImageElement.h
+++ b/Source/core/html/HTMLImageElement.h
@@ -89,6 +89,8 @@ public:
virtual HTMLFormElement* formOwner() const OVERRIDE;
void formRemovedFromTree(const Node& formRoot);
+ void ensureFallbackContent();
+ void ensurePrimaryContent();
// CanvasImageSourceImplementations
virtual PassRefPtr<Image> getSourceImageForCanvas(SourceImageMode, SourceImageStatus*) const;
@@ -99,11 +101,18 @@ public:
// public so that HTMLPictureElement can call this as well.
void selectSourceURL(ImageLoader::UpdateFromElementBehavior);
+ void reattachFallbackContent();
+ void setUseFallbackContent() { m_useFallbackContent = true; ensureUserAgentShadowRoot(); }
+ void setIsFallbackImage() { m_isFallbackImage = true; }
+
protected:
explicit HTMLImageElement(Document&, HTMLFormElement* = 0, bool createdByParser = false);
virtual void didMoveToNewDocument(Document& oldDocument) OVERRIDE;
+ virtual bool useFallbackContent() const { return m_useFallbackContent; }
+ virtual void didAddUserAgentShadowRoot(ShadowRoot&) OVERRIDE;
+ virtual PassRefPtr<RenderStyle> customStyleForRenderer() OVERRIDE;
private:
virtual bool areAuthorShadowsAllowed() const OVERRIDE { return false; }
@@ -135,6 +144,7 @@ private:
HTMLImageLoader& imageLoader() const { return *m_imageLoader; }
void notifyViewportChanged();
void createMediaQueryListIfDoesNotExist();
+ Text* altTextNode() { return m_altTextNode; }
esprehn 2014/09/05 00:47:51 Remove this.
rhogan 2014/09/08 19:52:41 Not done. See note above.
OwnPtrWillBeMember<HTMLImageLoader> m_imageLoader;
RefPtrWillBeMember<ViewportChangeListener> m_listener;
@@ -143,6 +153,7 @@ private:
#else
WeakPtr<HTMLFormElement> m_form;
#endif
+ Text* m_altTextNode;
esprehn 2014/09/05 00:47:51 ditto, use ids.
CompositeOperator m_compositeOperator;
AtomicString m_bestFitImageURL;
float m_imageDevicePixelRatio;
@@ -152,6 +163,8 @@ private:
unsigned m_intrinsicSizingViewportDependant : 1;
// Effective size is viewport dependant if the sizes attribute's effective size used v* length units.
unsigned m_effectiveSizeViewportDependant : 1;
+ unsigned m_useFallbackContent : 1;
+ unsigned m_isFallbackImage : 1;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698