Changeset 56180 in webkit
- Timestamp:
- Mar 18, 2010 12:32:03 PM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r56175 r56180 1 2010-03-18 Luiz Agostini <luiz.agostini@openbossa.org> 2 3 Reviewed by Kenneth Rohde Christiansen. 4 5 Multiselect Popup - Listbox click simulation 6 https://bugs.webkit.org/show_bug.cgi?id=36177 7 8 Listbox popups will need to notify the corresponding select elements that a 9 selection change happened. The current HTMLSelectElement interface does not 10 allow multiple selections. 11 12 The new method listBoxSelectItem will be used for that. I have refactored part 13 of the mouse handling code in bug 36124 and I am now reusing it here for 14 <select multiple> popups. All the other cases will handled as they were before to be 15 sure that no side effects will show up. 16 17 * dom/SelectElement.cpp: 18 (WebCore::SelectElement::updateListBoxSelection): 19 (WebCore::SelectElement::listBoxOnChange): 20 * dom/SelectElement.h: 21 * html/HTMLSelectElement.cpp: 22 (WebCore::HTMLSelectElement::listBoxPopupClick): 23 * html/HTMLSelectElement.h: 24 1 25 2010-03-12 Ojan Vafai <ojan@chromium.org> 2 26 -
trunk/WebCore/dom/SelectElement.cpp
r56120 r56180 151 151 void SelectElement::updateListBoxSelection(SelectElementData& data, Element* element, bool deselectOtherOptions) 152 152 { 153 ASSERT(element->renderer() && element->renderer()->isListBox());153 ASSERT(element->renderer() && (element->renderer()->isListBox() || data.multiple())); 154 154 ASSERT(data.activeSelectionAnchorIndex() >= 0); 155 155 … … 177 177 void SelectElement::listBoxOnChange(SelectElementData& data, Element* element) 178 178 { 179 ASSERT(!data.usesMenuList() );179 ASSERT(!data.usesMenuList() || data.multiple()); 180 180 181 181 Vector<bool>& lastOnChangeSelection = data.lastOnChangeSelection(); -
trunk/WebCore/dom/SelectElement.h
r56116 r56180 1 1 /* 2 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 2 3 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http//www.torchmobile.com/) 3 4 * … … 60 61 virtual void setSelectedIndex(int index, bool deselect = true) = 0; 61 62 virtual void setSelectedIndexByUser(int index, bool deselect = true, bool fireOnChangeNow = false) = 0; 63 64 virtual void listBoxSelectItem(int listIndex, bool allowMultiplySelections, bool shift, bool fireOnChangeNow = true) = 0; 62 65 63 66 protected: -
trunk/WebCore/html/HTMLSelectElement.cpp
r55557 r56180 1 1 /* 2 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 2 3 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 3 4 * (C) 1999 Antti Koivisto (koivisto@kde.org) … … 98 99 } 99 100 101 void HTMLSelectElement::listBoxSelectItem(int listIndex, bool allowMultiplySelections, bool shift, bool fireOnChangeNow) 102 { 103 if (!multiple()) 104 setSelectedIndexByUser(listIndex, true, fireOnChangeNow); 105 else { 106 updateSelectedState(m_data, this, listIndex, allowMultiplySelections, shift); 107 if (fireOnChangeNow) 108 listBoxOnChange(); 109 } 110 } 111 100 112 int HTMLSelectElement::activeSelectionStartListIndex() const 101 113 { -
trunk/WebCore/html/HTMLSelectElement.h
r53957 r56180 1 1 /* 2 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 2 3 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 3 4 * (C) 1999 Antti Koivisto (koivisto@kde.org) … … 81 82 void scrollToSelection(); 82 83 84 void listBoxSelectItem(int listIndex, bool allowMultiplySelections, bool shift, bool fireOnChangeNow = true); 85 83 86 private: 84 87 virtual int tagPriority() const { return 6; }
Note: See TracChangeset
for help on using the changeset viewer.