diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2018-03-29 02:02:37 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-29 02:02:37 -0400 |
commit | 0c148809c1528a969f80f205dce570a5db606374 (patch) | |
tree | a6ad076b0e80b8b0ffc85576d0a3ae24d0444f87 /components/script/dom | |
parent | a69eceefc92d011dc825cbcf7b408042ae607ecc (diff) | |
parent | 3f06ccb1acc93b6340a20be31b1acd3d7b69be7b (diff) | |
download | servo-0c148809c1528a969f80f205dce570a5db606374.tar.gz servo-0c148809c1528a969f80f205dce570a5db606374.zip |
Auto merge of #20434 - nupurbaghel:typed-array-xml, r=jdm
Typed array support for XMLHttpRequest's send API
<!-- Please describe your changes on the following line: -->
---
<!-- 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 #20343
<!-- Either: -->
- [x] Updated some tests for these changes
<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->
<!-- 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/20434)
<!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom')
-rw-r--r-- | components/script/dom/webidls/XMLHttpRequest.webidl | 2 | ||||
-rw-r--r-- | components/script/dom/xmlhttprequest.rs | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/components/script/dom/webidls/XMLHttpRequest.webidl b/components/script/dom/webidls/XMLHttpRequest.webidl index 270e45ca7ed..f6ae05c66ec 100644 --- a/components/script/dom/webidls/XMLHttpRequest.webidl +++ b/components/script/dom/webidls/XMLHttpRequest.webidl @@ -13,7 +13,7 @@ */ // https://fetch.spec.whatwg.org/#bodyinit -typedef (Blob or /*BufferSource or */ FormData or DOMString or URLSearchParams) BodyInit; +typedef (Blob or BufferSource or FormData or DOMString or URLSearchParams) BodyInit; enum XMLHttpRequestResponseType { "", diff --git a/components/script/dom/xmlhttprequest.rs b/components/script/dom/xmlhttprequest.rs index e818a1fd756..49a72bbf46d 100644 --- a/components/script/dom/xmlhttprequest.rs +++ b/components/script/dom/xmlhttprequest.rs @@ -520,6 +520,8 @@ impl XMLHttpRequestMethods for XMLHttpRequest { Some(DocumentOrBodyInit::FormData(ref formdata)) => Some(formdata.extract()), Some(DocumentOrBodyInit::String(ref str)) => Some(str.extract()), Some(DocumentOrBodyInit::URLSearchParams(ref urlsp)) => Some(urlsp.extract()), + Some(DocumentOrBodyInit::ArrayBuffer(ref typedarray)) => Some((typedarray.to_vec(), None)), + Some(DocumentOrBodyInit::ArrayBufferView(ref typedarray)) => Some((typedarray.to_vec(), None)), None => None, }; @@ -1441,6 +1443,8 @@ impl Extractable for BodyInit { BodyInit::URLSearchParams(ref usp) => usp.extract(), BodyInit::Blob(ref b) => b.extract(), BodyInit::FormData(ref formdata) => formdata.extract(), + BodyInit::ArrayBuffer(ref typedarray) => ((typedarray.to_vec(), None)), + BodyInit::ArrayBufferView(ref typedarray) => ((typedarray.to_vec(), None)), } } } |