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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 if (m_vBar) { | 192 if (m_vBar) { |
193 bool enabled = numVisibleItems() < numItems(); | 193 bool enabled = numVisibleItems() < numItems(); |
194 m_vBar->setEnabled(enabled); | 194 m_vBar->setEnabled(enabled); |
195 m_vBar->setProportion(numVisibleItems(), numItems()); | 195 m_vBar->setProportion(numVisibleItems(), numItems()); |
196 if (!enabled) { | 196 if (!enabled) { |
197 scrollToOffsetWithoutAnimation(VerticalScrollbar, 0); | 197 scrollToOffsetWithoutAnimation(VerticalScrollbar, 0); |
198 m_indexOffset = 0; | 198 m_indexOffset = 0; |
199 } | 199 } |
200 } | 200 } |
201 | 201 |
202 if (m_scrollToRevealSelectionAfterLayout) | 202 if (m_scrollToRevealSelectionAfterLayout) { |
| 203 ForceHorriblySlowRectMapping slowRectMapping(*this); |
203 scrollToRevealSelection(); | 204 scrollToRevealSelection(); |
| 205 } |
204 } | 206 } |
205 | 207 |
206 void RenderListBox::invalidateTreeAfterLayout(const PaintInvalidationState& pain
tInvalidationState) | 208 void RenderListBox::invalidateTreeAfterLayout(const RenderLayerModelObject& inva
lidationContainer) |
207 { | 209 { |
208 repaintScrollbarIfNeeded(); | 210 repaintScrollbarIfNeeded(); |
209 RenderBox::invalidateTreeAfterLayout(paintInvalidationState); | 211 RenderBox::invalidateTreeAfterLayout(invalidationContainer); |
210 } | 212 } |
211 | 213 |
212 void RenderListBox::scrollToRevealSelection() | 214 void RenderListBox::scrollToRevealSelection() |
213 { | 215 { |
214 HTMLSelectElement* select = selectElement(); | 216 HTMLSelectElement* select = selectElement(); |
215 | 217 |
216 m_scrollToRevealSelectionAfterLayout = false; | 218 m_scrollToRevealSelectionAfterLayout = false; |
217 | 219 |
218 int firstIndex = listIndexToRenderListBoxIndex(select->activeSelectionStartL
istIndex()); | 220 int firstIndex = listIndexToRenderListBoxIndex(select->activeSelectionStartL
istIndex()); |
219 int lastIndex = listIndexToRenderListBoxIndex(select->activeSelectionEndList
Index()); | 221 int lastIndex = listIndexToRenderListBoxIndex(select->activeSelectionEndList
Index()); |
(...skipping 796 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1016 { | 1018 { |
1017 return itemBoundingBoxRectInternal(point, listIndexToRenderListBoxIndex(inde
x)); | 1019 return itemBoundingBoxRectInternal(point, listIndexToRenderListBoxIndex(inde
x)); |
1018 } | 1020 } |
1019 | 1021 |
1020 bool RenderListBox::scrollToRevealElementAtListIndex(int index) | 1022 bool RenderListBox::scrollToRevealElementAtListIndex(int index) |
1021 { | 1023 { |
1022 return scrollToRevealElementAtListIndexInternal(listIndexToRenderListBoxInde
x(index)); | 1024 return scrollToRevealElementAtListIndexInternal(listIndexToRenderListBoxInde
x(index)); |
1023 } | 1025 } |
1024 | 1026 |
1025 } // namespace WebCore | 1027 } // namespace WebCore |
OLD | NEW |