Commit graph

25073 commits

Author SHA1 Message Date
Fabrice Desré
fec4c589b2 Switch to the sha2 crate for SRI digests.
This removes one (simple) use of OpenSSL
2023-02-24 18:38:06 -08:00
bors-servo
e714b95267
Auto merge of #29382 - atomgardner:update-winit, r=jdm
Bump winit to 0.28.1

This fixes the following wayland-client error:

	Attempted to dispatch unknown opcode 0 for wl_shm, aborting.

<!-- 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 #27740 (GitHub issue number if applicable)

<!-- Either: -->
- [x] There are tests for these changes OR
- [X] These changes do not require tests because only dependencies are updated.

<!-- 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. -->
2023-02-24 14:57:39 +01:00
Thomas Gardner
140dda9968 Bump surfman to 0.6
Update to the new release of surfman, and consume it without using the
`patches` section in Cargo.toml.
2023-02-24 19:00:57 +11:00
bors-servo
fbe102fe6c
Auto merge of #29364 - delan:selectors-servo_arc, r=jdm
Release selectors 0.24.0 and servo_arc 0.2.0

This patch extends #29361, bumping selectors to 0.24.0 and servo_arc to 0.2.0.

We’ll need to publish them too, in order to close #29105.

---
<!-- 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 #29105 (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because there are no functional changes
2023-02-20 16:53:35 +01:00
sagudev
9c2cc05a8e Upgrade remaining components to edition 2018 2023-02-18 09:42:37 +01:00
Delan Azabani
e75cc39238 sync versions of to_shmem + to_shmem_derive with dummy releases 2023-02-16 16:48:12 +08:00
bors-servo
a01035e6fd
Auto merge of #29361 - federicomenaquintero:selectors-shmem-feature, r=delan
Add a "shmem" feature to selectors to avoid publishing that dependency

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

Hopefully as a way to help #29105, this PR adds a `shmem` feature to the selectors crate.  This is so that the crate can be released with that feature off by default, as the `ToShmem` derives are only of interest to Servo, I think.

All the places where servo's source code includes the selectors crate are made to turn on this feature.
2023-02-15 10:26:18 +01:00
Delan Azabani
6ee10ca762 Release selectors 0.24.0 and servo_arc 0.2.0 2023-02-15 14:07:12 +08:00
Delan Azabani
42b62296b6 merge from federicomenaquintero/selectors-shmem-feature (#29361) 2023-02-15 13:48:03 +08:00
bors-servo
02de93dc38
Auto merge of #29354 - ben-freist:dom-drop-impl-worklet, r=delan
#26488 Move worklet drop implementation into single droppable member

Signed-off-by: Benjamin Freist <bfreist@soundhound.com>

<!-- Please describe your changes on the following line: -->
Hey @jdm ,
is this issue still free? I would like to start contributing to servo.
This patch is straight from PR 28302, I thought it would be good to start with a small part, I hope that's ok.

---
<!-- 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: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because they will be checked by the compiler.

<!-- 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. -->
2023-02-14 23:43:47 +01:00
Federico Mena Quintero
8a0810ee74 */Cargo.toml: use the shmem feature for the dependency on the selectors cratre 2023-02-14 13:05:59 -06:00
Federico Mena Quintero
c78af6a32f selectors/*.rs - Put all the to_shmem attributes behind a "shmem" feature 2023-02-14 13:05:59 -06:00
Federico Mena Quintero
9dae402dc5 selectors/Cargo.toml: Gate the_shmem/to_shmem_derive deps behind a new "shmem" feature
ToShmem is of interest only to Servo, not to the public selectors
crate.
2023-02-14 11:38:36 -06:00
bors-servo
2826dd753d
Auto merge of #29035 - yvt:patch/process-pending-animation-events, r=mrobinson
Don't hold back the delivery of pending animation events

The script event loop can block for an indefinite period despite having pending animation-related events that it needs to deliver immediately.

The bug can cause a test timeout in `/css/css-transitions/events-001.html` but (to my knowledge) never manifested in `master` because any irrelevant messages received by the script thread afterward would unblock the event loop and cause it to process any pending animation-related events. We can reproduce the bug in `master` by removing [the `maybe_observe_paint_time` call][2] in `LayoutThread::compute_abs_pos_and_build_display_list`. This also explains the test failure [seen in #28708][1] because the same call is [commented out][3].

[1]: https://github.com/servo/servo/pull/28708#issuecomment-1080003778
[2]: 5448528279/components/layout_thread/lib.rs (L1156-L1157)
[3]: 03a41ffe32/components/layout_thread/lib.rs (L1186-L1187)

---
- [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)

---
- [x] There are tests for these changes OR
- [ ] These changes do not require tests because ___
2023-02-14 02:41:36 +01:00
Benjamin Freist
10ef6cdb38 26488 Move worklet drop implementation into single droppable member
Signed-off-by: Benjamin Freist <bfreist@soundhound.com>
2023-02-13 20:23:34 +01:00
yvt
effd5a3107 fix(script): request animation ticks if Animations::pending_events is not empty
Fixes the test case `/_mozilla/css/css-transition-cancel-event
.html`, which was failing under a specific circumstance.

The observed sequence of events during the failing test run looks like
this:

1. Transitions start in `div1` and `div2`.

2. `div1` generates a `transitionend` event.

3. The `transitionend` event handler removes `div2` from DOM, cancelling
   its ongoing transition.

4. `div2` is supposed to generate a `transitioncancel` event in a timely
   manner, which it does not. The test fails as a result.

What is going on here? Here's a possible explaination:

1. During one invocation of `ScriptThread::handle_msgs`...

2. In step 2, `ScriptThread::update_animations_send_events` -> `Document
   ::update_for_new_timeline_value` detects the completion of the
   transition, and in response, pends the `transitionend` event.

3. In step 3, `ScriptThread::update_animations_send_events` ->
   `Animations::send_pending_events` calls the `transitionend` handler.

4. The `transitionend` event handler removes `div2`, thereby cancelling
   its ongoing transition and triggering a reflow.

5. Reflow takes place. During this, `Animations::do_post_reflow_update`
   -> `Animations::handle_canceled_animations` pends the
   `transitioncancel` event (precursor to step 4).

6. Having discovering that there was no running animation, `Animations::
   do_post_reflow_update` calls `self.update_running_animation_presence
   (_, false)`, which sends `AnimationState::NoAnimationsPresent`.

7. The invocation of `ScriptThread::handle_msgs` ends, and another
   starts. It blocks waiting for events.

8. Meanwhile, the compositor receives `AnimationState::
   NoAnimationsPresent` and stops further generation of animation ticks.

9. With no events to wake it up, the script thread is stuck waiting
   despite having the pending `transitioncancel` event (step 4).

The HTML specification [says][1] that "an event loop must continually
run [...] as long as it exists" and does not say it can block if there
is nothing to do. Blocking is merely optimization in a user agent
implementation. Pending animation-related events must be processed every
time a "rendering opportunity" arises unless the user agent has a reason
to believe that it "would have no visible effect".

Skipping the processing of animation-related events would have visible
effect if such events are indeed present. The correct implementation in
Servo, therefore, would be to request more animation ticks so that such
events are processed in a subsequent tick.

[1]: https://html.spec.whatwg.org/multipage/#event-loop-processing-model
2023-02-10 14:44:27 +01:00
yvt
af1b0b0f14 fix(script): update animation timeline before processing pending events
This commit reverses the order of the `send_pending_events` and
`update_animation_timeline` calls in `ScriptThread::update_animations_
send_events` so that animation-related events pended by the latter are
processed by the former.

The new calling order is more compliant with the "update animations and
send events" algorithm steps from [the Web Animations specification][1].

The old implementation was prone to blocking for an indefinite period
while holding pending events. Due to complex interaction with other
events and timing behavior, I was only able to reproduce the problem
under the following conditions:

- *The `maybe_observe_paint_time` call in `LayoutThread::compute_abs_
  pos_and_build_display_list` is removed from the code*. While
  performance events may seem irrelevant to the issue, they would
  bombard the script thread with events. *Any* extra messages received
  would unblock the event loop and prevent the manifestation of the
  issue. (But, of course, we aren't supposed to count on that to avoid
  the issue.)

- Servo is running in a headless mode, which somehow makes it less
  likely for the script thread to receive a `TickAllAnimations` event
  after sending `AnimationState::NoAnimationsPresent`.

With the above conditions met and the stars aligned, you can reproduce
the problem by running the WPT test `/css/css-transitions/events-001.
html`.

[1]: https://drafts.csswg.org/web-animations-1/#update-animations-and-send-events
2023-02-10 12:42:51 +01:00
Alex Touchet
d1c6a7ac1d Use crates.io release of raqote 2023-02-08 19:36:12 -08:00
bors-servo
aa2e1433d2
Auto merge of #29252 - servo:update-euclid, r=jdm
Bump euclid to 0.22

Major changes:

- All matrices are now stored in row major order. This means that parameters to rotation functions should no longer be negated.
- `post_...()` functions are now named `then()`. `pre_transform()` is removed, so `then()` is used and the order of operations changed.

In addition, this PR updates lyon_geom to the latest version.

<!-- 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 #27424
- [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. -->
2023-02-08 18:15:03 +01:00
Mukilan Thiyagarajan
5738a16dcb Upgrade the Rust toolchain to 'nightly-2023-02-01'
Signed-off-by: Mukilan Thiyagarajan <mukilanthiagarajan@gmail.com>
2023-02-01 19:38:06 +05:30
Martin Robinson
423cc34cb0 Bump euclid to 0.22
- Also updates raqote to latest with an upgrade of font-kit to 0.11
  applied on as a patch
- Update lyon_geom to the latest version

Major change:

- All matrices are now stored in row major order. This means that
  parameters to rotation functions no longer should be negated.
- `post_...()` functions are now named `then()`. `pre_transform()` is removed,
  so `then()` is used and the order of operations changed.
2023-01-26 08:59:21 +01:00
Alex Touchet
967601bade Remove some badges 2023-01-19 19:38:30 -08:00
bors-servo
f70857906d
Auto merge of #29250 - fabricedesre:no-deprecated-symbol-to-jsid, r=delan
Replace use of the deprecated RUST_SYMBOL_TO_JSID by SymbolId

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

A simple replacement of a deprecated function, according to changes in https://github.com/servo/mozjs/pull/315

That removes the only build warning I saw when doing a clobber.

---
<!-- 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: -->
- [ ] There are tests for these changes OR
- [ X] These changes do not require tests because no behavior change is expected.

<!-- 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. -->
2023-01-18 18:05:12 +01:00
bors-servo
c8d9aad3e3
Auto merge of #28880 - wusyong:fix-footer, r=delan
Fix absolute descendents being replaced when retreiving root

<!-- Please describe your changes on the following line: -->
The cause of #16410 is because calling `try_get_layout_root` will replace its `abs_descendants` even itself isn't absolute positioned. So I pushed them instead if the root isn't absolute. Also add a few docs and comments to help understand how block size of absolute flow is being calculated.

---
<!-- 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 #16410 (GitHub issue number if applicable)

<!-- Either: -->
- [x] There are tests for these changes:
Reduced testcase from the issue.
```html
<style>
  html {
    min-height: 100%;
    position: relative;
  }
  div {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 25px;
    border: 1px solid black;
  }
</style>
<div>
</div>
```

<!-- 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. -->
2023-01-18 08:18:39 +01:00
bors-servo
a8db596d1e
Auto merge of #29236 - servo:application-json, r=jdm
Allow displaying content with "application/json" mime type

For me this allows the WPT test
performance-timeline/tentative/include-frames-one-remote-child.sub.html
to match expected results. The wptserver is sending a 404 JSON response
because the URL that the test requests is not found.

<!-- 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 #29136.
- [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. -->
2023-01-17 19:13:38 +01:00
The Capyloon Team
a9c0479a48 Replace use of the deprecated RUST_SYMBOL_TO_JSID by SymbolId 2023-01-16 19:14:01 +00:00
Martin Robinson
0d7284dc34 Allow displaying content with "application/json" mime type
For me this allows the WPT test
performance-timeline/tentative/include-frames-one-remote-child.sub.html
to match expected results. The wptserver is sending a 404 JSON response
because the URL that the test requests is not found.
2023-01-16 10:21:41 +01:00
Martin Robinson
e68ebd2617 Stringify unknown JavaScript objects in global exception handlers
When turning DOM exceptions into `ErrorInfo` always try to stringify
the JavaScript value, even if it's an object that isn't a `DOMException`
or native exception.  This means that exceptions that extend the `Error`
prototype are now stringified. The result is that test output for WPT
global assertion failures is more useful. For instance for the test
include-frames-from-child-same-origin-grandchild.sub.html:

Before:
```
uncaught exception: unknown (can't convert to string)
```

After:
```
uncaught exception: Error: assert_equals: expected 4 but got 3
```
2023-01-12 19:57:51 +01:00
bors-servo
1a60636274
Auto merge of #29229 - servo:intermittent-video-poster, r=jdm
Fix intermittency when loading poster images

Wait until a poster image is cached to in order to unblock document load. If not, the document may continue loading before the image is ready to use, leading to intermittency in test output. Now load is unblocked when getting the ImageResponse from the cache, which allows the code to properly unblock the load when the entire load fails or succeeds.

This reveals several false passes in the `object-view-box` test suite which were very flaky.

<!-- 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 #29204.
- [x] These changes fix #29188.
- [x] These changes fix #29179.

<!-- 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. -->
2023-01-12 02:04:09 +01:00
Martin Robinson
c021df027a Fix some build warnings
- Mark some instances of unused fields and variables as as allowed,
  when they are used for memory management.
- Remove the use of some deprecated function.s

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2023-01-11 12:50:36 +01:00
Martin Robinson
6defd7011b Fix intermittency when loading poster images
Wait until a poster image is cached to in order to unblock document load. If
not, the document may continue loading before the image is ready to use,
leading to intermittency in test output. Now load is unblocked when
getting the ImageResponse from the cache, which allows the code to
properly unblock the load when the entire load fails or succeeds.

This reveals several false passes in the `object-view-box` test suite
which were very flaky.

Fixes #29204.
Fixes #29188.
Fixes #29179.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2023-01-11 12:27:27 +01:00
Ivan Ukhov
0ac2cb08da Update truetype 2023-01-02 16:13:17 +01:00
Dirk Stolle
f2260e7c18 Fix some typos
Signed-off-by: Dirk Stolle <striezel-dev@web.de>
2022-12-17 03:22:34 +01:00
michaelgrigoryan25
6347bcf83f Replaced some Opts struct fields with shorthand initializers. 2022-12-06 21:01:27 +04:00
michaelgrigoryan25
3a99a733cd Removed unnecessary type bindings. 2022-12-06 20:41:32 +04:00
michaelgrigoryan25
269da66cfb Removed the commented code. 2022-12-01 18:27:59 +04:00
michaelgrigoryan25
83b41fdbf0 Replaced explicit Default implementation for Seed with derive. 2022-12-01 18:21:54 +04:00
bors-servo
901b76297d
Auto merge of #29079 - jdm:sm107, r=jdm
Upgrade to spidermonkey 107

This successfully loads servo.org and google.com on macOS, so that means it's time for tests!
2022-11-23 10:05:42 -05:00
Josh Matthews
4fffa67a6e Update bindgen and webxr. 2022-11-23 10:05:06 -05:00
Josh Matthews
60b3af4dad Update to newest merged spidermonkey. 2022-11-23 10:05:06 -05:00
Josh Matthews
f76bb20c2e Format. 2022-11-23 10:04:53 -05:00
Josh Matthews
76edfce6a7 Trigger new module error reporting behaviour. 2022-11-23 10:04:52 -05:00
Josh Matthews
bd77a4043c Changes for spidermomkey upgrade. 2022-11-23 10:04:50 -05:00
bors-servo
7175a5368a
Auto merge of #29085 - jdm:rustup, r=jdm
Update to latest nightly.

Fixes build issue in the latest nightly.
2022-11-21 01:29:20 -05:00
Josh Matthews
801dfeff17 Update to latest nightly. 2022-11-21 00:59:32 -05:00
bors-servo
73b066e1b5
Auto merge of #28967 - servo:jdm-patch-52, r=jdm
Add missing license files for servo_arc.

Fixes #28966.
2022-11-20 11:42:39 -05:00
Michael Mc Donnell
a3728b8ce2 Fix for loop over option warnings 2022-11-10 16:57:56 -08:00
bors-servo
d13aa55c2d
Auto merge of #29005 - BurtonQin:fix-double-lock, r=jdm
components/net: Fix a double-lock in image_cache

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

Add fn `add_listener_with_store` which requires `self.store.lock()` before calling.
Use this function instead of `add_listener` on L555 because `self.store.lock()` is called before.

---
<!-- 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
- [X] These changes fix #29003 (GitHub issue number if applicable)

<!-- Either: -->
- [ ] There are tests for these changes OR
- [X] These changes do not require tests because the fix is straightforward.

<!-- 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. -->
2022-10-25 19:41:09 -04:00
bors-servo
2926f05f69
Auto merge of #29014 - yvt:patch/bump-rust-toolchain, r=jdm
chore: upgrade the Rust toolchain to `nightly-2022-10-13`

---
- [x] `./mach build -d` does not report any errors (prerequisite: #29009)
- [x] `./mach test-tidy` does not report any errors
- [ ] These changes fix #___ (GitHub issue number if applicable)

---
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because they are not functional changes
2022-10-23 18:54:43 -04:00
bors-servo
a8deb4d971
Auto merge of #29010 - atouchet:lic, r=jdm
Use SPDX license format

<!-- 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: -->
- [ ] `./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. -->
2022-10-16 13:18:24 -04:00