Commit graph

178 commits

Author SHA1 Message Date
Anthony Ramine
dd5c527689 Replace ScriptHelpers by GlobalRef methods 2016-10-03 11:42:21 +02:00
Josh Matthews
57b3ccd38c Support promises in workers. 2016-09-22 16:16:55 -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
Connor Brewster
e9b2f1b916 Replace current session entry for reloads 2016-09-19 14:23:03 -05:00
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
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
b9b25b6f82 Consistently use parent_pipeline_id
Instead of containing_pipeline_id, use parent_pipeline_id because it is
more clear that it refers to the immediate parent.
2016-09-13 15:24:13 -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
UK992
93a103ba73 Reorder use statements 2016-09-09 04:55:19 +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
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
Ashwin R
41accc283d fixed calling unwrap on an Err value 2016-08-27 07:37:12 +05:30
Josh Matthews
2ad293ca64 Pass real values to the proxy handler setup. 2016-08-25 00:11:38 -04:00
bors-servo
3c4a08c016 Auto merge of #12954 - GuillaumeGomez:dictionary_error, r=nox
Update rust-mozjs

<!-- 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/12954)
<!-- Reviewable:end -->
2016-08-24 06:19:37 -05:00
Guillaume Gomez
2f3f4a5bd6 Update rust-mozjs dependency 2016-08-24 12:56:49 +02:00
Ms2ger
307d1ced3c Move thread_state to style. 2016-08-22 16:08:56 +02:00
Anthony Ramine
7ad51dcd7a Update serde to 0.8 (fixes #12659) 2016-08-12 18:37:27 +02:00
Steve Melia
04f5369577 Issue 7720: Add target selector and update when scrolling to fragment 2016-08-03 13:23:10 +01:00
bors-servo
944d371b8f Auto merge of #12563 - emilio:stylo, r=bholley,jdm,pcwalton
stylo: Improve restyling performance

This commit adds hooks to the Servo style traversal to avoid traversing all the
DOM for every restyle. Additionally it changes the behavior of the dirty flag to
be propagated top down, to prevent extra overhead when an element is dirtied.

This commit doesn't aim to change the behavior on Servo just yet, since Servo does extra job when dirtying the node related with DOM revision counters that might be necessary.

CC @asajeffrey for the DOM revision counters stuff. When a node is dirty, do all its descendants really need to increment the revision counter, or is this an unintended effect? My intuition is that this is hurting performance quite a lot for servo.

r? @bholley

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

<!-- Either: -->
- [x] These changes do not require tests because no geckolib tests yet.

<!-- 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/12563)
<!-- Reviewable:end -->
2016-07-27 17:56:26 -05:00
bors-servo
a94b92f8c4 Auto merge of #11791 - craftytrickster:11712/pipeline-lookup, r=asajeffrey
Pipeline lookup in webdriver

Fixes #11712

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

Removed a method that seemed to duplicate already existing functionality, and returned BrowsingContextErrors in the web_handler file where panics were previously occurring.

I am not sure if I like all the unwrapping that occurs in the script thread, but the current methods are not set up to return Option/Result.

Also, should line the method on line 37 `find_node_by_unique_id` of components/script/webdriver_handlers.rs return None if the context is not found like I have it currently? Or should it return a `Result<Option...>` instead?

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

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because I simply removed a method that duplicated already existing functionality. On the other part, I added better error sending instead of forcing a panic, which does not require testing to my knowledge.

<!-- 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="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11791)
<!-- Reviewable:end -->
2016-07-26 00:44:28 -05:00
David Raifaizen
2475dc1d21 Removed some sources of panic from script thread and devtools, using Option values instead to indicate when a pipeline context is missing where appropriate. Additionally, removed erroneous method get_browsing_context. 2016-07-25 22:28:04 -04:00
Emilio Cobos Álvarez
e6958d3947
script: Fix a few load related bugs.
This is what was making me hit the new test failures. So turns out that when the
DOMContentLoaded event is fired we fired no messages to the constellation, but
we fired the DOMLoad message from the DocumentProgressHandler, effectively after
having dispatched the Load message from script thread.

This also fixes the possibility of a subframe navigation not blocking the load
event of the parent document, for example.
2016-07-25 10:51:52 -07:00
Dirkjan Ochtman
e182d29441 Hoist retrieval of layout_threads from opts into Constellation 2016-07-24 21:45:31 +02:00
Alan Jeffrey
c889900cff Removed panic channel, replaced by integrated logging and issue reporting. 2016-07-20 21:56:43 -05:00
Emilio Cobos Álvarez
2e68821014
script: Implement Debug on ConstellationControlMsg to simplify script_thread.rs 2016-07-20 09:03:56 -07:00
bors-servo
b6c0ed9a44 Auto merge of #12426 - asajeffrey:mozbrowser-event-targets, r=SimonSapin
Allow window elements as well as iframes to the the target of mozbrowser events

<!-- Please describe your changes on the following line: -->
Allow mozbrowser events, in particular mozbrowsererror events, to target a window. Needed for https://github.com/browserhtml/browserhtml/issues/1182

---
<!-- 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 #12420
- [X] These changes do not require tests because we're not testing our issue reporting system, which this is intended for.

<!-- 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/12426)
<!-- Reviewable:end -->
2016-07-20 04:41:34 -05:00
Alan Jeffrey
72aa4f2f62 Allow window elements as well as iframes to the the target of mozbrowser events. 2016-07-18 11:23:03 -05:00
Rahul Sharma
1e6293ea1d Integrate service worker manager thread 2016-07-16 23:29:44 +05:30
Aravind Gollakota
bfda32ea00 msg: Rename ReferrerPolicy::NoRefWhenDowngrade NoReferrerWhenDowngrade
This is more consistent with the other variants.
2016-07-15 08:13:57 -07:00
Aravind Gollakota
1a242d8a50 script: Obtain referrer policy from header 2016-07-15 08:12:24 -07:00
bors-servo
4b78b9adab Auto merge of #12416 - canaltinova:referrer, r=jdm
Implement Document.referrer

<!-- 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 #12389 (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/12416)
<!-- Reviewable:end -->
2016-07-14 11:55:44 -07:00
Nazım Can Altınova
d6c1f7b5e3 Implement Document.referrer 2016-07-14 21:35:39 +03:00
Keith Yeung
aa5f34fcd9 Implement file reading task source
And remove superfluous FileReaderEvent enum
2016-07-14 13:27:42 -04:00
Josh Matthews
2aef518ce6 Make task queue API usable from non-main threads. 2016-07-14 13:27:41 -04:00
Connor Brewster
ad30275d04 Move boxing to runnable initialization 2016-07-13 11:10:23 -06:00
Connor Brewster
5f7324a9a5 Make all task source runnables cancellable
Implement all Runnable methods on CancellableRunnable to redirect to their inner runnable
2016-07-13 09:59:51 -06:00
Connor Brewster
afc0ccb48d Add event runnables
Make tasks a wrapper over runnables
2016-07-11 22:21:45 -06:00
Connor Brewster
55267560ca Change ignore async events ordering to SeqCst 2016-07-08 09:02:16 -06:00
Connor Brewster
315ffe7677 Make network listener runnable cancellable 2016-07-08 09:00:59 -06:00
Connor Brewster
54cf3afe30 Add name method to Runnable trait 2016-07-06 11:23:56 -06:00
Connor Brewster
d6f4dc06df Combined DOMManipulationTask runnable variants into a single variant 2016-07-06 10:46:56 -06:00
Josh Matthews
6496d73210 Make textinput handle actual key values. Don't restrict character values to a single byte. 2016-07-06 00:10:24 -04:00
Josh Matthews
04ce86c08c Associate logical and physical keypresses together to support non-QWERTY keyboards. 2016-07-05 18:06:42 -04:00
Ms2ger
77caf83098 Move webdriver_msg to script_traits. 2016-07-05 09:02:46 +02:00
Ms2ger
b8fe9e9637 Move WindowSizeData to script_traits. 2016-07-05 09:02:43 +02:00
Eduard Burtescu
0db1faf876 Switch to using the new rooted!/RootedGuard API for rooting. 2016-07-04 20:59:01 +03:00
Emilio Cobos Álvarez
c16c5acade
style: Rewrite the animation representation to allow having state in layout
I have to make the appropriate changes in layout, but I'm running out of battery
in the bus.
2016-06-28 15:09:53 +00:00
Dan Robertson
246723114f
Use common cookie struct add cookie webdriver cmds
One cookie struct to rule them all. One struct to represent them.
One cookie struct to bind them all, and through the IPC carry them.
2016-06-25 22:24:35 +00:00
Alan Jeffrey
9da00e20f2 Removed some sources of panic from script thread. 2016-06-24 08:17:14 -05:00