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

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

Issue 2535383003: Collapse images disallowed by the Safe Browsing Subresource Filter. (Closed)
Patch Set: Phrasing. Created 4 years 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: third_party/WebKit/Source/core/html/HTMLImageElement.h
diff --git a/third_party/WebKit/Source/core/html/HTMLImageElement.h b/third_party/WebKit/Source/core/html/HTMLImageElement.h
index 1bc5c0cd1c677c4b104b4df99b2b9fc23ca74200..ed5fc31792aac7094d9421ead67faef1853d5d1d 100644
--- a/third_party/WebKit/Source/core/html/HTMLImageElement.h
+++ b/third_party/WebKit/Source/core/html/HTMLImageElement.h
@@ -102,7 +102,7 @@ class CORE_EXPORT HTMLImageElement final : public HTMLElement,
HTMLFormElement* formOwner() const override;
void formRemovedFromTree(const Node& formRoot);
- virtual void ensureFallbackContent();
+ virtual void ensureCollapsedOrFallbackContent();
virtual void ensureFallbackForGeneratedContent();
virtual void ensurePrimaryContent();
@@ -123,7 +123,7 @@ class CORE_EXPORT HTMLImageElement final : public HTMLElement,
// public so that HTMLPictureElement can call this as well.
void selectSourceURL(ImageLoader::UpdateFromElementBehavior);
- void reattachFallbackContent();
+ void reattachContent();
void setUseFallbackContent();
void setIsFallbackImage() { m_isFallbackImage = true; }
@@ -141,12 +141,20 @@ class CORE_EXPORT HTMLImageElement final : public HTMLElement,
ExceptionState&) override;
protected:
+ enum class LayoutDisposition : uint8_t {
+ PrimaryContent,
dominicc (has gone to gerrit) 2016/12/05 03:30:55 It would be splendid to have some comments explain
engedy 2016/12/06 15:27:57 Done.
+ FallbackContent,
+ Collapsed
+ };
+
explicit HTMLImageElement(Document&,
HTMLFormElement* = 0,
bool createdByParser = false);
void didMoveToNewDocument(Document& oldDocument) override;
- virtual bool useFallbackContent() const { return m_useFallbackContent; }
+ virtual bool useFallbackContent() const {
+ return m_layoutDisposition == LayoutDisposition::FallbackContent;
+ }
void didAddUserAgentShadowRoot(ShadowRoot&) override;
PassRefPtr<ComputedStyle> customStyleForLayoutObject() override;
@@ -163,6 +171,7 @@ class CORE_EXPORT HTMLImageElement final : public HTMLElement,
MutableStylePropertySet*) override;
void attachLayoutTree(const AttachContext& = AttachContext()) override;
+ bool layoutObjectIsNeeded(const ComputedStyle&) override;
LayoutObject* createLayoutObject(const ComputedStyle&) override;
bool canStartSelection() const override { return false; }
@@ -193,9 +202,9 @@ class CORE_EXPORT HTMLImageElement final : public HTMLElement,
AtomicString m_bestFitImageURL;
float m_imageDevicePixelRatio;
Member<HTMLSourceElement> m_source;
+ LayoutDisposition m_layoutDisposition;
unsigned m_formWasSetByParser : 1;
unsigned m_elementCreatedByParser : 1;
- unsigned m_useFallbackContent : 1;
unsigned m_isFallbackImage : 1;
ReferrerPolicy m_referrerPolicy;

Powered by Google App Engine
This is Rietveld 408576698