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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 | 80 |
81 protected: | 81 protected: |
82 bool needsPreferredWidthsRecalculation() const final; | 82 bool needsPreferredWidthsRecalculation() const final; |
83 LayoutBox* embeddedContentBox() const final; | 83 LayoutBox* embeddedContentBox() const final; |
84 void computeIntrinsicRatioInformation(FloatSize& intrinsicSize, double& intr
insicRatio) const final; | 84 void computeIntrinsicRatioInformation(FloatSize& intrinsicSize, double& intr
insicRatio) const final; |
85 | 85 |
86 void imageChanged(WrappedImagePtr, const IntRect* = nullptr) override; | 86 void imageChanged(WrappedImagePtr, const IntRect* = nullptr) override; |
87 | 87 |
88 void paint(const PaintInfo&, const LayoutPoint&) const final; | 88 void paint(const PaintInfo&, const LayoutPoint&) const final; |
89 | 89 |
90 void layout() override; | |
91 | |
92 bool isOfType(LayoutObjectType type) const override { return type == LayoutO
bjectLayoutImage || LayoutReplaced::isOfType(type); } | 90 bool isOfType(LayoutObjectType type) const override { return type == LayoutO
bjectLayoutImage || LayoutReplaced::isOfType(type); } |
93 | 91 |
94 void willBeDestroyed() override; | 92 void willBeDestroyed() override; |
95 | 93 |
96 void styleDidChange(StyleDifference, const ComputedStyle* oldStyle) override
; | 94 void styleDidChange(StyleDifference, const ComputedStyle* oldStyle) override
; |
97 | 95 |
98 private: | 96 private: |
99 bool isImage() const override { return true; } | 97 bool isImage() const override { return true; } |
100 | 98 |
101 void paintReplaced(const PaintInfo&, const LayoutPoint&) const override; | 99 void paintReplaced(const PaintInfo&, const LayoutPoint&) const override; |
102 | 100 |
103 bool foregroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect, unsigned
maxDepthToTest) const final; | 101 bool foregroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect, unsigned
maxDepthToTest) const final; |
104 bool computeBackgroundIsKnownToBeObscured() const final; | 102 bool computeBackgroundIsKnownToBeObscured() const final; |
105 | 103 |
106 bool backgroundShouldAlwaysBeClipped() const override { return true; } | 104 bool backgroundShouldAlwaysBeClipped() const override { return true; } |
107 | 105 |
108 LayoutUnit minimumReplacedHeight() const override; | 106 LayoutUnit minimumReplacedHeight() const override; |
109 | 107 |
110 void notifyFinished(Resource*) final; | 108 void notifyFinished(Resource*) final; |
111 bool nodeAtPoint(HitTestResult&, const HitTestLocation& locationInContainer,
const LayoutPoint& accumulatedOffset, HitTestAction) final; | 109 bool nodeAtPoint(HitTestResult&, const HitTestLocation& locationInContainer,
const LayoutPoint& accumulatedOffset, HitTestAction) final; |
112 | 110 |
113 bool boxShadowShouldBeAppliedToBackground(BackgroundBleedAvoidance, const In
lineFlowBox*) const final; | 111 bool boxShadowShouldBeAppliedToBackground(BackgroundBleedAvoidance, const In
lineFlowBox*) const final; |
114 | 112 |
115 void invalidatePaintAndMarkForLayoutIfNeeded(); | 113 void invalidatePaintAndMarkForLayoutIfNeeded(); |
116 void updateIntrinsicSizeIfNeeded(const LayoutSize&); | 114 void updateIntrinsicSizeIfNeeded(const LayoutSize&); |
117 // Update the size of the image to be rendered. Object-fit may cause this to
be different from the CSS box's content rect. | |
118 void updateInnerContentRect(); | |
119 | 115 |
120 // This member wraps the associated decoded image. | 116 // This member wraps the associated decoded image. |
121 // | 117 // |
122 // This field is set using setImageResource above which can be called in | 118 // This field is set using setImageResource above which can be called in |
123 // several ways: | 119 // several ways: |
124 // * For normal images, from the network stack (ImageLoader) once we have | 120 // * For normal images, from the network stack (ImageLoader) once we have |
125 // some image data. | 121 // some image data. |
126 // * For generated content, the resource is loaded during style resolution | 122 // * For generated content, the resource is loaded during style resolution |
127 // and thus is stored in ComputedStyle (see ContentData::image) that gets | 123 // and thus is stored in ComputedStyle (see ContentData::image) that gets |
128 // propagated to the anonymous LayoutImage in LayoutObject::createObject. | 124 // propagated to the anonymous LayoutImage in LayoutObject::createObject. |
129 OwnPtrWillBePersistent<LayoutImageResource> m_imageResource; | 125 OwnPtrWillBePersistent<LayoutImageResource> m_imageResource; |
130 bool m_didIncrementVisuallyNonEmptyPixelCount; | 126 bool m_didIncrementVisuallyNonEmptyPixelCount; |
131 | 127 |
132 // This field stores whether this image is generated with 'content'. | 128 // This field stores whether this image is generated with 'content'. |
133 bool m_isGeneratedContent; | 129 bool m_isGeneratedContent; |
134 float m_imageDevicePixelRatio; | 130 float m_imageDevicePixelRatio; |
135 }; | 131 }; |
136 | 132 |
137 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutImage, isLayoutImage()); | 133 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutImage, isLayoutImage()); |
138 | 134 |
139 } // namespace blink | 135 } // namespace blink |
140 | 136 |
141 #endif // LayoutImage_h | 137 #endif // LayoutImage_h |
OLD | NEW |