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); | |
204 scrollToRevealSelection(); | 203 scrollToRevealSelection(); |
205 } | |
206 } | 204 } |
207 | 205 |
208 void RenderListBox::invalidateTreeAfterLayout(const RenderLayerModelObject& inva
lidationContainer) | 206 void RenderListBox::invalidateTreeAfterLayout(const InvalidationTreeWalkState& i
nvalidationTreeWalkState) |
209 { | 207 { |
210 repaintScrollbarIfNeeded(); | 208 repaintScrollbarIfNeeded(); |
211 RenderBox::invalidateTreeAfterLayout(invalidationContainer); | 209 RenderBox::invalidateTreeAfterLayout(invalidationTreeWalkState); |
212 } | 210 } |
213 | 211 |
214 void RenderListBox::scrollToRevealSelection() | 212 void RenderListBox::scrollToRevealSelection() |
215 { | 213 { |
216 HTMLSelectElement* select = selectElement(); | 214 HTMLSelectElement* select = selectElement(); |
217 | 215 |
218 m_scrollToRevealSelectionAfterLayout = false; | 216 m_scrollToRevealSelectionAfterLayout = false; |
219 | 217 |
220 int firstIndex = listIndexToRenderListBoxIndex(select->activeSelectionStartL
istIndex()); | 218 int firstIndex = listIndexToRenderListBoxIndex(select->activeSelectionStartL
istIndex()); |
221 int lastIndex = listIndexToRenderListBoxIndex(select->activeSelectionEndList
Index()); | 219 int lastIndex = listIndexToRenderListBoxIndex(select->activeSelectionEndList
Index()); |
(...skipping 796 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1018 { | 1016 { |
1019 return itemBoundingBoxRectInternal(point, listIndexToRenderListBoxIndex(inde
x)); | 1017 return itemBoundingBoxRectInternal(point, listIndexToRenderListBoxIndex(inde
x)); |
1020 } | 1018 } |
1021 | 1019 |
1022 bool RenderListBox::scrollToRevealElementAtListIndex(int index) | 1020 bool RenderListBox::scrollToRevealElementAtListIndex(int index) |
1023 { | 1021 { |
1024 return scrollToRevealElementAtListIndexInternal(listIndexToRenderListBoxInde
x(index)); | 1022 return scrollToRevealElementAtListIndexInternal(listIndexToRenderListBoxInde
x(index)); |
1025 } | 1023 } |
1026 | 1024 |
1027 } // namespace WebCore | 1025 } // namespace WebCore |
OLD | NEW |