Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutImage.h

Issue 2727853002: [css-display] Support display: contents pseudo-elements.
Patch Set: Add missing nullcheck (whoops). Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010, 2011 Apple Inc.
7 * All rights reserved. 7 * All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 17 matching lines...) Expand all
28 28
29 #include "core/CoreExport.h" 29 #include "core/CoreExport.h"
30 #include "core/layout/LayoutImageResource.h" 30 #include "core/layout/LayoutImageResource.h"
31 #include "core/layout/LayoutReplaced.h" 31 #include "core/layout/LayoutReplaced.h"
32 #include "platform/loader/fetch/ResourceClient.h" 32 #include "platform/loader/fetch/ResourceClient.h"
33 33
34 namespace blink { 34 namespace blink {
35 35
36 class HTMLAreaElement; 36 class HTMLAreaElement;
37 class HTMLMapElement; 37 class HTMLMapElement;
38 class PseudoElement;
38 39
39 // LayoutImage is used to display any image type. 40 // LayoutImage is used to display any image type.
40 // 41 //
41 // There is 2 types of images: 42 // There is 2 types of images:
42 // * normal images, e.g. <image>, <picture>. 43 // * normal images, e.g. <image>, <picture>.
43 // * content images with "content: url(path/to/image.png)". 44 // * content images with "content: url(path/to/image.png)".
44 // We store the type inside m_isGeneratedContent. 45 // We store the type inside m_isGeneratedContent.
45 // 46 //
46 // The class is image type agnostic as it only manipulates decoded images. 47 // The class is image type agnostic as it only manipulates decoded images.
47 // See LayoutImageResource that holds this image. 48 // See LayoutImageResource that holds this image.
48 class CORE_EXPORT LayoutImage : public LayoutReplaced { 49 class CORE_EXPORT LayoutImage : public LayoutReplaced {
49 public: 50 public:
50 // These are the paddings to use when displaying either alt text or an image. 51 // These are the paddings to use when displaying either alt text or an image.
51 static const unsigned short paddingWidth = 4; 52 static const unsigned short paddingWidth = 4;
52 static const unsigned short paddingHeight = 4; 53 static const unsigned short paddingHeight = 4;
53 54
54 LayoutImage(Element*); 55 LayoutImage(Element*);
55 ~LayoutImage() override; 56 ~LayoutImage() override;
56 57
57 static LayoutImage* createAnonymous(Document*); 58 static LayoutImage* createAnonymous(PseudoElement&);
58 59
59 void setImageResource(LayoutImageResource*); 60 void setImageResource(LayoutImageResource*);
60 61
61 LayoutImageResource* imageResource() { return m_imageResource.get(); } 62 LayoutImageResource* imageResource() { return m_imageResource.get(); }
62 const LayoutImageResource* imageResource() const { 63 const LayoutImageResource* imageResource() const {
63 return m_imageResource.get(); 64 return m_imageResource.get();
64 } 65 }
65 ImageResourceContent* cachedImage() const { 66 ImageResourceContent* cachedImage() const {
66 return m_imageResource ? m_imageResource->cachedImage() : 0; 67 return m_imageResource ? m_imageResource->cachedImage() : 0;
67 } 68 }
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 // This field stores whether this image is generated with 'content'. 142 // This field stores whether this image is generated with 'content'.
142 bool m_isGeneratedContent; 143 bool m_isGeneratedContent;
143 float m_imageDevicePixelRatio; 144 float m_imageDevicePixelRatio;
144 }; 145 };
145 146
146 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutImage, isLayoutImage()); 147 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutImage, isLayoutImage());
147 148
148 } // namespace blink 149 } // namespace blink
149 150
150 #endif // LayoutImage_h 151 #endif // LayoutImage_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698