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 |
11 * version 2 of the License, or (at your option) any later version. | 11 * version 2 of the License, or (at your option) any later version. |
12 * | 12 * |
13 * This library is distributed in the hope that it will be useful, | 13 * This library is distributed in the hope that it will be useful, |
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
16 * Library General Public License for more details. | 16 * Library General Public License for more details. |
17 * | 17 * |
18 * You should have received a copy of the GNU Library General Public License | 18 * You should have received a copy of the GNU Library General Public License |
19 * along with this library; see the file COPYING.LIB. If not, write to | 19 * along with this library; see the file COPYING.LIB. If not, write to |
20 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 20 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
21 * Boston, MA 02110-1301, USA. | 21 * Boston, MA 02110-1301, USA. |
22 * | 22 * |
23 */ | 23 */ |
24 | 24 |
25 #ifndef LayoutImage_h | 25 #ifndef LayoutImage_h |
26 #define LayoutImage_h | 26 #define LayoutImage_h |
27 | 27 |
28 #include "core/layout/LayoutImageResource.h" | 28 #include "core/layout/LayoutImageResource.h" |
29 #include "core/rendering/RenderReplaced.h" | 29 #include "core/layout/LayoutReplaced.h" |
30 | 30 |
31 namespace blink { | 31 namespace blink { |
32 | 32 |
33 class HTMLAreaElement; | 33 class HTMLAreaElement; |
34 class HTMLMapElement; | 34 class HTMLMapElement; |
35 | 35 |
36 class LayoutImage : public RenderReplaced { | 36 class LayoutImage : public LayoutReplaced { |
37 public: | 37 public: |
38 // These are the paddings to use when displaying either alt text or an image
. | 38 // These are the paddings to use when displaying either alt text or an image
. |
39 static const unsigned short paddingWidth = 4; | 39 static const unsigned short paddingWidth = 4; |
40 static const unsigned short paddingHeight = 4; | 40 static const unsigned short paddingHeight = 4; |
41 | 41 |
42 LayoutImage(Element*); | 42 LayoutImage(Element*); |
43 virtual ~LayoutImage(); | 43 virtual ~LayoutImage(); |
44 virtual void destroy() override; | 44 virtual void destroy() override; |
45 | 45 |
46 static LayoutImage* createAnonymous(Document*); | 46 static LayoutImage* createAnonymous(Document*); |
(...skipping 25 matching lines...) Expand all Loading... |
72 virtual RenderBox* embeddedContentBox() const override final; | 72 virtual RenderBox* embeddedContentBox() const override final; |
73 virtual void computeIntrinsicRatioInformation(FloatSize& intrinsicSize, doub
le& intrinsicRatio) const override final; | 73 virtual void computeIntrinsicRatioInformation(FloatSize& intrinsicSize, doub
le& intrinsicRatio) const override final; |
74 | 74 |
75 virtual void imageChanged(WrappedImagePtr, const IntRect* = 0) override; | 75 virtual void imageChanged(WrappedImagePtr, const IntRect* = 0) override; |
76 | 76 |
77 virtual void paint(const PaintInfo&, const LayoutPoint&) override final; | 77 virtual void paint(const PaintInfo&, const LayoutPoint&) override final; |
78 | 78 |
79 virtual void layout() override; | 79 virtual void layout() override; |
80 virtual bool updateImageLoadingPriorities() override final; | 80 virtual bool updateImageLoadingPriorities() override final; |
81 | 81 |
82 virtual bool isOfType(LayoutObjectType type) const override { return type ==
LayoutObjectLayoutImage || RenderReplaced::isOfType(type); } | 82 virtual bool isOfType(LayoutObjectType type) const override { return type ==
LayoutObjectLayoutImage || LayoutReplaced::isOfType(type); } |
83 | 83 |
84 private: | 84 private: |
85 virtual const char* renderName() const override { return "LayoutImage"; } | 85 virtual const char* renderName() const override { return "LayoutImage"; } |
86 | 86 |
87 virtual bool isImage() const override { return true; } | 87 virtual bool isImage() const override { return true; } |
88 | 88 |
89 virtual void paintReplaced(const PaintInfo&, const LayoutPoint&) override; | 89 virtual void paintReplaced(const PaintInfo&, const LayoutPoint&) override; |
90 | 90 |
91 virtual bool foregroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect,
unsigned maxDepthToTest) const override final; | 91 virtual bool foregroundIsKnownToBeOpaqueInRect(const LayoutRect& localRect,
unsigned maxDepthToTest) const override final; |
92 virtual bool computeBackgroundIsKnownToBeObscured() override final; | 92 virtual bool computeBackgroundIsKnownToBeObscured() override final; |
(...skipping 17 matching lines...) Expand all Loading... |
110 bool m_didIncrementVisuallyNonEmptyPixelCount; | 110 bool m_didIncrementVisuallyNonEmptyPixelCount; |
111 bool m_isGeneratedContent; | 111 bool m_isGeneratedContent; |
112 float m_imageDevicePixelRatio; | 112 float m_imageDevicePixelRatio; |
113 }; | 113 }; |
114 | 114 |
115 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutImage, isLayoutImage()); | 115 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutImage, isLayoutImage()); |
116 | 116 |
117 } // namespace blink | 117 } // namespace blink |
118 | 118 |
119 #endif // LayoutImage_h | 119 #endif // LayoutImage_h |
OLD | NEW |