Auto merge of #13396 - jdm:FormData_iterable, r=jdm

Added FormData Iterable

Implement FormData's iterator
Rebased from #13104.

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #13020
- [X] There are tests for these changes (It adds `./mach test-wpt tests/wpt/web-platform-tests/XMLHttpRequest/formdata-foreach.html`)

Notice: Our `FormData` is implemented by `HashMap` ,  which is different from [Gecko's array implementation](3c6ff93c8f/dom/base/FormData.h (L160)). So our `FormData`'s iterator order is different from Gecko's, as there is no way to keep our key's original insertion order.

<!-- 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/13396)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-09-24 03:54:18 -05:00 committed by GitHub
commit 89804bb251
5 changed files with 116 additions and 9 deletions

View file

@ -19,5 +19,5 @@ interface FormData {
boolean has(USVString name);
void set(USVString name, USVString value);
void set(USVString name, Blob value, optional USVString filename);
// iterable<USVString, FormDataEntryValue>;
iterable<USVString, FormDataEntryValue>;
};