Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: WebCore/dom/SelectElement.cpp

Issue 5526003: Merge 72927 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/597/
Patch Set: Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « LayoutTests/fast/forms/select-option-accesskey-crash-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 2 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 931 matching lines...) Expand 10 before | Expand all | Expand 10 after
942 942
943 // if this index is already selected, unselect. otherwise update the selecte d index 943 // if this index is already selected, unselect. otherwise update the selecte d index
944 const Vector<Element*>& items = data.listItems(element); 944 const Vector<Element*>& items = data.listItems(element);
945 int listIndex = optionToListIndex(data, element, index); 945 int listIndex = optionToListIndex(data, element, index);
946 if (OptionElement* optionElement = (listIndex >= 0 ? toOptionElement(items[l istIndex]) : 0)) { 946 if (OptionElement* optionElement = (listIndex >= 0 ? toOptionElement(items[l istIndex]) : 0)) {
947 if (optionElement->selected()) 947 if (optionElement->selected())
948 optionElement->setSelectedState(false); 948 optionElement->setSelectedState(false);
949 else 949 else
950 setSelectedIndex(data, element, index, false, true); 950 setSelectedIndex(data, element, index, false, true);
951 } 951 }
952 952
953 listBoxOnChange(data, element); 953 if (data.usesMenuList())
954 menuListOnChange(data, element);
955 else
956 listBoxOnChange(data, element);
957
954 scrollToSelection(data, element); 958 scrollToSelection(data, element);
955 } 959 }
956 960
957 unsigned SelectElement::optionCount(const SelectElementData& data, const Element * element) 961 unsigned SelectElement::optionCount(const SelectElementData& data, const Element * element)
958 { 962 {
959 unsigned options = 0; 963 unsigned options = 0;
960 964
961 const Vector<Element*>& items = data.listItems(element); 965 const Vector<Element*>& items = data.listItems(element);
962 for (unsigned i = 0; i < items.size(); ++i) { 966 for (unsigned i = 0; i < items.size(); ++i) {
963 if (isOptionElement(items[i])) 967 if (isOptionElement(items[i]))
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
1027 1031
1028 #if ENABLE(WML) 1032 #if ENABLE(WML)
1029 if (element->isWMLElement() && element->hasTagName(WMLNames::selectTag)) 1033 if (element->isWMLElement() && element->hasTagName(WMLNames::selectTag))
1030 return static_cast<WMLSelectElement*>(element); 1034 return static_cast<WMLSelectElement*>(element);
1031 #endif 1035 #endif
1032 1036
1033 return 0; 1037 return 0;
1034 } 1038 }
1035 1039
1036 } 1040 }
OLDNEW
« no previous file with comments | « LayoutTests/fast/forms/select-option-accesskey-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698