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 19 matching lines...) Expand all Loading... |
30 | 30 |
31 namespace blink { | 31 namespace blink { |
32 | 32 |
33 class HTMLMediaElement; | 33 class HTMLMediaElement; |
34 | 34 |
35 class RenderMedia : public RenderImage { | 35 class RenderMedia : public RenderImage { |
36 public: | 36 public: |
37 explicit RenderMedia(HTMLMediaElement*); | 37 explicit RenderMedia(HTMLMediaElement*); |
38 virtual ~RenderMedia(); | 38 virtual ~RenderMedia(); |
39 | 39 |
40 RenderObject* firstChild() const { ASSERT(children() == virtualChildren());
return children()->firstChild(); } | 40 LayoutObject* firstChild() const { ASSERT(children() == virtualChildren());
return children()->firstChild(); } |
41 RenderObject* 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 RenderMedia, use firstChild or lastChild instead. | 43 // If you have a RenderMedia, 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 RenderObjectChildList* children() const { return &m_children; } | 47 const LayoutObjectChildList* children() const { return &m_children; } |
48 RenderObjectChildList* children() { return &m_children; } | 48 LayoutObjectChildList* children() { return &m_children; } |
49 | 49 |
50 HTMLMediaElement* mediaElement() const; | 50 HTMLMediaElement* mediaElement() const; |
51 | 51 |
52 protected: | 52 protected: |
53 virtual void layout() override; | 53 virtual void layout() override; |
54 | 54 |
55 virtual bool isOfType(RenderObjectType type) const override { return type ==
RenderObjectMedia || RenderImage::isOfType(type); } | 55 virtual bool isOfType(LayoutObjectType type) const override { return type ==
LayoutObjectMedia || RenderImage::isOfType(type); } |
56 | 56 |
57 private: | 57 private: |
58 virtual RenderObjectChildList* virtualChildren() override final { return chi
ldren(); } | 58 virtual LayoutObjectChildList* virtualChildren() override final { return chi
ldren(); } |
59 virtual const RenderObjectChildList* virtualChildren() const override final
{ return children(); } | 59 virtual const LayoutObjectChildList* virtualChildren() const override final
{ return children(); } |
60 | 60 |
61 virtual LayerType layerTypeRequired() const override { return NormalLayer; } | 61 virtual LayerType layerTypeRequired() const override { return NormalLayer; } |
62 | 62 |
63 // FIXME: RenderMedia::layout makes assumptions about what children are allo
wed | 63 // FIXME: RenderMedia::layout makes assumptions about what children are allo
wed |
64 // so we can't support generated content. | 64 // so we can't support generated content. |
65 virtual bool canHaveGeneratedChildren() const override final { return false;
} | 65 virtual bool canHaveGeneratedChildren() const override final { return false;
} |
66 virtual bool canHaveChildren() const override final { return true; } | 66 virtual bool canHaveChildren() const override final { return true; } |
67 virtual bool isChildAllowed(RenderObject*, const RenderStyle&) const overrid
e final; | 67 virtual bool isChildAllowed(LayoutObject*, const RenderStyle&) const overrid
e final; |
68 | 68 |
69 virtual const char* renderName() const override { return "RenderMedia"; } | 69 virtual const char* renderName() const override { return "RenderMedia"; } |
70 virtual bool isImage() const override final { return false; } | 70 virtual bool isImage() const override final { return false; } |
71 virtual void paintReplaced(const PaintInfo&, const LayoutPoint&) override; | 71 virtual void paintReplaced(const PaintInfo&, const LayoutPoint&) override; |
72 | 72 |
73 virtual bool backgroundShouldAlwaysBeClipped() const override final { return
false; } | 73 virtual bool backgroundShouldAlwaysBeClipped() const override final { return
false; } |
74 | 74 |
75 RenderObjectChildList m_children; | 75 LayoutObjectChildList m_children; |
76 }; | 76 }; |
77 | 77 |
78 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderMedia, isMedia()); | 78 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(RenderMedia, isMedia()); |
79 | 79 |
80 } // namespace blink | 80 } // namespace blink |
81 | 81 |
82 #endif // RenderMedia_h | 82 #endif // RenderMedia_h |
OLD | NEW |