Commit graph

669 commits

Author SHA1 Message Date
Martin Robinson
3a74013abc Start having animations conform to the HTML spec
This is a small step toward fixing #19242. The main idea is that the
clock for animations should advance as the event loop ticks. We
accomplish this by moving the clock from layout and naming it the
"animation timeline" which is the spec language. This should fix
flakiness with animations and transitions tests where a reflow could
move animations forward while script was running.

This change also starts to break out transition and animation events
into their own data structure, because it's quite likely that the next
step in fixing #19242 is to no longer send these events through a
channel.
2020-05-05 20:08:44 +02:00
Martin Robinson
b585ce5b1f Use a restyle for animation ticks
This change corrects synchronization issues with animations, by
reworking the animation processing model to do a quick restyle and
incremental layout when ticking animations.

While this change adds overhead to animation ticks, the idea is that
this will be the fallback when synchronous behavior is required to
fulfill specification requirements. In the optimistic case, many
animations could be updated and applied off-the-main-thread and then
resynchronized when style information is queried by script.

Fixes #13865.
2020-05-05 15:13:35 +02:00
Martin Robinson
3903c1fb98 Add support for animationend event
This is triggered when an animation finishes. This is a high priority
because it allows us to start rooting nodes with animations in the
script thread.

This doesn't yet cause a lot of tests to pass because they rely on the
existence of `Document.getAnimations()` and the presence of
`animationstart` and animationiteration` events.
2020-05-01 15:29:57 +02:00
bors-servo
1aab10f20a
Auto merge of #26325 - jdm:devtools-nav, r=gterzian
Improve devtools experience when navigating

The primary motivation for this work was to fix #15425, and these changes make it possible to use the devtools to meaningfully inspect multiple pages when navigating between them. Navigating through session history is not yet supported.

These changes also include improvements to the dedicated worker support, which broke at some point. We now can observe console messages in workers.
2020-04-28 16:56:11 -04:00
Josh Matthews
565e9432c6 Support connecting to worker globals from remote devtools. 2020-04-28 11:07:45 -04:00
Josh Matthews
7c48644cad Support navigating browsing contexts in the devtools.
Break the association between pipelines and browsing context actors.
Now there is one browsing context actor per actual browsing context,
and individual actors keep track of known pipelines as necessary.
There is also one console/performance/timeline/inspector/etc. actor
per browsing context.

This also centralizes more information in the browsing context actor.
Rather than duplicating state for the active pipeline in actors that
need to use it, each actor now remembers the name of its associated
browsing context actor and obtains that state whenever it's necessary.
2020-04-26 18:11:23 -04:00
Martin Robinson
d386d6d1f1 Add support for transitionrun events
These events are triggered as soon as a transition is added to the list
of running transitions. This will allow better test coverage while
reworking the transitions and animations processing model.
2020-04-24 14:20:37 +02:00
Martin Robinson
453b252a65 Add support for canceling CSS transitions
This change adds support for canceling CSS transitions when a property
is no longer transitionable or when an element becomes styled with
display:none. Support for canceling and replacing CSS transitions when
the end value changes is still pending. This change also takes advantage
of updating the constellation message to fix a bug where transition
events could be sent for closed pipelines.

Fixes #15079.
2020-04-22 17:23:26 +02:00
bors-servo
9fd668488e
Auto merge of #26071 - servo:rustup, r=nox
Upgrade to rustc 1.44.0-nightly (42abbd887 2020-04-07)

~Blocked on https://github.com/rust-lang/rust/issues/70280~
2020-04-10 00:37:54 -04:00
Simon Sapin
1c0549ce7f Upgrade to rustc 1.44.0-nightly (42abbd887 2020-04-07) 2020-04-09 21:33:44 +02:00
Alan Jeffrey
c611e46381 Remove WebVR 2020-04-08 20:23:41 -05:00
Anthony Ramine
185a402d9c Make DOM own the style and layout data, in an UnsafeCell
The previous Cell was a lie.
2020-04-04 13:10:19 +02:00
Josh Matthews
6ab7a50b31 Cache the result of retrieving an element's client rectangle from layout. 2020-03-31 17:15:44 -04:00
Gregory Terzian
53497fe87f shutting down IPC router thread when a process shuts down. 2020-03-31 00:49:28 +08:00
Josh Matthews
1449bac0e1 Avoid accessing node global during Node's destructor. 2020-02-24 16:27:40 -05:00
Kunal Mohan
a05553f188
Make Background Hang Monitor Optional
This is done by wrapping all channels of communication
and related objects inside Option which are configured
using flag inside servo_config.
2020-02-23 01:45:52 +05:30
Kunal Mohan
5a3e1b8e69
rename compartment to realm 2020-01-24 20:52:36 +05:30
Zakor Gyula
a751b1c3d7 Only start WebGPU thread if an adapter is requested 2020-01-13 10:39:23 +01:00
bors-servo
bac9903fbe
Auto merge of #24123 - gterzian:redo_blob, r=jdm
Restructure Blob, structured serialization

<!-- Please describe your changes on the following line: -->
FIX #24052 and also address the "cloning" half of FIX #23917

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [ ] `./mach build -d` does not report any errors
- [ ] `./mach test-tidy` does not report any errors
- [ ] These changes fix #___ (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/24123)
<!-- Reviewable:end -->
2019-12-19 16:16:56 -05:00
Shinichi Morimoto
91287216f5 #24468 Performance::queue_entries return the index of the added performance entry 2019-12-13 13:41:47 -05:00
Gregory Terzian
6e8a85482c re-structure blob, structured serialization 2019-12-11 22:46:50 +08:00
Paul Rouget
b3b886e837 devtools: save and send cached messages 2019-12-06 10:10:43 +01:00
Josh Matthews
564c16d754 Use non-IPC webrender API over explicit IPC channels. 2019-11-27 20:47:53 -05:00
bors-servo
a922c497fa
Auto merge of #24758 - gterzian:impl_timer_task_source, r=nox
Implement timer-task-source, time-out service worker

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

Implements the timer task-source, and folds the IPC glue-code into a single route set by the globalscope.

Also switches service worker to using a dedicated "time-out" mechanism, which previously relied on the timer mechanism(and I think didn't actually implement script timers).

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [ ] `./mach build -d` does not report any errors
- [ ] `./mach test-tidy` does not report any errors
- [ ] These changes fix #24747 (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. -->
2019-11-26 16:26:20 -05:00
bors-servo
ea32495504
Auto merge of #24708 - szeged:webgpu-base, r=gterzian,kvark
Initial implementation of WebGPU API

<!-- Please describe your changes on the following line: -->
- Added the WebIDL bindings for GPU and GPUadapter interfaces.
- Created a background thread for WebGPU api calls.
- Established the async communication between the background thread and the WebGPU interfaces.
- Implemented the `requesAdapter` function of `navigator.gpu`

`./mach test-tidy` reports an error due to the different `arrayvec` version used in `servo` and `webgpu`, so added it to the ignore list in `servo-tidy.toml`

---
<!-- 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
- [ ] `./mach test-tidy` does not report any errors
- [ ] These changes addresses a part of #https://github.com/servo/servo/issues/24706

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

cc @jdm, cc @kvark

<!-- 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/24708)
<!-- Reviewable:end -->
2019-11-25 00:00:46 -05:00
bors-servo
1b524ead1e
Auto merge of #24818 - gterzian:fix_panic_on_finish_load, r=jdm
Prevent panic on layout send in finish-load

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

Do not run the finish load steps if the pipeline has been discarded by the time the parser finishes.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [ ] `./mach build -d` does not report any errors
- [ ] `./mach test-tidy` does not report any errors
- [ ] These changes fix #22955 (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. -->
2019-11-22 03:12:59 -05:00
Gregory Terzian
f28ffaca59 abort parser before shutting down layout in exit pipeline 2019-11-22 14:45:23 +08:00
bors-servo
c060f00535
Auto merge of #24789 - gterzian:fix_unloading, r=jdm
Fix unloading, active BC, and clearing js runtime

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

Do not set the window to be the currently active one for the windowproxy as part of `load`, as it will be done later when the document activity is set. And doing it later means that when unload runs, it is with the unloaded pipeline as the active window.

Only nullify the window proxy if it's not used by another (currently-active) window.

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [ ] `./mach build -d` does not report any errors
- [ ] `./mach test-tidy` does not report any errors
- [ ] These changes fix #24591 (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. -->
2019-11-22 01:28:36 -05:00
Gregory Terzian
1fab2416d7 abort parser, if any, when pipeline exits 2019-11-21 23:58:03 +08:00
Gregory Terzian
a21c0bfd1a ensure unload run with old pipeline as currently-active, do not nullify proxy unless currently-active 2019-11-21 22:30:08 +08:00
Zakor Gyula
12893aa010 Initial implementation of WebGPU API 2019-11-21 08:30:26 +01:00
bors-servo
dc22a78cc2
Auto merge of #24757 - Akash-Pateria:async-wasm-compilation-subsequent, r=jdm
Async wasm compilation event loop integration

The PR contains changes related to binding the runnable dispatching in script_runtime and is part of the Asynchronous WebAssembly Compilation fix. This is the first step in the subsequent steps mentioned in the [wiki](https://github.com/servo/servo/wiki/Asynchronous-WebAssembly-compilation-project).

---
<!-- 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 #21476 fix
2019-11-20 16:16:13 -05:00
Fernando Jiménez Moreno
b048d7faf7 Fix media session action handling 2019-11-20 13:34:29 +01:00
Fernando Jiménez Moreno
85ec66b43e Move active media session logic to constellation 2019-11-20 13:33:51 +01:00
Fernando Jiménez Moreno
4d147d2c56 Register media instance with session and prepare communication with embedder 2019-11-20 13:33:14 +01:00
Fernando Jiménez Moreno
fa61191405 Make MediaSession handle embedder requested action 2019-11-20 13:32:11 +01:00
Fernando Jiménez Moreno
6233f78de4 MediaSessionAction message from embedder to script thread 2019-11-20 13:32:10 +01:00
Fernando Jiménez Moreno
7101a9d070 Use BrowsingContextId for MediaSession registration 2019-11-20 13:32:10 +01:00
Fernando Jiménez Moreno
f8246801ba MediaSession registration 2019-11-20 13:32:10 +01:00
Akash-Pateria
84f16eae98 Bind runnable dispatching in script_runtime 2019-11-19 23:25:52 -05:00
Gregory Terzian
50a7111eb6 impl timer-task-source, dedicated time-out mechanism for service-worker 2019-11-19 14:32:21 +08:00
bors-servo
901fef5fa9
Auto merge of #24742 - servo:jdm-patch-34, r=asajeffrey
Reduce unnecesarily large borrow in script thread

- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #24730
- [x] There are tests for these changes
2019-11-16 18:32:27 -05:00
Simon Sapin
bea73951db Use #![register_tool] instead of #![register_attr]
CC https://github.com/rust-lang/rust/issues/66079
2019-11-15 17:24:42 +01:00
Josh Matthews
8846cda501 script: Reduce scope of borrows for history updates. 2019-11-14 14:11:53 -05:00
jaymodi98
bf69b6fea7 Implement srcdoc support for iframes. 2019-11-12 13:57:54 -05:00
Josh Matthews
91dfa354b1 Ensure layout/script always have a correct viewport size when a new pipeline is created. 2019-11-06 16:13:55 -05:00
Josh Matthews
2aa5ddf922 script: Ignore redundant resize notifications. 2019-11-06 16:13:55 -05:00
Gregory Terzian
2f8932a6a1 continue messageport, transferable, postmessage options 2019-10-19 14:28:18 +08:00
Keith Yeung
c3b17c1201 begin messageport, transferable objects, impl
Accept transfer argument for StructuredCloneData::write

Allow structured clone reads to return a boolean

Add Transferable trait

Add basic skeletons to MessagePort

Implement transfer and transfer-receiving steps on MessagePort

Use transfer and transfer_receive in StructuredClone callbacks

Implement MessageChannel

Freeze the array object for the MessageEvent ports attribute

Implement transfer argument on window.postMessage

Use ReentrantMutex instead for MessagePortInternal

Accept origin as a parameter in dispatch_jsval

Fix BorrowMut crash with pending_port_message

Detach port on closure and check for detached during transfer

Enable webmessaging tests

fix webidl

fix
2019-10-19 14:12:22 +08:00
Gregory Terzian
45ec250b0a improve spec compliance of discarding BCs
do not handle compositor input events when BC is being discarded

prevent firing of timers for discarded BCs

return null for opener is BC has been discarded

bundle discard BC steps into window method

return null in window.opener, if BC has already been discarded

move the window closed check pre-event to script-thread
2019-09-22 12:46:40 +08:00