OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. |
3 * 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 3 * 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 | 185 |
186 if (AXObjectCache* cache = document().existingAXObjectCache()) | 186 if (AXObjectCache* cache = document().existingAXObjectCache()) |
187 cache->selectedChildrenChanged(this); | 187 cache->selectedChildrenChanged(this); |
188 } | 188 } |
189 | 189 |
190 void RenderListBox::layout() | 190 void RenderListBox::layout() |
191 { | 191 { |
192 RenderBlockFlow::layout(); | 192 RenderBlockFlow::layout(); |
193 | 193 |
194 if (m_vBar) { | 194 if (m_vBar) { |
| 195 setMayNeedInvalidation(true); |
| 196 |
195 bool enabled = numVisibleItems() < numItems(); | 197 bool enabled = numVisibleItems() < numItems(); |
196 m_vBar->setEnabled(enabled); | 198 m_vBar->setEnabled(enabled); |
197 m_vBar->setProportion(numVisibleItems(), numItems()); | 199 m_vBar->setProportion(numVisibleItems(), numItems()); |
198 if (!enabled) { | 200 if (!enabled) { |
199 scrollToOffsetWithoutAnimation(VerticalScrollbar, 0); | 201 scrollToOffsetWithoutAnimation(VerticalScrollbar, 0); |
200 m_indexOffset = 0; | 202 m_indexOffset = 0; |
201 } | 203 } |
202 } | 204 } |
203 | 205 |
204 if (m_scrollToRevealSelectionAfterLayout) { | 206 if (m_scrollToRevealSelectionAfterLayout) { |
| 207 setMayNeedInvalidation(true); |
| 208 |
205 LayoutStateDisabler layoutStateDisabler(*this); | 209 LayoutStateDisabler layoutStateDisabler(*this); |
206 scrollToRevealSelection(); | 210 scrollToRevealSelection(); |
207 } | 211 } |
208 } | 212 } |
209 | 213 |
210 void RenderListBox::repaintTreeAfterLayout() | 214 void RenderListBox::repaintTreeAfterLayout() |
211 { | 215 { |
212 repaintScrollbarIfNeeded(); | 216 repaintScrollbarIfNeeded(); |
213 RenderBox::repaintTreeAfterLayout(); | 217 RenderBox::repaintTreeAfterLayout(); |
214 } | 218 } |
(...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1022 { | 1026 { |
1023 return itemBoundingBoxRectInternal(point, listIndexToRenderListBoxIndex(inde
x)); | 1027 return itemBoundingBoxRectInternal(point, listIndexToRenderListBoxIndex(inde
x)); |
1024 } | 1028 } |
1025 | 1029 |
1026 bool RenderListBox::scrollToRevealElementAtListIndex(int index) | 1030 bool RenderListBox::scrollToRevealElementAtListIndex(int index) |
1027 { | 1031 { |
1028 return scrollToRevealElementAtListIndexInternal(listIndexToRenderListBoxInde
x(index)); | 1032 return scrollToRevealElementAtListIndexInternal(listIndexToRenderListBoxInde
x(index)); |
1029 } | 1033 } |
1030 | 1034 |
1031 } // namespace WebCore | 1035 } // namespace WebCore |
OLD | NEW |