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 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009 Apple Inc. All rights reserv
ed. | 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2009 Apple Inc. All rights reserv
ed. |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 15 matching lines...) Expand all Loading... |
26 #include "core/rendering/RenderBox.h" | 26 #include "core/rendering/RenderBox.h" |
27 | 27 |
28 namespace blink { | 28 namespace blink { |
29 | 29 |
30 class RenderListItem; | 30 class RenderListItem; |
31 | 31 |
32 String listMarkerText(EListStyleType, int value); | 32 String listMarkerText(EListStyleType, int value); |
33 | 33 |
34 // Used to render the list item's marker. | 34 // Used to render the list item's marker. |
35 // The RenderListMarker always has to be a child of a RenderListItem. | 35 // The RenderListMarker always has to be a child of a RenderListItem. |
36 class RenderListMarker FINAL : public RenderBox { | 36 class RenderListMarker final : public RenderBox { |
37 public: | 37 public: |
38 static RenderListMarker* createAnonymous(RenderListItem*); | 38 static RenderListMarker* createAnonymous(RenderListItem*); |
39 | 39 |
40 virtual ~RenderListMarker(); | 40 virtual ~RenderListMarker(); |
41 virtual void destroy() OVERRIDE; | 41 virtual void destroy() override; |
42 virtual void trace(Visitor*) OVERRIDE; | 42 virtual void trace(Visitor*) override; |
43 | 43 |
44 const String& text() const { return m_text; } | 44 const String& text() const { return m_text; } |
45 | 45 |
46 bool isInside() const; | 46 bool isInside() const; |
47 | 47 |
48 void updateMarginsAndContent(); | 48 void updateMarginsAndContent(); |
49 | 49 |
50 IntRect getRelativeMarkerRect(); | 50 IntRect getRelativeMarkerRect(); |
51 LayoutRect localSelectionRect(); | 51 LayoutRect localSelectionRect(); |
52 virtual bool isImage() const OVERRIDE; | 52 virtual bool isImage() const override; |
53 const StyleImage* image() { return m_image.get(); } | 53 const StyleImage* image() { return m_image.get(); } |
54 const RenderListItem* listItem() { return m_listItem.get(); } | 54 const RenderListItem* listItem() { return m_listItem.get(); } |
55 | 55 |
56 static UChar listMarkerSuffix(EListStyleType, int value); | 56 static UChar listMarkerSuffix(EListStyleType, int value); |
57 | 57 |
58 private: | 58 private: |
59 RenderListMarker(RenderListItem*); | 59 RenderListMarker(RenderListItem*); |
60 | 60 |
61 virtual const char* renderName() const OVERRIDE { return "RenderListMarker";
} | 61 virtual const char* renderName() const override { return "RenderListMarker";
} |
62 virtual void computePreferredLogicalWidths() OVERRIDE; | 62 virtual void computePreferredLogicalWidths() override; |
63 | 63 |
64 virtual bool isListMarker() const OVERRIDE { return true; } | 64 virtual bool isListMarker() const override { return true; } |
65 | 65 |
66 virtual void paint(PaintInfo&, const LayoutPoint&) OVERRIDE; | 66 virtual void paint(PaintInfo&, const LayoutPoint&) override; |
67 | 67 |
68 virtual void layout() OVERRIDE; | 68 virtual void layout() override; |
69 | 69 |
70 virtual void imageChanged(WrappedImagePtr, const IntRect* = 0) OVERRIDE; | 70 virtual void imageChanged(WrappedImagePtr, const IntRect* = 0) override; |
71 | 71 |
72 virtual InlineBox* createInlineBox() OVERRIDE; | 72 virtual InlineBox* createInlineBox() override; |
73 | 73 |
74 virtual LayoutUnit lineHeight(bool firstLine, LineDirectionMode, LinePositio
nMode = PositionOnContainingLine) const OVERRIDE; | 74 virtual LayoutUnit lineHeight(bool firstLine, LineDirectionMode, LinePositio
nMode = PositionOnContainingLine) const override; |
75 virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode
, LinePositionMode = PositionOnContainingLine) const OVERRIDE; | 75 virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode
, LinePositionMode = PositionOnContainingLine) const override; |
76 | 76 |
77 bool isText() const { return !isImage(); } | 77 bool isText() const { return !isImage(); } |
78 | 78 |
79 virtual void setSelectionState(SelectionState) OVERRIDE; | 79 virtual void setSelectionState(SelectionState) override; |
80 virtual LayoutRect selectionRectForPaintInvalidation(const RenderLayerModelO
bject* paintInvalidationContainer) const OVERRIDE; | 80 virtual LayoutRect selectionRectForPaintInvalidation(const RenderLayerModelO
bject* paintInvalidationContainer) const override; |
81 virtual bool canBeSelectionLeaf() const OVERRIDE { return true; } | 81 virtual bool canBeSelectionLeaf() const override { return true; } |
82 | 82 |
83 void updateMargins(); | 83 void updateMargins(); |
84 void updateContent(); | 84 void updateContent(); |
85 | 85 |
86 virtual void styleWillChange(StyleDifference, const RenderStyle& newStyle) O
VERRIDE; | 86 virtual void styleWillChange(StyleDifference, const RenderStyle& newStyle) o
verride; |
87 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) OV
ERRIDE; | 87 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) ov
erride; |
88 | 88 |
89 String m_text; | 89 String m_text; |
90 RefPtr<StyleImage> m_image; | 90 RefPtr<StyleImage> m_image; |
91 RawPtrWillBeMember<RenderListItem> m_listItem; | 91 RawPtrWillBeMember<RenderListItem> m_listItem; |
92 }; | 92 }; |
93 | 93 |
94 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderListMarker, isListMarker()); | 94 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderListMarker, isListMarker()); |
95 | 95 |
96 } // namespace blink | 96 } // namespace blink |
97 | 97 |
98 #endif // RenderListMarker_h | 98 #endif // RenderListMarker_h |
OLD | NEW |