Commit graph

5841 commits

Author SHA1 Message Date
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
bors-servo
77afc3f33a Auto merge of #18714 - jdm:sizes, r=jdm
Parse sizes attribute values

Squashed version of #17808.

---
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix (partially) #11416
- [x] There are tests for these changes

<!-- 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/18714)
<!-- Reviewable:end -->
2017-10-03 04:16:00 -05:00
Rakhi Sharma
c31b0e4bd2 Parse sizes attribute values. 2017-10-02 20:31:06 +02:00
Martin Robinson
0380431157 Combine ReflowGoal and ReflowQueryType
This simplifies the logic in the layout_thread and makes it clearer
which types of reflows generate display lists and cause display updates.
2017-09-30 16:06:48 +02:00
Guillaume Gomez
3d0b7fbc41 Implement EventListenerOptions for EventTarget
For now, only "capture" is supported.
2017-09-30 02:12:35 +02:00
bors-servo
ffa03380ca Auto merge of #18580 - MortimerGoro:webgl_active_texture, r=jdm
Associate WebGL textures with texture units

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

Currently `bound_texture_2d` and `bound_texture_cube_map` fields are used to restore texture states and to get the current bindings in GetParams(...). But as soon as active texture is changed all the values can become dirty, leading to broken textures in some demos or invalid getParam(...) call results.

This PR implements the texture binding association with the texture units.

---
<!-- 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/18580)
<!-- Reviewable:end -->
2017-09-28 14:12:06 -05:00
Imanol Fernandez
b9710a59b5 Associate bound WebGLTextures with texture units. 2017-09-28 18:52:29 +02:00
Anthony Ramine
dee38475b8 Make DomRoot<T> a type alias of a more general Root<T> type
This Root<T> relies on the concept of a stable trace object, which doesn't
move for the whole lifetime of the T value. For safety reasons, T must be 'static.

The only implementor of StableTraceObject for now is Dom<T>.
2017-09-28 15:42:43 +02:00
Anthony Ramine
b441f8a0f7 Kill RootCollectionPtr 2017-09-27 14:24:37 +02:00
Anthony Ramine
378babfd4c Move STACK_ROOTS to dom::bindings::root 2017-09-27 14:16:05 +02:00
Anthony Ramine
8d566fbc3c Move script_runtime::StackRootTLS to root::ThreadLocalStackRoots 2017-09-27 13:58:59 +02:00
Anthony Ramine
a6d01c92d9 Reorder things in dom::bindings::root
The type DomRoot<T> is now the first one defined in it.
2017-09-27 13:44:07 +02:00
Anthony Ramine
9ea645481b Store a Dom<T> in DomRoot<T> 2017-09-26 18:29:15 +02:00
Anthony Ramine
1ff6c4f9aa Make DomRoot::new unsafe 2017-09-26 16:10:30 +02:00
bors-servo
1282e0d808 Auto merge of #18635 - servo:RENAME-ALL-THE-THINGS, r=emilio
Rename JS<T> to Dom<T>, Root<T> to DomRoot<T>, and other 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/18635)
<!-- Reviewable:end -->
2017-09-26 03:20:05 -05: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
9a7ba89c84 Rename OnceCellJS<T> to DomOnceCell<T>
Like DOMRefCell<T>.
2017-09-26 09:49:06 +02:00
Anthony Ramine
e2dac78d36 Rename LayoutJS<T> to LayoutDom<T> 2017-09-26 09:49:04 +02:00
Anthony Ramine
c52fd0a780 Rename MutNullableJS<T> to MutNullableDom<T> 2017-09-26 09:49:02 +02:00
Anthony Ramine
d29335040d Rename MutJS<T> to MutDom<T> 2017-09-26 09:49:00 +02:00
Anthony Ramine
7be32fb237 Rename JS<T> to Dom<T> 2017-09-26 09:48:55 +02:00
Anthony Ramine
0e3c54c191 Rename dom::bindings::js to dom::bindings::root 2017-09-26 02:19:05 +02:00
bors-servo
e6099b4364 Auto merge of #18617 - TheDan64:master, r=KiChjang
Removed integrity check and test for no-cors requests

Removed Step 30.2 which raised a JS TypeError if the integrity metadata was not empty. I manually ran `new Request("", {"mode" : "no-cors", "integrity" : "not an empty string"});` in servo to validate that the exception no longer arose.

---
<!-- 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 #18345
- [x] These changes do not require tests because according to the ticket "Unfortunately, there's no automated test available for this yet because we are having trouble updating our copy of the upstream tests. "

<!-- 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/18617)
<!-- Reviewable:end -->
2017-09-25 19:15:26 -05:00
Daniel Kolsoi
96f9cc77e6 Removed integrity check and test for no-cors requests
Also updated request-headers.html manifest hash
2017-09-25 19:11:30 -04:00
Josh Matthews
44822c364c Use more named string interpolation. 2017-09-25 16:11:49 -04:00
Josh Matthews
77b3e911c1 Remove almost all uses of Heap::new. 2017-09-25 16:11:49 -04:00
Josh Matthews
f5eb8445b0 Initialize rooted dictionaries to a stable value before setting fields. 2017-09-25 16:11:48 -04:00
Josh Matthews
16166d6673 Derive the Default trait for dictionaries containing GC values. 2017-09-25 16:10:58 -04:00
Josh Matthews
b169689f32 Store rootable dictionary members of dictionaries in RootedTraceableBox. 2017-09-25 16:10:58 -04:00
Josh Matthews
da65698c5c Be more conservative about safety of dictionary and union values.
Mark dictionaries containing GC values as must_root, and wrap them in
RootedTraceableBox in automatically-generated APIs. To accommodate
union variants that are now flagged as unsafe, add RootedTraceableBox
to union variants that need to be rooted, rather than wrapping the
entire union value.
2017-09-25 16:10:58 -04:00
Josh Matthews
e481e8934a Don't generate union conversion functions for object variants. 2017-09-25 16:10:57 -04: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
da392e3524 Rename Document::mut_loader to loader_mut 2017-09-25 12:32:34 +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
bors-servo
c48ef50b72 Auto merge of #18514 - asajeffrey:layout-dont-panic-if-no-iframe-bc, r=emilio
Remove sources of panic when laying out an iframe without a nested browsing context

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

At the moment, layout panics if it discovers an iframe without a nested browsing context. Under normal circumstances, this is reasonable, but it requires very tight synchronization between script, layout, the constellation and the compositor. In particular, if a layout is in progress when an iframe's browsing context is discarded, this can trigger panic.

This PR fixes this in two ways:

1. Making the pipeline and browsing context ids optional in layout's representation of an iframe.
2. Shutting down layout before discarding a browsing context, rather than after.

This is belt and braces.

---
<!-- 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 #17482 and #18477
- [X] These changes do not require tests because the PR is fixing a panic caused by a race condition

<!-- 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/18514)
<!-- Reviewable:end -->
2017-09-22 09:34:12 -05:00
Alan Jeffrey
fbfb9a80b4 Remove sources of panic when laying out an iframe without a nested browsing context. 2017-09-22 09:04:18 -05:00
bors-servo
4af0d9acb3 Auto merge of #18600 - servo:promises, r=<try>
Improve Promise

The elephant 🐘 (not PHP's) still remains in the room: `Rc<Promise>` shouldn't require `#⁠[allow(unrooted_must_root)]`.

<!-- 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/18600)
<!-- Reviewable:end -->
2017-09-22 07:36:38 -05:00
Anthony Ramine
386973efeb Make Promise::new_resolved unsafe 2017-09-22 14:18:32 +02:00
Anthony Ramine
a69c5da208 Make Promise::new_rejected unsafe 2017-09-22 14:18:28 +02:00
Anthony Ramine
860f2d806f Rename Promise::is_settled to Promise::is_fulfilled 2017-09-22 14:18:25 +02:00
Anthony Ramine
dabecfade6 Remove unused method Promise::then 2017-09-22 14:18:23 +02:00
Anthony Ramine
d31018d444 Make Promise::reject unsafe 2017-09-22 14:18:20 +02:00
Anthony Ramine
d246c5cf20 Remove JSContext argument from AsyncBluetoothListener::handle_response 2017-09-22 13:56:31 +02:00
Anthony Ramine
2400731bfc Make Promise::resolve unsafe 2017-09-22 02:15:28 +02:00
Anthony Ramine
5994e40070 Use Promise::resolve_native in fullscreen tasks 2017-09-22 02:15:26 +02:00
Anthony Ramine
af2e83f378 Make Promise::reject_error sound 2017-09-22 02:15:22 +02:00