| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2006 Allan Sandfeld Jensen (kde@carewolf.com) | 4 * (C) 2006 Allan Sandfeld Jensen (kde@carewolf.com) |
| 5 * (C) 2006 Samuel Weinig (sam.weinig@gmail.com) | 5 * (C) 2006 Samuel Weinig (sam.weinig@gmail.com) |
| 6 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010, 2011 Apple Inc. All rights
reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010, 2011 Apple Inc. All rights
reserved. |
| 7 * | 7 * |
| 8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
| 9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
| 10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 virtual void destroy() override; | 44 virtual void destroy() override; |
| 45 | 45 |
| 46 static RenderImage* createAnonymous(Document*); | 46 static RenderImage* createAnonymous(Document*); |
| 47 | 47 |
| 48 void setImageResource(PassOwnPtr<RenderImageResource>); | 48 void setImageResource(PassOwnPtr<RenderImageResource>); |
| 49 | 49 |
| 50 RenderImageResource* imageResource() { return m_imageResource.get(); } | 50 RenderImageResource* imageResource() { return m_imageResource.get(); } |
| 51 const RenderImageResource* imageResource() const { return m_imageResource.ge
t(); } | 51 const RenderImageResource* imageResource() const { return m_imageResource.ge
t(); } |
| 52 ImageResource* cachedImage() const { return m_imageResource ? m_imageResourc
e->cachedImage() : 0; } | 52 ImageResource* cachedImage() const { return m_imageResource ? m_imageResourc
e->cachedImage() : 0; } |
| 53 | 53 |
| 54 bool setImageSizeForAltText(ImageResource* newImage = 0); |
| 55 |
| 56 void updateAltText(); |
| 57 |
| 54 HTMLMapElement* imageMap() const; | 58 HTMLMapElement* imageMap() const; |
| 55 void areaElementFocusChanged(HTMLAreaElement*); | 59 void areaElementFocusChanged(HTMLAreaElement*); |
| 56 | 60 |
| 57 void setIsGeneratedContent(bool generated = true) { m_isGeneratedContent = g
enerated; } | 61 void setIsGeneratedContent(bool generated = true) { m_isGeneratedContent = g
enerated; } |
| 58 | 62 |
| 59 bool isGeneratedContent() const { return m_isGeneratedContent; } | 63 bool isGeneratedContent() const { return m_isGeneratedContent; } |
| 60 | 64 |
| 65 String altText() const { return m_altText; } |
| 66 |
| 61 inline void setImageDevicePixelRatio(float factor) { m_imageDevicePixelRatio
= factor; } | 67 inline void setImageDevicePixelRatio(float factor) { m_imageDevicePixelRatio
= factor; } |
| 62 float imageDevicePixelRatio() const { return m_imageDevicePixelRatio; } | 68 float imageDevicePixelRatio() const { return m_imageDevicePixelRatio; } |
| 63 | 69 |
| 64 virtual void intrinsicSizeChanged() override | 70 virtual void intrinsicSizeChanged() override |
| 65 { | 71 { |
| 66 if (m_imageResource) | 72 if (m_imageResource) |
| 67 imageChanged(m_imageResource->imagePtr()); | 73 imageChanged(m_imageResource->imagePtr()); |
| 68 } | 74 } |
| 69 | 75 |
| 70 protected: | 76 protected: |
| (...skipping 19 matching lines...) Expand all Loading... |
| 90 virtual bool foregroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect,
unsigned maxDepthToTest) const override final; | 96 virtual bool foregroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect,
unsigned maxDepthToTest) const override final; |
| 91 virtual bool computeBackgroundIsKnownToBeObscured() override final; | 97 virtual bool computeBackgroundIsKnownToBeObscured() override final; |
| 92 | 98 |
| 93 virtual LayoutUnit minimumReplacedHeight() const override; | 99 virtual LayoutUnit minimumReplacedHeight() const override; |
| 94 | 100 |
| 95 virtual void notifyFinished(Resource*) override final; | 101 virtual void notifyFinished(Resource*) override final; |
| 96 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes
tLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAct
ion) override final; | 102 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes
tLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAct
ion) override final; |
| 97 | 103 |
| 98 virtual bool boxShadowShouldBeAppliedToBackground(BackgroundBleedAvoidance,
InlineFlowBox*) const override final; | 104 virtual bool boxShadowShouldBeAppliedToBackground(BackgroundBleedAvoidance,
InlineFlowBox*) const override final; |
| 99 | 105 |
| 100 void repaintOrMarkForLayout(const IntRect* = 0); | 106 IntSize imageSizeForError(ImageResource*) const; |
| 107 void paintInvalidationOrMarkForLayout(bool imageSizeChanged, const IntRect*
= 0); |
| 101 void updateIntrinsicSizeIfNeeded(const LayoutSize&); | 108 void updateIntrinsicSizeIfNeeded(const LayoutSize&); |
| 102 // Update the size of the image to be rendered. Object-fit may cause this to
be different from the CSS box's content rect. | 109 // Update the size of the image to be rendered. Object-fit may cause this to
be different from the CSS box's content rect. |
| 103 void updateInnerContentRect(); | 110 void updateInnerContentRect(); |
| 104 | 111 |
| 105 // Text to display as long as the image isn't available. | 112 // Text to display as long as the image isn't available. |
| 113 String m_altText; |
| 106 OwnPtr<RenderImageResource> m_imageResource; | 114 OwnPtr<RenderImageResource> m_imageResource; |
| 107 bool m_didIncrementVisuallyNonEmptyPixelCount; | 115 bool m_didIncrementVisuallyNonEmptyPixelCount; |
| 108 bool m_isGeneratedContent; | 116 bool m_isGeneratedContent; |
| 109 float m_imageDevicePixelRatio; | 117 float m_imageDevicePixelRatio; |
| 110 | 118 |
| 111 friend class RenderImageScaleObserver; | 119 friend class RenderImageScaleObserver; |
| 112 }; | 120 }; |
| 113 | 121 |
| 114 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderImage, isRenderImage()); | 122 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderImage, isRenderImage()); |
| 115 | 123 |
| 116 } // namespace blink | 124 } // namespace blink |
| 117 | 125 |
| 118 #endif // RenderImage_h | 126 #endif // RenderImage_h |
| OLD | NEW |