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