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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 { | 116 { |
117 Scrollbar::setParent(parent); | 117 Scrollbar::setParent(parent); |
118 if (!parent) { | 118 if (!parent) { |
119 // Destroy all of the scrollbar's RenderBoxes. | 119 // Destroy all of the scrollbar's RenderBoxes. |
120 updateScrollbarParts(true); | 120 updateScrollbarParts(true); |
121 } | 121 } |
122 } | 122 } |
123 | 123 |
124 void RenderScrollbar::setEnabled(bool e) | 124 void RenderScrollbar::setEnabled(bool e) |
125 { | 125 { |
126 bool wasEnabled = enabled(); | |
127 Scrollbar::setEnabled(e); | 126 Scrollbar::setEnabled(e); |
128 if (wasEnabled != e) | 127 updateScrollbarParts(); |
129 updateScrollbarParts(); | |
130 } | 128 } |
131 | 129 |
132 void RenderScrollbar::styleChanged() | 130 void RenderScrollbar::styleChanged() |
133 { | 131 { |
134 updateScrollbarParts(); | 132 updateScrollbarParts(); |
135 } | 133 } |
136 | 134 |
137 void RenderScrollbar::setHoveredPart(ScrollbarPart part) | 135 void RenderScrollbar::setHoveredPart(ScrollbarPart part) |
138 { | 136 { |
139 if (part == m_hoveredPart) | 137 if (part == m_hoveredPart) |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 int RenderScrollbar::minimumThumbLength() | 356 int RenderScrollbar::minimumThumbLength() |
359 { | 357 { |
360 RenderScrollbarPart* partRenderer = m_parts.get(ThumbPart); | 358 RenderScrollbarPart* partRenderer = m_parts.get(ThumbPart); |
361 if (!partRenderer) | 359 if (!partRenderer) |
362 return 0; | 360 return 0; |
363 partRenderer->layout(); | 361 partRenderer->layout(); |
364 return orientation() == HorizontalScrollbar ? partRenderer->width() : partRe
nderer->height(); | 362 return orientation() == HorizontalScrollbar ? partRenderer->width() : partRe
nderer->height(); |
365 } | 363 } |
366 | 364 |
367 } | 365 } |
OLD | NEW |