Commit graph

5942 commits

Author SHA1 Message Date
Ian
cb3f8c9e86 The ArrayBufferViewContents trait was removed 2017-02-19 21:01:56 +03:00
bors-servo
debdebe8de Auto merge of #15495 - prampey:mql-borrow-error, r=jdm
Calling matchMedia during a MQL change event will not panic

<!-- Please describe your changes on the following line: -->
Calling matchMedia now leads to a new copy of MQL objects to prevent errors when borrowing references from MQL during an MQL change event.

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

<!-- Either: -->
- [X] There are tests for these changes OR
- [x] 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/15495)
<!-- Reviewable:end -->
2017-02-19 04:10:04 -08:00
bors-servo
5f813233c9 Auto merge of #15520 - frewsxcv:html-options-collection-selected-index, r=nox
Implement `selectedIndex` IDL attribute on `HTMLOptionsCollection`.

<!-- 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/15520)
<!-- Reviewable:end -->
2017-02-19 03:08:12 -08:00
Anthony Ramine
fe3f4ff0c2 Update serde to 0.9 (fixes #15325) 2017-02-18 21:09:46 +01:00
Prudhvi Rampey
0c21333777 Calling matchMedia during a MQL change event will not panic 2017-02-18 20:12:19 +05:30
Josh Matthews
103fa0246d Update document constructor spec link. 2017-02-17 15:51:46 -05:00
bors-servo
6adbcb4ccd Auto merge of #15358 - asajeffrey:script-browsingcontext-xorigin-window, r=jdm
Allow browsing contexts to resolve to cross-origin windows

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

This PR implements cross-thread `WindowProxy` objects.

At the moment, if a `Window` performs a non-similar-origin navigation, the old script thread does not update its `WindowProxy`, since the new `Window` is in the new script thread. With this PR, the `WindowProxy` is updated to a dummy `XOriginWindow` object, that only implements the whitelisted methods that are allowed to be called cross-origin.

This PR does not include working implementations of some of the cross-origin `Window` or `Location` methods.

This PR causes some cross-origin wpt tests to now pass, in particular `/html/browsers/origin/cross-origin-objects/cross-origin-objects.html ` now passes `Only whitelisted properties are accessible cross-origin`. There are some CORS failures in `fetch`, I suspect caused by the incorrect setting of `origin` in fetch requests.

Although there are some functions that now throw `SecurityException`, it is not meant to be a complete implementation, which will have to wait for XOWs to land.

---
<!-- 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 #15180.
- [X] There are tests for these changes

<!-- 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/15358)
<!-- Reviewable:end -->
2017-02-16 16:57:05 -08:00
Alan Jeffrey
e8d765557f Allow browsing contexts to resolve to cross-origin windows. 2017-02-16 16:45:29 -06:00
bors-servo
a099d27f99 Auto merge of #15584 - nox:plugin, r=jdm
Move script lints to script_plugins

<!-- 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/15584)
<!-- Reviewable:end -->
2017-02-16 10:58:19 -08:00
Anthony Ramine
3eed8a91a1 Move script lints to script_plugins
The plugins crate now just allows to hook into clippy from a single crate.
2017-02-16 18:37:14 +01:00
Gregory Katz
4d205f00b0 Adds an as_str() method to WebIDL enums to hide slice of strings from callers. Uses the new method in two places. 2017-02-16 10:59:07 -05:00
bors-servo
4a0b730caf Auto merge of #15537 - servo:webrender, r=SimonSapin
Update ipc-channel to 0.6.3

<!-- 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/15537)
<!-- Reviewable:end -->
2017-02-16 03:53:49 -08:00
Anthony Ramine
85e2648ffc Update ipc-channel to 0.6.3 2017-02-16 12:04:32 +01:00
Ms2ger
f7e2f0e641 Use RootedTraceableBox for dictionaries. 2017-02-16 11:03:26 +01:00
Ms2ger
f1605ab149 Introduce RootedTraceableBox. 2017-02-16 11:03:25 +01:00
Ms2ger
8c8eb41cdf Use from_jsval for dictionaries. 2017-02-16 11:03:24 +01:00
Ms2ger
3613e8f231 Implement JSTraceable for more types. 2017-02-16 11:03:22 +01:00
Ms2ger
8ce9ca6243 Use Heap for dictionary and union members. 2017-02-16 11:03:21 +01:00
Ms2ger
5eaa19bdd4 Share a little less code between the branches for conversion to any. 2017-02-16 11:03:20 +01:00
Ms2ger
7d24cd7752 Pass isMember to getJSToNativeConversionInfo for unions.
Also includes a documentation update for isMember.
2017-02-16 11:03:19 +01:00
bors-servo
84a44a4014 Auto merge of #15567 - nox:plugin, r=SimonSapin
Replace inheritance_integrity by trait shenanigans

<!-- 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/15567)
<!-- Reviewable:end -->
2017-02-15 20:49:47 -08:00
Anthony Ramine
a6d59d8714 Replace inheritance_integrity by trait shenanigans
For each derived DomObject impl, we also generate a dummy trait
ShouldNotImplDomObject that is implemented for all T: DomObject.
We then try to implement it for each field type except the first one.
If compilation succeed, this means that field type doesn't implement
DomObject itself otherwise it would break coherence rules.

error[E0119]: conflicting implementations of trait `dom::xmlhttprequest::_IMPL_DOMOBJECT_FOR_XMLHttpRequest::ShouldNotImplDomObject` for type `((), SomeFieldTypeThatShouldNotImplementDomObject)`:
   --> /Users/nox/src/servo/components/script/dom/xmlhttprequest.rs:120:1
    |
120 | #[dom_struct]
    | ^^^^^^^^^^^^^
    | |
    | first implementation here
    | conflicting implementation for `((), SomeFieldTypeThatShouldNotImplementDomObject)`
2017-02-15 22:11:20 +01:00
bors-servo
3c8daca772 Auto merge of #15561 - saneyuki:rm-domrefcell-heap, r=mbrubeck
Stop using DOMRefCell<Heap<..>>

Fix https://github.com/servo/servo/issues/15560

<!-- 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/15561)
<!-- Reviewable:end -->
2017-02-15 11:11:40 -08:00
bors-servo
34fb10bd40 Auto merge of #15563 - servo:update-js, r=nox
Update js.

Fixes #15553.

<!-- 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/15563)
<!-- Reviewable:end -->
2017-02-15 07:46:03 -08:00
Ms2ger
67c572af37 Update js.
Fixes #15553.
2017-02-15 16:27:29 +01:00
Simon Sapin
c3cad2d6c7 Update cssparser to 0.9 2017-02-15 12:42:14 +01:00
Tetsuharu OHZEKI
d8e9e6c660 Stop using DOMRefCell<Heap<..>>. 2017-02-15 20:38:46 +09:00
Anthony Ramine
be000d3833 Use #[dom_struct] on IterableIterator<T> (fixes #12811) 2017-02-15 10:24:02 +01:00
Anthony Ramine
8bcf36b9a5 Change #[privatize] into #[derive(DenyPublicFields)] 2017-02-15 10:24:01 +01:00
bors-servo
357bf3b85a Auto merge of #15518 - emilio:color, r=SimonSapin
style: Unbox a bunch of color properties.

This builds on https://github.com/servo/rust-cssparser/pull/118.

<!-- 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/15518)
<!-- Reviewable:end -->
2017-02-14 11:43:16 -08:00
Emilio Cobos Álvarez
0c102e2350
style: Unbox a bunch of color properties.
This builds on https://github.com/servo/rust-cssparser/pull/118.
2017-02-14 20:18:31 +01:00
bors-servo
a537cf48b1 Auto merge of #15314 - szeged:permissions-api, r=jdm
Permissions API and WebBluetooth integration

<!-- Please describe your changes on the following line: -->
This implements the [Permissions API](https://w3c.github.io/permissions/) spec.
Also includes the WebBluetooth related implementation for this.

There are some know issues:
- [ ] If the descriptor name is invalid [this](https://gist.github.com/dati91/7a6a0a563d90f49ba5a351e48c5b626b#file-permissionstatusbindings-rs-L323) will throw an error, rather that return it and we could handle it.
- [x] The [environment settings object](https://html.spec.whatwg.org/multipage/webappapis.html#environment-settings-object) is not implemented in servo and the spec rely on it.
- [x] There is a popup in the implementation which prevent us to add wpt test, we should figure out a way to make it work
- [ ] The allowedDevice's allowed_services attribute is not used in our implementation, because we store these in the lower level, not in the dom side.
- [ ] We think the bluetooth revoke function will need some more work, but the problem is the spec needs clarifications on that part.

---
<!-- 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
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] 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/15314)
<!-- Reviewable:end -->
2017-02-14 08:09:22 -08:00
Zakor Gyula
462a825bd1 previous invocation results 2017-02-14 15:01:27 +01:00
Anthony Ramine
c84cea995b Derive DomObject with a proc macro 2017-02-14 14:13:43 +01:00
Attila Dusnoki
2de91c7788 refactor extra permission data 2017-02-14 13:39:00 +01:00
bors-servo
da8d15427c Auto merge of #15527 - simon-whitehead:fix-15521, r=cbrewster
Make HTMLOptionsCollection constructor accept a HTMLSelectElement argument. Fixes #15521

<!-- Please describe your changes on the following line: -->
Moves the `HTMLSelectElement.upcast()` call into the `HTMLOptionsCollection` constructors, replacing their signatures with `&HTMLSelectElement` references. This limits the surface area for misuse by only allowing `HTMLSelectElement` instances to be passed in rather than `Node` instances.

---
<!-- 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 #15521.

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because: the linked issue explicitly says building without errors is good enough.

<!-- 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/15527)
<!-- Reviewable:end -->
2017-02-13 13:31:33 -08:00
bors-servo
28d62f0f03 Auto merge of #15470 - karan1276:karan_rmv_unwrap, r=Wafflespeanut
remove unwrap(), not needed

Fixes #15387

<!-- 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: -->
- [ ] `./mach build -d` does not report any errors
- [ ] `./mach test-tidy` does not report any errors
- [ ] These changes fix #__ (github issue number if applicable).

<!-- Either: -->
- [ ] 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/15470)
<!-- Reviewable:end -->
2017-02-13 11:45:50 -08:00
Attila Dusnoki
d5cc10a636 Move extra permission data to window 2017-02-13 14:58:16 +01:00
Attila Dusnoki
b1d388a991 Fix BluetoothPermissionResult return state 2017-02-13 14:58:15 +01:00
Zakor Gyula
f7e86d2d0e Use rooted_vec instead of Vec<JS<T>> 2017-02-13 14:58:14 +01:00
Attila Dusnoki
4a62562b0f Add pref to ignore popup in testing 2017-02-13 14:58:13 +01:00
Zakor Gyula
3ec9f0bab9 Fix comments, and lesser modifications 2017-02-13 14:58:12 +01:00
Attila Dusnoki
0b713fd689 Refactor permission operations into one function 2017-02-13 14:58:11 +01:00
Attila Dusnoki
cce362dc39 Fix popup build error 2017-02-13 14:58:10 +01:00
Attila Dusnoki
52680bba6b Fix Permissions and Bluetooth prefs 2017-02-13 14:58:07 +01:00
Zakor Gyula
5287cd3bea Bluetooth Permission API integration 2017-02-13 14:58:06 +01:00
Simon Whitehead
7409031af2 Move HTMLSelectElement upcast call into HTMLOptionsCollection constructor. Fixes #15521 2017-02-14 00:49:31 +11:00
Zakor Gyula
f3ddee5dbc Modify CodegenRust.py to import structs from sequence return values 2017-02-13 14:35:52 +01:00
Attila Dusnoki
5ca3ee9474 Permission API 2017-02-13 14:35:52 +01:00
bors-servo
e394334739 Auto merge of #15368 - szeged:get_availability, r=nox
Implement GetAvailability for Bluetooth

<!-- Please describe your changes on the following line: -->
This implements the [getAvailability](https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetooth-getavailability) function from the spec.

---
<!-- 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
- [ ] These changes fix #__ (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/15368)
<!-- Reviewable:end -->
2017-02-13 04:32:46 -08:00