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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 | 71 |
72 protected: | 72 protected: |
73 bool needsPreferredWidthsRecalculation() const final; | 73 bool needsPreferredWidthsRecalculation() const final; |
74 LayoutBox* embeddedContentBox() const final; | 74 LayoutBox* embeddedContentBox() const final; |
75 void computeIntrinsicRatioInformation(FloatSize& intrinsicSize, double& intr
insicRatio) const final; | 75 void computeIntrinsicRatioInformation(FloatSize& intrinsicSize, double& intr
insicRatio) const final; |
76 | 76 |
77 void imageChanged(WrappedImagePtr, const IntRect* = nullptr) override; | 77 void imageChanged(WrappedImagePtr, const IntRect* = nullptr) override; |
78 | 78 |
79 void paint(const PaintInfo&, const LayoutPoint&) final; | 79 void paint(const PaintInfo&, const LayoutPoint&) final; |
80 | 80 |
81 void layout() override; | |
82 bool updateImageLoadingPriorities() final; | 81 bool updateImageLoadingPriorities() final; |
83 | 82 |
84 bool isOfType(LayoutObjectType type) const override { return type == LayoutO
bjectLayoutImage || LayoutReplaced::isOfType(type); } | 83 bool isOfType(LayoutObjectType type) const override { return type == LayoutO
bjectLayoutImage || LayoutReplaced::isOfType(type); } |
85 | 84 |
86 void willBeDestroyed() override; | 85 void willBeDestroyed() override; |
87 | 86 |
88 void styleDidChange(StyleDifference, const ComputedStyle* oldStyle) override
; | 87 void styleDidChange(StyleDifference, const ComputedStyle* oldStyle) override
; |
89 | 88 |
90 private: | 89 private: |
91 bool isImage() const override { return true; } | 90 bool isImage() const override { return true; } |
92 | 91 |
93 void paintReplaced(const PaintInfo&, const LayoutPoint&) override; | 92 void paintReplaced(const PaintInfo&, const LayoutPoint&) override; |
94 | 93 |
95 bool foregroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect, unsigned
maxDepthToTest) const final; | 94 bool foregroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect, unsigned
maxDepthToTest) const final; |
96 bool computeBackgroundIsKnownToBeObscured() final; | 95 bool computeBackgroundIsKnownToBeObscured() final; |
97 | 96 |
98 bool backgroundShouldAlwaysBeClipped() const override { return true; } | 97 bool backgroundShouldAlwaysBeClipped() const override { return true; } |
99 | 98 |
100 LayoutUnit minimumReplacedHeight() const override; | 99 LayoutUnit minimumReplacedHeight() const override; |
101 | 100 |
102 void notifyFinished(Resource*) final; | 101 void notifyFinished(Resource*) final; |
103 bool nodeAtPoint(HitTestResult&, const HitTestLocation& locationInContainer,
const LayoutPoint& accumulatedOffset, HitTestAction) final; | 102 bool nodeAtPoint(HitTestResult&, const HitTestLocation& locationInContainer,
const LayoutPoint& accumulatedOffset, HitTestAction) final; |
104 | 103 |
105 bool boxShadowShouldBeAppliedToBackground(BackgroundBleedAvoidance, InlineFl
owBox*) const final; | 104 bool boxShadowShouldBeAppliedToBackground(BackgroundBleedAvoidance, InlineFl
owBox*) const final; |
106 | 105 |
107 void invalidatePaintAndMarkForLayoutIfNeeded(); | 106 void invalidatePaintAndMarkForLayoutIfNeeded(); |
108 void updateIntrinsicSizeIfNeeded(const LayoutSize&); | 107 void updateIntrinsicSizeIfNeeded(const LayoutSize&); |
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. | |
110 void updateInnerContentRect(); | |
111 | 108 |
112 // Text to display as long as the image isn't available. | 109 // Text to display as long as the image isn't available. |
113 OwnPtrWillBePersistent<LayoutImageResource> m_imageResource; | 110 OwnPtrWillBePersistent<LayoutImageResource> m_imageResource; |
114 bool m_didIncrementVisuallyNonEmptyPixelCount; | 111 bool m_didIncrementVisuallyNonEmptyPixelCount; |
115 bool m_isGeneratedContent; | 112 bool m_isGeneratedContent; |
116 float m_imageDevicePixelRatio; | 113 float m_imageDevicePixelRatio; |
117 }; | 114 }; |
118 | 115 |
119 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutImage, isLayoutImage()); | 116 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutImage, isLayoutImage()); |
120 | 117 |
121 } // namespace blink | 118 } // namespace blink |
122 | 119 |
123 #endif // LayoutImage_h | 120 #endif // LayoutImage_h |
OLD | NEW |