Chromium Code Reviews| 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..d767c1b217122068b05d4123e68c4a4f88bc30a9 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,8 +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 setUseFallbackContent(); |
| + |
| void setIsFallbackImage() { m_isFallbackImage = true; } |
| FetchRequest::ResourceWidth getResourceWidth(); |
| @@ -141,12 +140,27 @@ class CORE_EXPORT HTMLImageElement final : public HTMLElement, |
| ExceptionState&) override; |
| protected: |
| + // Controls how an image element appears in the layout. See: |
|
dominicc (has gone to gerrit)
2016/12/07 01:51:42
Awesome :D thank you.
|
| + // https://html.spec.whatwg.org/multipage/embedded-content.html#image-request |
| + enum class LayoutDisposition : uint8_t { |
| + // Displayed as a partially or completely loaded image. Corresponds to the |
| + // `current request` state being: `unavailable`, `partially available`, or |
| + // `completely available`. |
| + PrimaryContent, |
| + // Showing a broken image icon and 'alt' text, if any. Corresponds to the |
| + // `current request` being in the `broken` state. |
| + FallbackContent, |
| + // No layout object. Corresponds to the `current request` being in the |
| + // `broken` state when the resource load failed with an error that has the |
| + // |shouldCollapseInitiator| flag set. |
| + Collapsed |
| + }; |
| + |
| explicit HTMLImageElement(Document&, |
| HTMLFormElement* = 0, |
| bool createdByParser = false); |
| void didMoveToNewDocument(Document& oldDocument) override; |
| - virtual bool useFallbackContent() const { return m_useFallbackContent; } |
| void didAddUserAgentShadowRoot(ShadowRoot&) override; |
| PassRefPtr<ComputedStyle> customStyleForLayoutObject() override; |
| @@ -161,8 +175,10 @@ class CORE_EXPORT HTMLImageElement final : public HTMLElement, |
| void collectStyleForPresentationAttribute(const QualifiedName&, |
| const AtomicString&, |
| MutableStylePropertySet*) override; |
| + void setLayoutDisposition(LayoutDisposition, bool forceReattach = false); |
| void attachLayoutTree(const AttachContext& = AttachContext()) override; |
| + bool layoutObjectIsNeeded(const ComputedStyle&) override; |
| LayoutObject* createLayoutObject(const ComputedStyle&) override; |
| bool canStartSelection() const override { return false; } |
| @@ -193,9 +209,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; |