OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 17 matching lines...) Expand all Loading... |
28 | 28 |
29 #include "core/layout/LayoutImage.h" | 29 #include "core/layout/LayoutImage.h" |
30 | 30 |
31 namespace blink { | 31 namespace blink { |
32 | 32 |
33 class HTMLMediaElement; | 33 class HTMLMediaElement; |
34 | 34 |
35 class LayoutMedia : public LayoutImage { | 35 class LayoutMedia : public LayoutImage { |
36 public: | 36 public: |
37 explicit LayoutMedia(HTMLMediaElement*); | 37 explicit LayoutMedia(HTMLMediaElement*); |
38 virtual ~LayoutMedia(); | 38 ~LayoutMedia() override; |
39 | 39 |
40 LayoutObject* firstChild() const { ASSERT(children() == virtualChildren());
return children()->firstChild(); } | 40 LayoutObject* firstChild() const { ASSERT(children() == virtualChildren());
return children()->firstChild(); } |
41 LayoutObject* lastChild() const { ASSERT(children() == virtualChildren()); r
eturn children()->lastChild(); } | 41 LayoutObject* lastChild() const { ASSERT(children() == virtualChildren()); r
eturn children()->lastChild(); } |
42 | 42 |
43 // If you have a LayoutMedia, use firstChild or lastChild instead. | 43 // If you have a LayoutMedia, use firstChild or lastChild instead. |
44 void slowFirstChild() const = delete; | 44 void slowFirstChild() const = delete; |
45 void slowLastChild() const = delete; | 45 void slowLastChild() const = delete; |
46 | 46 |
47 const LayoutObjectChildList* children() const { return &m_children; } | 47 const LayoutObjectChildList* children() const { return &m_children; } |
48 LayoutObjectChildList* children() { return &m_children; } | 48 LayoutObjectChildList* children() { return &m_children; } |
49 | 49 |
50 HTMLMediaElement* mediaElement() const; | 50 HTMLMediaElement* mediaElement() const; |
51 | 51 |
52 virtual const char* name() const override { return "LayoutMedia"; } | 52 const char* name() const override { return "LayoutMedia"; } |
53 | 53 |
54 protected: | 54 protected: |
55 virtual void layout() override; | 55 void layout() override; |
56 | 56 |
57 virtual bool isOfType(LayoutObjectType type) const override { return type ==
LayoutObjectMedia || LayoutImage::isOfType(type); } | 57 bool isOfType(LayoutObjectType type) const override { return type == LayoutO
bjectMedia || LayoutImage::isOfType(type); } |
58 | 58 |
59 private: | 59 private: |
60 virtual LayoutObjectChildList* virtualChildren() override final { return chi
ldren(); } | 60 LayoutObjectChildList* virtualChildren() final { return children(); } |
61 virtual const LayoutObjectChildList* virtualChildren() const override final
{ return children(); } | 61 const LayoutObjectChildList* virtualChildren() const final { return children
(); } |
62 | 62 |
63 virtual DeprecatedPaintLayerType layerTypeRequired() const override { return
NormalDeprecatedPaintLayer; } | 63 DeprecatedPaintLayerType layerTypeRequired() const override { return NormalD
eprecatedPaintLayer; } |
64 | 64 |
65 virtual bool canHaveChildren() const override final { return true; } | 65 bool canHaveChildren() const final { return true; } |
66 virtual bool isChildAllowed(LayoutObject*, const ComputedStyle&) const overr
ide final; | 66 bool isChildAllowed(LayoutObject*, const ComputedStyle&) const final; |
67 | 67 |
68 virtual bool isImage() const override final { return false; } | 68 bool isImage() const final { return false; } |
69 virtual void paintReplaced(const PaintInfo&, const LayoutPoint&) override; | 69 void paintReplaced(const PaintInfo&, const LayoutPoint&) override; |
70 | 70 |
71 virtual bool backgroundShouldAlwaysBeClipped() const override final { return
false; } | 71 bool backgroundShouldAlwaysBeClipped() const final { return false; } |
72 | 72 |
73 LayoutObjectChildList m_children; | 73 LayoutObjectChildList m_children; |
74 }; | 74 }; |
75 | 75 |
76 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutMedia, isMedia()); | 76 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutMedia, isMedia()); |
77 | 77 |
78 } // namespace blink | 78 } // namespace blink |
79 | 79 |
80 #endif // LayoutMedia_h | 80 #endif // LayoutMedia_h |
OLD | NEW |