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..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; |