Changeset 110340 in webkit
- Timestamp:
- Mar 9, 2012, 3:11:47 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 7 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/dom/select-selectedOptions-expected.txt (added)
-
LayoutTests/fast/dom/select-selectedOptions.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/html/CollectionType.h (modified) (1 diff)
-
Source/WebCore/html/HTMLCollection.cpp (modified) (2 diffs)
-
Source/WebCore/html/HTMLSelectElement.cpp (modified) (1 diff)
-
Source/WebCore/html/HTMLSelectElement.h (modified) (2 diffs)
-
Source/WebCore/html/HTMLSelectElement.idl (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r110332 r110340 1 2012-03-09 Alexis Menard <alexis.menard@openbossa.org> 2 3 Implement selectedOptions attribute of <select>. 4 https://bugs.webkit.org/show_bug.cgi?id=80631 5 6 Reviewed by Benjamin Poulain. 7 8 New tests to cover the feature. 9 10 * fast/dom/select-selectedOptions-expected.txt: Added. 11 * fast/dom/select-selectedOptions.html: Added. 12 1 13 2012-03-09 Ken Buchanan <kenrb@chromium.org> 2 14 -
trunk/Source/WebCore/ChangeLog
r110338 r110340 1 2012-03-09 Alexis Menard <alexis.menard@openbossa.org> 2 3 Implement selectedOptions attribute of <select>. 4 https://bugs.webkit.org/show_bug.cgi?id=80631 5 6 Reviewed by Benjamin Poulain. 7 8 Add a new collection as a member of HTMLSelectElement which is 9 used to store the selected elements. Extend HTMLCollection to 10 support the new collection type needed by this feature. 11 12 Reference : http://www.whatwg.org/specs/web-apps/current-work/multipage/the-button-element.html#dom-select-selectedoptions 13 14 Test: fast/dom/select-selectedOptions.html 15 16 * html/CollectionType.h: 17 * html/HTMLCollection.cpp: 18 (WebCore::HTMLCollection::shouldIncludeChildren): 19 (WebCore::HTMLCollection::isAcceptableElement): 20 * html/HTMLSelectElement.cpp: 21 (WebCore::HTMLSelectElement::selectedOptions): 22 (WebCore): 23 * html/HTMLSelectElement.h: 24 (HTMLSelectElement): 25 * html/HTMLSelectElement.idl: 26 1 27 2012-03-09 Tien-Ren Chen <trchen@chromium.org> 2 28 -
trunk/Source/WebCore/html/CollectionType.h
r103883 r110340 52 52 TRCells, // all cells in this row 53 53 SelectOptions, 54 SelectedOptions, 54 55 DataListOptions, 55 56 MapAreas, -
trunk/Source/WebCore/html/HTMLCollection.cpp
r107477 r110340 62 62 case OtherCollection: 63 63 case SelectOptions: 64 case SelectedOptions: 64 65 case DataListOptions: 65 66 case WindowNamedItems: … … 115 116 case SelectOptions: 116 117 return element->hasLocalName(optionTag); 118 case SelectedOptions: 119 if (element->hasLocalName(optionTag)) { 120 HTMLOptionElement* option = static_cast<HTMLOptionElement*>(element); 121 if (option->selected()) 122 return true; 123 } 124 return false; 117 125 case DataListOptions: 118 126 if (element->hasLocalName(optionTag)) { -
trunk/Source/WebCore/html/HTMLSelectElement.cpp
r109149 r110340 330 330 { 331 331 return childContext.isOnEncapsulationBoundary() && HTMLFormControlElementWithState::childShouldCreateRenderer(childContext); 332 } 333 334 HTMLCollection* HTMLSelectElement::selectedOptions() 335 { 336 if (!m_selectedOptionsCollection) 337 m_selectedOptionsCollection = HTMLCollection::create(this, SelectedOptions); 338 return m_selectedOptionsCollection.get(); 332 339 } 333 340 -
trunk/Source/WebCore/html/HTMLSelectElement.h
r110055 r110340 64 64 65 65 HTMLOptionsCollection* options(); 66 HTMLCollection* selectedOptions(); 66 67 67 68 void optionElementChildrenChanged(); … … 179 180 180 181 OwnPtr<HTMLOptionsCollection> m_optionsCollection; 182 OwnPtr<HTMLCollection> m_selectedOptionsCollection; 181 183 182 184 // m_listItems contains HTMLOptionElement, HTMLOptGroupElement, and HTMLHRElement objects. -
trunk/Source/WebCore/html/HTMLSelectElement.idl
r109562 r110340 54 54 void remove(in long index); 55 55 #endif 56 readonly attribute HTMLCollection selectedOptions; 56 57 attribute long selectedIndex; 57 58 attribute [TreatNullAs=NullString] DOMString value;
Note:
See TracChangeset
for help on using the changeset viewer.