Chromium Code Reviews| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 54 void areaElementFocusChanged(HTMLAreaElement*); | 54 void areaElementFocusChanged(HTMLAreaElement*); |
| 55 | 55 |
| 56 void highQualityRepaintTimerFired(Timer<RenderImage>*); | 56 void highQualityRepaintTimerFired(Timer<RenderImage>*); |
| 57 | 57 |
| 58 void setIsGeneratedContent(bool generated = true) { m_isGeneratedContent = g enerated; } | 58 void setIsGeneratedContent(bool generated = true) { m_isGeneratedContent = g enerated; } |
| 59 | 59 |
| 60 bool isGeneratedContent() const { return m_isGeneratedContent; } | 60 bool isGeneratedContent() const { return m_isGeneratedContent; } |
| 61 | 61 |
| 62 String altText() const { return m_altText; } | 62 String altText() const { return m_altText; } |
| 63 | 63 |
| 64 inline void setIntrinsicSizeFactor(float factor) { m_intrinsicSizeFactor = f actor; } | |
| 65 virtual LayoutSize intrinsicSize() const OVERRIDE; | |
| 66 LayoutSize unscaledIntrinsicSize() const; | |
|
pdr.
2013/10/11 05:17:33
Can we change this to something more descriptive?
Yoav Weiss
2013/10/11 07:22:32
I think (hope) this mechanism is not srcset specif
| |
| 64 protected: | 67 protected: |
| 65 virtual bool needsPreferredWidthsRecalculation() const OVERRIDE FINAL; | 68 virtual bool needsPreferredWidthsRecalculation() const OVERRIDE FINAL; |
| 66 virtual RenderBox* embeddedContentBox() const OVERRIDE FINAL; | 69 virtual RenderBox* embeddedContentBox() const OVERRIDE FINAL; |
| 67 virtual void computeIntrinsicRatioInformation(FloatSize& intrinsicSize, doub le& intrinsicRatio, bool& isPercentageIntrinsicSize) const OVERRIDE FINAL; | 70 virtual void computeIntrinsicRatioInformation(FloatSize& intrinsicSize, doub le& intrinsicRatio, bool& isPercentageIntrinsicSize) const OVERRIDE FINAL; |
| 68 | 71 |
| 69 virtual void styleDidChange(StyleDifference, const RenderStyle*) OVERRIDE FI NAL; | 72 virtual void styleDidChange(StyleDifference, const RenderStyle*) OVERRIDE FI NAL; |
| 70 | 73 |
| 71 virtual void imageChanged(WrappedImagePtr, const IntRect* = 0); | 74 virtual void imageChanged(WrappedImagePtr, const IntRect* = 0); |
| 72 | 75 |
| 73 void paintIntoRect(GraphicsContext*, const LayoutRect&); | 76 void paintIntoRect(GraphicsContext*, const LayoutRect&); |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 94 virtual LayoutUnit minimumReplacedHeight() const OVERRIDE; | 97 virtual LayoutUnit minimumReplacedHeight() const OVERRIDE; |
| 95 | 98 |
| 96 virtual void notifyFinished(Resource*) OVERRIDE FINAL; | 99 virtual void notifyFinished(Resource*) OVERRIDE FINAL; |
| 97 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes tLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAct ion) OVERRIDE FINAL; | 100 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes tLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAct ion) OVERRIDE FINAL; |
| 98 | 101 |
| 99 virtual bool boxShadowShouldBeAppliedToBackground(BackgroundBleedAvoidance, InlineFlowBox*) const OVERRIDE FINAL; | 102 virtual bool boxShadowShouldBeAppliedToBackground(BackgroundBleedAvoidance, InlineFlowBox*) const OVERRIDE FINAL; |
| 100 | 103 |
| 101 IntSize imageSizeForError(ImageResource*) const; | 104 IntSize imageSizeForError(ImageResource*) const; |
| 102 void imageDimensionsChanged(bool imageSizeChanged, const IntRect* = 0); | 105 void imageDimensionsChanged(bool imageSizeChanged, const IntRect* = 0); |
| 103 bool updateIntrinsicSizeIfNeeded(const LayoutSize&, bool imageSizeChanged); | 106 bool updateIntrinsicSizeIfNeeded(const LayoutSize&, bool imageSizeChanged); |
| 107 virtual float intrinsicSizeFactor() const { return m_intrinsicSizeFactor; } | |
| 104 // Update the size of the image to be rendered. Object-fit may cause this to be different from the CSS box's content rect. | 108 // Update the size of the image to be rendered. Object-fit may cause this to be different from the CSS box's content rect. |
| 105 void updateInnerContentRect(); | 109 void updateInnerContentRect(); |
| 106 | 110 |
| 107 void paintAreaElementFocusRing(PaintInfo&); | 111 void paintAreaElementFocusRing(PaintInfo&); |
| 108 | 112 |
| 109 // Text to display as long as the image isn't available. | 113 // Text to display as long as the image isn't available. |
| 110 String m_altText; | 114 String m_altText; |
| 111 OwnPtr<RenderImageResource> m_imageResource; | 115 OwnPtr<RenderImageResource> m_imageResource; |
| 112 bool m_needsToSetSizeForAltText; | 116 bool m_needsToSetSizeForAltText; |
| 113 bool m_didIncrementVisuallyNonEmptyPixelCount; | 117 bool m_didIncrementVisuallyNonEmptyPixelCount; |
| 114 bool m_isGeneratedContent; | 118 bool m_isGeneratedContent; |
| 119 float m_intrinsicSizeFactor; | |
| 115 | 120 |
| 116 friend class RenderImageScaleObserver; | 121 friend class RenderImageScaleObserver; |
| 117 }; | 122 }; |
| 118 | 123 |
| 119 inline RenderImage* toRenderImage(RenderObject* object) | 124 inline RenderImage* toRenderImage(RenderObject* object) |
| 120 { | 125 { |
| 121 ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isRenderImage()); | 126 ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isRenderImage()); |
| 122 return static_cast<RenderImage*>(object); | 127 return static_cast<RenderImage*>(object); |
| 123 } | 128 } |
| 124 | 129 |
| 125 inline const RenderImage* toRenderImage(const RenderObject* object) | 130 inline const RenderImage* toRenderImage(const RenderObject* object) |
| 126 { | 131 { |
| 127 ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isRenderImage()); | 132 ASSERT_WITH_SECURITY_IMPLICATION(!object || object->isRenderImage()); |
| 128 return static_cast<const RenderImage*>(object); | 133 return static_cast<const RenderImage*>(object); |
| 129 } | 134 } |
| 130 | 135 |
| 131 // This will catch anyone doing an unnecessary cast. | 136 // This will catch anyone doing an unnecessary cast. |
| 132 void toRenderImage(const RenderImage*); | 137 void toRenderImage(const RenderImage*); |
| 133 | 138 |
| 134 } // namespace WebCore | 139 } // namespace WebCore |
| 135 | 140 |
| 136 #endif // RenderImage_h | 141 #endif // RenderImage_h |
| OLD | NEW |