Auto merge of #13066 - mskrzypkows:htmlselect_index, r=KiChjang

Implement indexed access on select elements

<!-- Please describe your changes on the following line: -->
Added methods for indexed access on select: SetLength, Length, Item, IndexedGetter

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #11763 (github issue number if applicable).

<!-- Either: -->
- [x] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13066)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-09-22 13:14:27 -05:00 committed by GitHub
commit d74f6adf54
5 changed files with 48 additions and 41 deletions

View file

@ -15,8 +15,8 @@ interface HTMLSelectElement : HTMLElement {
readonly attribute DOMString type;
//readonly attribute HTMLOptionsCollection options;
// attribute unsigned long length;
//getter Element? item(unsigned long index);
attribute unsigned long length;
getter Element? item(unsigned long index);
//HTMLOptionElement? namedItem(DOMString name);
// Note: this function currently only exists for union.html.
void add((HTMLOptionElement or HTMLOptGroupElement) element, optional (HTMLElement or long)? before = null);