OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008, 2009 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008, 2009 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 | 82 |
83 DEFINE_TRACE(LayoutScrollbar) | 83 DEFINE_TRACE(LayoutScrollbar) |
84 { | 84 { |
85 #if ENABLE(OILPAN) | 85 #if ENABLE(OILPAN) |
86 visitor->trace(m_owner); | 86 visitor->trace(m_owner); |
87 visitor->trace(m_owningFrame); | 87 visitor->trace(m_owningFrame); |
88 #endif | 88 #endif |
89 Scrollbar::trace(visitor); | 89 Scrollbar::trace(visitor); |
90 } | 90 } |
91 | 91 |
92 RenderBox* LayoutScrollbar::owningRenderer() const | 92 LayoutBox* LayoutScrollbar::owningRenderer() const |
93 { | 93 { |
94 if (m_owningFrame) { | 94 if (m_owningFrame) { |
95 RenderBox* currentRenderer = m_owningFrame->ownerRenderer(); | 95 LayoutBox* currentRenderer = m_owningFrame->ownerRenderer(); |
96 return currentRenderer; | 96 return currentRenderer; |
97 } | 97 } |
98 return m_owner && m_owner->renderer() ? m_owner->renderer()->enclosingBox()
: 0; | 98 return m_owner && m_owner->renderer() ? m_owner->renderer()->enclosingBox()
: 0; |
99 } | 99 } |
100 | 100 |
101 void LayoutScrollbar::setParent(Widget* parent) | 101 void LayoutScrollbar::setParent(Widget* parent) |
102 { | 102 { |
103 Scrollbar::setParent(parent); | 103 Scrollbar::setParent(parent); |
104 if (!parent) { | 104 if (!parent) { |
105 // Destroy all of the scrollbar's RenderBoxes. | 105 // Destroy all of the scrollbar's LayoutBoxes. |
106 updateScrollbarParts(true); | 106 updateScrollbarParts(true); |
107 } | 107 } |
108 } | 108 } |
109 | 109 |
110 void LayoutScrollbar::setEnabled(bool e) | 110 void LayoutScrollbar::setEnabled(bool e) |
111 { | 111 { |
112 bool wasEnabled = enabled(); | 112 bool wasEnabled = enabled(); |
113 Scrollbar::setEnabled(e); | 113 Scrollbar::setEnabled(e); |
114 if (wasEnabled != e) | 114 if (wasEnabled != e) |
115 updateScrollbarParts(); | 115 updateScrollbarParts(); |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 int oldThickness = isHorizontal ? height() : width(); | 183 int oldThickness = isHorizontal ? height() : width(); |
184 int newThickness = 0; | 184 int newThickness = 0; |
185 LayoutScrollbarPart* part = m_parts.get(ScrollbarBGPart); | 185 LayoutScrollbarPart* part = m_parts.get(ScrollbarBGPart); |
186 if (part) { | 186 if (part) { |
187 part->layout(); | 187 part->layout(); |
188 newThickness = isHorizontal ? part->size().height() : part->size().width
(); | 188 newThickness = isHorizontal ? part->size().height() : part->size().width
(); |
189 } | 189 } |
190 | 190 |
191 if (newThickness != oldThickness) { | 191 if (newThickness != oldThickness) { |
192 setFrameRect(IntRect(location(), IntSize(isHorizontal ? width() : newThi
ckness, isHorizontal ? newThickness : height()))); | 192 setFrameRect(IntRect(location(), IntSize(isHorizontal ? width() : newThi
ckness, isHorizontal ? newThickness : height()))); |
193 if (RenderBox* box = owningRenderer()) { | 193 if (LayoutBox* box = owningRenderer()) { |
194 if (box->isRenderBlock()) | 194 if (box->isRenderBlock()) |
195 toRenderBlock(box)->notifyScrollbarThicknessChanged(); | 195 toRenderBlock(box)->notifyScrollbarThicknessChanged(); |
196 box->setChildNeedsLayout(); | 196 box->setChildNeedsLayout(); |
197 } | 197 } |
198 } | 198 } |
199 } | 199 } |
200 | 200 |
201 static PseudoId pseudoForScrollbarPart(ScrollbarPart part) | 201 static PseudoId pseudoForScrollbarPart(ScrollbarPart part) |
202 { | 202 { |
203 switch (part) { | 203 switch (part) { |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 int LayoutScrollbar::minimumThumbLength() | 348 int LayoutScrollbar::minimumThumbLength() |
349 { | 349 { |
350 LayoutScrollbarPart* partRenderer = m_parts.get(ThumbPart); | 350 LayoutScrollbarPart* partRenderer = m_parts.get(ThumbPart); |
351 if (!partRenderer) | 351 if (!partRenderer) |
352 return 0; | 352 return 0; |
353 partRenderer->layout(); | 353 partRenderer->layout(); |
354 return orientation() == HorizontalScrollbar ? partRenderer->size().width() :
partRenderer->size().height(); | 354 return orientation() == HorizontalScrollbar ? partRenderer->size().width() :
partRenderer->size().height(); |
355 } | 355 } |
356 | 356 |
357 } | 357 } |
OLD | NEW |