Commit graph

1081 commits

Author SHA1 Message Date
bors-servo
0ec4ea4ee1 Auto merge of #12910 - creativcoder:swsender, r=jdm
Implement postMessage for ServiceWorkers

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

Fixes #12773
r? @jdm

Changes:
* Implements `postMessage` on `ServiceWorker` object.
* Removes unused channels from sw and their scopes.
* Fixes a crash when calling `scope.script_chan()` in sw-scopes event handling.

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

<!-- Either: -->
- [X] There are tests for these changes at `tests/html/service-worker`

<!-- 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/12910)
<!-- Reviewable:end -->
2016-09-15 08:34:22 -05:00
Rahul Sharma
314dedb96f make structured clone an enum 2016-09-15 11:32:55 +05:30
Aneesh Agrawal
56fbfd46a4 Excise SubpageId and use only PipelineIds
SubpageId was originally introduced in 2013 to help iframes keep track of
their associated (children) pipelines. However, since each pipeline
already has a PipelineId, and those are unique, those are sufficient
to keep track of children.
2016-09-13 15:37:38 -04:00
Aneesh Agrawal
9d097e7d15 Use fn pipeline_id consistently, not fn pipeline
Consistently use the name 'pipeline_id' to refer to a function that
returns an (optional) PipelineId.

This was prompted by discovering both fn pipeline and fn pipeline_id
doing the same job in htmliframeelement.rs.

Note that there is fn pipeline in components/compositing/compositor.rs,
but that actually returns an Option<&CompositionPipeline>, not any kind
of PipelineId.
2016-09-13 15:17:40 -04:00
bors-servo
67bfd0df4b Auto merge of #13130 - samuknet:dblclick, r=nox
'dblclick' event

<!-- Please describe your changes on the following line: -->
* Add field to document struct to store information about last 'click' event
* Add code to `handle_mouse_event` function to detect and fire double click events

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

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X ] These changes do not require tests because it is input related

<!-- 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/13130)
<!-- Reviewable:end -->
2016-09-10 08:46:13 -05:00
bors-servo
84f3cf22bf Auto merge of #13185 - nox:namespaces, r=jdm,Ms2ger
Make console a namespace (fixes #13010)

<!-- 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/13185)
<!-- Reviewable:end -->
2016-09-10 07:33:25 -05:00
bors-servo
1b3c7ed0ee Auto merge of #13201 - KiChjang:codegen-typedefs, r=nox
Properly generate typedef identities in unions

Fixes #10605.

<!-- 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/13201)
<!-- Reviewable:end -->
2016-09-09 18:45:56 -05:00
Ms2ger
60142f87e2 Implement error reporting for workers.
Fixes #3311.
Fixes #13158.
2016-09-09 09:03:09 +02:00
UK992
93a103ba73 Reorder use statements 2016-09-09 04:55:19 +02:00
bors-servo
5a5a76cc5d Auto merge of #13058 - malisas:malisa-responseAPI, r=Manishearth,jdm
Response API

<!-- Please describe your changes on the following line: -->
This PR adds the [dom::Response](https://fetch.spec.whatwg.org/#response-class) implementation and addresses #11896.

The relevant passing tests` expectations have been updated.

In order to allow non-UTF-8-encoded status messages, `net_traits::response::Response`'s `raw_status` field has been changed from type [`Option<RawStatus>`](https://doc.servo.org/hyper/http/struct.RawStatus.html) to type `Option<(u16, Vec<u8>)>`. As a result, a few other files which rely on the `raw_status` field were affected and updated.

TODOs:
- The `body` and `trailer` methods. Relies on implementation of `ReadableStream` and `Promise`s.
- Similarly, replace the dummy constructor `_body: Option<USVString>` argument with `body: ResponseBodyInit`.
- Currently, whenever `r's response's header list` or `r's Headers object` are mentioned, I always modify the `headers_reflector` field (of type dom::Headers, or `r's Headers object`) and not the corresponding hyper::Headers list in the net_traits::Response field. A completely accurate interpretation of the spec might consider making both of these lists the same thing via a reference. [Discussion](https://github.com/whatwg/fetch/issues/358) was [had](https://github.com/servo/servo/pull/12884).

---
<!-- 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/13058)
<!-- Reviewable:end -->
2016-09-08 18:58:05 -05:00
Anthony Ramine
0b689a8a31 Implement WebIDL namespaces 2016-09-08 11:01:34 +02:00
Keith Yeung
3976d974fc Properly generate typedef identities in unions 2016-09-07 21:48:46 -07:00
Anthony Ramine
8ba0cf30a1 Fix descriptor argument in CGCallGenerator.__init__
It's a descriptor, not a descriptor provider.
2016-09-07 15:48:22 +02:00
Anthony Ramine
7a942b1742 Store Console timers in globals 2016-09-07 15:48:22 +02:00
Anthony Ramine
20b131af17 Implement Borrow<str> for DOMString
Useful to use DOMString as a HashMap key type.
2016-09-07 15:47:36 +02:00
Josh Matthews
61fcc72d35 Implement Reflectable for GlobalRef. 2016-09-07 10:52:44 +02:00
Sam Wood
b6f2a4f159 Working implementation of dblclick.
Signed-off-by: Sam Wood <sam@sam.uk.net>

Fix mach test tidy

Signed-off-by: Sam Wood <sam@sam.uk.net>

Fix import newline

Signed-off-by: Sam Wood <sam@sam.uk.net>
2016-09-07 09:51:48 +01:00
Josh Matthews
8653450b6e Extract mutability out of Reflectable trait. 2016-09-07 10:40:13 +02:00
Rahul Sharma
9dcb7348a2 store senders instead of buffering messages 2016-09-07 12:07:36 +05:30
Rahul Sharma
0996b38ade Make service workers talk to their serviceworkerglobalscopes 2016-09-07 12:07:36 +05:30
Malisa Smith
faf32a7cfb dom::Response implementation 2016-09-06 19:58:32 -07:00
bors-servo
3631e314b9 Auto merge of #13174 - servo:error-workers, r=nox
Prepare for error reporting in workers.

<!-- 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/13174)
<!-- Reviewable:end -->
2016-09-06 12:35:39 -05:00
bors-servo
628c644fee Auto merge of #13183 - nox:cleanup-interface, r=Ms2ger
Clean up stuff in bindings::interface

<!-- 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/13183)
<!-- Reviewable:end -->
2016-09-06 08:48:15 -05:00
Ms2ger
00559f18b1 Add missing IsCallable checks. 2016-09-06 13:59:44 +02:00
Anthony Ramine
a60634b998 Fix case of InterfaceObjectClass in codegen 2016-09-06 13:31:25 +02:00
Anthony Ramine
718d733cc8 Reorder some stuff in bindings::interface 2016-09-06 13:31:24 +02:00
Anthony Ramine
86996fdf83 Remove NonNullJSNative 2016-09-06 10:14:11 +02:00
Anthony Ramine
51e46b11a3 Move WebIDL constants machinery to bindings::constant 2016-09-06 10:14:11 +02:00
Anthony Ramine
109a297309 Simplify InterfaceConstructorBehavior 2016-09-06 10:13:55 +02:00
Ms2ger
b3050855e7 Implement report_an_error on GlobalRef. 2016-09-05 17:14:28 +02:00
Ms2ger
5ae29b02b6 Stop using mem::transmute_copy. 2016-09-05 09:54:40 +02:00
Ms2ger
137845d47b Panic when stringifying an primitive fails.
This should not happen.
2016-09-02 11:44:46 +02:00
Ms2ger
ae38c53de7 Dispatch error events at the window object. 2016-09-02 11:44:44 +02:00
bors-servo
bbfe38e35f Auto merge of #13134 - servo:archery, r=emilio
Add lots of Arc’s in style, and prepare for using DOMRefCell

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

`DOMRefCell` usage is not there year because of thread-safety questions, but I have this much already that I’d like to land before it bitrots.

r? @emilio

---
<!-- 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
- [x] These changes do not require new tests because refactor

<!-- 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/13134)
<!-- Reviewable:end -->
2016-08-31 16:30:56 -05:00
Simon Sapin
c87180a2fb Move DOMRefCell to style. 2016-08-31 02:34:05 +02:00
Simon Sapin
ec723057b2 Make DOMRefCell use style’s copy of RefCell 2016-08-31 02:34:04 +02:00
Anthony Ramine
7dfb336be8 Use Option<T> to return from getters
This removes the cumbersome &mut bool argument and offers overall
a more readable code.
2016-08-30 19:07:19 +02:00
Anthony Ramine
6e1523f4ae Compile WebIDL return type "object" to NonZero<*mut JSObject> 2016-08-30 19:07:13 +02:00
Alan Jeffrey
6a271b0527 Remove mutex from Trusted
Use weak references rather than message passing to
garbage-collect dead references.
2016-08-29 11:56:28 +02:00
bors-servo
1fd2577e51 Auto merge of #13070 - tp6vup54:master, r=KiChjang
Convert imports in generate_imports into one per line, so that it can…

<!-- Please describe your changes on the following line: -->
Convert imports in generate_imports into one per line, so that it can easily add new ones with alphabetical order.

---
<!-- 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 #13036 (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. -->

… easily add new ones with alphabetical 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/13070)
<!-- Reviewable:end -->
2016-08-27 07:27:50 -05:00
bors-servo
0be94bb7cc Auto merge of #13057 - servo:rpe-ac, r=nox
Remove the JSAutoCompartment from report_pending_exception.

<!-- 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/13057)
<!-- Reviewable:end -->
2016-08-27 06:32:12 -05:00
tp6vup54
59dcb31491 Convert imports in generate_imports into one per line, so that it can easily add new ones with alphabetical order. 2016-08-27 14:45:47 +08:00
Tetsuharu OHZEKI
0277cf9174 Make DOMJSClass use JSClass instead of Class (fixes #13031) 2016-08-26 22:31:09 +02:00
Ms2ger
5662f0d346 Remove the JSAutoCompartment from report_pending_exception.
It doesn't really belong there.
2016-08-26 17:59:31 +02:00
bors-servo
2ad6a7e612 Auto merge of #13044 - nox:webidl, r=Ms2ger
Update the WebIDL parser

<!-- 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/13044)
<!-- Reviewable:end -->
2016-08-26 05:26:19 -05:00
Anthony Ramine
dccf771e25 Implement [Replaceable] (fixes #13033) 2016-08-26 10:37:59 +02:00
Anthony Ramine
60f0f8eaa5 Update the WebIDL parser 2016-08-26 00:56:08 +02:00
Anthony Ramine
7ac2464302 Restore abstract.patch which was mistakenly removed 2016-08-26 00:55:47 +02:00
Anthony Ramine
a4f96761b2 Hoist 7fd65affab as its own patch 2016-08-26 00:55:29 +02:00
Anthony Ramine
6c1167b1e2 Pass the receiver to get_property_on_prototype (fixes #11600) 2016-08-25 15:48:07 +02:00