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

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
« no previous file with comments | « Source/core/html/HTMLElement.h ('k') | Source/core/html/HTMLImageElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLImageElement.h
diff --git a/Source/core/html/HTMLImageElement.h b/Source/core/html/HTMLImageElement.h
index 7b5d9a21699042b08fd862ba27b99ce2463e743d..518cfb44373ddbfa2fe93aca8c853b12c81329f7 100644
--- a/Source/core/html/HTMLImageElement.h
+++ b/Source/core/html/HTMLImageElement.h
@@ -57,7 +57,7 @@ public:
bool isServerMap() const;
- const AtomicString& altText() const;
+ virtual String altText() const OVERRIDE FINAL;
CompositeOperator compositeOperator() const { return m_compositeOperator; }
@@ -89,6 +89,8 @@ public:
virtual HTMLFormElement* formOwner() const OVERRIDE;
void formRemovedFromTree(const Node& formRoot);
+ virtual void ensureFallbackContent() OVERRIDE FINAL;
+ virtual void ensurePrimaryContent() OVERRIDE FINAL;
// 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; }
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/09 19:52:41 There's no reason for this, just do userAgentShado
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
« no previous file with comments | « Source/core/html/HTMLElement.h ('k') | Source/core/html/HTMLImageElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698