| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). | 2 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
| 3 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 3 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 4 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 4 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 5 * (C) 2001 Dirk Mueller (mueller@kde.org) | 5 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 6 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010, 2011 Apple Inc. All rights
reserved. | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010, 2011 Apple Inc. All rights
reserved. |
| 7 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 7 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
| 8 * Copyright (C) 2010 Google Inc. All rights reserved. | 8 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 9 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 9 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
| 10 * | 10 * |
| (...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 723 } | 723 } |
| 724 | 724 |
| 725 void HTMLSelectElement::scrollToSelection() | 725 void HTMLSelectElement::scrollToSelection() |
| 726 { | 726 { |
| 727 if (!isFinishedParsingChildren()) | 727 if (!isFinishedParsingChildren()) |
| 728 return; | 728 return; |
| 729 if (usesMenuList()) | 729 if (usesMenuList()) |
| 730 return; | 730 return; |
| 731 scrollToIndex(activeSelectionEndListIndex()); | 731 scrollToIndex(activeSelectionEndListIndex()); |
| 732 if (AXObjectCache* cache = document().existingAXObjectCache()) | 732 if (AXObjectCache* cache = document().existingAXObjectCache()) |
| 733 cache->selectedChildrenChanged(this); | 733 cache->listboxActiveIndexChanged(this); |
| 734 } | 734 } |
| 735 | 735 |
| 736 void HTMLSelectElement::setOptionsChangedOnRenderer() | 736 void HTMLSelectElement::setOptionsChangedOnRenderer() |
| 737 { | 737 { |
| 738 if (LayoutObject* renderer = this->layoutObject()) { | 738 if (LayoutObject* renderer = this->layoutObject()) { |
| 739 if (usesMenuList()) | 739 if (usesMenuList()) |
| 740 toLayoutMenuList(renderer)->setOptionsChanged(true); | 740 toLayoutMenuList(renderer)->setOptionsChanged(true); |
| 741 } | 741 } |
| 742 } | 742 } |
| 743 | 743 |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 963 scrollToSelection(); | 963 scrollToSelection(); |
| 964 setNeedsValidityCheck(); | 964 setNeedsValidityCheck(); |
| 965 | 965 |
| 966 if (usesMenuList()) { | 966 if (usesMenuList()) { |
| 967 m_isProcessingUserDrivenChange = flags & UserDriven; | 967 m_isProcessingUserDrivenChange = flags & UserDriven; |
| 968 if (flags & DispatchInputAndChangeEvent) | 968 if (flags & DispatchInputAndChangeEvent) |
| 969 dispatchInputAndChangeEventForMenuList(); | 969 dispatchInputAndChangeEventForMenuList(); |
| 970 if (LayoutObject* renderer = this->layoutObject()) { | 970 if (LayoutObject* renderer = this->layoutObject()) { |
| 971 if (usesMenuList()) { | 971 if (usesMenuList()) { |
| 972 toLayoutMenuList(renderer)->didSetSelectedIndex(listIndex); | 972 toLayoutMenuList(renderer)->didSetSelectedIndex(listIndex); |
| 973 } else if (renderer->isListBox()) { | |
| 974 if (AXObjectCache* cache = document().existingAXObjectCache()) | |
| 975 cache->selectedChildrenChanged(this); | |
| 976 } | 973 } |
| 977 } | 974 } |
| 978 } | 975 } |
| 979 | 976 |
| 980 notifyFormStateChanged(); | 977 notifyFormStateChanged(); |
| 981 } | 978 } |
| 982 | 979 |
| 983 int HTMLSelectElement::optionToListIndex(int optionIndex) const | 980 int HTMLSelectElement::optionToListIndex(int optionIndex) const |
| 984 { | 981 { |
| 985 const WillBeHeapVector<RawPtrWillBeMember<HTMLElement>>& items = listItems()
; | 982 const WillBeHeapVector<RawPtrWillBeMember<HTMLElement>>& items = listItems()
; |
| (...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1768 int focusedIndex = activeSelectionEndListIndex(); | 1765 int focusedIndex = activeSelectionEndListIndex(); |
| 1769 if (focusedIndex < 0) | 1766 if (focusedIndex < 0) |
| 1770 focusedIndex = firstSelectableListIndex(); | 1767 focusedIndex = firstSelectableListIndex(); |
| 1771 if (focusedIndex < 0) | 1768 if (focusedIndex < 0) |
| 1772 return nullptr; | 1769 return nullptr; |
| 1773 HTMLElement* focused = listItems()[focusedIndex]; | 1770 HTMLElement* focused = listItems()[focusedIndex]; |
| 1774 return isHTMLOptionElement(focused) ? toHTMLOptionElement(focused) : nullptr
; | 1771 return isHTMLOptionElement(focused) ? toHTMLOptionElement(focused) : nullptr
; |
| 1775 } | 1772 } |
| 1776 | 1773 |
| 1777 } // namespace | 1774 } // namespace |
| OLD | NEW |