Commit graph

5741 commits

Author SHA1 Message Date
Anthony Ramine
f58207b851 Introduce MainThreadScriptMsg::RegisterPaintWorklet
This avoids the need for a generic task to send messages to the layout thread
through the main script thread.
2017-09-17 10:19:59 +02:00
Anthony Ramine
95dc54d216 Use normal tasks to reject and resolve promises 2017-09-17 01:34:07 +02:00
Anthony Ramine
4a39631eaf Remove FileReadingRunnable 2017-09-16 15:43:31 +02:00
Anthony Ramine
56117d3185 Rename Runnable to Task
The changes are:
 * `*Runnable` -> `*Task`;
 * `RunnableMsg` -> `Task`;
 * `RunnableWrapper` -> `TaskCanceller`;
 * `MainThreadRunnable` -> `MainThreadTask`;
 * `wrap_runnable` -> `wrap_task`;
 * `get_runnable_wrapper` -> `task_canceller`;
 * `handler` -> `run`;
 * `main_thread_handler` -> `run_with_script_thread`.
2017-09-16 15:43:26 +02:00
Anthony Ramine
52a6f63608 Introduce MainThreadScriptMsg::MainThreadRunnable
This will allow us to separate the types for tasks that must run on the main
script thread and regular tasks.
2017-09-16 15:10:07 +02:00
Anthony Ramine
69275162b0 Clean up Storage::queue_storage_event
This moves the Runnable type directly in the method and makes it not use
main_thread_handler, which is unneeded here anyway.
2017-09-16 03:47:14 +02:00
bors-servo
7cc0af37cf Auto merge of #18512 - tromey:preserve-style-sheet-source-url, r=SimonSapin
Preserve sourceURL comment on style sheets

In addition to the sourceMappingURL comment, there is a second special
comment, "sourceURL", that can be used to set the "display name" of a
style sheet for developer tools.  This name is also used as the base
URL for the source-map URL resolution algorithm.  sourceURL is
described here:
https://blog.getfirebug.com/2009/08/11/give-your-eval-a-name-with-sourceurl/
The devtools feature bug is here:
https://bugzilla.mozilla.org/show_bug.cgi?id=880831

This patch changes servo to preserve and expose this value for use in M-C.

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

<!-- 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/18512)
<!-- Reviewable:end -->
2017-09-15 08:07:49 -05:00
bors-servo
1b9a5ea719 Auto merge of #18504 - servo:media, r=emilio
Some minor HTMLMediaElement improvements

<!-- 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/18504)
<!-- Reviewable:end -->
2017-09-14 20:51:51 -05:00
bors-servo
4268037424 Auto merge of #18503 - servo:globalism, r=emilio
Simplify WorkerGlobalScope::process_event

<!-- 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/18503)
<!-- Reviewable:end -->
2017-09-14 18:17:55 -05:00
Tom Tromey
c48226ff6f Preserve sourceURL comment on style sheets
In addition to the sourceMappingURL comment, there is a second special
comment, "sourceURL", that can be used to set the "display name" of a
style sheet for developer tools.  This name is also used as the base
URL for the source-map URL resolution algorithm.  sourceURL is
described here:
https://blog.getfirebug.com/2009/08/11/give-your-eval-a-name-with-sourceurl/
The devtools feature bug is here:
https://bugzilla.mozilla.org/show_bug.cgi?id=880831

This patch changes servo to preserve and expose this value for use in M-C.
2017-09-14 12:39:18 -06:00
Emilio Cobos Álvarez
0a9309aa96
style: Unify how servo and Gecko handle UA sheets. 2017-09-14 20:33:43 +02:00
Anthony Ramine
518e34e7c8 Use an enum for the ready state of media elements 2017-09-14 15:30:20 +02:00
Anthony Ramine
86b25cd6b5 Use an enum for the network state of media elements 2017-09-14 14:23:06 +02:00
Anthony Ramine
87bb5ba381 Fix some HTMLMediaElement spec links 2017-09-14 13:52:25 +02:00
Anthony Ramine
35d86afcc8 Simplify WorkerGlobalScope::process_event
This method does not need to dispatch to interfaces derived from
WorkerGlobalScope, given they end up doing exactly the same thing
in all workers.
2017-09-14 13:37:33 +02:00
bors-servo
bb2030a493 Auto merge of #18494 - frewsxcv:frewsxcv-size-hint, r=jdm
Implement `size_hint` for more iterators.

```
implement size hint for
more iterators because why
not we like fast things
```

<!-- 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/18494)
<!-- Reviewable:end -->
2017-09-13 19:38:32 -05:00
Corey Farwell
9cd4535364 Implement size_hint for more iterators.
```
implement size hint for
more iterators because why
not we like fast things
```
2017-09-13 20:29:27 -04:00
bors-servo
d461347adf Auto merge of #18484 - emilio:per-origin-sheets, r=SimonSapin
style: Store stylesheets per origin

This is the first step that will allow us to cache UA sheets across documents.

<!-- 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/18484)
<!-- Reviewable:end -->
2017-09-13 14:59:16 -05:00
Emilio Cobos Álvarez
82c58d0a05
script: Fix stylesheet adoption. 2017-09-13 17:11:24 +02:00
Emilio Cobos Álvarez
02d1264047
style: Store stylesheets per origin.
This will allow us to cache UA sheets across documents.

MozReview-Commit-ID: 5rYIKTmC6iw
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2017-09-13 16:01:35 +02:00
Anthony Ramine
24cf15a014 Store microtask queues in their global (fixes #18467) 2017-09-13 15:02:45 +02:00
Anthony Ramine
7481ce177f Store a Rc<MicrotaskQueue> directly on Window 2017-09-13 14:27:45 +02:00
Anthony Ramine
7f9f95b7ce Store microtask queues in Rc<T> 2017-09-13 14:27:42 +02:00
Anthony Ramine
65dfd6bf63 Clean up DissimilarOriginWindow::origin
It's not dead code, and it should use Castable instead of directly reaching
to the globascope field.
2017-09-13 14:27:36 +02:00
Anthony Ramine
1c46135c75 Reformat DissimilarOriginWindow::new 2017-09-13 10:53:05 +02:00
Anthony Ramine
b8ae82ffb8 Reformat GlobalScope::new_inherited 2017-09-13 10:53:03 +02:00
Anthony Ramine
3764217ca6 Reformat WorkerGlobalScope::new_inherited 2017-09-13 10:53:01 +02:00
Anthony Ramine
71df1d5d9b Reformat WorkletGlobalScope::new_inherited 2017-09-13 10:53:00 +02:00
Anthony Ramine
0822a74f94 Reformat Window::new 2017-09-13 10:50:09 +02:00
bors-servo
e7f45028dc Auto merge of #18431 - mbrubeck:pdb-size, r=SimonSapin
Use SmallBitVec to optimize size of PropertyDeclarationBlock

https://bugzilla.mozilla.org/show_bug.cgi?id=1398322

<!-- 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/18431)
<!-- Reviewable:end -->
2017-09-11 08:57:07 -05:00
Matt Brubeck
a5a0e9ffe8 Use SmallBitVec for important flags in PDB 2017-09-11 06:53:05 -07:00
bors-servo
6a09b1d21a Auto merge of #18372 - tigercosmos:userTimingApi, r=ferjm
TEST: fix and add case of po-observe.any.js

<!-- Please describe your changes on the following line: -->
1. implementing step 3 from the [`PerformanceObserver.observe()`](https://w3c.github.io/performance-timeline/#dom-performanceobserver-observe()) method spec properly.
2. also add cases about step 1 & 2

work on the top of #18283

 r? @ferjm
---
<!-- 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 #18285 (github issue number if applicable).

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

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- 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/18372)
<!-- Reviewable:end -->
2017-09-11 05:26:46 -05:00
bors-servo
40c8a6389a Auto merge of #17083 - danielj41:javascript-url-global-3, r=jdm
"javascript:" urls: execute in correct global scope

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

#### Summary

This pull request makes `javascript:` urls execute in the correct global scope.

#### Example

```html
<script> var x = 4; </script>

<!-- this branch: logs "4" -->
<!-- master: undefined variable error -->
<a href="javascript:console.log(x)">link</a>
```

#### Questions

I'm new to servo and rust, so I'm unsure about these changes. In particular:
  * What's the appropriate place to evaluate the js?
    * I moved it to `handle_navigate`, but I'm not sure if this will catch all occurrences of `javascript:` urls. I also don't know if this will execute in the correct thread and the correct window.
  * What should I do with the result of the js evaluation?
    * I just ignored it. The previous behavior displayed it as the content of a new page load.

---
<!-- 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 #15147, #16718

<!-- Either: -->
- [x] There are tests for these changes

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- 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/17083)
<!-- Reviewable:end -->
2017-09-09 04:39:43 -05:00
tigercosmos
3877e9162f fix observer comparing and test 2017-09-09 03:00:42 +08:00
bors-servo
867d542261 Auto merge of #18370 - pylbrecht:observer, r=ferjm
An observer disconnected after a mark must receive the mark

<!-- Please describe your changes on the following line: -->
I worked on top of #18283 as suggested [here](https://github.com/servo/servo/issues/18284#issuecomment-326043873).

r? @ferjm

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

<!-- Either: -->
- [X] There are tests for these changes

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- 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/18370)
<!-- Reviewable:end -->
2017-09-08 13:04:26 -05:00
bors-servo
fef2cfde8c Auto merge of #18341 - ferjm:bug1384225.media.errors, r=jdm
stylo: Error reporting for unknown media features

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix [bug 1384225](https://bugzilla.mozilla.org/show_bug.cgi?id=1384225)

<!-- 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/18341)
<!-- Reviewable:end -->
2017-09-08 11:14:51 -05:00
P. Albrecht
354ed65c21 Observer receives pending marks before removed 2017-09-08 15:36:43 +02:00
Fernando Jiménez Moreno
337a90329c stylo: Error reporting for unknown media features 2017-09-08 12:48:50 +02:00
bors-servo
e9336b39a6 Auto merge of #18411 - servo:rename-preshint-method, r=emilio
Rename VirtualMethods::attribute_is_mapped

<!-- 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/18411)
<!-- Reviewable:end -->
2017-09-07 15:56:01 -05:00
bors-servo
1e93749941 Auto merge of #18283 - ferjm:user.timing.api, r=jdm
User Timing API

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #18109
- [X] There are tests for these changes. I enabled the peformance-timeline API WPTs but some of them are still failing because of implementation bugs or missing APIs (Resource Timing, for instance) the tests are dependent of. I'll file issues to fix them.

<!-- 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/18283)
<!-- Reviewable:end -->
2017-09-07 12:45:46 -05:00
Anthony Ramine
558f5772a6 Rename VirtualMethods::attribute_is_mapped
This name doesn't convey what the method is about, it's now
attribute_affects_presentational_hints.
2017-09-07 18:46:53 +02:00
bors-servo
3a7539a442 Auto merge of #18406 - servo:cleanup-media, r=emilio
Start cleaning up HTMLMediaElement a bit

<!-- 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/18406)
<!-- Reviewable:end -->
2017-09-07 11:41:12 -05:00
P. Albrecht
8161d1931d Handle dynamic font color change 2017-09-07 15:47:28 +02:00
Anthony Ramine
a3044a3755 Document HTMLMediaElement fields and cleanup some algos 2017-09-07 13:45:42 +02:00
bors-servo
4ada03febf Auto merge of #18382 - servo:jdm-patch-1, r=cbrewster
Add CEReactions to element creation APIs.

This addresses https://github.com/whatwg/dom/pull/506.

---
- [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 they will exist upstream in the future.

<!-- 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/18382)
<!-- Reviewable:end -->
2017-09-06 09:38:58 -05:00
Anthony Ramine
e169acd1d6 Put HTMLMediaElement first in its module 2017-09-06 13:50:56 +02:00
Fernando Jiménez Moreno
8412f5403a User Timing API 2017-09-06 13:33:30 +02:00
bors-servo
c6e774e69a Auto merge of #18383 - MortimerGoro:float_textures, r=emilio
Fix WebGL texture_float and texture_half_float detection on some GPUs

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

Fix WebGL texture_float and texture_half_float detection on some GPUs. Some of them use different extension names.

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

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- 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/18383)
<!-- Reviewable:end -->
2017-09-05 20:23:52 -05:00
Imanol Fernandez
4f35e82cf5 Fix texture_float and texture_half_float detection on some GPUs 2017-09-05 18:24:59 +02:00
Josh Matthews
90ff099b2d Add CEReactions to element creation APIs. 2017-09-05 08:51:31 -07:00