Commit graph

5167 commits

Author SHA1 Message Date
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
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
bors-servo
13f6d1f53f Auto merge of #15525 - szeged:step-reorder, r=Wafflespeanut
Reorder startNotifications steps

<!-- Please describe your changes on the following line: -->
https://github.com/WebBluetoothCG/web-bluetooth/pull/355 changed the step order in startNotifications.
The connection check is now Step 2 instead of Step 6.
Link for the current spec state: https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetoothremotegattcharacteristic-startnotifications
Step annotations are also updated for this function.

---
<!-- 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] 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/15525)
<!-- Reviewable:end -->
2017-02-13 02:00:46 -08:00
Michael Nelson
bb7833a7fc Rewrite TextEncoder::Encode to use typed array API. Fixes #15504 2017-02-13 07:21:44 +11:00
Anthony Ramine
5aba878227 Kill dead code 2017-02-12 09:44:10 +01:00
deror1869107
2d99f7f995 Remove slice_to_array_buffer_view and update_array_buffer_view 2017-02-11 23:25:14 +08:00
Josh Matthews
baf8c5462a Make typed_array_or_sequence_to_vec support typed arrays. 2017-02-10 16:34:11 -05:00
deror1869107
6c4ce7247f Use TypedArray 2017-02-10 16:33:57 -05:00
Zakor Gyula
fae2beeda0 Reorder startNotifications steps 2017-02-10 13:32:07 +01:00
bors-servo
3d0fe9a0dd Auto merge of #15475 - kekkyojin:bb15436, r=jdm
Only expose Storage/StorageEvent in Window

<!-- Please describe your changes on the following line: -->
This patch removes Worker scope from Storage and StorageEvent WebIDL definition. This way it is possible to construct the objects passing Window instead of GlobalScope. It also removes some tests as they would run out of the scope.

It removes Worker from the WebIDL files defining the Storage and StorageEvent interfaces, as they should not be exposed in that scope.

In Rust source code, this patch replaces "GlobalScope" with "Window" on the contructors. It also modifies constructor calling code in order to pass Window instead of the previously used GlobalScope.

There has been removed these interfaces from the Worker tests.

(This time I did a real build and real tests. Sorry about previous pull requests, I am used to the Mozilla flow, which doesn't uses GitHub)

---
<!-- 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 #15436 (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/15475)
<!-- Reviewable:end -->
2017-02-09 08:17:53 -08:00
Javier Rueda
1aeca9c255 Only expose Storage/StorageEvent in Window 2017-02-09 15:34:24 +01:00
Nazım Can Altınova
78afe2b8d1 Box larger specified values to avoid memmove impact 2017-02-09 11:10:08 +01:00
Bobby Holley
9e860df9df Bug 1336646 - Apply selector flags during traversal. r=emilio 2017-02-08 19:21:05 -08:00
Attila Dusnoki
ca7aa6bff8 Implement GetAvailability for Bluetooth 2017-02-08 15:53:53 +01:00
bors-servo
6d1d4b5783 Auto merge of #15453 - servo:unwrapCastableObject, r=nox
Inline unwrapCastableObject into its only caller.

<!-- 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/15453)
<!-- Reviewable:end -->
2017-02-08 06:38:44 -08:00
Ms2ger
350a970208 Inline unwrapCastableObject into its only caller. 2017-02-08 15:38:23 +01:00
Ms2ger
85585d9334 Remove unused Descriptor.needsRooting field. 2017-02-08 12:40:19 +01:00
Ms2ger
5230ad2c61 Remove typeNeedsRooting().
It is only used once, in a case where it can never have an effect: in case
for it to do something, both returnType.isDictionary() and
returnType.isGeckoInterface() would need to be true at the same time.
2017-02-08 12:39:38 +01:00
Ms2ger
7d5320f419 Remove pointless assertion in the typedef code. 2017-02-08 12:37:17 +01:00
Ms2ger
507b4bf05e Cleanup formatting for typedefs. 2017-02-08 12:31:56 +01:00
Ms2ger
8a5987c1db Fix typo in the non-union code path for typedefs. 2017-02-08 12:28:51 +01:00
Ms2ger
35bc171a05 Support using typedefs with nullable unions. 2017-02-08 12:18:24 +01:00
Anthony Ramine
55b2c5c1bd Update selectors to 0.17 2017-02-07 20:33:35 -08:00
Ms2ger
b57abc19da Make {get,ensure}_expando_object unsafe.
They trust the caller-provided raw pointers to be valid.
2017-02-07 11:44:38 +01:00
Ms2ger
bd431039b9 Properly root expando objects. 2017-02-07 11:35:55 +01:00
Manish Goregaokar
34ba00e6d9 Basic handling framework for presentation attributes in Stylo, with handling for font-size and color
This introduces a basic framework for servo's style system to be able
to query the style of presentation attributes which it can then insert
into the cascade. It uses that framework to implement the size and
color attributes on <font>.

There are a number of improvements that can be done on top of this:

 - Implement all other properties
 - Abstractify the ruledata parameter of the mappers using templates or virtual dispatch so that it can be a Servo decl block instead
 - Implement aforementiond abstraction over Servo decl blocks (this obsoletes the code in the first item above, so it might just be better to skip that and directly do this)
 - Replace uses of nsHTMLStyleSheet with an abstract base class containing common elements between Servo and Gecko

I'd prefer for these to be done in separate steps.
2017-02-03 17:35:44 -08:00
bors-servo
8926db302a Auto merge of #15359 - freeatnet:15332-macroed-event-handlers-check-for-window, r=KiChjang
Event handlers forwarded to a window check for window presence

<!-- Please describe your changes on the following line: -->
This change adds a check for the presence of a window in event handlers of `body` and `frameset` that are forwarded to the window.

---
<!-- 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 #15332

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

I'm new to both Servo and Rust — so any suggestions for improvement are very welcome.

<!-- 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/15359)
<!-- Reviewable:end -->
2017-02-03 13:10:50 -08:00
Arseniy Ivanov
72ec00e0b5 Refactor some window_from_node calls based on feedback 2017-02-03 14:57:08 -05:00
bors-servo
fa60ce62b8 Auto merge of #15303 - nox:open-your-heart-to-eternal-dimension, r=jdm
Implement document.open and document.close

<!-- 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/15303)
<!-- Reviewable:end -->
2017-02-03 10:53:46 -08:00
Arseniy Ivanov
1bd1bddacf Extend window presence checks to non-native event handlers 2017-02-03 13:23:36 -05:00
Arseniy Ivanov
d23b34e243 Check for the presence of a window when working with event handlers forwarded to the window 2017-02-03 13:23:34 -05:00