OLD | NEW |
1 /* | 1 /* |
2 * This file is part of the select element renderer in WebCore. | 2 * This file is part of the select element renderer in WebCore. |
3 * | 3 * |
4 * Copyright (C) 2006, 2007, 2009 Apple Inc. All rights reserved. | 4 * Copyright (C) 2006, 2007, 2009 Apple Inc. All rights reserved. |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * | 9 * |
10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 bool scrollToRevealElementAtListIndex(int index); | 53 bool scrollToRevealElementAtListIndex(int index); |
54 bool listIndexIsVisible(int index); | 54 bool listIndexIsVisible(int index); |
55 | 55 |
56 int scrollToward(const IntPoint&); // Returns the new index or -1 if no scro
ll occurred | 56 int scrollToward(const IntPoint&); // Returns the new index or -1 if no scro
ll occurred |
57 | 57 |
58 int size() const; | 58 int size() const; |
59 | 59 |
60 private: | 60 private: |
61 HTMLSelectElement* selectElement() const; | 61 HTMLSelectElement* selectElement() const; |
62 | 62 |
63 virtual const char* renderName() const { return "RenderListBox"; } | 63 virtual const char* renderName() const OVERRIDE { return "RenderListBox"; } |
64 | 64 |
65 virtual bool isListBox() const { return true; } | 65 virtual bool isListBox() const OVERRIDE { return true; } |
66 virtual bool isChildAllowed(RenderObject*, RenderStyle*) const OVERRIDE; | 66 virtual bool isChildAllowed(RenderObject*, RenderStyle*) const OVERRIDE; |
67 | 67 |
68 virtual void updateFromElement(); | 68 virtual void updateFromElement() OVERRIDE; |
69 virtual bool hasControlClip() const { return true; } | 69 virtual bool hasControlClip() const OVERRIDE { return true; } |
70 virtual void paintObject(PaintInfo&, const LayoutPoint&); | 70 virtual void paintObject(PaintInfo&, const LayoutPoint&) OVERRIDE; |
71 virtual LayoutRect controlClipRect(const LayoutPoint&) const; | 71 virtual LayoutRect controlClipRect(const LayoutPoint&) const OVERRIDE; |
72 | 72 |
73 virtual bool isPointInOverflowControl(HitTestResult&, const LayoutPoint& loc
ationInContainer, const LayoutPoint& accumulatedOffset); | 73 virtual bool isPointInOverflowControl(HitTestResult&, const LayoutPoint& loc
ationInContainer, const LayoutPoint& accumulatedOffset) OVERRIDE; |
74 | 74 |
75 virtual bool scroll(ScrollDirection, ScrollGranularity, float) OVERRIDE; | 75 virtual bool scroll(ScrollDirection, ScrollGranularity, float) OVERRIDE; |
76 | 76 |
77 virtual void computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, Layo
utUnit& maxLogicalWidth) const OVERRIDE; | 77 virtual void computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, Layo
utUnit& maxLogicalWidth) const OVERRIDE; |
78 virtual void computePreferredLogicalWidths() OVERRIDE; | 78 virtual void computePreferredLogicalWidths() OVERRIDE; |
79 virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode
, LinePositionMode = PositionOnContainingLine) const; | 79 virtual int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode
, LinePositionMode = PositionOnContainingLine) const OVERRIDE; |
80 virtual void computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logic
alTop, LogicalExtentComputedValues&) const OVERRIDE; | 80 virtual void computeLogicalHeight(LayoutUnit logicalHeight, LayoutUnit logic
alTop, LogicalExtentComputedValues&) const OVERRIDE; |
81 | 81 |
82 virtual void layout(); | 82 virtual void layout() OVERRIDE; |
83 | 83 |
84 virtual bool supportsPartialLayout() const OVERRIDE { return false; } | 84 virtual bool supportsPartialLayout() const OVERRIDE { return false; } |
85 | 85 |
86 virtual void addFocusRingRects(Vector<IntRect>&, const LayoutPoint& addition
alOffset, const RenderLayerModelObject* paintContainer = 0) OVERRIDE; | 86 virtual void addFocusRingRects(Vector<IntRect>&, const LayoutPoint& addition
alOffset, const RenderLayerModelObject* paintContainer = 0) OVERRIDE; |
87 | 87 |
88 virtual bool canBeProgramaticallyScrolled() const { return true; } | 88 virtual bool canBeProgramaticallyScrolled() const OVERRIDE { return true; } |
89 virtual void autoscroll(const IntPoint&); | 89 virtual void autoscroll(const IntPoint&) OVERRIDE; |
90 virtual void stopAutoscroll(); | 90 virtual void stopAutoscroll() OVERRIDE; |
91 | 91 |
92 virtual bool shouldPanScroll() const { return true; } | 92 virtual void panScroll(const IntPoint&) OVERRIDE; |
93 virtual void panScroll(const IntPoint&); | |
94 | 93 |
95 virtual int verticalScrollbarWidth() const; | 94 virtual int verticalScrollbarWidth() const OVERRIDE; |
96 virtual int scrollLeft() const; | 95 virtual int scrollLeft() const OVERRIDE; |
97 virtual int scrollTop() const; | 96 virtual int scrollTop() const OVERRIDE; |
98 virtual int scrollWidth() const; | 97 virtual int scrollWidth() const OVERRIDE; |
99 virtual int scrollHeight() const; | 98 virtual int scrollHeight() const OVERRIDE; |
100 virtual void setScrollLeft(int); | 99 virtual void setScrollLeft(int) OVERRIDE; |
101 virtual void setScrollTop(int); | 100 virtual void setScrollTop(int) OVERRIDE; |
102 | 101 |
103 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes
tLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAct
ion) OVERRIDE; | 102 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes
tLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAct
ion) OVERRIDE; |
104 | 103 |
105 // ScrollableArea interface. | 104 // ScrollableArea interface. |
106 virtual int scrollSize(ScrollbarOrientation) const OVERRIDE; | 105 virtual int scrollSize(ScrollbarOrientation) const OVERRIDE; |
107 virtual IntPoint scrollPosition() const OVERRIDE; | 106 virtual IntPoint scrollPosition() const OVERRIDE; |
108 virtual void setScrollOffset(const IntPoint&) OVERRIDE; | 107 virtual void setScrollOffset(const IntPoint&) OVERRIDE; |
109 virtual void invalidateScrollbarRect(Scrollbar*, const IntRect&) OVERRIDE; | 108 virtual void invalidateScrollbarRect(Scrollbar*, const IntRect&) OVERRIDE; |
110 virtual bool isActive() const OVERRIDE; | 109 virtual bool isActive() const OVERRIDE; |
111 virtual bool isScrollCornerVisible() const OVERRIDE { return false; } // We
don't support resize on list boxes yet. If we did these would have to change. | 110 virtual bool isScrollCornerVisible() const OVERRIDE { return false; } // We
don't support resize on list boxes yet. If we did these would have to change. |
112 virtual IntRect scrollCornerRect() const OVERRIDE { return IntRect(); } | 111 virtual IntRect scrollCornerRect() const OVERRIDE { return IntRect(); } |
113 virtual void invalidateScrollCornerRect(const IntRect&) OVERRIDE { } | 112 virtual void invalidateScrollCornerRect(const IntRect&) OVERRIDE { } |
114 virtual IntRect convertFromScrollbarToContainingView(const Scrollbar*, const
IntRect&) const OVERRIDE; | 113 virtual IntRect convertFromScrollbarToContainingView(const Scrollbar*, const
IntRect&) const OVERRIDE; |
115 virtual IntRect convertFromContainingViewToScrollbar(const Scrollbar*, const
IntRect&) const OVERRIDE; | 114 virtual IntRect convertFromContainingViewToScrollbar(const Scrollbar*, const
IntRect&) const OVERRIDE; |
116 virtual IntPoint convertFromScrollbarToContainingView(const Scrollbar*, cons
t IntPoint&) const OVERRIDE; | 115 virtual IntPoint convertFromScrollbarToContainingView(const Scrollbar*, cons
t IntPoint&) const OVERRIDE; |
117 virtual IntPoint convertFromContainingViewToScrollbar(const Scrollbar*, cons
t IntPoint&) const OVERRIDE; | 116 virtual IntPoint convertFromContainingViewToScrollbar(const Scrollbar*, cons
t IntPoint&) const OVERRIDE; |
118 virtual Scrollbar* verticalScrollbar() const OVERRIDE { return m_vBar.get();
} | 117 virtual Scrollbar* verticalScrollbar() const OVERRIDE { return m_vBar.get();
} |
119 virtual IntSize contentsSize() const OVERRIDE; | 118 virtual IntSize contentsSize() const OVERRIDE; |
120 virtual int visibleHeight() const OVERRIDE; | 119 virtual int visibleHeight() const OVERRIDE; |
121 virtual int visibleWidth() const OVERRIDE; | 120 virtual int visibleWidth() const OVERRIDE; |
122 virtual IntPoint lastKnownMousePosition() const OVERRIDE; | 121 virtual IntPoint lastKnownMousePosition() const OVERRIDE; |
123 virtual bool shouldSuspendScrollAnimations() const OVERRIDE; | 122 virtual bool shouldSuspendScrollAnimations() const OVERRIDE; |
124 virtual bool scrollbarsCanBeActive() const OVERRIDE; | 123 virtual bool scrollbarsCanBeActive() const OVERRIDE; |
125 virtual IntPoint minimumScrollPosition() const OVERRIDE; | 124 virtual IntPoint minimumScrollPosition() const OVERRIDE; |
126 virtual IntPoint maximumScrollPosition() const OVERRIDE; | 125 virtual IntPoint maximumScrollPosition() const OVERRIDE; |
127 virtual bool userInputScrollable(ScrollbarOrientation) const OVERRIDE; | 126 virtual bool userInputScrollable(ScrollbarOrientation) const OVERRIDE; |
128 virtual bool shouldPlaceVerticalScrollbarOnLeft() const OVERRIDE; | 127 virtual bool shouldPlaceVerticalScrollbarOnLeft() const OVERRIDE; |
129 virtual int lineStep(ScrollbarOrientation) const; | 128 virtual int lineStep(ScrollbarOrientation) const OVERRIDE; |
130 virtual int pageStep(ScrollbarOrientation) const; | 129 virtual int pageStep(ScrollbarOrientation) const OVERRIDE; |
131 virtual float pixelStep(ScrollbarOrientation) const; | 130 virtual float pixelStep(ScrollbarOrientation) const OVERRIDE; |
132 | 131 |
133 | 132 |
134 virtual ScrollableArea* enclosingScrollableArea() const OVERRIDE; | 133 virtual ScrollableArea* enclosingScrollableArea() const OVERRIDE; |
135 virtual IntRect scrollableAreaBoundingBox() const OVERRIDE; | 134 virtual IntRect scrollableAreaBoundingBox() const OVERRIDE; |
136 | 135 |
137 // NOTE: This should only be called by the overriden setScrollOffset from Sc
rollableArea. | 136 // NOTE: This should only be called by the overriden setScrollOffset from Sc
rollableArea. |
138 void scrollTo(int newOffset); | 137 void scrollTo(int newOffset); |
139 | 138 |
140 void setHasVerticalScrollbar(bool hasScrollbar); | 139 void setHasVerticalScrollbar(bool hasScrollbar); |
141 PassRefPtr<Scrollbar> createScrollbar(); | 140 PassRefPtr<Scrollbar> createScrollbar(); |
(...skipping 17 matching lines...) Expand all Loading... |
159 int m_indexOffset; | 158 int m_indexOffset; |
160 | 159 |
161 RefPtr<Scrollbar> m_vBar; | 160 RefPtr<Scrollbar> m_vBar; |
162 }; | 161 }; |
163 | 162 |
164 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderListBox, isListBox()); | 163 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderListBox, isListBox()); |
165 | 164 |
166 } // namepace WebCore | 165 } // namepace WebCore |
167 | 166 |
168 #endif // RenderListBox_h | 167 #endif // RenderListBox_h |
OLD | NEW |