Commit graph

380 commits

Author SHA1 Message Date
Gregory Terzian
671627e97e introduce "per task source" ignoring of tasks 2018-07-10 13:42:28 +08:00
Fernando Jiménez Moreno
f46fbe4599 Remove gecko-media dependency 2018-01-19 15:06:52 +01:00
Anthony Ramine
8e75c4d30e Use GeckoMedia and only that on platforms that support it 2017-11-24 10:18:36 +01:00
Philippe Normand
24454c33b2 Implement HTMLMediaElement::canPlayType using gecko-media 2017-11-23 11:27:28 +00:00
Keith Yeung
c6bb1cb9d5 Merge request type and destination 2017-10-23 11:19:35 -07:00
Nicholas Nethercote
4506f0d30c Replace all uses of the heapsize crate with malloc_size_of.
Servo currently uses `heapsize`, but Stylo/Gecko use `malloc_size_of`.
`malloc_size_of` is better -- it handles various cases that `heapsize` does not
-- so this patch changes Servo to use `malloc_size_of`.

This patch makes the following changes to the `malloc_size_of` crate.

- Adds `MallocSizeOf` trait implementations for numerous types, some built-in
  (e.g. `VecDeque`), some external and Servo-only (e.g. `string_cache`).

- Makes `enclosing_size_of_op` optional, because vanilla jemalloc doesn't
  support that operation.

- For `HashSet`/`HashMap`, falls back to a computed estimate when
  `enclosing_size_of_op` isn't available.

- Adds an extern "C" `malloc_size_of` function that does the actual heap
  measurement; this is based on the same functions from the `heapsize` crate.

This patch makes the following changes elsewhere.

- Converts all the uses of `heapsize` to instead use `malloc_size_of`.

- Disables the "heapsize"/"heap_size" feature for the external crates that
  provide it.

- Removes the `HeapSizeOf` implementation from `hashglobe`.

- Adds `ignore` annotations to a few `Rc`/`Arc`, because `malloc_size_of`
  doesn't derive those types, unlike `heapsize`.
2017-10-18 22:20:37 +11:00
Matt Brubeck
efc3683cc7 Fix commonmark Markdown warnings in docs, part 1
Fixes warnings from rust-lang/rust#44229 when `--enable-commonmark` is
passed to rustdoc.

This is mostly a global find-and-replace for bare URIs on lines by
themselves in doc comments.
2017-10-17 11:24:57 -07:00
Simon Sapin
aa15dc269f Remove use of unstable box syntax.
http://www.robohornet.org gives a score of 101.36 on master,
and 102.68 with this PR. The latter is slightly better,
but probably within noise level.
So it looks like this PR does not affect DOM performance.

This is expected since `Box::new` is defined as:

```rust
impl<T> Box<T> {
    #[inline(always)]
    pub fn new(x: T) -> Box<T> {
        box x
    }
}
```

With inlining, it should compile to the same as box syntax.
2017-10-16 17:16:20 +02:00
Anthony Ramine
c7b1d3054f Change AttrValue::Url to AttrValue::ResolvedUrl
There is actually only one attribute that can use that, the one for
<body background>.
2017-10-15 11:03:20 +02:00
Anthony Ramine
605c679fee Fix URL attributes
URL attributes should always use AttrValue::Url, and the input should be
resolved against the document's base URL at setting time always.
2017-10-11 13:56:07 +02:00
Anthony Ramine
e3fb99dd59 Implement a bit more of the "object" path when loading media 2017-10-10 11:44:29 +02:00
Anthony Ramine
b7452f37d9 Properly abort any ongoing resource selection on loading a new media 2017-10-10 10:10:39 +02:00
Anthony Ramine
b8c55e7da6 Set have_metadata for audio elements too
We don't store video-specific metadata anymore, and we don't ignore audio-specific
metadata anymore. We now just acknowledge that we received some metadata.
2017-10-04 11:28:47 +02:00
Anthony Ramine
f87c2a8d76 Rename Root<T> to DomRoot<T>
In a later PR, DomRoot<T> will become a type alias of Root<Dom<T>>,
where Root<T> will be able to handle all the things that need to be
rooted that have a stable traceable address that doesn't move for the
whole lifetime of the root. Stay tuned.
2017-09-26 09:49:10 +02:00
Anthony Ramine
577370746e Rename DOMRefCell<T> to DomRefCell<T>
I don't want to do such a gratuitous rename, but with all the other types
now having "Dom" as part of their name, and especially with "DomOnceCell",
I feel like the other cell type that we already have should also follow
the convention. That argument loses weight though when we realise there
is still DOMString and other things.
2017-09-26 09:49:08 +02:00
Anthony Ramine
c52fd0a780 Rename MutNullableJS<T> to MutNullableDom<T> 2017-09-26 09:49:02 +02:00
Anthony Ramine
0e3c54c191 Rename dom::bindings::js to dom::bindings::root 2017-09-26 02:19:05 +02:00
Anthony Ramine
40a72f3e83 Decouple media load blockers from their resource URL
A media element can delay the document's load event without having a resource URL,
and it can even block it while being inserted into a different document AFAIK.
2017-09-25 13:04:52 +02:00
Anthony Ramine
5245931dc2 Implement the error path for source children of media elements
This removes some test timeout.
2017-09-25 00:35:35 +02:00
Anthony Ramine
49dd04cd8b Return a promise from HTMLMediaElement::Play 2017-09-23 12:01:43 +02:00
Anthony Ramine
6c5fe041d7 Ignore media-related tasks when starting the media load algorithm 2017-09-23 12:01:39 +02:00
Anthony Ramine
9aaa42b061 Remove some obsolete comments 2017-09-23 10:01:24 +02:00
Anthony Ramine
6c9fb5ae7a Introduce TaskOnce
Having both TaskBox and TaskOnce allows us to remove the superfluous inner boxing
from CancellableTask<T>.
2017-09-20 10:37:09 +02:00
Anthony Ramine
0e2249f07f Clean up HTMLMediaElement::Play 2017-09-19 14:26:11 +02:00
Anthony Ramine
7e835c351e Handle invalid MIME types in HTMLMediaElement::CanPlayType 2017-09-19 14:26:10 +02:00
Anthony Ramine
bd9486bbe2 Clean up code for the media element load algorithm 2017-09-19 14:26:09 +02:00
Anthony Ramine
e8d7eaf8a3 Clean up code of the resource fetch algorithm 2017-09-19 14:26:07 +02:00
Anthony Ramine
5352697558 Clean up the resource selection algorithm a bit 2017-09-19 14:26:06 +02:00
Anthony Ramine
e4cd6be831 Clean up HTMLMediaElement::change_ready_state 2017-09-19 14:26:05 +02:00
Anthony Ramine
30a1d3f617 Use task! for the dedicated media source failure steps 2017-09-18 02:47:11 +02:00
Anthony Ramine
91c2865e36 Use task! for notifying about playing 2017-09-18 02:47:09 +02:00
Anthony Ramine
5412767f46 Introduce a task! macro and use it for internal pause steps 2017-09-18 02:47:06 +02:00
Anthony Ramine
46628fba05 Move Task to its own module 2017-09-18 02:47:04 +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
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
a3044a3755 Document HTMLMediaElement fields and cleanup some algos 2017-09-07 13:45:42 +02:00
Anthony Ramine
e169acd1d6 Put HTMLMediaElement first in its module 2017-09-06 13:50:56 +02:00
Anthony Ramine
62c73b61b7 Do not NIH queueing a task to fire an event in htmlmediaelement 2017-09-04 16:14:04 +02:00
toidiu
99e4504f85 move name implementation as default implementation to the trait and remove overrides. 2017-09-03 16:30:48 -04:00
Clément DAVID
c5fe235112 order derivable traits lists
Ignoring :
 - **generated**.rs
 - python/tidy/servo_tidy_tests/rust_tidy.rs
2017-08-23 21:38:44 +02:00
Fausto Núñez Alberro
6032940fb8 Change RequestInit origin type to ImmutableOrigin 2017-07-16 21:44:33 +02:00
Gregory Terzian
a8390aea24 use microtasks to await a stable state 2017-05-19 17:29:16 +08:00
Christian Poveda
62821a6915 Solving merge conficts related to the html5ever_atoms -> html5ever change 2017-05-03 12:57:49 -05:00
Christian Poveda
875e422fe6 Changed all prefixes from DOMString to the atomic Prefix from html5ever 2017-05-03 10:17:42 -05:00
Simon Sapin
6c518c89b9 Upgrade to html5ever 0.16 2017-05-02 19:24:28 +02:00
Anthony Ramine
31e9d81c0f Make #[dom_struct] a proc_macro attribute 2017-02-24 01:50:51 +01:00
Ms2ger
1bc0862214 Remove and allow some dead code. 2016-12-22 16:06:22 +01:00
Simon Sapin
53f5023685 Fix/silence some warnings 2016-12-20 07:07:06 +01:00