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 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
624 bool RenderListBox::listIndexIsVisible(int index) | 624 bool RenderListBox::listIndexIsVisible(int index) |
625 { | 625 { |
626 return index >= m_indexOffset && index < m_indexOffset + numVisibleItems(); | 626 return index >= m_indexOffset && index < m_indexOffset + numVisibleItems(); |
627 } | 627 } |
628 | 628 |
629 bool RenderListBox::scroll(ScrollDirection direction, ScrollGranularity granular
ity, float multiplier) | 629 bool RenderListBox::scroll(ScrollDirection direction, ScrollGranularity granular
ity, float multiplier) |
630 { | 630 { |
631 return ScrollableArea::scroll(direction, granularity, multiplier); | 631 return ScrollableArea::scroll(direction, granularity, multiplier); |
632 } | 632 } |
633 | 633 |
634 void RenderListBox::valueChanged(unsigned listIndex) | |
635 { | |
636 HTMLSelectElement* element = selectElement(); | |
637 element->setSelectedIndex(element->listToOptionIndex(listIndex)); | |
638 element->dispatchFormControlChangeEvent(); | |
639 } | |
640 | |
641 int RenderListBox::scrollSize(ScrollbarOrientation orientation) const | 634 int RenderListBox::scrollSize(ScrollbarOrientation orientation) const |
642 { | 635 { |
643 return orientation == VerticalScrollbar ? (numItems() - numVisibleItems()) :
0; | 636 return orientation == VerticalScrollbar ? (numItems() - numVisibleItems()) :
0; |
644 } | 637 } |
645 | 638 |
646 IntPoint RenderListBox::scrollPosition() const | 639 IntPoint RenderListBox::scrollPosition() const |
647 { | 640 { |
648 return IntPoint(0, m_indexOffset); | 641 return IntPoint(0, m_indexOffset); |
649 } | 642 } |
650 | 643 |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
950 | 943 |
951 if (m_vBar) | 944 if (m_vBar) |
952 m_vBar->styleChanged(); | 945 m_vBar->styleChanged(); |
953 | 946 |
954 // Force an update since we know the scrollbars have changed things. | 947 // Force an update since we know the scrollbars have changed things. |
955 if (document().hasAnnotatedRegions()) | 948 if (document().hasAnnotatedRegions()) |
956 document().setAnnotatedRegionsDirty(true); | 949 document().setAnnotatedRegionsDirty(true); |
957 } | 950 } |
958 | 951 |
959 } // namespace WebCore | 952 } // namespace WebCore |
OLD | NEW |