Commit graph

4352 commits

Author SHA1 Message Date
bors-servo
06bb57bdcb Auto merge of #13406 - Mylainos:issue-13377, r=jdm
Extract panic-catching for JS engine callbacks into a separate function

All of our generated code for script contains inline code like this:
```
let result = panic::catch_unwind(AssertUnwindSafe(|| {
    ...
};
match result {
    Ok(result) => result,
    Err(error) => {
        store_panic_result(error);
        return false;
    }
}
```
This PR change it to something like this:
```
wrap_panic(|| { ... }, false)
```

---
- [X] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [X] These changes fix #13377

- [ ] There are tests for these changes

<!-- 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/13406)
<!-- Reviewable:end -->
2016-09-27 09:58:42 -05:00
bors-servo
ef1b594f48 Auto merge of #13422 - SecurityInsanity:master, r=KiChjang
Make Assign throw error on invalid url

Step 2 of: https://html.spec.whatwg.org/multipage/browsers.html#dom-location-assign says we should throw an error. This makes it do that.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #13420  (github issue number if applicable).
- [x] There are tests for these changes

<!-- 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/13422)
<!-- Reviewable:end -->
2016-09-27 01:24:28 -05:00
bors-servo
d03f0a20cc Auto merge of #13405 - ashrko619:textencoder-encoding, r=Ms2ger
Removed support for UTF-16 in TextEncoder

<!-- 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 #13231  (github issue number if applicable).

<!-- 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/13405)
<!-- Reviewable:end -->
2016-09-26 22:19:40 -05:00
Ashwin R
67a94d81d1 removed support for UTF-16 in TextEncoder 2016-09-27 05:44:52 +05:30
Alexandrov Sergey
cf284cc035 implement HTMLOptionsCollection and add related items to HTMLSelectElement 2016-09-26 21:49:10 +03:00
Alexandrov Sergey
6bda471007 remove link to #5876 due to everything has been fixed in PR #13333 2016-09-26 21:49:09 +03:00
Hugo Thiessard
4654dd91a8 Issue #13377 Extract panic-catching for JS engine callbacks into a
separate function
2016-09-26 19:20:22 +02:00
bors-servo
9b7708063a Auto merge of #13397 - aochagavia:dispatch-event, r=Ms2ger
Return an enum instead of a boolean from dispatch_event

Fixes #13196

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #13196.
- [X] These changes do not require tests because the functionality hasn't changed

<!-- 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/13397)
<!-- Reviewable:end -->
2016-09-26 12:09:48 -05:00
Eric Coan
096c0362fe Make Assign throw error on invalid url 2016-09-26 11:03:22 -06:00
Adolfo Ochagavía
6c8bfdb774 Return an enum instead of a boolean from dispatch_event
Fixes #13196
2016-09-26 17:52:38 +02:00
bors-servo
d00639c55f Auto merge of #13416 - vigneshsarma:issue-13408, r=jdm
Replace instances of old ServiceWorker specification URL with new one

<!-- Please describe your changes on the following line: -->

The old specification URL is
https://slightlyoff.github.io/ServiceWorker/spec/service_worker/, which has
been replaced by the new one at https://w3c.github.io/ServiceWorker/.

---
<!-- 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 #13408 (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because all the changes are in commented parts of the code.

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

The old specification URL is
https://slightlyoff.github.io/ServiceWorker/spec/service_worker/ has
been replaced by the new one at https://w3c.github.io/ServiceWorker/.

<!-- 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/13416)
<!-- Reviewable:end -->
2016-09-25 10:12:30 -05:00
Vignesh Sarma K (വിഘ്നേഷ് ശ൪മ കെ)
3bf5813096 Replace instances of old ServiceWorker specification URL with new one
The old specification URL is
https://slightlyoff.github.io/ServiceWorker/spec/service_worker/ has
been replaced by the new one at https://w3c.github.io/ServiceWorker/.
2016-09-25 20:32:32 +05:30
bors-servo
89804bb251 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 -->
2016-09-24 03:54:18 -05:00
bors-servo
2ba804e6db Auto merge of #13361 - Mylainos:issue-13350, r=Wafflespeanut
Report tidy error for space after (

<!-- Please describe your changes on the following line: -->
Add report in tidy for code which have a space after the `(` like `some_function( argument)`

---
<!-- 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 #13350 (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/13361)
<!-- Reviewable:end -->
2016-09-23 22:16:57 -05:00
Chiu-Hsiang Hsu
652c578e15 Added FormData Iterable 2016-09-23 10:19:11 -04:00
Nikhil Shagrithaya
9d378ceb74 use .set_tokenlist_attribute to set rel content attribute in SetRel
Removed .ini files expecting crashes
2016-09-23 17:36:59 +00:00
Hugo Thiessard
0ac212afb1 Issue #13350 Report tidy error for space after ( 2016-09-23 14:01:58 +02:00
Jeena Lee
3b75d223f1 Enable OpenEndedDictionary in Headers
Expected wpt results are updated as well.
2016-09-22 15:01:34 -07:00
bors-servo
2b1a39c2ae Auto merge of #12830 - jdm:promises, r=Ms2ger
Implement promise bindings

This implements support for using Promises in WebIDL, executing promise callbacks in batches (equivalent to running all enqueued jobs from a setTimeout(0)), and attaching native callbacks to promise objects. This is the combined work of myself, @dati91, and @mmatyas based on the following prior work in Gecko:
* Codegen.py
* Promise.webidl
* Promise.cpp/Promise.h
* PromiseNativeHandler.h

This does not implement microtasks per #4283. This allows us to make progress on testing code that requires the use of Promises right now; the microtasks work is more complicated, but also largely orthogonal to implement.

Requires https://github.com/servo/mozjs/pull/89, https://github.com/servo/rust-mozjs/pull/287, and https://github.com/servo/rust-mozjs/pull/294.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #4282
- [X] There are tests for these changes

<!-- 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/12830)
<!-- Reviewable:end -->
2016-09-22 15:23:23 -05:00
Josh Matthews
e9c0606454 Remove maybe_ prefix from Promise methods. 2016-09-22 16:21:23 -04:00
Josh Matthews
498ccd41e8 Support an equivalent of Trusted<T> for Rc<Promise> objects named TrustedPromise. 2016-09-22 16:16:59 -04:00
Josh Matthews
27d44c8d10 Add a simple API to reject promises with DOM error values. 2016-09-22 16:16:58 -04:00
Josh Matthews
ae81ab3972 Create meaningful tests for native promise handlers. 2016-09-22 16:16:56 -04:00
Josh Matthews
57b3ccd38c Support promises in workers. 2016-09-22 16:16:55 -04:00
Josh Matthews
ef501603bf Ensure Promise "reflector" is not GCed before the Rust object. 2016-09-22 16:16:54 -04:00
Josh Matthews
f89355b85d Add integration tests for interacting with promises from native code. 2016-09-22 16:16:53 -04:00
Josh Matthews
ab168204ed Support native promise callbacks. 2016-09-22 16:16:52 -04:00
Josh Matthews
7ba3172ce0 Useful APIs for resolving/rejecting from native code. 2016-09-22 16:16:51 -04:00
Mátyás Mustoha
fd778b4240 Enqueue promise jobs from SpiderMonkey callbacks, and execute them in batches. Implement native Promise APIs.
Add SpiderMonkey hooks for enqueuing promise jobs. Start porting various native Promise APIs.
2016-09-22 16:16:49 -04:00
Josh Matthews
a1091772ec Implement binding support for returning and accepting Promises in WebIDL. 2016-09-22 16:16:48 -04:00
bors-servo
d74f6adf54 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 -->
2016-09-22 13:14:27 -05:00
bors-servo
b86420d693 Auto merge of #13351 - servo:rustup, r=Ms2ger
Update Cargo and Rust

<!-- 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/13351)
<!-- Reviewable:end -->
2016-09-22 12:10:05 -05:00
Ofek
ee149cdac7 implement WebGLRenderingContext::isEnabled 2016-09-22 13:44:35 +03:00
Maciej Skrzypkowski
670693ba7e Implement indexed access on select elements
refs #11763
2016-09-22 09:17:15 +02:00
bors-servo
73b2963509 Auto merge of #13333 - splav:JS-setters-fix#13327, r=jdm
fix JS IndexedGetter and NamedSetter bindings generation

<!-- Please describe your changes on the following line: -->
Fix JS IndexedGetter and NamedSetter bindings generation.

---
<!-- 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 #13327 (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because the test will be in PR for #13129 as currently these setters are used by nobody.

<!-- 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/13333)
<!-- Reviewable:end -->
2016-09-22 01:36:25 -05:00
Keith Yeung
07c9cfecec Add FetchMetadata and update corresponding methods 2016-09-21 14:26:03 -07:00
Keith Yeung
4dcf693a75 Use fetch infrastructure to load external scripts 2016-09-21 11:50:55 -07:00
Keith Yeung
d4816762fa Add fetch_async to PendingAsyncLoad, DocumentLoader and Document 2016-09-21 11:50:54 -07:00
Keith Yeung
2bb95989c5 Implement default values for RequestInit 2016-09-21 11:50:53 -07:00
Keith Yeung
5729a4a3d4 Fix incorrect indentation 2016-09-21 11:50:52 -07:00
Keith Yeung
4c616dad90 Add crossorigin attribute and implement step 14 of prepare a script
Add WPT test for HTMLScriptElement crossOrigin IDL attribute
2016-09-21 11:50:51 -07:00
Keith Yeung
f566a8d44f Update step annotations for prepare a script 2016-09-21 11:49:47 -07:00
bors-servo
7b98c8a788 Auto merge of #13332 - servo:mozmap, r=jdm
Implement the MozMap type.

Fixes #13144.

<!-- 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/13332)
<!-- Reviewable:end -->
2016-09-21 10:09:58 -05:00
Anthony Ramine
fe4f3543c1 Silence a warning in ExtendableEvent::WaitUntil 2016-09-21 15:38:51 +02:00
Taryn Hill
2cb5adf6c6 Implement minlength for text inputs 2016-09-21 07:54:39 -05:00
Ms2ger
2d83e5a788 Implement the MozMap type.
Fixes #13144.
2016-09-21 14:03:34 +02:00
Ms2ger
9a9ca45084 Introduce wrapInNativeContainerType. 2016-09-21 14:03:33 +02:00
Ms2ger
9371889a03 Use innerContainerType in getConversionConfigForType. 2016-09-21 13:44:31 +02:00
Ms2ger
b2fc80a847 Rename innerSequenceType to innerContainerType. 2016-09-21 13:42:35 +02:00
Ms2ger
e942f50e1b Handle unsupported types better in getUnionTypeTemplateVars. 2016-09-21 13:17:05 +02:00