Commit graph

4580 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
0b67b218d0
style: Add a new Timer structure to the shared style context, and basic infrastructure for controlling animations. 2016-07-20 09:05:53 -07: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
bors-servo
2d01d41a50 Auto merge of #12515 - servo:concrete-style, r=bholley
Make the style crate more concrete

Background:

The changes to Servo code to support Stylo began in the `selectors` crate with making pseudo-elements generic, defined be the user, so that different users (such as Servo and Gecko/Stylo) could have a different set of pseudo-elements supported and parsed. Adding a trait makes sense there since `selectors` is in its own repository and has others users (or at least [one](https://github.com/SimonSapin/kuchiki)).

Then we kind of kept going with the same pattern and added a bunch of traits in the `style` crate to make everything generic, allowing Servo and Gecko/Stylo to do things differently. But we’ve also added a `gecko` Cargo feature to do conditional compilation, at first to enable or disable some CSS properties and values in the Mako templates. Since we’re doing conditional compilation anyway, it’s often easier and simpler to do it more (with `#[cfg(feature = "gecko")]` and `#[cfg(feature = "servo")]`) that to keep adding traits and making everything generic. When a type is generic, any method that we want to call on it needs to be part of some trait.

----

The first several commits move some code around, mostly from `geckolib` to `style` (with `#[cfg(feature = "gecko")]`) but otherwise don’t change much.

The following commits remove some traits and many type parameters through the `style` crate, replacing them with pairs of conditionally-compiled API-compatible items (types, methods, …).

Simplifying code is nice to make it more maintainable, but this is motivated by another change described in https://github.com/servo/servo/pull/12391#issuecomment-232183942. (Porting Servo for that change proved difficult because some code in the `style` crate was becoming generic over `String` vs `Atom`, and this PR will help make that concrete. That change, in turn, is motivated by removing geckolib’s `[replace]` override for string-cache, in order to enable using a single Cargo "workspace" in this repository.)

r? @bholley

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

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require new tests because refactoring

<!-- 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/12515)
<!-- Reviewable:end -->
2016-07-20 02:58:34 -05:00
Simon Sapin
6d0e48f6cc Remove some type aliases that are now just re-exports. 2016-07-20 08:42:47 +02:00
Simon Sapin
789807b7b0 Remove the ComputedValue traits and style_struct_traits 2016-07-20 08:42:40 +02:00
bors-servo
86ed7bfc09 Auto merge of #12500 - Ms2ger:DOMString, r=nox
Expand the documentation for DOMString.

There was some confusion on IRC about its purpose; hopefully this will clarify the situation.

<!-- 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/12500)
<!-- Reviewable:end -->
2016-07-20 01:41:55 -05:00
bors-servo
efa5a0329a Auto merge of #12457 - johannhof:worker-global, r=Ms2ger
Expose Worker interfaces only to Worker

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

Partial #12415. Let me know if you suspect some other tests may be affected by this.

r? @Ms2ger

---
<!-- 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] There (sorta) 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/12457)
<!-- Reviewable:end -->
2016-07-19 04:40:41 -07:00
Johann Hofmann
bad529a0f7
Expose Worker interfaces only to Worker
See #12415.
2016-07-19 12:43:16 +02:00
Ms2ger
94fabbc366 Expand the documentation for DOMString.
There was some confusion on IRC about its purpose; hopefully this will clarify
the situation.
2016-07-19 09:57:51 +02:00
Kuba Birecki
fcabcccd9a Implement Runnable trait name method for PauseIfNotInDocumentTask 2016-07-18 21:13:59 +02:00
bors-servo
513811f6b4 Auto merge of #11727 - creativcoder:swmanager, r=jdm
Integrate service worker manager thread

<!-- 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 are part of #11091

<!-- Either: -->
- [X] There are tests for these changes at my [gh-pages](https://github.com/creativcoder/gsoc16/tree/gh-pages) branch to test  the instantiation of service workers by their manager, but will need to discuss how that would integrate into master.

Changes:
- Introduces a `ServiceWorkerManager`, which maintains an map of registered service workers as well as a map of active workers keyed by their `scope_url`.
- Adds the initialization of ServiceWorkerManager, at the `script::init()`, which makes it available as a single entity listening for requests from different script threads.
- Adds a timeout thread in `serviceworkerglobalscope`, which terminates the workers, after a timeout of 60 secs, thereby removing it from the active workers list.
- Adds the matching of scope urls, in longest prefix way rather than path structural way, according to [spec](https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#scope-match-algorithm).
- Make ServiceWorkerManager, the holder of network sender, instead of script thread, so it can send `CustomResponse`.

<!-- 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/11727)
<!-- Reviewable:end -->
2016-07-18 09:50:59 -07: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
bors-servo
fa432a5a34 Auto merge of #12400 - izgzhen:fix-type-string, r=Manishearth
Fix Blob type-string

Use a final construction guard over type-string format; and other minor related cleanups

r? @Manishearth
<!-- 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: -->
- [ ] 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/12400)
<!-- Reviewable:end -->
2016-07-18 07:19:49 -07:00
Rahul Sharma
eff3e01df0 make resource_thread talk to sw-manager 2016-07-18 19:06:48 +05:30
Shing Lyu
f754cacbd5 Only restyle viewport-relative nodes on viewport size change 2016-07-18 11:01:42 +08:00
Rahul Sharma
1e6293ea1d Integrate service worker manager thread 2016-07-16 23:29:44 +05:30
Ms2ger
b65240d730 Stop destructuring load in HTMLScriptElement::execute(). 2016-07-16 12:33:52 +02:00
Ms2ger
91b9bcd125 Turn ScriptOrigin into a struct. 2016-07-16 12:24:36 +02:00
Ms2ger
a13318fb2c Convert script source to DOMString earlier. 2016-07-16 12:24:35 +02:00
Ms2ger
4896200467 Pull HTMLScriptElement::load inside-out. 2016-07-16 12:24:34 +02:00
Ms2ger
180569f65f Update step numbers in HTMLScriptElement::execute(). 2016-07-16 12:24:32 +02:00
bors-servo
73ad0b928d Auto merge of #12451 - jdm:generate-dom-apis, r=Ms2ger
Generate a list of supported DOM APIs from parsed WebIDLs.

Supplement the existing list of supported CSS properties with an equivalent list of DOM APIs.

---
<!-- 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 do not require tests because automatic generated documentation

<!-- 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/12451)
<!-- Reviewable:end -->
2016-07-15 15:13:22 -07:00
Josh Matthews
3c2435a172 Generate a list of supported DOM APIs from parsed WebIDLs. 2016-07-15 18:13:09 -04:00
bors-servo
b382cc2103 Auto merge of #12441 - aravind-pg:referrer-pol-header, r=jdm
Implement referrer policy delivery by header

Adds a new `Option<ReferrerPolicy>` field to Document and sets it appropriately in `ScriptThread::load` if a Referrer-Policy header is present.

r? @jdm

<!-- 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 #11860
- [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/12441)
<!-- Reviewable:end -->
2016-07-15 11:25:43 -07:00
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
Alan Jeffrey
d1e5bafef0 Replace any errors caused by content-provided URLs by warnings. 2016-07-15 09:50:40 -05:00
Zhen Zhang
fdc3a8e3ac Put Blob URL online 2016-07-15 20:33:51 +08: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
bors-servo
48a912f57e Auto merge of #12448 - jdm:file-reading-task-source-2, r=KiChjang
Implement file reading task source

Implement the task source API for the File Reader task source, enabling using task sources from non-main threads.

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix (partially) #7959 (github issue number if applicable).
- [X] These changes do not require tests because they're refactoring existing code

<!-- 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/12448)
<!-- Reviewable:end -->
2016-07-14 10:55:17 -07: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
Josh Matthews
0e4865ea1a Allow wrapping worker runnables in cancellable runnables. 2016-07-14 13:27:38 -04:00
Alan Jeffrey
62e95c5a61 All our Cargo.toml files should contain an MPL-2.0 license field. 2016-07-14 10:26:34 -05:00
bors-servo
86b2104f11 Auto merge of #12444 - servo:fetch-script, r=jdm
Improve the readability of the script fetching code.

<!-- 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/12444)
<!-- Reviewable:end -->
2016-07-14 06:39:37 -07:00
bors-servo
2cab846140 Auto merge of #12445 - szeged:pub-remove, r=jdm
Remove some unnecessary pub modifiers (#50)

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

Removed unnecessary pub modifiers from DOM class functions get_instance_id.

<!-- 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 do not require tests, because there are no WebBluetooth test API implementation 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/12445)
<!-- Reviewable:end -->
2016-07-14 05:09:26 -07:00
Ms2ger
f696f311dc Remove TODO comment in ScriptContext::response_complete().
We already do what it suggests.
2016-07-14 14:07:43 +02:00
Ms2ger
7489f82a9b Handle script encoding more in line with the specification. 2016-07-14 13:56:21 +02:00
Ms2ger
20a8c97cf0 Extract some code into a new fetch_a_classic_script function. 2016-07-14 13:40:03 +02:00
Ms2ger
1feeff2972 Update step numbers in HTMLScriptElement::prepare(). 2016-07-14 13:34:19 +02:00
Ms2ger
f45b8bc53e Remove an unnecessary variable from HTMLScriptElement::prepare(). 2016-07-14 13:16:42 +02:00
zakorgy
aaf21dab4f Remove some unnecessary pub modifiers (#50) 2016-07-14 10:35:06 +02:00
Kuba Birecki
85f4da18a6 Inline DOM element creation into box expressions in components/script/dom/ 2016-07-14 08:44:22 +02:00
bors-servo
3011d4b450 Auto merge of #12404 - ConnorGBrewster:task_source_cleanup, r=asajeffrey
Clean up task sources and make all tasks cancellable

<!-- Please describe your changes on the following line: -->
This makes it so each task is a thin wrapper over a runnable and whenever a task is queued, it is automatically wrapped by the window's `runnable_wrapper`.

---
<!-- 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  #11703 (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/12404)
<!-- Reviewable:end -->
2016-07-13 10:18:15 -07: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
Zhen Zhang
8985f37fa7 Fix Blob type-string 2016-07-13 22:21:21 +08:00
bors-servo
902e6322e0 Auto merge of #12419 - GuillaumeGomez:try_from, r=Ms2ger
Replace AdjacentPosition::parse by TryFrom

Fixes #12387.

<!-- 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/12419)
<!-- Reviewable:end -->
2016-07-13 00:57:35 -07:00