Compare commits

...

1383 Commits

Author SHA1 Message Date
Delan Azabani
b29afd0f20 CI: fix self-hosted runners in Linux builds
Signed-off-by: Delan Azabani <dazabani@igalia.com>
2024-09-10 14:42:13 +08:00
Delan Azabani
ce57cc80c2 wip
Signed-off-by: Delan Azabani <dazabani@igalia.com>
2024-09-10 14:42:13 +08:00
Oriol Brufau
f1ad364ec2 Fix reordering of table-header-group and table-footer-group (#33383)
We weren't moving a table-header-group to the front if it was the first
row group. However, there might still be preceding rows that don't
belong to any row group.

And similarly, we weren't moving a table-footer-group to the end if it
was the last row group. However, there might still be following rows
that don't belong to any row group.

This patch fixes the logic, and enables existing tests from Microsoft
that were missing a reference.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-09-09 23:20:48 +00:00
webbeef
193f592617 Send less title changes to the embedder (#33287)
Instead of sending a title change for each incremental parsing change, we now do it when:
- the element is bound to the tree.
- the parser is done with the element (in pop()).
- the title content changes after the parsing, eg. using document.title .

Signed-off-by: webbeef <me@webbeef.org>
2024-09-09 22:41:02 +00:00
Andriy Sultanov
e5150dbda1 Propagate CanGc from Document::new() (#33386)
* Add canGc as a parameter to autogenerated trait methods

Signed-off-by: Andriy Sultanov <sultanovandriy@gmail.com>

* Propagate CanGc from Document::new()

Signed-off-by: Andriy Sultanov <sultanovandriy@gmail.com>

---------

Signed-off-by: Andriy Sultanov <sultanovandriy@gmail.com>
2024-09-09 22:38:01 +00:00
Simon Wülker
10e5bb72d9 Initial support for <link rel="prefetch"> (#33345)
* Properly store link relations

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Send fetch request for prefetch links

We don't actually *do* anything with the response yet
(handle errors etc) but its a first step.

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Fire load/error events for prefetch loads

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Set prefetch destination/cors setting correctly

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Update WPT expectations

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Fix ./mach test-tidy errors

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Set correct "Accept" value for prefetch requests

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Add spec text to individual steps

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2024-09-09 18:52:56 +00:00
Cristian Brinza
2993577ac0 script: Added missing spec step in Location::SetHash (#33380)
* Implement missing spec step in Location::SetHash

Signed-off-by: crbrz <cristianb@gmail.com>

* Fixed wrong URL fragment when hash set to empty string

Signed-off-by: crbrz <cristianb@gmail.com>

* Add WPT tests

Signed-off-by: crbrz <cristianb@gmail.com>

---------

Signed-off-by: crbrz <cristianb@gmail.com>
2024-09-09 16:58:26 +00:00
Simon Wülker
cc3c69b953 implement console.timeLog (#33377)
* Implement console.timeLog

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Adjust WPT expectations

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2024-09-09 16:48:49 +00:00
Taym Haddadi
8c0a566860 Fix devtool crashs after entering window.location in console (#33381)
Signed-off-by: Taym <haddadi.taym@gmail.com>
2024-09-09 15:09:06 +00:00
Martin Robinson
d169a82d2e layout: Implement proper absolute child position for flexbox (#33346)
This implements the requirements outlined in the [flexbox specification]
about how to position absolute children of flex containers. We must
establish a static position rectangle (to use if all insets are auto)
and also align the child into that rectangle.

[flebox specification]: https://drafts.csswg.org/css-flexbox/#abspos-items

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2024-09-09 14:44:16 +00:00
webbeef
a3a86d5913 script: Implement TextEncoder::encodeInto() (#33360)
* Implement TextEncoder::encodeInto()

Signed-off-by: webbeef <me@webbeef.org>

* Update components/script/dom/textencoder.rs

Signed-off-by: Martin Robinson <mrobinson@igalia.com>

* Update components/script/dom/textencoder.rs

Signed-off-by: Martin Robinson <mrobinson@igalia.com>

---------

Signed-off-by: webbeef <me@webbeef.org>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-09-09 14:40:12 +00:00
Mukilan Thiyagarajan
52a447b1e3 android: make aarch64 the default target (#33379)
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-09-09 14:38:01 +00:00
Martin Robinson
8842fe9df5 script: Use time@0.3 for input elements and do conversion in a &str trait (#33355)
This changes converts all input element parsing and normalization to use
`time` instead of `chrono`. `time` is used by our dependencies, so it
makes sense to work toward removing the Servo dependency on chrono.

In addition, parsing and normalization also moves to a trait on &str to
prepare for the possibility of all script parsers moving to a separate
crate that can have unit tests written against it.

Code duplication is eliminated when possible and more conversion is done
using integer types. These two things together mean we pass more tests
now.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-09-09 14:33:16 +00:00
Samson
687f356db9 webgpu: Factor out swapchain to separate file (#33367)
* Move some stuff to swapchain.rs

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Use typed WebGPUContextId instead of u64

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Extract create_swapchain function and move more stuff in it

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* extract destroy_swapchain

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* extract swapchain_present

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* extract update_wr_image callback

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* fixup

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2024-09-09 13:29:04 +00:00
Daniel Adams
938fd8c12f webxr: Update XRInputSource gamepad index to be -1 (#33369)
* Update XRInputSource gamepad index to be -1

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update test expectations

Signed-off-by: Daniel Adams <msub2official@gmail.com>

---------

Signed-off-by: Daniel Adams <msub2official@gmail.com>
2024-09-09 11:07:56 +00:00
Delan Azabani
9cfbaf92e5 CI: fix self-hosted runners in try-label builds (#33373)
Signed-off-by: Delan Azabani <dazabani@igalia.com>
2024-09-09 04:43:25 +00:00
Oriol Brufau
4d0bef0ac3 Remove unused imports (#33371)
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2024-09-09 03:02:24 +00:00
Delan Azabani
8bb739b818 CI: use self-hosted runners for Linux build jobs (#33321)
* CI: use self-hosted runners for Linux build jobs

Signed-off-by: Delan Azabani <dazabani@igalia.com>

* Set ccache and incremental env variables when not self-hosted

Signed-off-by: Delan Azabani <dazabani@igalia.com>

* Force GitHub-hosted runner when in upload mode

Signed-off-by: Delan Azabani <dazabani@igalia.com>

* Revert s/python/python3/ now that our image has python

Signed-off-by: Delan Azabani <dazabani@igalia.com>

* Remove stray comment in timeout workflow

Signed-off-by: Delan Azabani <dazabani@igalia.com>

* Update description of runner-select job

Signed-off-by: Delan Azabani <dazabani@igalia.com>

* Apply suggestions from code review

Address couple minor naming / formatting nits

Signed-off-by: Martin Robinson <mrobinson@igalia.com>

---------

Signed-off-by: Delan Azabani <dazabani@igalia.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-09-08 15:06:44 +00:00
Martin Robinson
e70507ca40 tidy: Fix rustdoc warnings and add a tidy check for a common URL issue (#33366)
This change fixes all rustdoc errors and also adds a tidy check for a
very common rustdoc URL issue. Eventually rustdoc warnings should likely
cause the build to fail, but this catches those issues sooner in order
to not waste so much developer time.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-09-08 15:04:19 +00:00
webbeef
f6ae050077 net: use saturating_sub when substracting durations to prevent underflows (#33341)
* net: use saturating_sub when substracting durations to prevent underflows

Signed-off-by: webbeef <me@webbeef.org>

* Add regression test. (#1)

* Add regression test.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

---------

Signed-off-by: webbeef <me@webbeef.org>
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
2024-09-08 07:36:27 +00:00
Servo WPT Sync
85823edd01 Update web-platform-tests to revision b'ec9b870fec350e59e9db48ae2858e914a07f38d6' (#33359)
Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
2024-09-08 01:41:09 +00:00
Simon Wülker
1c6fb1a7ba Set empty object as console prototype (#33358)
* Remove console prototype hack

The console object has an empty object as its prototype,
not the realm object prototype.

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Update WPT expectations

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2024-09-07 23:10:47 +00:00
Martin Robinson
f3f96c3393 layout: Do not use orthogonal baselines in flex layout (#33347)
When a baseline is orthogonal to the main flexbox axis, it should not
take part in baseline alignment. This change does that for column flex.
While there is no support for vertical writing modes, this change is
made to be as writing mode-agnostic as possible.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2024-09-07 22:08:48 +00:00
Taym Haddadi
a43e296436 Fix devtool crashs after clicking Enable connection prompt (#33305)
* Fix devtool crashs after clicking Enable connection prompt

Signed-off-by: Taym <haddadi.taym@gmail.com>

* Use early error return

Signed-off-by: Taym <haddadi.taym@gmail.com>

---------

Signed-off-by: Taym <haddadi.taym@gmail.com>
2024-09-07 20:58:16 +00:00
Samson
567c3185f8 chore: Update wgpu (#33357)
* Update wgpu

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Update expectations

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2024-09-07 20:28:36 +00:00
Taym Haddadi
152e62022a Move convert_label to Into implementation (#33348)
Signed-off-by: Taym <haddadi.taym@gmail.com>
2024-09-06 21:58:13 +00:00
dependabot[bot]
bc04f94a30 build(deps): bump wayland-cursor from 0.31.5 to 0.31.6 (#33351)
Bumps [wayland-cursor](https://github.com/smithay/wayland-rs) from 0.31.5 to 0.31.6.
- [Release notes](https://github.com/smithay/wayland-rs/releases)
- [Changelog](https://github.com/Smithay/wayland-rs/blob/master/historical_changelog.md)
- [Commits](https://github.com/smithay/wayland-rs/commits)

---
updated-dependencies:
- dependency-name: wayland-cursor
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-06 17:48:38 +00:00
dependabot[bot]
5d85f283c7 build(deps): bump cpufeatures from 0.2.13 to 0.2.14 (#33350)
Bumps [cpufeatures](https://github.com/RustCrypto/utils) from 0.2.13 to 0.2.14.
- [Commits](https://github.com/RustCrypto/utils/compare/cpufeatures-v0.2.13...cpufeatures-v0.2.14)

---
updated-dependencies:
- dependency-name: cpufeatures
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-06 17:42:13 +00:00
dependabot[bot]
3fb4833c88 build(deps): bump bytemuck from 1.17.1 to 1.18.0 (#33349)
Bumps [bytemuck](https://github.com/Lokathor/bytemuck) from 1.17.1 to 1.18.0.
- [Changelog](https://github.com/Lokathor/bytemuck/blob/main/changelog.md)
- [Commits](https://github.com/Lokathor/bytemuck/compare/v1.17.1...v1.18.0)

---
updated-dependencies:
- dependency-name: bytemuck
  dependency-type: indirect
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-06 17:34:44 +00:00
Martin Robinson
c24c7d8e4d layout: Lay out absolutes in atomic containing blocks (#33336)
When inline atomics establish containing blocks for absolute
descendants, layout should happen with those atomics as the containing
block. This ensures that the absolute descendents have the correct
containing block and Fragment parent. This wasn't happening before and
this change fixes that.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2024-09-06 13:42:45 +00:00
Samson
ebed9218f2 webgpu: Move actual Create* implementations from GPUDevice to Self (#33320)
* Move actual Create* implementations from `GPUDevice` to Self

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* move Create*Pipeline to Self::create

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* `parse_render_pipeline` outside`GPURenderPipeline::create`

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2024-09-05 19:48:16 +00:00
Martin Robinson
312cf0df08 script: Create a CrossProcessInstant to enable serializable monotonic time (#33282)
Up until now, Servo was using a very old version of time to get a
cross-process monotonic timestamp (using `time::precise_time_ns()`).
This change replaces the usage of old time with a new serializable
monotonic time called `CrossProcessInstant` and uses it where `u64`
timestamps were stored before. The standard library doesn't provide this
functionality because it isn't something you can do reliably on all
platforms. The idea is that we do our best and then fall back
gracefully.

This is a big change, because Servo was using `u64` timestamps all over
the place some as raw values taken from `time::precise_time_ns()` and
some as relative offsets from the "navigation start," which is a concept
similar to DOM's `timeOrigin` (but not exactly the same). It's very
difficult to fix this situation without fixing it everywhere as the
`Instant` concept is supposed to be opaque. The good thing is that this
change clears up all ambiguity when passing times as a `time::Duration`
is unit agnostic and a `CrossProcessInstant` represents an absolute
moment in time.

The `time` version of `Duration` is used because it can both be negative
and is also serializable.

Good things:
 - No need too pass around `time` and `time_precise` any longer.
   `CrossProcessInstant` is also precise and monotonic.
 - The distinction between a time that is unset or at `0` (at some kind
   of timer epoch) is now gone.

There still a lot of work to do to clean up timing, but this is the
first step. In general, I've tried to preserve existing behavior, even
when not spec compliant, as much as possible. I plan to submit followup
PRs fixing some of the issues I've noticed.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-09-05 18:50:09 +00:00
dependabot[bot]
35baf056f6 build(deps): bump serde_json from 1.0.127 to 1.0.128 (#33333)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.127 to 1.0.128.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/1.0.127...1.0.128)

---
updated-dependencies:
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-05 17:41:39 +00:00
dependabot[bot]
5d30f8f3cc build(deps): bump rustix from 0.38.35 to 0.38.36 (#33332)
Bumps [rustix](https://github.com/bytecodealliance/rustix) from 0.38.35 to 0.38.36.
- [Release notes](https://github.com/bytecodealliance/rustix/releases)
- [Commits](https://github.com/bytecodealliance/rustix/compare/v0.38.35...v0.38.36)

---
updated-dependencies:
- dependency-name: rustix
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-05 17:35:24 +00:00
dependabot[bot]
a59f295fa2 build(deps): bump wayland-scanner from 0.31.4 to 0.31.5 (#33330)
Bumps [wayland-scanner](https://github.com/smithay/wayland-rs) from 0.31.4 to 0.31.5.
- [Release notes](https://github.com/smithay/wayland-rs/releases)
- [Changelog](https://github.com/Smithay/wayland-rs/blob/master/historical_changelog.md)
- [Commits](https://github.com/smithay/wayland-rs/commits)

---
updated-dependencies:
- dependency-name: wayland-scanner
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-05 17:35:05 +00:00
dependabot[bot]
004fd0281b build(deps): bump wayland-client from 0.31.5 to 0.31.6 (#33331)
Bumps [wayland-client](https://github.com/smithay/wayland-rs) from 0.31.5 to 0.31.6.
- [Release notes](https://github.com/smithay/wayland-rs/releases)
- [Changelog](https://github.com/Smithay/wayland-rs/blob/master/historical_changelog.md)
- [Commits](https://github.com/smithay/wayland-rs/commits)

---
updated-dependencies:
- dependency-name: wayland-client
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-05 17:31:46 +00:00
dependabot[bot]
5350edb6ea build(deps): bump ohos-sys from 0.3.0 to 0.3.1 (#33329)
Bumps [ohos-sys](https://github.com/openharmony-rs/ohos-sys) from 0.3.0 to 0.3.1.
- [Changelog](https://github.com/openharmony-rs/ohos-sys/blob/main/CHANGELOG.md)
- [Commits](https://github.com/openharmony-rs/ohos-sys/commits)

---
updated-dependencies:
- dependency-name: ohos-sys
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-05 17:28:57 +00:00
dependabot[bot]
0ee1a5e82c build(deps): bump rustfix from 0.8.4 to 0.8.5 (#33328)
Bumps [rustfix](https://github.com/rust-lang/cargo) from 0.8.4 to 0.8.5.
- [Changelog](https://github.com/rust-lang/cargo/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/cargo/commits)

---
updated-dependencies:
- dependency-name: rustfix
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-05 17:22:24 +00:00
dependabot[bot]
aa8c8f8153 build(deps): bump tokio-util from 0.7.11 to 0.7.12 (#33326)
Bumps [tokio-util](https://github.com/tokio-rs/tokio) from 0.7.11 to 0.7.12.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-util-0.7.11...tokio-util-0.7.12)

---
updated-dependencies:
- dependency-name: tokio-util
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-05 17:19:35 +00:00
dependabot[bot]
e271a47c06 build(deps): bump wayland-backend from 0.3.6 to 0.3.7 (#33327)
Bumps [wayland-backend](https://github.com/smithay/wayland-rs) from 0.3.6 to 0.3.7.
- [Release notes](https://github.com/smithay/wayland-rs/releases)
- [Changelog](https://github.com/Smithay/wayland-rs/blob/master/historical_changelog.md)
- [Commits](https://github.com/smithay/wayland-rs/commits)

---
updated-dependencies:
- dependency-name: wayland-backend
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-05 17:19:30 +00:00
dependabot[bot]
66544c39cc build(deps): bump tokio-stream from 0.1.15 to 0.1.16 (#33325)
Bumps [tokio-stream](https://github.com/tokio-rs/tokio) from 0.1.15 to 0.1.16.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-stream-0.1.15...tokio-stream-0.1.16)

---
updated-dependencies:
- dependency-name: tokio-stream
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-05 17:16:27 +00:00
webbeef
7e493ba865 minibrowser: Reset the location field when switching tabs (#33316)
Signed-off-by: webbeef <me@webbeef.org>
2024-09-05 13:45:11 +00:00
dependabot[bot]
e6ee879d2a build(deps): bump cc from 1.1.15 to 1.1.16 (#33317)
Bumps [cc](https://github.com/rust-lang/cc-rs) from 1.1.15 to 1.1.16.
- [Release notes](https://github.com/rust-lang/cc-rs/releases)
- [Changelog](https://github.com/rust-lang/cc-rs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/cc-rs/compare/cc-v1.1.15...cc-v1.1.16)

---
updated-dependencies:
- dependency-name: cc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-05 13:33:47 +00:00
atbrakhi
0f24b8c823 Add tracing events (#33189)
Signed-off-by: atbrakhi <atbrakhi@igalia.com>
2024-09-05 12:11:12 +00:00
Oriol Brufau
37e1c3385e Treat align-self: normal as stretch on flex items (#33314)
According to https://drafts.csswg.org/css-align/#align-flex
It was being treated as `auto` instead.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2024-09-05 11:15:41 +00:00
Ben
8263fe5495 Added some keyboard shortcuts for focusing tabs (#33319)
Currently Cmd/Ctrl + [1-9] and Ctrl + PageUp/Down, since they are
present in most major browsers.

Signed-off-by: Benjamin Vincent Schulenburg <bennyschulenburg@gmx.de>
2024-09-05 10:38:29 +00:00
Daniel Adams
75c7712905 webxr: Add some missing internal checks/validation (#33318)
* Ensure depthFar is non-negative

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Properly append default features in requestSession

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Ensure XRRigidTransform init members have finite values

Signed-off-by: Daniel Adams <msub2official@gmail.com>

---------

Signed-off-by: Daniel Adams <msub2official@gmail.com>
2024-09-05 03:39:27 +00:00
Andriy Sultanov
aadc212b95 jsstring_to_str should accept a NonNull argument for the JS string (#33306)
Instead of asserting the raw pointer is not null, force callers to
produce a NonNull pointer.

Signed-off-by: Andriy Sultanov <sultanovandriy@gmail.com>
2024-09-05 03:25:49 +00:00
Delan Azabani
642c25d9a7 CI: use monitor API for self-hosted runners (#33315)
Signed-off-by: Delan Azabani <dazabani@igalia.com>
2024-09-04 17:11:32 +00:00
Taym Haddadi
00389cf007 Transform convert_* functions in gpuconvert.rs to From/TryFrom implementations (#33302)
Signed-off-by: Taym <haddadi.taym@gmail.com>
2024-09-04 16:03:59 +00:00
Delan Azabani
c0ced7a524 Make tracing available on all platforms, with or without perfetto (#33301)
* Make tracing available on all platforms

Signed-off-by: Delan Azabani <dazabani@igalia.com>

* Gate perfetto support behind its own feature

Signed-off-by: Delan Azabani <dazabani@igalia.com>

---------

Signed-off-by: Delan Azabani <dazabani@igalia.com>
2024-09-04 12:56:29 +00:00
Ben
891562be8e servoshell: Add close buttons and increase interactivity of tabs (#33244)
* Improved the minibrowser tab bar

Added a close button for each tab as well as another button for opening
a new tab, also changed the styling so it looks more like other
browsers.

Signed-off-by: Benjamin Vincent Schulenburg <bennyschulenburg@gmx.de>

* Make sure to restore the egui visuals after drawing a browser tab

Signed-off-by: Benjamin Vincent Schulenburg <bennyschulenburg@gmx.de>

* Only use colors from the current theme for the minibrowser tabbar

That way we can easily switch between light and dark mode

Signed-off-by: Benjamin Vincent Schulenburg <bennyschulenburg@gmx.de>

---------

Signed-off-by: Benjamin Vincent Schulenburg <bennyschulenburg@gmx.de>
2024-09-04 11:31:23 +00:00
Samson
3c6ca33832 webgpu: Support pipeline-overridable constants (#33291)
* Impl pipeline constants

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* More relaxed lifetimes

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Update expectations

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Replace convert function with `From` implementation

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2024-09-04 11:31:07 +00:00
Daniel Adams
a976db3ec0 Update layout of servoshell android app (#33294)
* Update layout of servoshell android app

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Remove gap after loop/idle text

Signed-off-by: Daniel Adams <msub2official@gmail.com>

---------

Signed-off-by: Daniel Adams <msub2official@gmail.com>
2024-09-04 11:30:52 +00:00
Simon Wülker
961fcfc46d Only handle most recent resize event in script thread (#33297)
This avoids having to do unnecessary layout work and
prevents resize events from accumulating, which looks
weird.

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2024-09-04 11:30:39 +00:00
Simon Wülker
fc5f8e9237 Implement HTMLQuoteElement "cite" attribute (#33307)
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2024-09-04 11:29:59 +00:00
dependabot[bot]
febb4f24c4 build(deps): bump syn from 2.0.76 to 2.0.77 (#33285)
Bumps [syn](https://github.com/dtolnay/syn) from 2.0.76 to 2.0.77.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/2.0.76...2.0.77)

---
updated-dependencies:
- dependency-name: syn
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-04 10:28:03 +00:00
atbrakhi
ba7e53264d Add initial support for tracing and tracing-perfetto (#33188)
Signed-off-by: atbrakhi <atbrakhi@igalia.com>
Co-authored-by: Delan Azabani <dazabani@igalia.com>
2024-09-04 08:24:29 +00:00
Samson
abe532dd2f CI: Force github hosted runners and remove concurrency on select-runner job (#33308)
temporary fix for #33276

Signed-off-by: Samson <16504129+sagudev@users.noreply.github.com>
2024-09-04 08:23:40 +00:00
Oriol Brufau
27d87f104e Fix intrinsic sizing of column flex containers (#33299)
From https://drafts.csswg.org/css-flexbox-1/#intrinsic-cross-sizes,
> The min-content/max-content cross size of a single-line flex container
> is the largest min-content contribution/max-content contribution
> (respectively) of its flex items.

We were using the min/max-content size instead of the min/max-content
contribution.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2024-09-04 06:44:31 +00:00
Simon Wülker
e43e477842 Implement compact/type attributes for HTMLUListElement (#33303)
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2024-09-04 06:17:27 +00:00
dependabot[bot]
93cd8d1ba4 build(deps): bump indexmap from 2.4.0 to 2.5.0 (#33284)
Bumps [indexmap](https://github.com/indexmap-rs/indexmap) from 2.4.0 to 2.5.0.
- [Changelog](https://github.com/indexmap-rs/indexmap/blob/master/RELEASES.md)
- [Commits](https://github.com/indexmap-rs/indexmap/compare/2.4.0...2.5.0)

---
updated-dependencies:
- dependency-name: indexmap
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-04 04:59:01 +00:00
Samson
e857cdf022 Hack around DCO not in MQ (#33290)
See https://github.com/servo/servo/pull/33283#issuecomment-2325240423

Signed-off-by: Samson <16504129+sagudev@users.noreply.github.com>
2024-09-03 07:56:03 +00:00
Delan Azabani
4b96d8ef36 CI: label self-hosted runners with run id to aid debugging (#33283)
Signed-off-by: Delan Azabani <dazabani@igalia.com>
2024-09-03 07:55:55 +00:00
Taym Haddadi
6c0394bc80 Impl PartialEq and Eq for DomObject (#33212)
* Impl PartialEq and Eq for DomObject

Signed-off-by: Taym <haddadi.taym@gmail.com>

* move to Eq and PartialEq to domobject_derive

Signed-off-by: Taym <haddadi.taym@gmail.com>

---------

Signed-off-by: Taym <haddadi.taym@gmail.com>
2024-09-02 09:50:46 +00:00
Jonathan Schwender
31e84a8c48 ohos: Enable Webgl context creation on OH 5.0 (#33257)
* ohos: Enable Webgl context creation on OH 5.0

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>

* Bump surfman to 0.9.8

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>

---------

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
2024-09-02 07:00:11 +00:00
Jonathan Schwender
c9548d82ef bootstrap: Avoid needless sudo when pkgs are installed (#33281)
- Previously on fedora `./mach bootstrap` would always detect it needs to
  reinstall packages and require root permissions.
- use custom queryformat for `rpm -qa` to to just get the package name
  (e.g. `openssl-libs` instead of `openssl-libs-3.2.2-3.fc40.i686`
- Use a list to store the output result instead of one string
- Fedora (40) installs `zlib-ng` instead of `zlib` and `libjpeg-turbo` instead
  of `libjpeg`, meaning that `rpm` / dnf commands report `zlib` as not installed.
  Specifying the actually installed package avoids this problem.

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
2024-09-02 06:56:38 +00:00
Jonathan Schwender
35ca050bfb android: Fix install (#33277)
self.config["android"]["target"] is unset, causing an exception.
We can just use self.target.triple() instead.

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2024-09-01 20:17:34 +00:00
Josh Matthews
a62612a025 Make all platforms use a delay during cookie tests. (#33279)
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2024-09-01 20:07:46 +00:00
dependabot[bot]
12a782dc20 build(deps): bump glslopt from 0.1.10 to 0.1.11 (#33268)
Bumps [glslopt](https://github.com/jamienicol/glslopt-rs) from 0.1.10 to 0.1.11.
- [Commits](https://github.com/jamienicol/glslopt-rs/commits)

---
updated-dependencies:
- dependency-name: glslopt
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-01 17:28:08 +00:00
dependabot[bot]
06778e3643 build(deps): bump object from 0.36.3 to 0.36.4 (#33269)
Bumps [object](https://github.com/gimli-rs/object) from 0.36.3 to 0.36.4.
- [Changelog](https://github.com/gimli-rs/object/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gimli-rs/object/compare/0.36.3...0.36.4)

---
updated-dependencies:
- dependency-name: object
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-01 15:28:38 +00:00
Daniel Adams
9fdaf9bf0c Update FakeXRDevice to support updating bounds (#33271)
* Update FakeXRDevice to support updating bounds

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Add missing spec link

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Mark secondaryViews as optional in FakeXRDevice.setViews

Signed-off-by: Daniel Adams <msub2official@gmail.com>

---------

Signed-off-by: Daniel Adams <msub2official@gmail.com>
2024-09-01 11:58:32 +00:00
Servo WPT Sync
3453d9fdad Update web-platform-tests to revision b'5d8ec746ed021738e7ee0cee92ad1a1814ba00fe' (#33274)
Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
2024-09-01 01:40:45 +00:00
Oriol Brufau
3acc9edd82 Fix various issues with replaced elements in flex layout (#33263)
In particular, this takes into account that flex items may be stretched,
and if they have an aspect ratio, we ma6y need to convert the stretched
size through the ratio.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-08-30 23:39:18 +00:00
Cristian Brinza
4ae2610c24 fonts: Enable fast text shaping on Windows (#33123)
* Use patched dwrote

Signed-off-by: crbrz <cristianb@gmail.com>

* Enable fast text shaping

Signed-off-by: crbrz <cristianb@gmail.com>

* Add fast text shape test

Signed-off-by: crbrz <cristianb@gmail.com>

* Update dwrote to 0.11.1

Signed-off-by: crbrz <cristianb@gmail.com>

---------

Signed-off-by: crbrz <cristianb@gmail.com>
2024-08-30 23:16:26 +00:00
Martin Robinson
6f333a8e29 net: Stop using both versions of the time crate in the cookie code (#33260)
`std::time` is good enough for us here. `cookie` is using `time 0.3`,
but Servo can convert to standard library types when getting data from
`cookie`. This reduces our direct dependencies and removes more use of
the very old `time 0.1` series.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-08-30 17:15:47 +00:00
dependabot[bot]
1e9344cb5c build(deps): bump tokio from 1.39.3 to 1.40.0 (#33270)
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.39.3 to 1.40.0.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.39.3...tokio-1.40.0)

---
updated-dependencies:
- dependency-name: tokio
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-30 17:08:41 +00:00
Samson
5e89643fa7 chore: Update wgpu to 34bb9e4ceb45a5b1cfc5df6aa2b2e201cc55372c (#33266)
* Update wgpu to include local const

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* set expectations

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2024-08-30 16:38:34 +00:00
Martin Robinson
a4ceb82ef5 script: Stop using time in DOM timers (#33262)
This switches to using `std::time` types for DOM timer operations, which
allows removing our custom time units in favor of `Duration`.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-08-30 15:20:44 +00:00
Jonathan Schwender
8a0c7487e7 ohos: Present on vsync signals (#33117)
Rely on callbacks from the vertical synchronization driver,
to drive presentation.
Future commits will base animation updates and touchless
gestures like fling off these vsync events.

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-08-30 13:25:50 +00:00
Martin Robinson
a58d816319 net: Stop using legacy time in the HTTP and CORS caches (#33259)
This is part of switching away from using a very old version of `time`.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-08-30 12:54:02 +00:00
Samson
817a91f2ac webgpu: Clean up GPUCommandEncoders and add some validation (#33223)
* TextureUsages::from_bits_retain

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Fixup CreateBindGroupLayout

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* GPUExtent3D checking and converting

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Cleanup GPUCommandEncoders and some TODOs

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* validate gpuorigin3d

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* validate GPUColor

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* set good expect

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2024-08-30 11:23:17 +00:00
Martin Robinson
83a40c5180 script: Stop using legacy time for Document::reflow_timeout (#33258)
Use `std::time` from the Rust standard library instead. This is one step
toward removing our use of the legacy `time` crate which has security
issues.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-08-30 08:00:34 +00:00
Oriol Brufau
cd8b803368 Use the proper aspect ratio in flexbox (#33256)
When computing the automatic minimum size, flex layout was using the
natural aspect ratio, ignoring the `aspect-ratio` property.

`ReplacedContent::inline_size_over_block_size_intrinsic_ratio()` is now
made private to avoid more accidental uses.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-08-30 06:28:14 +00:00
dependabot[bot]
13cbcf614a build(deps): bump ohos-sys from 0.2.2 to 0.3.0 (#33253)
Bumps [ohos-sys](https://github.com/openharmony-rs/ohos-sys) from 0.2.2 to 0.3.0.
- [Changelog](https://github.com/openharmony-rs/ohos-sys/blob/main/CHANGELOG.md)
- [Commits](https://github.com/openharmony-rs/ohos-sys/compare/v0.2.2...v0.3.0)

---
updated-dependencies:
- dependency-name: ohos-sys
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-29 17:02:03 +00:00
Oriol Brufau
4bf941bc8a Fix automatic minimum size for column flexbox (#33248)
`main_content_size_info()` was always assigning the main-axis automatic
minimum size into the inline axis. But in a column flexbox, the main
axis corresponds to the block axis.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2024-08-29 16:55:44 +00:00
Cristian Brinza
9ea02fa4b4 Fix minibrowser scroll by keyboard (#33252)
* Fix minibrowser scroll by keyboard

Signed-off-by: crbrz <cristianb@gmail.com>

* Apply suggested change

Co-authored-by: Josh Matthews <josh@joshmatthews.net>
Signed-off-by: Cristian Brinza <cristianb@gmail.com>

---------

Signed-off-by: crbrz <cristianb@gmail.com>
Signed-off-by: Cristian Brinza <cristianb@gmail.com>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
2024-08-29 16:39:08 +00:00
Cristian Brinza
99bd6afa81 Pass keyboard events to WebView on Windows (#33225)
* Pass keyboard events to webview on Windows

Signed-off-by: crbrz <cristianb@gmail.com>

* Refactor WebViewManager::handle_key_from_window

Signed-off-by: crbrz <cristianb@gmail.com>

---------

Signed-off-by: crbrz <cristianb@gmail.com>
2024-08-29 16:06:35 +00:00
Samson
8dd40ed2bd mach: Add test-speedometer command and --bmf-output to speedometer and dromaeo (#33247)
* Allow exporting Dromaeo results as BMF JSON

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Add speedometer runner

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2024-08-29 15:58:57 +00:00
Oriol Brufau
0643aa4708 Handle aspect ratios in ReplacedContent::inline_content_sizes (#33240)
We were only handling the aspect ratio of a replaced element when
computing its min/max-content contribution, but not when computing
the min/max-content size. Now both cases will take it into account.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2024-08-29 15:38:59 +00:00
Martin Robinson
3f93de7f54 layout: Stop using unicode-segmentation in layout (#33250)
`layout` already uses `icu_segmentation` so there's no need to pull in
another segmenter. This reduces the number of segmenters used in the
crate to 2 from 3.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-08-29 14:51:39 +00:00
Oriol Brufau
93abdf7cb5 layout: Add an indefinite containing block for intrinsic sizing (#33204)
When computing the min-content or max-content size of an element we
need to ignore `inline-size`, `min-inline-size` and `max-inline-size`.

However, we should take the block-axis sizing properties into account.
That's because the contents could have percentages depending on them,
which can then affect their inline size via an aspect ratio.

Therefore, this patch adds `IndefiniteContainingBlock`, which is similar
to `ContainingBlock`, but it allows an indefinite inline-size. This
struct is then passed arround during intrinsic sizing.

More refinement will be needed in follow-up patches in order to fully
address the problem.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-08-29 14:10:46 +00:00
Oriol Brufau
46dbe4ce32 Obey min and max cross sizes of flex items (#33242)
When laying out the contents of a flex item, we used to resolve their
cross-axis percentages against the preferred cross size of the item.
Now we will take the min and max cross sizes into account.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-08-29 11:24:23 +00:00
Oriol Brufau
59c74c874a Obey min-block-size and max-block-size in floats (#33241)
We were using the unclamped `box_size.block` instead of `block_size`.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2024-08-29 11:24:07 +00:00
Jonathan Schwender
e8d0f85f52 Bump xi_unicode to latest version (#33246)
* Bump xi_unicode to latest version

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>

* dep: update XI_LINE_BREAKING_CLASS_ZWJ constant to 42

This matches the value returned by xi-unicode's linebreak_property
for `u200D` codepoint in v0.3.0 of the crate.

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

---------

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-08-29 10:43:13 +00:00
Martin Robinson
65c2e75379 ci: Fix the WPT export job after the repository change (#33228)
The GitHub search API is a bit sensitive. There isn't a great way to
search for the repository organization and the branch name when looking
for open PRs. Instead use the bot username as the author name, which
should likely have been having before. This fixes the WPT export job.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-08-29 09:26:04 +00:00
dependabot[bot]
89421b70ad build(deps): bump rustc_version from 0.4.0 to 0.4.1 (#33236)
Bumps [rustc_version](https://github.com/djc/rustc-version-rs) from 0.4.0 to 0.4.1.
- [Release notes](https://github.com/djc/rustc-version-rs/releases)
- [Commits](https://github.com/djc/rustc-version-rs/compare/v0.4.0...v0.4.1)

---
updated-dependencies:
- dependency-name: rustc_version
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-29 08:19:00 +00:00
Daniel Adams
5ffdce9aee servoshell: Enable OpenXR by default and remove old WebVR prefs, adjust XrDiscovery initialization (#33245)
* Remove WebVR prefs, enable OpenXR by default

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Prefer OpenXR if available, otherwise use GLWindow

Signed-off-by: Daniel Adams <msub2official@gmail.com>

---------

Signed-off-by: Daniel Adams <msub2official@gmail.com>
2024-08-29 05:06:57 +00:00
Mukilan Thiyagarajan
1aff31fd96 wpt: fix path to wpt-prefs.json (#33243)
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-08-29 04:37:35 +00:00
Samson
c69acd1848 Fix run_dromaeo.py (#33239)
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2024-08-28 19:03:42 +00:00
dependabot[bot]
b2a9184ddc build(deps): bump euclid from 0.22.10 to 0.22.11 (#33238)
Bumps [euclid](https://github.com/servo/euclid) from 0.22.10 to 0.22.11.
- [Release notes](https://github.com/servo/euclid/releases)
- [Commits](https://github.com/servo/euclid/commits)

---
updated-dependencies:
- dependency-name: euclid
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-28 17:45:38 +00:00
dependabot[bot]
3d0c4f9ea8 build(deps): bump filetime from 0.2.24 to 0.2.25 (#33234)
Bumps [filetime](https://github.com/alexcrichton/filetime) from 0.2.24 to 0.2.25.
- [Commits](https://github.com/alexcrichton/filetime/compare/0.2.24...0.2.25)

---
updated-dependencies:
- dependency-name: filetime
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-28 17:36:05 +00:00
dependabot[bot]
1e47361537 build(deps): bump webxr from 06cf810 to 7656508 (#33233)
Bumps [webxr](https://github.com/servo/webxr) from `06cf810` to `7656508`.
- [Commits](06cf8102e1...7656508fdc)

---
updated-dependencies:
- dependency-name: webxr
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-28 17:35:06 +00:00
dependabot[bot]
0a9fe1beb2 build(deps): bump rustix from 0.38.34 to 0.38.35 (#33232)
Bumps [rustix](https://github.com/bytecodealliance/rustix) from 0.38.34 to 0.38.35.
- [Release notes](https://github.com/bytecodealliance/rustix/releases)
- [Commits](https://github.com/bytecodealliance/rustix/compare/v0.38.34...v0.38.35)

---
updated-dependencies:
- dependency-name: rustix
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-28 17:32:56 +00:00
dependabot[bot]
64b31b6e6a build(deps): bump webrender from c0bcdd0 to 8468e81 (#33231)
Bumps [webrender](https://github.com/servo/webrender) from `c0bcdd0` to `8468e81`.
- [Release notes](https://github.com/servo/webrender/releases)
- [Commits](c0bcdd024a...8468e81608)

---
updated-dependencies:
- dependency-name: webrender
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-28 17:21:34 +00:00
Callum Leslie
87f437d230 fix clippy warning for clamp pattern in webgl_thread (#33230)
Signed-off-by: Callum Leslie <git@cleslie.uk>
2024-08-28 17:01:13 +00:00
Simon Wülker
7c4ba51f51 Don't allow minibrowser tab titles to be empty (#33229)
* avoid unnecessary clones when setting tab title in minibrowser

This is of course not a performance issue, but rather just bad style.
Especially since the url doesn't even need to be .clone()'d
in the first place.

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Don't allow empty tab titles in minibrowser

These look very confusing. If the page has no title
its better to fall back to the url instead of displaying
absolutely nothing. (This is what firefox seems to do
too)

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2024-08-28 16:57:28 +00:00
Callum Leslie
ef42ac0dfc Fix several clippy warnings in components/devtools (#33227)
Signed-off-by: Callum Leslie <git@cleslie.uk>
2024-08-28 16:36:43 +00:00
Chocolate Pie
590527176e layout: Add initial support for clip-path: [<basic-shape> || <shape-box>] (#33107)
* Turn on clip-path tests and add results

Signed-off-by: Martin Robinson <mrobinson@igalia.com>

* enhance: Add support for `clip-path: [<basic-shape> || <shape-box>]`

Signed-off-by: Chocolate Pie <106949016+chocolate-pie@users.noreply.github.com>

* Changes from review

Signed-off-by: Martin Robinson <mrobinson@igalia.com>

---------

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Signed-off-by: Chocolate Pie <106949016+chocolate-pie@users.noreply.github.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-08-28 15:00:34 +00:00
Oriol Brufau
f810983fd2 Remove unused import (#33226)
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2024-08-28 14:09:25 +00:00
Samson
fe44010000 mach: Extract binary select into common_command_arguments (#33205)
* Extract binary select into common_command_arguments

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* fixups

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Small English edit

Signed-off-by: Martin Robinson <mrobinson@igalia.com>

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-08-28 12:07:02 +00:00
Martin Robinson
b29b614775 ci: Use Servo's wpt repository for WPT export (#33224)
This switches the WPT export script to use Servo's fork the `wpt`
upstream repository. The reasoning is that Servo developers's can fix
issues with branches there. This isn't possible because no one has
permissions to the servo-wpt-sync fork of the repository.

I have given `servo-wpt-sync` write persmissions to `servo/wpt`.

This also updates the tests a bit to reflect the new default repository.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-08-28 11:29:51 +00:00
Taym Haddadi
bb5547a5d0 Fix panic in parser-reentrancy-customelement.window.js (#33162)
* Try to fix panic in parser-reentrancy-customelement.window.js

Signed-off-by: Taym <haddadi.taym@gmail.com>

* ./mach fmt

Signed-off-by: Taym <haddadi.taym@gmail.com>

* Only return with ToTokenizerMsg::End and continue for others

Signed-off-by: Taym <haddadi.taym@gmail.com>

---------

Signed-off-by: Taym <haddadi.taym@gmail.com>
2024-08-28 11:01:21 +00:00
Oriol Brufau
9639d36550 Remove width and height presentational hints for <canvas> (#33211)
According to HTML, the `width` and `height` attributes should only set
the natural sizes and the aspect ratio.
The `width` and `height` properties should stay as `initial` by default.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-08-28 10:20:18 +00:00
Martin Robinson
a6b9640c99 compositor: Do not parse the Cargo.lock file while building (#33222)
The compositor's `build.rs` script was parsing the `Cargo.lock` file in
order to tag WebRender captures with the WebRender version. The embedder
already knows what version of Servo we are using, which should be enough
to infer the WebRender revision. This changes does that and generally
does a bit of cleaning up of how captures are done.

- The name of the capture directory is now `webrender-captures`
- There is console output now when captures are done. Before it was hard
  to know if it succeeded.
- Simplify the Compositor constructor a little to avoid passing
  arguments so much.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-08-28 08:36:54 +00:00
Mukilan Thiyagarajan
5092cece7a wpt: fix the path to wpt-prefs.json on WPT runner (#33220)
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-08-28 07:50:16 +00:00
Jonathan Schwender
6de7848aff android: Remove unused imports in android.rs (#33218)
Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
2024-08-28 03:51:00 +00:00
atbrakhi
2037884469 Fix clippy wanings in layout (#33215)
Signed-off-by: atbrakhi <atbrakhi@igalia.com>
2024-08-27 20:53:43 +00:00
Samson
12661c1920 Update wgpu (#33209)
no gfx_select macro and some minor changes to passes

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2024-08-27 20:31:31 +00:00
webbeef
1b48bd18aa Basic tab strip for the minibrowser (#33100)
This implements a simple tab system for servoshell:
- The egui part uses the built-in SelectableLabels components and
  display the full tab title on hover.
- WebView structs now hold all the state for each WebView. When we
  need "global" state, we return the focused WebView state, eg.
  for the load status since it's still global in the UI.
- New keyboard shortcut: [Cmd-or-Ctrl]+[W] to close the current tab.
- New keyboard shortcut: [Cmd-or-Ctrl]+[T] to create a new tab.
- The new tab content is loaded from the 'servo:newtab' url using a
  couple of custom protocol handlers.

Signed-off-by: webbeef <me@webbeef.org>
2024-08-27 20:17:33 +00:00
dependabot[bot]
a0ff57cea1 build(deps): bump bytemuck from 1.17.0 to 1.17.1 (#33214)
Bumps [bytemuck](https://github.com/Lokathor/bytemuck) from 1.17.0 to 1.17.1.
- [Changelog](https://github.com/Lokathor/bytemuck/blob/main/changelog.md)
- [Commits](https://github.com/Lokathor/bytemuck/compare/v1.17.0...v1.17.1)

---
updated-dependencies:
- dependency-name: bytemuck
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-27 17:20:09 +00:00
Martin Robinson
87027d2e5c Remove measurement of layout query wait time (#33210)
Now that the script thread and the layout thread are the same the wait
time effectively zero, so there's no need to measure it. This also
removes one dependency and removes one use of legacy time.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-08-27 16:01:48 +00:00
Oriol Brufau
50eb69a7e0 Allow creating a ContentSizes from Au (#33208)
No change in behavior, it just simplies some code a little bit.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2024-08-27 15:22:47 +00:00
Oriol Brufau
dbd0a79b3e Allow caching IndependentFormattingContext::inline_content_sizes() (#33207)
For non-replaced formatting contexts, this method redirected directly to
`NonReplacedFormattingContextContents::inline_content_sizes()`, which
has the actual logic for the computation.

Thus it was bypassing the cache, which is handled in
`NonReplacedFormattingContext::inline_content_sizes()`.

Therefore, this patch redirects to the latter.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2024-08-27 13:43:50 +00:00
Jonathan Schwender
2537234090 ohos: Add FFI-APIs to navigate back and forward (#33206)
To be useful it requires using the latest version of the OH demo ArkTS app,
but it is still compatible with older versions, as the newly added FFI functions
will simply be unused in such a case.

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
2024-08-27 11:48:17 +00:00
Delan Azabani
658df79d88 CI: use self-hosted runners for Windows build jobs (#33081)
* CI: use self-hosted Windows runners in main workflow

Signed-off-by: Delan Azabani <dazabani@igalia.com>

* Fix a couple of robustness issues by generating a unique build id

Signed-off-by: Delan Azabani <dazabani@igalia.com>

* Work around needs-context expressions being busted in concurrency

Signed-off-by: Delan Azabani <dazabani@igalia.com>

* CI: use self-hosted Windows runners in try and try-label workflows

Signed-off-by: Delan Azabani <dazabani@igalia.com>

* Rename windows workflow back for simplicity

Signed-off-by: Delan Azabani <dazabani@igalia.com>

* Clarify why the copy resources step is for GitHub-hosted jobs only

Signed-off-by: Delan Azabani <dazabani@igalia.com>

* Fix cancelled status problem by dispatching instead of calling

Signed-off-by: Delan Azabani <dazabani@igalia.com>

* Tweak retry strategy to avoid hitting REST API rate limits

Signed-off-by: Delan Azabani <dazabani@igalia.com>

* Update dispatch-workflow.yml accordingly

Signed-off-by: Delan Azabani <dazabani@igalia.com>

* Rework to use simpler approach with runner labels

Signed-off-by: Delan Azabani <dazabani@igalia.com>

* Use org-scoped self-hosted runners

Signed-off-by: Delan Azabani <dazabani@igalia.com>

* Don’t run runner-timeout job when GitHub-hosted runner is selected

Signed-off-by: Delan Azabani <dazabani@igalia.com>

* Downgrade to Python 3.10

Signed-off-by: Delan Azabani <dazabani@igalia.com>

* Avoid failing when RUNNER_API_TOKEN is missing (such as in forks)

Signed-off-by: Delan Azabani <dazabani@igalia.com>

* Fix undefined needs output when RUNNER_API_TOKEN is missing

Signed-off-by: Delan Azabani <dazabani@igalia.com>

* Reset working tree, in case it was dirty in the runner image

Signed-off-by: Delan Azabani <dazabani@igalia.com>

* Clearer runner assignment timeout jobs that fail and offer help

Signed-off-by: Delan Azabani <dazabani@igalia.com>

* Fix some other sources of incremental build breakage (but not PATH)

Signed-off-by: Delan Azabani <dazabani@igalia.com>

* Log reasons why we fall back to GitHub-hosted runners

Signed-off-by: Delan Azabani <dazabani@igalia.com>

* Allow self-hosted runners to be disabled via repository variable

Signed-off-by: Delan Azabani <dazabani@igalia.com>

* Always install crown, even on self-hosted runners

Signed-off-by: Delan Azabani <dazabani@igalia.com>

* Rename incremental build debugging step

Signed-off-by: Delan Azabani <dazabani@igalia.com>

* Clean up job friendly names

Signed-off-by: Delan Azabani <dazabani@igalia.com>

* Reduce fetch depth, now that this job no longer lints

Signed-off-by: Delan Azabani <dazabani@igalia.com>

---------

Signed-off-by: Delan Azabani <dazabani@igalia.com>
2024-08-27 11:04:42 +00:00
Oriol Brufau
5d43d88b6c Respect min/max constraints in the block axis of block containers (#33203)
Consider a block container that establishes an inline formatting context
and has a definite `block-size` which is clamped by `min-block-size` or
`max-block-size`.

We were already sizing such container correctly, however, its contents
were resolving their percentages against the unclamped `block-size`
value.

This patch fixes the `ContainingBlock` that we pass to the contents so
that they resolve percentages correctly.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-08-27 09:05:43 +00:00
Ben
fef44620cc Fixed build error on macos (#33200)
This was due to uname reporting the architecture as arm64
instead of aarch64 on macos

Signed-off-by: Benjamin Vincent Schulenburg <bennyschulenburg@gmx.de>
2024-08-27 08:31:26 +00:00
Mukilan Thiyagarajan
173b6f183c wpt: check for wpt-prefs.json in "./servo" sub-directory (#33202)
The current working directory when running on WPT runners is not the
folder with the servo binary, but a parent folder into which the servo
nightly tar is extracted. This means the binary is `$PWD/servo/servo`
and resources directory in in `$PWD/servo/resources`, so the current
hardcoded relative path `resources/wpt-prefs.json` will not work on WPT
runners.

This is causing crashes in WPT runner:

https://github.com/web-platform-tests/wpt/runs/29284407168
https://community-tc.services.mozilla.com/tasks/J7MqNwJGQRSkIWlvB5ktPQ/runs/0/logs/live/public/logs/live.log

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-08-27 08:04:12 +00:00
Samson
7fce24f9d5 webgpu: Sync GPUBuffer (#33154)
* More helpers on `Promise`

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Sync `GPUBuffer`

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Set some good expectations

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Some bad expect

also on firefox

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Extract DataBlock, DataView impl from GPUBuffer

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Fix size check to work on 32bit platforms

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2024-08-27 07:54:55 +00:00
Martin Robinson
bb5926b329 mach: Do not manually install toolchain for non-cross builds (#33190)
* mach: Do not manually install toolchain for non-cross builds

This fixes the Apple Silicon build where the installed toolchain does
not match the host triple. We only install toolchains manually for cross
builds, because cargo and friends will do this automatically when
executing.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>

* fix lints

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

---------

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-08-27 05:30:43 +00:00
dependabot[bot]
ba4e081e8e build(deps): bump serde from 1.0.208 to 1.0.209 (#33196)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.208 to 1.0.209.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.208...v1.0.209)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-26 18:56:21 +00:00
dependabot[bot]
f84da1521a build(deps): bump fastrand from 2.1.0 to 2.1.1 (#33198)
Bumps [fastrand](https://github.com/smol-rs/fastrand) from 2.1.0 to 2.1.1.
- [Release notes](https://github.com/smol-rs/fastrand/releases)
- [Changelog](https://github.com/smol-rs/fastrand/blob/master/CHANGELOG.md)
- [Commits](https://github.com/smol-rs/fastrand/compare/v2.1.0...v2.1.1)

---
updated-dependencies:
- dependency-name: fastrand
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-26 17:08:35 +00:00
dependabot[bot]
4b8ca674fc build(deps): bump syn from 2.0.75 to 2.0.76 (#33197)
Bumps [syn](https://github.com/dtolnay/syn) from 2.0.75 to 2.0.76.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/2.0.75...2.0.76)

---
updated-dependencies:
- dependency-name: syn
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-26 17:07:21 +00:00
dependabot[bot]
00ba0dfa2e build(deps): bump libz-sys from 1.1.19 to 1.1.20 (#33194)
Bumps [libz-sys](https://github.com/rust-lang/libz-sys) from 1.1.19 to 1.1.20.
- [Release notes](https://github.com/rust-lang/libz-sys/releases)
- [Commits](https://github.com/rust-lang/libz-sys/compare/1.1.19...1.1.20)

---
updated-dependencies:
- dependency-name: libz-sys
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-26 16:55:17 +00:00
dependabot[bot]
806d960d38 build(deps): bump serde_json from 1.0.125 to 1.0.127 (#33195)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.125 to 1.0.127.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/1.0.125...1.0.127)

---
updated-dependencies:
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-26 16:51:58 +00:00
dependabot[bot]
cdedb57aee build(deps): bump cc from 1.1.14 to 1.1.15 (#33193)
Bumps [cc](https://github.com/rust-lang/cc-rs) from 1.1.14 to 1.1.15.
- [Release notes](https://github.com/rust-lang/cc-rs/releases)
- [Changelog](https://github.com/rust-lang/cc-rs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/cc-rs/compare/cc-v1.1.14...cc-v1.1.15)

---
updated-dependencies:
- dependency-name: cc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-26 16:48:51 +00:00
dependabot[bot]
8f14f7bee6 build(deps): bump flate2 from 1.0.32 to 1.0.33 (#33192)
Bumps [flate2](https://github.com/rust-lang/flate2-rs) from 1.0.32 to 1.0.33.
- [Release notes](https://github.com/rust-lang/flate2-rs/releases)
- [Changelog](https://github.com/rust-lang/flate2-rs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/flate2-rs/compare/1.0.32...1.0.33)

---
updated-dependencies:
- dependency-name: flate2
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-26 16:41:57 +00:00
Martin Robinson
7b7020a8d4 layout: Enable flexbox by default on non-legacy layout (#33186)
Flexbox is still very much in progress, but things are working well
enough that we can enable it by default. It improves most pages that use
flexbox now.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-08-26 13:50:52 +00:00
Mukilan Thiyagarajan
b6d5ac09b0 mach: introduce BuildTarget abstraction (#33114)
Introduce a new `BuildTarget` abstraction to centralize the code for
supporting different ways of choosing the build target (e.g --android,
--target x86_64-linux-android , --target aarch64-linux-ohos). This
is currently handled in an adhoc fashion in different commands (
mach package, install, run) leading to a proliferation of keyword
parameters for the commands and duplicated logic.

The patch introduces a new `allow_target_configuration` decorator to
do the validation and parsing of these parameters into the appropriate
`BuildTarget` subclass, which is now stored as an instance attribute
of the CommandBase class. All the code that previously relied on
`self.cross_compile_target` has been switched to use the BuildTarget.

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-08-26 13:08:21 +00:00
Samson
4397d8a021 Add dom.allow_scripts_to_close_windows pref. (#33187)
It's also present in firefox: https://searchfox.org/mozilla-central/search?q=allow_scripts_to_close_windows

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2024-08-26 11:44:47 +00:00
Ben
0e6b55c71d Redesigned minibrowser toolbar to use icons instead of text (#33179)
* Redesigned minibrowser toolbar to use icons instead of text

Signed-off-by: Benjamin Vincent Schulenburg <bennyschulenburg@gmx.de>

* Apply suggestions from code review

Address a couple nits

Signed-off-by: Martin Robinson <mrobinson@igalia.com>

---------

Signed-off-by: Benjamin Vincent Schulenburg <bennyschulenburg@gmx.de>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-08-26 09:43:40 +00:00
Erik Hennig
e5caa725da Fix a memory leak in components/script/script_runtime.rs and add more leak suppressions (#33175)
* asan: Add suppression for known false positive

Signed-off-by: ede1998 <online@erik-hennig.me>

* fix: re-suppress lazy_static leaks

lazy_static is still used by dependencies and still leaks
from static variables.

Signed-off-by: ede1998 <online@erik-hennig.me>

* fix: Memory leak of Box<NetworkingTaskSource>

Signed-off-by: ede1998 <online@erik-hennig.me>

---------

Signed-off-by: ede1998 <online@erik-hennig.me>
2024-08-26 07:33:23 +00:00
Daniel Adams
c028b5c299 webxr: Implement XRBoundedReferenceSpace (#33176)
* Implement XRBoundedReferenceSpace

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update expectations

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update interfaces

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Add missing pref condition on IDL interface

Signed-off-by: Daniel Adams <msub2official@gmail.com>

---------

Signed-off-by: Daniel Adams <msub2official@gmail.com>
2024-08-25 23:53:39 +00:00
Samson
e0e562137c Add fallback value for data['message'] (#33185)
Signed-off-by: Samson <16504129+sagudev@users.noreply.github.com>
2024-08-25 21:54:51 +00:00
Taym Haddadi
a3f5a8482d Fix panic in abort-block-bfcache.window.js (#33173)
* Fix panic in abort-block-bfcache.window.js

Signed-off-by: Taym <haddadi.taym@gmail.com>

* Update test expectation

Signed-off-by: Taym <haddadi.taym@gmail.com>

---------

Signed-off-by: Taym <haddadi.taym@gmail.com>
2024-08-25 19:37:44 +00:00
Samson
88d8770214 Use global exports from derives (#33169)
* pub reexport *Traceable

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* reexport `HasParent` for derives

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* reexport DomObject, Reflector, MutDomObject

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* fmt

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Update lib.rs

Signed-off-by: Samson <16504129+sagudev@users.noreply.github.com>

* Update lib.rs

Signed-off-by: Samson <16504129+sagudev@users.noreply.github.com>

* Update lib.rs

Signed-off-by: Samson <16504129+sagudev@users.noreply.github.com>

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Signed-off-by: Samson <16504129+sagudev@users.noreply.github.com>
2024-08-25 13:58:09 +00:00
eri
6357998ede DevTools: Inspect node styles (#33025)
* feat: retrieve applied styles

Signed-off-by: eri <eri@inventati.org>

* feat: preliminary style showing

Signed-off-by: eri <eri@inventati.org>

* chore: some style tests

Signed-off-by: eri <eri@inventati.org>

* feat: edit style rules

Signed-off-by: eri <eri@inventati.org>

* feat: css database

Signed-off-by: eri <eri@inventati.org>

* feat: computed styles

Signed-off-by: eri <eri@inventati.org>

* feat: inherited styles

Signed-off-by: eri <eri@inventati.org>

* feat: get stylesheet styles

Signed-off-by: eri <eri@inventati.org>

* feat: all styles in inspector

Signed-off-by: eri <eri@inventati.org>

* feat: multiple stylesheets

Signed-off-by: eri <eri@inventati.org>

* refactor: clean up

Signed-off-by: eri <eri@inventati.org>

* Some minor cleanup

Signed-off-by: Martin Robinson <mrobinson@igalia.com>

---------

Signed-off-by: eri <eri@inventati.org>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-08-25 09:30:23 +00:00
Nolan Lawson
67e2bb0ee6 script: fix querySelector returning the root (#33174)
Signed-off-by: Nolan Lawson <nolan@nolanlawson.com>
2024-08-25 09:16:26 +00:00
Cristian Brinza
c79d9e68a3 Use webrender UploadMethod::Immediate with ANGLE (#33177)
* Use webrender UploadMethod::Immediate with ANGLE

Signed-off-by: crbrz <cristianb@gmail.com>

* Added comment with Gecko link

Signed-off-by: crbrz <cristianb@gmail.com>

---------

Signed-off-by: crbrz <cristianb@gmail.com>
2024-08-25 05:43:06 +00:00
Servo WPT Sync
6caaa0c955 Update web-platform-tests to revision b'd988aeeb33edc4d452899921799b8bed69fff65d' (#33178)
Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
2024-08-25 01:37:49 +00:00
Martin Robinson
7582afebec script: Update list of non-TS pseudo classes supported by Servo (#33165)
Also remove some code duplication by moving some of the code into the
`Element` impl.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-08-24 08:43:54 +00:00
Kopanov Anton
ad45fa0a19 script: Fix panic in htmlimageelement.rs using str::find() to find character boundaries. (#32980)
* fix loop with chars().enumerate() by using find()

Signed-off-by: Kopanov Anton <anton.kopanov@ya.ru>

* Add documentation to parser and fix some small issues

- Rename the properties of `Descriptor` so that they are full words
- Use the Rust-parser to parse doubles
- Add documentation and restructure parser to be more readable

Signed-off-by: Martin Robinson <mrobinson@igalia.com>

---------

Signed-off-by: Kopanov Anton <anton.kopanov@ya.ru>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-08-24 08:22:39 +00:00
Daniel Adams
e85491b5fc Allow prefs to be overridden from a file and set WPT-specific prefs from file (#33163)
* Allow prefs to be passed in from a separate file

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Add wpt-prefs.json for setting WPT-specific prefs

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* fix argument to read_prefs_file

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update test_parse_pref test

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Add line in executorservo.py to read from wpt-prefs.json

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update MANIFEST.json

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update expectations

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Disable dom.webxr.test for interfaces test

Signed-off-by: Daniel Adams <msub2official@gmail.com>

---------

Signed-off-by: Daniel Adams <msub2official@gmail.com>
2024-08-24 06:47:57 +00:00
Martin Robinson
2db9032e72 layout: Add support for flex items with position: relative (#33151)
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-08-23 18:11:22 +00:00
dependabot[bot]
b9f02cf773 build(deps): bump quote from 1.0.36 to 1.0.37 (#33167)
Bumps [quote](https://github.com/dtolnay/quote) from 1.0.36 to 1.0.37.
- [Release notes](https://github.com/dtolnay/quote/releases)
- [Commits](https://github.com/dtolnay/quote/compare/1.0.36...1.0.37)

---
updated-dependencies:
- dependency-name: quote
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-23 17:34:15 +00:00
dependabot[bot]
1165190c8e build(deps): bump cc from 1.1.13 to 1.1.14 (#33166)
Bumps [cc](https://github.com/rust-lang/cc-rs) from 1.1.13 to 1.1.14.
- [Release notes](https://github.com/rust-lang/cc-rs/releases)
- [Changelog](https://github.com/rust-lang/cc-rs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/cc-rs/compare/cc-v1.1.13...cc-v1.1.14)

---
updated-dependencies:
- dependency-name: cc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-23 17:20:51 +00:00
Martin Robinson
78e2691d3f shaping: Don't assume there's a space glyph when rendering tabs (#32979)
Previously if a font didn't have a space advance and it was needed to
make advances for tabs, Servo would try to read the advance from the
font. If the font didn't have a space glyph, Servo would panic. This
fixes that issue by making the space advance part of the `FontMetrics`
of a font (like Gecko) and falling back properly if that glyph doesn't
exist. The rendered glyph is still the "space" glyph, but we make
sure to select a font that supports that glyph explicitly.

This prevents a crash, but tabs still aren't handled properly. In
reality, tab stops should be calculated in layout and the size of
the space character of the current font shouldn't come into play.
The addition of the space advance metric will make this easier.

Fixes #32970.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-08-23 11:17:44 +00:00
Samson
ebdae6094e CI: Add separate Lint&Tidy check and remove test-tidy from linux (#33150)
* Create separate Lint&Tidy check

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Remove quick-check as it's not longer relevant

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Add clippy to rust-toolchain

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* fix try parser test expectations

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* use lint in result

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Lint & Tidy -> Lint

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
Signed-off-by: Samson <16504129+sagudev@users.noreply.github.com>

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Signed-off-by: Samson <16504129+sagudev@users.noreply.github.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-08-23 08:58:12 +00:00
Josh Matthews
0afcb83e9f Print reason when tests are skipped. (#33077)
* Print reason when tests are skipped.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Print reason tests are skipped in Servo's WPT formatter

Signed-off-by: Martin Robinson <mrobinson@igalia.com>

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-08-23 08:39:39 +00:00
Martin Robinson
e956b53827 layout: Clean up inline layout data structures (#33149)
- Rename `InlineFormattingContextState` to
  `InlineFormattingContextLayout`.
- Have `InlineFormattingContextLayout` hold a reference to the
 `InlineFormattingContext`, so that it does not need to be passed
 around as an argument
- Have `LineItemLayout` hold a reference to
  `InlineFormattingContextLayout` to avoid duplicating so much data.
- Rename some members of `LineItemLayout` to make it clearer what
  they do.
- Give beter names to many lifetimes and combine some that are
  effectively the same.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Rakhi Sharma <atbrakhi@igalia.com>
2024-08-22 12:05:15 +00:00
Josh Matthews
60ef6bc461 Start marking functions that can transitively trigger a GC (#33144)
* Mark JS reflector wrappers as CanGc.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Propagate CanGc from reflect_dom_object_with_proto.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Mark DOM constructors as GC operations.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2024-08-22 11:42:36 +00:00
webbeef
9a1051c917 Implement crypto.randomUUID() (#33158)
Signed-off-by: webbeef <me@webbeef.org>
2024-08-22 04:56:37 +00:00
webbeef
663a92a5df make protocol handlers registrable (#33104)
Signed-off-by: webbeef <me@webbeef.org>
2024-08-22 04:11:16 +00:00
Daniel Adams
562d32c051 webxr: Update XRWebGLLayer interface to latest spec (#33157)
* Update XRWebGLLayer interface to latest spec

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Add missing spec links

Signed-off-by: Daniel Adams <msub2official@gmail.com>

---------

Signed-off-by: Daniel Adams <msub2official@gmail.com>
2024-08-22 02:18:58 +00:00
dependabot[bot]
cde10241c3 build(deps): bump flate2 from 1.0.31 to 1.0.32 (#33141)
* build(deps): bump flate2 from 1.0.31 to 1.0.32

Bumps [flate2](https://github.com/rust-lang/flate2-rs) from 1.0.31 to 1.0.32.
- [Release notes](https://github.com/rust-lang/flate2-rs/releases)
- [Changelog](https://github.com/rust-lang/flate2-rs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/flate2-rs/compare/1.0.31...1.0.32)

---
updated-dependencies:
- dependency-name: flate2
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Allow duplicate miniz_oxide.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
2024-08-21 23:28:44 +00:00
A. Wilcox
0e56241c1b background_hang_monitor: Add musl compatibility (#33153)
musl does not have libunwind readily available; even if it did, it has
no concept of ucontext (needing an external lib).  Similar to ohos,
disable the background hang monitor and use the DummySampler.

Signed-off-by: A. Wilcox <AWilcox@Wilcox-Tech.com>
2024-08-21 21:38:28 +00:00
Daniel Adams
7501e3e12f webxr: Update XRInputSource interface to latest spec (#33155)
* Update XRInputSource interface to latest spec

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Bump webxr version

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Add missing spec link

Signed-off-by: Daniel Adams <msub2official@gmail.com>

---------

Signed-off-by: Daniel Adams <msub2official@gmail.com>
2024-08-21 21:26:29 +00:00
Martin Robinson
56280c6242 layout: Add initial support for bidirectional text (BiDi) (#33148)
This adds supports for right-to-left text assigning bidi levels to all
line items when necessary. This includes support for the `dir` attribute
as well as corresponding CSS properties like `unicode-bidi`. It only
implements right-to-left rendering for inline layout at the moment and
doesn't include support for `dir=auto`. Because of missing features,
this causes quite a few tests to start failing, as references become
incorrect due to right-to-left rendering being active in some cases,
but not others (before it didn't exist at all).

Analysis of most of the new failures:

```
- /css/css-flexbox/gap-001-rtl.html
  /css/css-flexbox/gap-004-rtl.html
 - Require implementing BiDi in Flexbox, because the start and
   end inline margins are opposite the order of items.

- /css/CSS2/bidi-text/direction-applies-to-*.xht
  /css/CSS2/bidi-text/direction-applies-to-002.xht
  /css/CSS2/bidi-text/direction-applies-to-003.xht
  /css/CSS2/bidi-text/direction-applies-to-004.xht
  - Broken due to a bug in tables, not allocating the
    right amount of width for a column.

- /css/css-lists/inline-list.html
  - This fails because we wrongly insert a soft wrap opportunity between the
    start of an inline box and its first content.

- /css/css-text/bidi/bidi-lines-001.html
  /css/css-text/bidi/bidi-lines-002.html
  /css/CSS2/text/bidi-flag-emoji.html
  - We do not fully support unicode-bidi: plaintext

- /css/css-text/text-align/text-align-end-010.html
  /css/css-text/text-align/text-align-justify-006.html
  /css/css-text/text-align/text-align-start-010.html
  /html/dom/elements/global-attributes/*
  - We do not support dir=auto yet.

- /css/css-text/white-space/tab-bidi-001.html
  - Servo doesn't support tab stops

- /css/CSS2/positioning/abspos-block-level-001.html
  /css/css-text/word-break/word-break-normal-ar-000.html
  - Do not yet support RTL layout in block

- /css/css-text/white-space/pre-wrap-018.html
  - Even in RTL contexts, spaces at the end of the line must hang and
    not be reordered

- /css/css-text/white-space/trailing-space-and-text-alignment-rtl-002.html
  - We are letting spaces hang with white-space: pre, but they shouldn't
    hang.
```

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Rakhi Sharma <atbrakhi@igalia.com>
2024-08-21 14:28:54 +00:00
Samson
65bd5a3b99 webgpu: Align writeBuffer with spec (#33147)
* Sync `WriteBuffer`

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Set good expectations

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Change assert to debug_assert

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2024-08-21 11:46:23 +00:00
Simon Wülker
3b8c638a84 Fix floating point errors in table layout (#33098)
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2024-08-21 10:41:43 +00:00
Daniel Adams
fb22dfb373 webxr: Update XRPose interface to latest spec (#33146)
* Update XRPose interface with missing members

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* ./mach fmt

Signed-off-by: Daniel Adams <msub2official@gmail.com>

---------

Signed-off-by: Daniel Adams <msub2official@gmail.com>
2024-08-21 10:41:04 +00:00
Daniel Adams
8e224cb4d3 webxr: Update XRView to latest spec (#33145)
* Add recommendedViewportScale and requestViewportScale

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Remove currently unused internal slots

Signed-off-by: Daniel Adams <msub2official@gmail.com>

---------

Signed-off-by: Daniel Adams <msub2official@gmail.com>
2024-08-21 02:37:58 +00:00
dependabot[bot]
75b817cca3 build(deps): bump unicode-xid from 0.2.4 to 0.2.5 (#33143)
Bumps [unicode-xid](https://github.com/unicode-rs/unicode-xid) from 0.2.4 to 0.2.5.
- [Commits](https://github.com/unicode-rs/unicode-xid/compare/v0.2.4...v0.2.5)

---
updated-dependencies:
- dependency-name: unicode-xid
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-20 17:32:13 +00:00
dependabot[bot]
1492624bb5 build(deps): bump unicode-properties from 0.1.1 to 0.1.2 (#33142)
Bumps [unicode-properties](https://github.com/unicode-rs/unicode-properties) from 0.1.1 to 0.1.2.
- [Commits](https://github.com/unicode-rs/unicode-properties/compare/v0.1.1...v0.1.2)

---
updated-dependencies:
- dependency-name: unicode-properties
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-20 17:18:51 +00:00
Josh Matthews
bc5235827f Various borrow hazard fixes (#33133)
* Reduce the scope of the document tag map borrow.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Reduce scope of borrow when finishing a Response.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Avoid creating a File object while borrowing FormData's data.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Prevent the GC from seeing an uninitialized window proxy slot.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2024-08-20 16:06:24 +00:00
Oriol Brufau
c00cd1326a Take into account the intrinsic block size when computing the main size of a column flex container (#33135)
In particular, `main_content_sizes()` now works with columns.

`layout_for_block_content_size()` is now used for both intrinsic sizes
and intrinsic contributions, a IntrinsicSizingMode parameter is added
to choose the behavior.

Also, we consider the main size of a flex item as indefinite if its flex
basis is indefinite and the flex container has an indefinite main size.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-08-20 11:30:27 +00:00
Taym Haddadi
cf98d8d7ec Update url setters test result (#33134)
Signed-off-by: Taym <haddadi.taym@gmail.com>
2024-08-20 10:34:45 +00:00
Daniel Adams
7e4979c852 webxr: Update XRFrame to latest spec (#33102)
* Update IDL+naming, add predictedDisplayTime getter stub

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Surface predicted display time

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update WPT expectations

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update todo comment

Signed-off-by: Daniel Adams <msub2official@gmail.com>

---------

Signed-off-by: Daniel Adams <msub2official@gmail.com>
2024-08-20 08:12:25 +00:00
Taym Haddadi
91adf39de7 Fix panic in embedded-opener-remove-frame (#33122)
Signed-off-by: Taym <haddadi.taym@gmail.com>
2024-08-19 20:05:03 +00:00
dependabot[bot]
32a298f3a2 build(deps): bump libc from 0.2.156 to 0.2.158 (#33131)
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.156 to 0.2.158.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Changelog](https://github.com/rust-lang/libc/blob/0.2.158/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.156...0.2.158)

---
updated-dependencies:
- dependency-name: libc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-19 17:42:42 +00:00
dependabot[bot]
9e2536c877 build(deps): bump syn from 2.0.74 to 2.0.75 (#33130)
Bumps [syn](https://github.com/dtolnay/syn) from 2.0.74 to 2.0.75.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/2.0.74...2.0.75)

---
updated-dependencies:
- dependency-name: syn
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-19 17:38:55 +00:00
dependabot[bot]
40e0052ef7 build(deps): bump webxr from 08a6d70 to 474d538 (#33129)
Bumps [webxr](https://github.com/servo/webxr) from `08a6d70` to `474d538`.
- [Commits](08a6d70ad4...474d53835c)

---
updated-dependencies:
- dependency-name: webxr
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-19 17:27:35 +00:00
dependabot[bot]
6a7d5210e9 build(deps): bump redox_users from 0.4.3 to 0.4.6 (#33127)
Bumps redox_users from 0.4.3 to 0.4.6.

---
updated-dependencies:
- dependency-name: redox_users
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-19 17:23:19 +00:00
dependabot[bot]
c5751af926 build(deps): bump ohos-sys from 0.2.1 to 0.2.2 (#33128)
Bumps [ohos-sys](https://github.com/openharmony-rs/ohos-sys) from 0.2.1 to 0.2.2.
- [Changelog](https://github.com/openharmony-rs/ohos-sys/blob/main/CHANGELOG.md)
- [Commits](https://github.com/openharmony-rs/ohos-sys/compare/v0.2.1...v0.2.2)

---
updated-dependencies:
- dependency-name: ohos-sys
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-19 17:18:24 +00:00
dependabot[bot]
54cb8d9a36 build(deps): bump tokio from 1.39.2 to 1.39.3 (#33126)
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.39.2 to 1.39.3.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.39.2...tokio-1.39.3)

---
updated-dependencies:
- dependency-name: tokio
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-19 17:17:48 +00:00
dependabot[bot]
c5d3c29b79 build(deps): bump arrayvec from 0.7.4 to 0.7.6 (#33125)
Bumps [arrayvec](https://github.com/bluss/arrayvec) from 0.7.4 to 0.7.6.
- [Release notes](https://github.com/bluss/arrayvec/releases)
- [Changelog](https://github.com/bluss/arrayvec/blob/master/CHANGELOG.md)
- [Commits](https://github.com/bluss/arrayvec/compare/0.7.4...0.7.6)

---
updated-dependencies:
- dependency-name: arrayvec
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-19 17:14:05 +00:00
Josh Matthews
b3280fe071 Update surfman to fix macOS webgl crashes. (#33124) 2024-08-19 16:31:50 +00:00
Samson
94ff89a5e4 webgpu: Sync various parts of spec (#33009)
* Sync `GPUObjectDescriptorBase` (label is not option anymore)

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Sync `GPUFeatureName`

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* shader_f16 feature is not usable in wgpu so disable it

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* sync `GPUTextureFormat`

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* `validate_texture_format_required_features`

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Sync `GPUTexture` attributes

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Make `entryPoint` in `GPUProgrammableStage` optional

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Set good expectations

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Bad expectations because naga does not support cons declarations

Also fail on firefox, where skipped before due to missing device features

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Bad expectation, also fails on firefox

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Bad expectations, because naga does not support `let pos = positions[vertex_index];`

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Set expectation

external texture does not work in firefox too (again naga)

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* set bad expectations, because naga does not support `enable`

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Set bad expectations for, `Texture with '' label has been destroyed`

also fails in firefox with same reason

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* one bad expectation

also on firefox

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* expect that also matches firefox

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* more expect

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Use only 1 proc for _webgpu

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* better doc comment

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2024-08-19 14:06:30 +00:00
Martin Robinson
f45c98496e Upgrade font-kit, raqote, and stop using dirs-next (#33120)
`dirs-next` is still used by the version of the `term` crate we are
using, but this also remoes a version of `cstr` so our dependency count
does not change.

A new version of `raqote` hasn't been released, so this depends on the
upstream repository directly. It's been almost 4 months since the
release has been ready -- so it's unclear when it will happen.

Fixes #32801.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-08-19 12:16:28 +00:00
Martin Robinson
2f6745c0c6 layout: Layout for column flex-basis and minimum automatic size determination (#33068)
This change adds an expensive layout for the determination of minimum
automatic size and flex basis in process of flexbox layout. Currently,
the layout is not cached, so may be performed up to 2 more times than
necessary.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2024-08-19 10:54:10 +00:00
Cristian Brinza
2a31fddc0b Refactor GlyphStore::iter_glyphs_for_byte_range without recursion (#33074)
* Implement DoubleEndedIterator for EachIndex

Signed-off-by: crbrz <cristianb@gmail.com>

* Refactor GlyphStore::iter_glyphs_for_byte_range without recursion

Signed-off-by: crbrz <cristianb@gmail.com>

* Update WPT result

Signed-off-by: crbrz <cristianb@gmail.com>

* Update WPT legacy result

Signed-off-by: crbrz <cristianb@gmail.com>

---------

Signed-off-by: crbrz <cristianb@gmail.com>
2024-08-19 10:47:09 +00:00
Servo WPT Sync
d59a7f62f8 Update web-platform-tests to revision b'ebe057a1153d34042bac1ff3dc944220876f69ec' (#33116)
Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
2024-08-19 07:45:30 +00:00
Samson
b5fe99ba5d wpt-tests-to-run -> wpt-args and make them last so they can override already provide (#33115)
d options

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2024-08-19 07:29:40 +00:00
Simon Wülker
84b5b64424 Fix incorrect documentation and add track_caller to DomRefCell methods (#33111)
* Fix DomRefCell documentation about panic behaviour

Fixes https://github.com/servo/servo/issues/33099

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Annotate DomRefCell::borrow/borrow_mut with #[track_caller]

Fixes https://github.com/servo/servo/issues/27336

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2024-08-19 07:24:38 +00:00
Jonathan Schwender
3576c02ae2 ohos: Remove custom touch history code (#33113)
The TouchHandler in servo already does the equivalent,
so there is no need to have this code in the OH specific code.

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
2024-08-19 05:52:34 +00:00
Daniel Adams
e078353bf0 Fix race in WebXR WPT test setup (#33112)
* Ensure xr_promise_test only runs after DOMContentLoaded

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update meta expectations

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update meta-legacy-layout expectations

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update manifest

Signed-off-by: Daniel Adams <msub2official@gmail.com>

---------

Signed-off-by: Daniel Adams <msub2official@gmail.com>
2024-08-18 21:27:05 +00:00
Taym Haddadi
a50e6a503e Remove unnecessary unsafe block (#33109)
Signed-off-by: Taym <haddadi.taym@gmail.com>
2024-08-18 16:18:28 +00:00
Taym Haddadi
a24e92778a fix: add error handling to BaseAudioContext::new_inherited (#33023)
* fix: add error handling to BaseAudioContext::new_inherited

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Update servo-media

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Update test expectations

Signed-off-by: Taym <haddadi.taym@gmail.com>

* Update servo-media

Signed-off-by: Taym <haddadi.taym@gmail.com>

---------

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
Signed-off-by: Taym <haddadi.taym@gmail.com>
2024-08-18 13:58:43 +00:00
Daniel Adams
1ef3e107bd Add makeXRCompatible for WebGL2, update WebXR WPT expectations (#33097)
* Add makeXRCompatible to WebGLRenderContextBase

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Activate webgl2 for webxr wpt, update meta expectations

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update meta legacy layout expectations

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Remove no longer existing expectations from meta files

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Remove files for fully passing tests

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Remove out-of-date expectations from meta legacy layout

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update webgl conformance expectations

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Fix test numbering in expectations

Signed-off-by: Daniel Adams <msub2official@gmail.com>

---------

Signed-off-by: Daniel Adams <msub2official@gmail.com>
2024-08-18 10:37:14 +00:00
Koki Saito
280063eee2 Make string formatting more consistent in CodegenRust.py (#33096)
* fix: Replace string concatenation with f-string

Signed-off-by: Koki Saito <saitoto828@gmail.com>

* fix: Replace substitute method with f-string

Signed-off-by: Koki Saito <saitoto828@gmail.com>

* fix: Cleanup unused function `onFailureInvalidEnumValue`

Signed-off-by: Koki Saito <saitoto828@gmail.com>

* fix: Replace %formatting with f-string

Signed-off-by: Koki Saito <saitoto828@gmail.com>

* fix: Fix some typo

Signed-off-by: Koki Saito <saitoto828@gmail.com>

* fix: Lint

Signed-off-by: Koki Saito <saitoto828@gmail.com>

---------

Signed-off-by: Koki Saito <saitoto828@gmail.com>
Co-authored-by: kokisaito <kosaito@indeed.com>
2024-08-18 05:02:11 +00:00
webbeef
6aee84f0d1 Update data-url to 0.3 (#33103)
Signed-off-by: webbeef <me@webbeef.org>
2024-08-18 04:34:55 +00:00
Koki Saito
db312319ae fix: Replace callargs_is_constructing with is_constructing method (#33101)
Signed-off-by: Koki Saito <saitoto828@gmail.com>
Co-authored-by: kokisaito <kosaito@indeed.com>
2024-08-18 01:48:39 +00:00
Daniel Adams
20273b062a webxr: Update XRSession to latest spec (#33059)
* Add missing XRSession members, initial implementations

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Implement supportedFramerates getter

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Implement framerate changes, add spec links

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update WPT expectations

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* ./mach fmt

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Add missing spec link

Signed-off-by: Daniel Adams <msub2official@gmail.com>

---------

Signed-off-by: Daniel Adams <msub2official@gmail.com>
2024-08-17 03:36:52 +00:00
Simon Wülker
f0045a7686 remove usage of legacy numeric operations in script (#33095)
These operations are deprecated and might be removed
in a future rust version. Clippy is also complaining
about them.

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2024-08-16 21:30:13 +00:00
dependabot[bot]
09cac6430b build(deps): bump libc from 0.2.155 to 0.2.156 (#33091)
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.155 to 0.2.156.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Changelog](https://github.com/rust-lang/libc/blob/0.2.156/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.155...0.2.156)

---
updated-dependencies:
- dependency-name: libc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-16 18:24:28 +00:00
dependabot[bot]
842bd607d4 build(deps): bump bytemuck_derive from 1.7.0 to 1.7.1 (#33086)
Bumps [bytemuck_derive](https://github.com/Lokathor/bytemuck) from 1.7.0 to 1.7.1.
- [Changelog](https://github.com/Lokathor/bytemuck/blob/main/changelog.md)
- [Commits](https://github.com/Lokathor/bytemuck/compare/bytemuck_derive-v1.7.0...bytemuck_derive-v1.7.1)

---
updated-dependencies:
- dependency-name: bytemuck_derive
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-16 18:22:02 +00:00
dependabot[bot]
a8fbfe712f build(deps): bump webxr from dd76329 to 08a6d70 (#33092)
Bumps [webxr](https://github.com/servo/webxr) from `dd76329` to `08a6d70`.
- [Commits](dd763293a8...08a6d70ad4)

---
updated-dependencies:
- dependency-name: webxr
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-16 18:21:27 +00:00
dependabot[bot]
23c2040f2b build(deps): bump cc from 1.1.12 to 1.1.13 (#33093)
Bumps [cc](https://github.com/rust-lang/cc-rs) from 1.1.12 to 1.1.13.
- [Release notes](https://github.com/rust-lang/cc-rs/releases)
- [Changelog](https://github.com/rust-lang/cc-rs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/cc-rs/compare/cc-v1.1.12...cc-v1.1.13)

---
updated-dependencies:
- dependency-name: cc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-16 18:20:30 +00:00
dependabot[bot]
10e2dc7a63 build(deps): bump bytemuck from 1.16.3 to 1.17.0 (#33090)
Bumps [bytemuck](https://github.com/Lokathor/bytemuck) from 1.16.3 to 1.17.0.
- [Changelog](https://github.com/Lokathor/bytemuck/blob/main/changelog.md)
- [Commits](https://github.com/Lokathor/bytemuck/compare/v1.16.3...v1.17.0)

---
updated-dependencies:
- dependency-name: bytemuck
  dependency-type: indirect
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-16 17:35:17 +00:00
dependabot[bot]
c6d6823b85 build(deps): bump scc from 2.1.14 to 2.1.16 (#33089)
Bumps [scc](https://github.com/wvwwvwwv/scalable-concurrent-containers) from 2.1.14 to 2.1.16.
- [Changelog](https://github.com/wvwwvwwv/scalable-concurrent-containers/blob/main/CHANGELOG.md)
- [Commits](https://github.com/wvwwvwwv/scalable-concurrent-containers/commits)

---
updated-dependencies:
- dependency-name: scc
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-16 17:31:27 +00:00
dependabot[bot]
4bdf6403d0 build(deps): bump surfman from 0.9.5 to 0.9.6 (#33088)
Bumps [surfman](https://github.com/servo/surfman) from 0.9.5 to 0.9.6.
- [Release notes](https://github.com/servo/surfman/releases)
- [Commits](https://github.com/servo/surfman/commits)

---
updated-dependencies:
- dependency-name: surfman
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-16 17:28:59 +00:00
Josh Matthews
3829e91662 Handle failed string conversions in console.log. (#33085)
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2024-08-16 16:49:56 +00:00
Josh Matthews
4df7a1af25 Support HTML parser reentrancy (#32820)
* Update parser interface for reentrancy.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Remove assertions around invoking scripts with active parser.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Add regression test.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Run test with normal and async html parser.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2024-08-16 16:25:50 +00:00
Mukilan Thiyagarajan
d44c0f7e5d mach: remove unused maven packaging code (#33083)
This code is unused and unmaintained. We can bring it back from version
control if needed in the future.

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-08-16 11:59:05 +00:00
Martin Robinson
0d94a8acd2 layout: Prepare for bidi by guarding all access to writing-mode (#33082)
We want to selectively enable right-to-left writing modes per layout
context. This change makes that possible by allowing access to
`writing-mode` though an interface that always returns the default
horizontal top-to-bottom (implicitly left-to-right) writing mode.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Rakhi Sharma <atbrakhi@igalia.com>
2024-08-16 11:38:04 +00:00
Josh Matthews
3d3621b652 Update stylo for latest changes. (#33079)
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2024-08-16 10:47:12 +00:00
Martin Robinson
ce5ebbcf77 legacy-layout: Fix display list building after WebRender upgrade (#33073)
The most recent version of WebRender tracks stacking context offsets in
a different way, which broke legacy layout. It's easier just to track
the stacking context offset in Servo and apply them to the items
manually like we do in non-legacy layout.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-08-16 10:02:43 +00:00
Hayashi Mikihiro
6816d11f88 replace once_cell (#33080)
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2024-08-16 04:49:50 +00:00
Hayashi Mikihiro
4cc1b68546 Remove lazy static (#33078)
* remove from rand

Mutex<OsRng> can be initialized in compile time.

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>

* remove from layout_2020

Mutex<()> can be initialize in compile time

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>

* remove from media

`IS_MULTIPROCESS` doesn't be used.

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>

* remove lazy_static from dependencies

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>

* rewrite suppressed_leaks_for_asan.txt

For all of lazy_static was replaced with LazyLock.

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>

---------

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2024-08-16 03:57:09 +00:00
Jonathan Schwender
4b3ed4b684 ohos: Fix log filtering (#33076)
* Increase default filtering to warn
 * fix module filtering (filter_builder was never used)

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
2024-08-16 02:31:35 +00:00
Josh Matthews
69185c4af1 Ensure parsers initiated from DOMParser always complete. (#33056)
* Ensure parsers initiated from DOMParser always complete.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Add test for parseFromString with async parser.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Add expected failure.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2024-08-15 23:45:00 +00:00
Josh Matthews
3cc91e655f Remove many explicit reflow calls (#33067)
* Remove explicit reflow for iframe content updates.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Remove explicit reflow for timers.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Remove explicit reflow for MouseEvent.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Remove explicit reflow for key events.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Remove explicit reflow for document load.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Remove explicit reflow for iframe load.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Remove unused reflow reasons.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Fix warnings.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2024-08-15 22:20:52 +00:00
Jose Monagas
a34920b605 fix(clippy): Clippy suggestions in components/script/dom/* (#33072)
Signed-off-by: Jose T. Monagas <josetmonagas@proton.me>
Co-authored-by: Jose T. Monagas <josetmonagas@proton.me>
2024-08-15 19:31:30 +00:00
dependabot[bot]
386a067c4b build(deps): bump is-terminal from 0.4.12 to 0.4.13 (#33071)
Bumps [is-terminal](https://github.com/sunfishcode/is-terminal) from 0.4.12 to 0.4.13.
- [Commits](https://github.com/sunfishcode/is-terminal/compare/v0.4.12...v0.4.13)

---
updated-dependencies:
- dependency-name: is-terminal
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-15 17:22:54 +00:00
dependabot[bot]
0710209557 build(deps): bump serde_json from 1.0.124 to 1.0.125 (#33070)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.124 to 1.0.125.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.124...1.0.125)

---
updated-dependencies:
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-15 17:00:26 +00:00
dependabot[bot]
bcfc642f2f build(deps): bump cc from 1.1.11 to 1.1.12 (#33069)
Bumps [cc](https://github.com/rust-lang/cc-rs) from 1.1.11 to 1.1.12.
- [Release notes](https://github.com/rust-lang/cc-rs/releases)
- [Changelog](https://github.com/rust-lang/cc-rs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/cc-rs/compare/cc-v1.1.11...cc-v1.1.12)

---
updated-dependencies:
- dependency-name: cc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-15 16:58:06 +00:00
dependabot[bot]
e4d0af8d91 build(deps): bump serde from 1.0.207 to 1.0.208 (#33066)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.207 to 1.0.208.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.207...v1.0.208)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-15 16:53:21 +00:00
Hayashi Mikihiro
016ff5dfa6 Replace lazy_static crate with std::sync::LazyLock in layout and config (#33065)
* replace in layout_thread_2020

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>

* replace in layout_thread

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>

* replace in layout

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>

* replace in config

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>

* replace in config_plugins

The macro of config_plugins require Send trait bounds

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>

---------

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2024-08-15 16:28:04 +00:00
Taym Haddadi
c01b733523 Update codegen for GetOpener:inRealms in Bindings.conf (#33062)
Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
2024-08-15 13:42:50 +00:00
Hayashi Mikihiro
86c4e014b4 Replace the lazy_static crate with std::sync::LazyLock in components/shared (#33060)
* replace in pub_domains.rs

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>

* replace in embedder/resources.rs

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>

* replace in base/id.rs

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>

* replace in net/lib.rs

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>

* remove lazy_static from components/shared

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>

---------

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2024-08-15 12:05:29 +00:00
Cristian Brinza
8f82b2a7cb Use FontInstanceFlags::SUBPIXEL_POSITION for font instances on Windows (#33045)
Signed-off-by: crbrz <cristianb@gmail.com>
2024-08-15 10:25:57 +00:00
Jonathan Schwender
97c84b6127 ohos/android: Redirect stdout/stderr to log sink (#32858)
* ohos: redirect stdout/stderr to logging sink

Based on the existing android `redirect_stdout_to_logcat` implementation,
but using the safe abstractions from `nix` and dumping to the `log` sink,
instead of directly writing the log.

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>

* android: Use new shared implementation for logcat redirection.

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>

* servoshell: Register cfg(production)

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>

* Update ports/servoshell/egl/log.rs

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
Signed-off-by: Jonathan Schwender <55576758+jschwe@users.noreply.github.com>

* Change info! to debug! to match original behavior on android

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>

---------

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
Signed-off-by: Jonathan Schwender <55576758+jschwe@users.noreply.github.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-08-15 09:26:03 +00:00
Daniel Adams
353ceb0ffb Update WebXR WPT expectations (#33058)
* Enable the dom.webxr.test pref for webxr WPT tests

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update webxr test expectations

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Fix erroneous timeouts

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Readd stable timeout

Signed-off-by: Daniel Adams <msub2official@gmail.com>

---------

Signed-off-by: Daniel Adams <msub2official@gmail.com>
2024-08-15 09:09:15 +00:00
Martin Robinson
8159f03288 layout: Support start and end values for flexbox align-self (#33032)
These are similar to `flex-start` and `flex-end`, but in `wrap-reverse`
situations, they are the opposite.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2024-08-15 08:20:41 +00:00
Samson
a6638c1952 Update mozjs and use release libz-sys (#33048)
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2024-08-15 00:32:30 +00:00
Daniel Adams
825d6f10e9 webxr: Update hand input to match latest spec (#32958)
* Update IDLs

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update XRHand and XRJointSpace methods/bindings

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Implement fillJointRadii

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Implement fillPoses

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Formatting

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update test expectations

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Tidy, missing spec link

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Remove idlharness expectation files, update hands pref

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update interfaces

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* XRJointPose interface

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* XRHand interface

Signed-off-by: Daniel Adams <msub2official@gmail.com>

---------

Signed-off-by: Daniel Adams <msub2official@gmail.com>
2024-08-14 22:45:45 +00:00
Martin Robinson
057873c94a Remove unused constant from components/net/fetch/methods.rs (#33054)
This was revealed by the recent switch to `LazyLock`.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-08-14 18:35:13 +00:00
dependabot[bot]
c438bfddd0 build(deps): bump indexmap from 2.3.0 to 2.4.0 (#33053)
Bumps [indexmap](https://github.com/indexmap-rs/indexmap) from 2.3.0 to 2.4.0.
- [Changelog](https://github.com/indexmap-rs/indexmap/blob/master/RELEASES.md)
- [Commits](https://github.com/indexmap-rs/indexmap/compare/2.3.0...2.4.0)

---
updated-dependencies:
- dependency-name: indexmap
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-14 17:27:23 +00:00
dependabot[bot]
6b0680c779 build(deps): bump web-sys from 0.3.69 to 0.3.70 (#33052)
Bumps [web-sys](https://github.com/rustwasm/wasm-bindgen) from 0.3.69 to 0.3.70.
- [Release notes](https://github.com/rustwasm/wasm-bindgen/releases)
- [Changelog](https://github.com/rustwasm/wasm-bindgen/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rustwasm/wasm-bindgen/commits)

---
updated-dependencies:
- dependency-name: web-sys
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-14 17:24:15 +00:00
dependabot[bot]
d3209040ce build(deps): bump cc from 1.1.10 to 1.1.11 (#33051)
Bumps [cc](https://github.com/rust-lang/cc-rs) from 1.1.10 to 1.1.11.
- [Release notes](https://github.com/rust-lang/cc-rs/releases)
- [Changelog](https://github.com/rust-lang/cc-rs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/cc-rs/compare/cc-v1.1.10...cc-v1.1.11)

---
updated-dependencies:
- dependency-name: cc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-14 17:19:39 +00:00
dependabot[bot]
cfbc10aefe build(deps): bump wasm-bindgen-futures from 0.4.42 to 0.4.43 (#33050)
Bumps [wasm-bindgen-futures](https://github.com/rustwasm/wasm-bindgen) from 0.4.42 to 0.4.43.
- [Release notes](https://github.com/rustwasm/wasm-bindgen/releases)
- [Changelog](https://github.com/rustwasm/wasm-bindgen/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rustwasm/wasm-bindgen/commits)

---
updated-dependencies:
- dependency-name: wasm-bindgen-futures
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-14 17:15:27 +00:00
Hayashi Mikihiro
ad85dd10e3 Replace lazy_static with std::sync::LazyLock in components/fonts (#33049)
* replace in shaper.rs

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>

* replace in android/font_list.rs

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>

* replace in ohos/font_list.rs

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>

* remove lazy_lock from components/fonts

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>

---------

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2024-08-14 16:20:54 +00:00
Martin Robinson
7633bdccd2 layout: Initial implementation of flex-direction: column and column-reverse (#33031)
This change removes restrictions on using the column layout mode of
flexbox and adds an initial implementation of sizing for that flex
direction. There's a lot of missing pieces still, but in some cases this
does render column flexbox.

In particular, there are now two code paths for preferred widths
(intrinsic size) calcuation: one in the main axis (row) and one in
the cross axis (column) corresponding to the flex direciton with
horizontal writing modes.

In addition, `FlexItemBox::inline_content_sizes` is removed in favor of
making `sizing::outer_inline` /
`IndependentFormattingContext::outer_inline_content_sizes` generic
enough to handle using a different value for auto minimum sizes, which
flexbox needs.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2024-08-14 14:25:09 +00:00
Simon Wülker
c059bab6f4 Dont use lazy static to construct mutexes (#33047)
* Remove usage of lazy-static in background_hang_monitor

The lazy-static crate was only used to construct a mutex,
but since Mutex::new is const this can be done at compiletime
instead.

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

* Remove usage of lazy-static in servoshell

Lazy-static was only used to construct a mutex, but
since Mutex::new is const this can simply be done at
compiletime.

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2024-08-14 13:42:01 +00:00
Martin Robinson
d941d2fd67 layout: Convert the FragmentTree to physical geometry (#33030)
This converts all geometry in the FragmentTree into physical geometry,
doing conversions ahead of time instead of when traversing the fragment
tree. This is necessary to properly implement BiDi in Servo as we need
to know what side borders are on in mixed RTL and LTR contexts.

In addition, fragments are laid out in a particular context and only
that context knows its writing mode. There were issues where were using
one writing mode to lay out and another to convert to phyisical
coordinates. This isn't an issue now since we only use the default
writing mode, but starts to be an issue with BiDi text.

Closes #25564.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-08-14 12:22:06 +00:00
Hayashi Mikihiro
65f90ff1fd Replace the lazy_static crate with std::sync::LazyLock in components/net (#33046)
* replace in net/fetch/methods.rs

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>

* replace in net/hosts.rs

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>

* replace in net/async_runtime.rs

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>

* replace in net/tests/main.rs

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>

* remove lazy_static crate from components/net

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>

---------

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2024-08-14 12:15:55 +00:00
Martin Robinson
6be99241c6 Fix warnings after latest rust upgrade (#33043)
This fixes various unused code warnings after the recent rust upgrade.
Some of the dead code is maintained, as it is quite likely that it will
be used in future changes.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-08-14 07:00:16 +00:00
dependabot[bot]
380348e4df build(deps): bump tower-service from 0.3.2 to 0.3.3 (#33041)
Bumps [tower-service](https://github.com/tower-rs/tower) from 0.3.2 to 0.3.3.
- [Release notes](https://github.com/tower-rs/tower/releases)
- [Commits](https://github.com/tower-rs/tower/compare/tower-service-0.3.2...tower-service-0.3.3)

---
updated-dependencies:
- dependency-name: tower-service
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-14 04:53:36 +00:00
Jonathan Schwender
3aef023368 ohos: Fix x86_64-unknown-linux-ohos (#33029)
* ohos: Fix compilation for x86_64

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>

* ohos: Use the SDK compiler-wrapper

When compiling for x86_64-unknown-linux-ohos without the compiler
wrapper, for some reason mozjs_sys will be refercing a wrong mangled symbol
resulting in the following error when loading the .so at runtime:

```
_ZNSt3__111this_thread9sleep_forERKNS_6chrono8durationIxNS_5ratioILl1ELl1000000000EEEEE: symbol not found
```

This problem does not occur when compiling for aarch64 or when using the compiler wrapper.
In this case the correct symbol
`_ZNSt4__n111this_thread9sleep_forERKNS_6chrono8durationIxNS_5ratioILl1ELl1000000000EEEEE`
is referenced.
It's unclear why manually passing the flags via CFLAGS / CXXFLAGS does not work.

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>

---------

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
2024-08-14 01:30:04 +00:00
Martin Robinson
478d95d245 Dedupliate syn (#33038)
This is the last step toward removing our use of `syn` version
1. It does three things:

1. Upgrades `async-recursion` to a newer version that uses `syn` 2.
2. Removes the use of `enum-iterator` that was only used to produce a
   trivial list of enum names. This reduces the number of crates we
   dependo on by 2.
3. Upgrades `media` to a version which no longer uses `syn` 1

Fixes #33034.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-08-13 21:21:47 +00:00
dependabot[bot]
fb6b56cdda build(deps): bump cpufeatures from 0.2.12 to 0.2.13 (#33035)
Bumps [cpufeatures](https://github.com/RustCrypto/utils) from 0.2.12 to 0.2.13.
- [Commits](https://github.com/RustCrypto/utils/compare/cpufeatures-v0.2.12...cpufeatures-v0.2.13)

---
updated-dependencies:
- dependency-name: cpufeatures
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-13 20:29:04 +00:00
dependabot[bot]
c922ab4b52 build(deps): bump serde from 1.0.206 to 1.0.207 (#33040)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.206 to 1.0.207.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.206...v1.0.207)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-13 18:50:22 +00:00
dependabot[bot]
a0a83bad96 build(deps): bump js-sys from 0.3.69 to 0.3.70 (#33039)
Bumps [js-sys](https://github.com/rustwasm/wasm-bindgen) from 0.3.69 to 0.3.70.
- [Release notes](https://github.com/rustwasm/wasm-bindgen/releases)
- [Changelog](https://github.com/rustwasm/wasm-bindgen/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rustwasm/wasm-bindgen/commits)

---
updated-dependencies:
- dependency-name: js-sys
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-13 18:44:37 +00:00
dependabot[bot]
0c276aeea5 build(deps): bump scc from 2.1.13 to 2.1.14 (#33037)
Bumps [scc](https://github.com/wvwwvwwv/scalable-concurrent-containers) from 2.1.13 to 2.1.14.
- [Changelog](https://github.com/wvwwvwwv/scalable-concurrent-containers/blob/main/CHANGELOG.md)
- [Commits](https://github.com/wvwwvwwv/scalable-concurrent-containers/commits)

---
updated-dependencies:
- dependency-name: scc
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-13 17:54:12 +00:00
dependabot[bot]
89c456b6d1 build(deps): bump wasm-bindgen from 0.2.92 to 0.2.93 (#33036)
Bumps [wasm-bindgen](https://github.com/rustwasm/wasm-bindgen) from 0.2.92 to 0.2.93.
- [Release notes](https://github.com/rustwasm/wasm-bindgen/releases)
- [Changelog](https://github.com/rustwasm/wasm-bindgen/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rustwasm/wasm-bindgen/compare/0.2.92...0.2.93)

---
updated-dependencies:
- dependency-name: wasm-bindgen
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-13 17:54:08 +00:00
Martin Robinson
3c19982040 ci: Only export WPT test changes on the main branch (#33033)
This ensures that the WPT export job only runs on chnages that target
the `main` branch. This makes it so changes to WPT tests in temporary
branches aren't upstreamed.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-08-13 15:39:35 +00:00
Martin Robinson
8582678e4b Properly handle subpixel units when dividing space between flex lines (#32913)
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2024-08-13 15:11:01 +00:00
danik292
5d6840873a clippy: Fix missing indentation in comments and remove on unecessary cast (#33026)
* Add missing indendations in comments.

Signed-off-by: Daniel Frantes <danfrantes@seznam.cz>

* Fix test tidy error

Signed-off-by: Daniel Frantes <danfrantes@seznam.cz>

---------

Signed-off-by: Daniel Frantes <danfrantes@seznam.cz>
2024-08-13 11:28:09 +00:00
Ashwin Naren
ea5cf75169 clippy: Fix various clippy warnings throughout the code (#33003)
* replace u64::max_value() with u64::MAX

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>

* removed redundant import

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>

* Fixed dereference

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>

* Fixed a probable bug

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>

* fixed imports

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>

* fixed dereference

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>

* dereference formatting

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>

* removed unnessicary number imports

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>

* removed unnessicary number imports

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>

* removed excess borrow

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>

* ran mach fmt

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>

* fixed doc comment

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>

* removed deref on an immutable reference

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>

* fixed minor syntax error

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>

* reverted clamping

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>

* formatting

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>

* reverted final clamp

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>

---------

Signed-off-by: Ashwin Naren <arihant2math@gmail.com>
Co-authored-by: Ashwin Naren <ashwin@pixelators.org>
2024-08-13 05:16:47 +00:00
Daniel Adams
0d137d276a webxr: Add missing IDL members from AR Module (#33007)
* Add missing IDL members from AR module

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update test expectations

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* ./mach fmt

Signed-off-by: Daniel Adams <msub2official@gmail.com>

---------

Signed-off-by: Daniel Adams <msub2official@gmail.com>
2024-08-13 04:28:40 +00:00
dependabot[bot]
4744debdfd build(deps): bump serde_json from 1.0.122 to 1.0.124 (#33021)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.122 to 1.0.124.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.122...v1.0.124)

---
updated-dependencies:
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-12 22:26:48 +00:00
dependabot[bot]
2d52b51e76 build(deps): bump xcursor from 0.3.6 to 0.3.8 (#33019)
Bumps [xcursor](https://github.com/esposm03/xcursor-rs) from 0.3.6 to 0.3.8.
- [Commits](https://github.com/esposm03/xcursor-rs/commits)

---
updated-dependencies:
- dependency-name: xcursor
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-12 17:11:08 +00:00
dependabot[bot]
f33190ae79 build(deps): bump mio from 1.0.1 to 1.0.2 (#33020)
Bumps [mio](https://github.com/tokio-rs/mio) from 1.0.1 to 1.0.2.
- [Release notes](https://github.com/tokio-rs/mio/releases)
- [Changelog](https://github.com/tokio-rs/mio/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tokio-rs/mio/compare/v1.0.1...v1.0.2)

---
updated-dependencies:
- dependency-name: mio
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-12 17:06:59 +00:00
dependabot[bot]
26cd4a84e5 build(deps): bump serde from 1.0.205 to 1.0.206 (#33018)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.205 to 1.0.206.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.205...v1.0.206)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-12 17:04:48 +00:00
dependabot[bot]
3f1149fbdd build(deps): bump scc from 2.1.9 to 2.1.13 (#33016)
Bumps [scc](https://github.com/wvwwvwwv/scalable-concurrent-containers) from 2.1.9 to 2.1.13.
- [Changelog](https://github.com/wvwwvwwv/scalable-concurrent-containers/blob/main/CHANGELOG.md)
- [Commits](https://github.com/wvwwvwwv/scalable-concurrent-containers/commits)

---
updated-dependencies:
- dependency-name: scc
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-12 16:57:01 +00:00
dependabot[bot]
d0b5080b5e build(deps): bump syn from 2.0.72 to 2.0.74 (#33014)
Bumps [syn](https://github.com/dtolnay/syn) from 2.0.72 to 2.0.74.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/2.0.72...2.0.74)

---
updated-dependencies:
- dependency-name: syn
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-12 16:54:54 +00:00
dependabot[bot]
1f3c193339 build(deps): bump core-foundation-sys from 0.8.6 to 0.8.7 (#33017)
Bumps [core-foundation-sys](https://github.com/servo/core-foundation-rs) from 0.8.6 to 0.8.7.
- [Commits](https://github.com/servo/core-foundation-rs/compare/core-foundation-sys-v0.8.6...core-foundation-sys-v0.8.7)

---
updated-dependencies:
- dependency-name: core-foundation-sys
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-12 16:54:32 +00:00
dependabot[bot]
ebf28fc784 build(deps): bump polling from 3.7.2 to 3.7.3 (#33015)
Bumps [polling](https://github.com/smol-rs/polling) from 3.7.2 to 3.7.3.
- [Release notes](https://github.com/smol-rs/polling/releases)
- [Changelog](https://github.com/smol-rs/polling/blob/master/CHANGELOG.md)
- [Commits](https://github.com/smol-rs/polling/compare/v3.7.2...v3.7.3)

---
updated-dependencies:
- dependency-name: polling
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-12 16:51:31 +00:00
dependabot[bot]
93b43703e6 build(deps): bump cc from 1.1.8 to 1.1.10 (#33013)
Bumps [cc](https://github.com/rust-lang/cc-rs) from 1.1.8 to 1.1.10.
- [Release notes](https://github.com/rust-lang/cc-rs/releases)
- [Changelog](https://github.com/rust-lang/cc-rs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/cc-rs/compare/cc-v1.1.8...cc-v1.1.10)

---
updated-dependencies:
- dependency-name: cc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-12 16:48:35 +00:00
Martin Robinson
564ba5969f layout: Non-auto z-index should always make stacking contexts for flex items (#32961)
Fixes #32756.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-08-12 12:15:20 +00:00
Samson
d29e937f7e Update Rust to 1.80.1 (#33008)
* Update rust to 1.80.1

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Update shell.nix

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2024-08-12 11:40:46 +00:00
Taym Haddadi
df8ccafa7c Fix: Return error and avoid panicking in SetOpener function (#33002)
* Fix: Return error and avoid panicking in SetOpener function

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* eturn JSFailed onstead of InvalidState

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Update wpt test result

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

---------

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
2024-08-12 07:58:00 +00:00
Hayashi Mikihiro
a797969efe Replace the lazy_static crate whth std::sync::LazyLock in components/script (#33004)
* replace in str.rs

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>

* replace navigator.rs

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>

* replace htmlmetaelement.rs

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>

* replace document.rs

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>

* replace cssstyledeclaration.rs

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>

* replace script_runtime.rs

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>

* replace window_named_properties.rs

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>

* reduce dependency lazy_static

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>

* reduce lazy in script_runtime.rs

 `Mutex::new()`  is const contexts. I think that `JS_ENGINE` is need not lazy initialize.

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>

---------

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2024-08-12 07:30:35 +00:00
Josh Matthews
f38d1574bc Allow navigations that include cross-origin redirects to succeed. (#32996)
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2024-08-12 06:09:45 +00:00
Daniel Adams
5520a9eb50 webaudio: Implement IIRFilterNode (#33001)
* Basic IIRFIlterNode bindings

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Add constructor to BaseAudioContext

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update IDL and use statements

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update non-crashing test expectations

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Tidy

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Add missing spec link

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Optimize error checks

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Pass context channel count to servo-media

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update test expectations

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update legacy expectations

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Add IIRFilterNode in interfaces.html

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update MANIFEST

Signed-off-by: Daniel Adams <msub2official@gmail.com>

---------

Signed-off-by: Daniel Adams <msub2official@gmail.com>
2024-08-12 00:27:54 +00:00
Servo WPT Sync
1af3ad8a74 Update web-platform-tests to revision b'3b3beee1bf2469013583bafe702f2d4821d76c1f' (#33000)
Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
2024-08-11 01:31:50 +00:00
dependabot[bot]
71898dae17 build(deps): bump filetime from 0.2.23 to 0.2.24 (#32993)
* build(deps): bump filetime from 0.2.23 to 0.2.24

Bumps [filetime](https://github.com/alexcrichton/filetime) from 0.2.23 to 0.2.24.
- [Commits](https://github.com/alexcrichton/filetime/compare/0.2.23...0.2.24)

---
updated-dependencies:
- dependency-name: filetime
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Allow duplicate package.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
2024-08-10 06:30:24 +00:00
Josh Matthews
1a58dba03e Use correct feature name for JS backtraces. (#32998)
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2024-08-10 04:56:53 +00:00
webbeef
2ebb71f08a Set the cfg properly for the production-stripped profile (#32991)
Signed-off-by: webbeef <me@webbeef.org>
2024-08-09 09:16:51 +00:00
Taym Haddadi
a1d3649f7c Fix ordering of documents (#32574)
* Fix ordering of documents

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

* order pipeline ids, get document later, avoid use of document_from_node on iframe because it returns the owner doc

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

* Fix build issue
Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Use iter::once to avoid allocation

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* scope batches of rendering opportunities by pipeline

Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>

---------

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
Signed-off-by: gterzian <2792687+gterzian@users.noreply.github.com>
Co-authored-by: gterzian <2792687+gterzian@users.noreply.github.com>
2024-08-09 07:41:20 +00:00
dependabot[bot]
c6a6319502 build(deps): bump windows-sys from 0.52.0 to 0.59.0 (#32982)
* build(deps): bump windows-sys from 0.52.0 to 0.59.0

Bumps [windows-sys](https://github.com/microsoft/windows-rs) from 0.52.0 to 0.59.0.
- [Release notes](https://github.com/microsoft/windows-rs/releases)
- [Commits](https://github.com/microsoft/windows-rs/compare/0.52.0...0.59.0)

---
updated-dependencies:
- dependency-name: windows-sys
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix GetDC call to match api change

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-08-09 06:33:26 +00:00
Josh Matthews
4eae4e29fa Fix incorrect target_os value. (#32984)
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2024-08-09 04:54:32 +00:00
Samson
24b1404d12 Update wgpu (#32981)
* Update wgpu to 781b54a8b9

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* expectations

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2024-08-08 20:27:16 +00:00
dependabot[bot]
77ce73e4c6 build(deps): bump serde from 1.0.204 to 1.0.205 (#32983)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.204 to 1.0.205.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.204...v1.0.205)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-08 17:08:42 +00:00
ToBinio
8fab6911d1 script: dont unwrap in header set (#32973)
Signed-off-by: tobinio <tobias.frischmann1@gmail.com>
2024-08-08 14:33:54 +00:00
Samson
b8cf0cf9af webgpu: Implement proper async pipeline creation and GPUPipelineError (#32636)
* Add GPUPipelineError

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Proper GetBindGroupLayout

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Proper Create*PipelineAsync

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Expectations

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* fixups

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* more good expectations

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2024-08-08 11:48:43 +00:00
Taym Haddadi
08eb4faf4d Initial structuredClone implementation (#32960)
* Initial structuredClone implementation

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Rename PostMessageOptions to StructuredSerializeOptions

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Update wpt test 2020 layout result

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Remove dublicated StructuredClone implementation

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Remove comment from StructuredSerializeOptions webidl

Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>

---------

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
Signed-off-by: Taym Haddadi <haddadi.taym@gmail.com>
2024-08-08 10:12:45 +00:00
Samson
f989d3776e separate Queue&Device Id (#32966)
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2024-08-08 07:53:17 +00:00
Josh Matthews
a5df51ea56 Refine crown annotations for HTML parser. (#32956)
* Refine crown annotations for HTML parser.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* Add missing annotation.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2024-08-08 07:20:26 +00:00
dependabot[bot]
1379cd5779 build(deps): bump tempfile from 3.11.0 to 3.12.0 (#32965)
Bumps [tempfile](https://github.com/Stebalien/tempfile) from 3.11.0 to 3.12.0.
- [Changelog](https://github.com/Stebalien/tempfile/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Stebalien/tempfile/commits)

---
updated-dependencies:
- dependency-name: tempfile
  dependency-type: indirect
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-07 17:38:41 +00:00
dependabot[bot]
db23bc7b12 build(deps): bump object from 0.36.2 to 0.36.3 (#32964)
Bumps [object](https://github.com/gimli-rs/object) from 0.36.2 to 0.36.3.
- [Changelog](https://github.com/gimli-rs/object/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gimli-rs/object/compare/0.36.2...0.36.3)

---
updated-dependencies:
- dependency-name: object
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-07 17:33:20 +00:00
dependabot[bot]
206d515c32 build(deps): bump cc from 1.1.7 to 1.1.8 (#32963)
Bumps [cc](https://github.com/rust-lang/cc-rs) from 1.1.7 to 1.1.8.
- [Release notes](https://github.com/rust-lang/cc-rs/releases)
- [Changelog](https://github.com/rust-lang/cc-rs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/cc-rs/compare/cc-v1.1.7...cc-v1.1.8)

---
updated-dependencies:
- dependency-name: cc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-07 17:24:16 +00:00
newmoneybigbucks
3fca6e015f script: Properly handle removed iframes in GlobalScope::get_referrer (#32782)
Signed-off-by: newmoneybigbucks <newmoneybigbucks@protonmail.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-08-07 11:12:19 +00:00
Servo WPT Sync
9cb0e74cdc Update web-platform-tests to revision b'3634d5a63f2fa3969616396d95537c91c3348fe5' (#32959)
Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
2024-08-07 10:15:56 +00:00
Hayashi Mikihiro
3c271fb298 Update to rust 1.80.0 (#32896)
* Update for nix

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>

* Update to Rust 1.80.0

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>

* Rename to BindingMode from BindingAnnotation

https://github.com/rust-lang/rust/pull/124047
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>

* Remove TypeVariableOriginKind

https://github.com/rust-lang/rust/pull/123016
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>

* Remove TypeVariableOrigin

https://github.com/rust-lang/rust/pull/124955
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>

* Remove LintDiagnostic::msg

rust-lang/rust#125410

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>

* common.rs fmt mistake indents

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>

* trace_in_no_trace.rs remove mistake space

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>

* trace_in_no_trace.rs remove mistake head space

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>

* Workaround for https://github.com/servo/servo/issues/32912

It's dirty but it worked on 2000 runs

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

---------

Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Co-authored-by: Samson <16504129+sagudev@users.noreply.github.com>
2024-08-07 08:40:18 +00:00
Jonathan Schwender
a3f588832b Bump mozjs-sys to 128.0-6 (#32951)
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2024-08-06 19:18:01 +00:00
dependabot[bot]
d2e620e03e build(deps): bump bytemuck from 1.16.1 to 1.16.3 (#32955)
Bumps [bytemuck](https://github.com/Lokathor/bytemuck) from 1.16.1 to 1.16.3.
- [Changelog](https://github.com/Lokathor/bytemuck/blob/main/changelog.md)
- [Commits](https://github.com/Lokathor/bytemuck/compare/v1.16.1...v1.16.3)

---
updated-dependencies:
- dependency-name: bytemuck
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-06 18:09:00 +00:00
dependabot[bot]
63265b8c47 build(deps): bump target-lexicon from 0.12.15 to 0.12.16 (#32954)
Bumps [target-lexicon](https://github.com/bytecodealliance/target-lexicon) from 0.12.15 to 0.12.16.
- [Commits](https://github.com/bytecodealliance/target-lexicon/compare/v0.12.15...v0.12.16)

---
updated-dependencies:
- dependency-name: target-lexicon
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-06 17:52:23 +00:00
Martin Robinson
c9fbe018f1 testing: Trigger a crash more reliably when panicking and hard fail is active (#32947)
Before when handling panics and hard-fail was activated, Servo would
just exit with an error return code. This isn't interpreted as a crash
by the WPT test runner. This change raises a SEGV signal instead, which
means that panics should more reliably be treated as crashes.

This doesn't seem to change any test results, at least any non-flaky
test results. It is necessary for the test in #32782 to work though.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-08-06 17:43:06 +00:00
dependabot[bot]
89d20fc401 build(deps): bump toml_datetime from 0.6.7 to 0.6.8 (#32953)
Bumps [toml_datetime](https://github.com/toml-rs/toml) from 0.6.7 to 0.6.8.
- [Commits](https://github.com/toml-rs/toml/compare/toml_datetime-v0.6.7...toml_datetime-v0.6.8)

---
updated-dependencies:
- dependency-name: toml_datetime
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-06 17:20:21 +00:00
dependabot[bot]
49aa129d22 build(deps): bump scc from 2.1.8 to 2.1.9 (#32952)
Bumps [scc](https://github.com/wvwwvwwv/scalable-concurrent-containers) from 2.1.8 to 2.1.9.
- [Changelog](https://github.com/wvwwvwwv/scalable-concurrent-containers/blob/main/CHANGELOG.md)
- [Commits](https://github.com/wvwwvwwv/scalable-concurrent-containers/commits)

---
updated-dependencies:
- dependency-name: scc
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-06 17:19:52 +00:00
Samson
68f4b359c5 Add exception to rejection logic in generic_call (#32950)
* exception in JS Promise

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* EXCEPTION_TO_REJECTION on generic_call

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* PromiseRejectionEvent should handle promise as object

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* expectations

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2024-08-06 17:12:31 +00:00
Martin Robinson
1d464a576a layout: Add support for align-content: stretch (#32906)
This adds support for `align-content: stretch` by splitting flex line
layout into two phases. The first phase takes place before determing how
much extra space to allocate for stretching items. Then line layout
finishes, which might cause two layouts for items with `align-self:
stretch`.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2024-08-06 10:33:37 +00:00
Taym Haddadi
3800922cde Fix panic in Webrender during shutdown (#32897)
* Fix panic in webrender during shutdown

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Pass webgl_threads_sender to WebGLThreads::exit

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* follow the naming convention and use sender instead of webgl_threads_sender

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Avoid deadlock when webgl_threads is None

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Use tuple matching for webgl_threads and webgl_threads_receiver

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Remove unused _webgl_threads_sender

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

---------

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
2024-08-06 10:01:33 +00:00
hatoo
28430bad0e Fix visual_studio.py to call vswhere with -utf8 (#32949)
In Japanese Windows, `vswhere` puts cp932 string in default and fails to
load json in Pyhton.
This fixes it by adding `-utf8` option

Signed-off-by: hatoo <hato2000@gmail.com>
2024-08-06 09:35:05 +00:00
Ngo Iok Ui (Wu Yu Wei)
3f339d6856 webrender_traits: update closure in with_front_buffer to FnOnce (#32946)
Signed-off-by: Wu Wayne <yuweiwu@pm.me>
2024-08-06 06:06:21 +00:00
dependabot[bot]
23df681479 build(deps): bump winapi-util from 0.1.8 to 0.1.9 (#32942)
Bumps [winapi-util](https://github.com/BurntSushi/winapi-util) from 0.1.8 to 0.1.9.
- [Commits](https://github.com/BurntSushi/winapi-util/compare/0.1.8...0.1.9)

---
updated-dependencies:
- dependency-name: winapi-util
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-06 04:40:05 +00:00
eri
b50c1cfaaa Nix: Bump nixpkgs (#32945)
Signed-off-by: eri <eri@inventati.org>
2024-08-05 22:36:31 +00:00
dependabot[bot]
1e30642d75 build(deps): bump ttf-parser from 0.24.0 to 0.24.1 (#32944)
Bumps [ttf-parser](https://github.com/RazrFalcon/ttf-parser) from 0.24.0 to 0.24.1.
- [Changelog](https://github.com/RazrFalcon/ttf-parser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/RazrFalcon/ttf-parser/commits)

---
updated-dependencies:
- dependency-name: ttf-parser
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-05 17:49:25 +00:00
dependabot[bot]
83821fdec5 build(deps): bump xml-rs from 0.8.20 to 0.8.21 (#32943)
Bumps [xml-rs](https://github.com/kornelski/xml-rs) from 0.8.20 to 0.8.21.
- [Changelog](https://github.com/kornelski/xml-rs/blob/main/Changelog.md)
- [Commits](https://github.com/kornelski/xml-rs/compare/0.8.20...0.8.21)

---
updated-dependencies:
- dependency-name: xml-rs
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-05 17:48:01 +00:00
dependabot[bot]
a33b66ade5 build(deps): bump serde_test from 1.0.176 to 1.0.177 (#32941)
Bumps [serde_test](https://github.com/serde-rs/test) from 1.0.176 to 1.0.177.
- [Release notes](https://github.com/serde-rs/test/releases)
- [Commits](https://github.com/serde-rs/test/compare/1.0.176...1.0.177)

---
updated-dependencies:
- dependency-name: serde_test
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-05 17:32:24 +00:00
dependabot[bot]
551fbdd092 build(deps): bump ppv-lite86 from 0.2.19 to 0.2.20 (#32940)
Bumps [ppv-lite86](https://github.com/cryptocorrosion/cryptocorrosion) from 0.2.19 to 0.2.20.
- [Commits](https://github.com/cryptocorrosion/cryptocorrosion/commits)

---
updated-dependencies:
- dependency-name: ppv-lite86
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-05 17:30:59 +00:00
dependabot[bot]
a348e68086 build(deps): bump flate2 from 1.0.30 to 1.0.31 (#32939)
Bumps [flate2](https://github.com/rust-lang/flate2-rs) from 1.0.30 to 1.0.31.
- [Release notes](https://github.com/rust-lang/flate2-rs/releases)
- [Commits](https://github.com/rust-lang/flate2-rs/commits)

---
updated-dependencies:
- dependency-name: flate2
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-05 17:24:58 +00:00
dependabot[bot]
2443b17848 build(deps): bump tempfile from 3.10.1 to 3.11.0 (#32938)
Bumps [tempfile](https://github.com/Stebalien/tempfile) from 3.10.1 to 3.11.0.
- [Changelog](https://github.com/Stebalien/tempfile/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Stebalien/tempfile/compare/v3.10.1...v3.11.0)

---
updated-dependencies:
- dependency-name: tempfile
  dependency-type: indirect
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-05 17:15:05 +00:00
dependabot[bot]
6ae64b2716 build(deps): bump scc from 2.1.7 to 2.1.8 (#32937)
Bumps [scc](https://github.com/wvwwvwwv/scalable-concurrent-containers) from 2.1.7 to 2.1.8.
- [Changelog](https://github.com/wvwwvwwv/scalable-concurrent-containers/blob/main/CHANGELOG.md)
- [Commits](https://github.com/wvwwvwwv/scalable-concurrent-containers/commits)

---
updated-dependencies:
- dependency-name: scc
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-05 17:07:30 +00:00
Mukilan Thiyagarajan
0ce9ce8dc0 mach: Add support for paths with spaces on Windows (#32936)
The default user name in Windows installations is of the form "FirstName
LastName", so it seems likely that there will be spaces in the user's
path. Based on my testing on Windows 11, the only Servo's bootstrap
script has trouble dealing with spaces in paths. This patch fixes that
by quoting such paths correctly. Our direct and indirect dependencies
seem to handle these without issue and Servo does build and run
correctly with this patch.

In this patch, the logic for gstreamer bootstrap now uses powershell
instead of directly invoking msiexec.exe via cmd.exe as I was unable to
get the installer to run correctly, even with quoting. Some extra hacks
were necessary to propagate the exit code correctly to mach.

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-08-05 14:42:21 +00:00
Martin Robinson
f1602005a0 deps: Upgrade to WebRender 0.65 (#32930)
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-08-05 14:35:21 +00:00
eri
babc844c93 DevTools: Allow modification of attributes (#32888)
* feat: allow modification of attributes

Signed-off-by: eri <eri@inventati.org>

* fix: tidiness

Signed-off-by: eri <eri@inventati.org>

* feat: clean walker name generation

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
Signed-off-by: eri <eri@inventati.org>

* fix: missed out parameter

Signed-off-by: eri <eri@inventati.org>

---------

Signed-off-by: eri <eri@inventati.org>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-08-05 10:24:01 +00:00
Ngo Iok Ui (Wu Yu Wei)
4d49b04668 Add surface methods to RenderingContext (#32933)
Signed-off-by: Wu Yu Wei <yuweiwu@pm.me>
2024-08-05 10:21:36 +00:00
Martin Robinson
45aa296b26 build: Fix a print statement when repackaging GStreamer (#32932)
I neglected to put make a string a formatted string, which means that
the variable won't be included in the output properly.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-08-05 09:28:13 +00:00
Martin Robinson
10b06f0129 layout: Improve documentation and code structure in FlexItemBox::automatic_min_size (#32911)
This change add specification text to comments and restructres the code
a bit to better match the specification. In addition, a the
`establishes_scroll_container()` helper is used instead of looking at
overflow directly. It should not change behavior at all.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-08-05 09:24:31 +00:00
Samson
5e59988c87 webgpu: Use wgpu's instead of string errors and update limits handling (#32925)
* Use wgpu specific errors

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* fixup expect

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* WIP

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Fix records erasing enforcerange

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* page can already be destroyed

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Support more limits

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Set good results

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Set OK (not PASS) expect CRASH

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* fixup expectation

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* bad expectations

https://github.com/gfx-rs/wgpu/issues/6075
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* set bad expectation

render bundleencoder needs to be rewritten

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2024-08-04 17:19:46 +00:00
Martin Robinson
b366a02318 build: Speed up first run after build on macOS (#32928)
GStreamer has to process plugins each time they are added when
initializing. When those files have changed, this triggers macOS
security protections which can add many seconds to access time. This
change eliminates that problem after the first packaging of libraries by
skipping packaging if everything is up-to-date and not overwriting the
dylibs everytime.

In addition, it moves a lot of the code for packaging GStreamer
libraries on macOS into the `gstreamer` module and adds type-safety and
comments to the Python.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-08-04 12:00:15 +00:00
Mukilan Thiyagarajan
8052027dd4 ci: allow android builds on forks to skip keystore configuration (#32927)
Our build.gradle configuration already defaults to using the debug
keystore when the keystore is not configured so only the CI needs this
fix.

Fixes #32922

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-08-04 06:35:49 +00:00
Cristian Brinza
7c2c383bb1 Fix save to image on Windows (#32914)
* Read pixels in same format (gl::RGBA) as the texture

Signed-off-by: crbrz <cristianb@gmail.com>

* Add read pixels test

Signed-off-by: crbrz <cristianb@gmail.com>

* Use patched surfman

Signed-off-by: crbrz <cristianb@gmail.com>

* Update surfman to 0.9.5

Signed-off-by: crbrz <cristianb@gmail.com>

---------

Signed-off-by: crbrz <cristianb@gmail.com>
2024-08-03 20:04:26 +00:00
Daniel Adams
bb176514c6 Pass AppInfo to OpenXrDiscovery (#32926)
Signed-off-by: Daniel Adams <msub2official@gmail.com>
2024-08-03 19:33:45 +00:00
Ben
f3fe11c382 Enabled WAV decoding support in gstreamer (#32924)
Signed-off-by: Benjamin Vincent Schulenburg <bennyschulenburg@gmx.de>
2024-08-03 16:28:00 +00:00
Samson
f3bec0aed3 bindings: Convert certain Exceptions into Promise rejections (#32923)
* Impl promise exception to rejection for methods

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Impl promise exception to rejection for getters

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Impl promise exception to rejection for static methods

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Add tests for exception to rejection

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Expectations

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2024-08-03 12:58:37 +00:00
Daniel Adams
fd83281657 Implement WebXR Gamepads Module (#32860)
* Expose gamepad attribute on XRInputSource

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Tidy, add spec links

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update WPT test expectations

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update gamepad state on InputChanged event

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Pin webxr commit

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Apply gamepad updates during frame updates

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Drain input frame map

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Don't store gamepad as option

Signed-off-by: Daniel Adams <msub2official@gmail.com>

---------

Signed-off-by: Daniel Adams <msub2official@gmail.com>
2024-08-03 12:51:44 +00:00
dependabot[bot]
0672eca749 build(deps): bump malloc_size_of_derive from 0.1.2 to 0.1.3 (#32917)
* build(deps): bump malloc_size_of_derive from 0.1.2 to 0.1.3

Bumps [malloc_size_of_derive](https://github.com/bholley/malloc_size_of_derive) from 0.1.2 to 0.1.3.
- [Commits](https://github.com/bholley/malloc_size_of_derive/commits)

---
updated-dependencies:
- dependency-name: malloc_size_of_derive
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Deduplicate synstructure.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
2024-08-03 05:12:47 +00:00
dependabot[bot]
1e510e8de7 build(deps): bump regex from 1.10.5 to 1.10.6 (#32918)
Bumps [regex](https://github.com/rust-lang/regex) from 1.10.5 to 1.10.6.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.10.5...1.10.6)

---
updated-dependencies:
- dependency-name: regex
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-02 17:47:32 +00:00
dependabot[bot]
69a716a4ce build(deps): bump bytes from 1.7.0 to 1.7.1 (#32919)
Bumps [bytes](https://github.com/tokio-rs/bytes) from 1.7.0 to 1.7.1.
- [Release notes](https://github.com/tokio-rs/bytes/releases)
- [Changelog](https://github.com/tokio-rs/bytes/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tokio-rs/bytes/compare/v1.7.0...v1.7.1)

---
updated-dependencies:
- dependency-name: bytes
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-02 17:42:19 +00:00
dependabot[bot]
3699aa0c18 build(deps): bump serde_json from 1.0.121 to 1.0.122 (#32916)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.121 to 1.0.122.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.121...v1.0.122)

---
updated-dependencies:
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-02 17:39:00 +00:00
Martin Robinson
72b3fd56e1 script: Fix two build warnings about unused imports (#32910)
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-08-02 06:50:47 +00:00
Delan Azabani
974c9dc89a layout: Compute intrinsic sizes for flex items and flex containers (#32854)
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-08-02 06:45:11 +00:00
Samson
7495ba20a5 Select servo feature on servo_arc (#32909)
Signed-off-by: Samson <16504129+sagudev@users.noreply.github.com>
2024-08-02 05:41:52 +00:00
Erik Hennig
5963695664 fix: Memory leak from CreateProxyWindowHandler (#32773)
* fix: Memory leak from CreateProxyWindowHandler

Signed-off-by: ede1998 <online@erik-hennig.me>

* fix: memory leak in WindowProxy

Signed-off-by: ede1998 <online@erik-hennig.me>

* fix: Memory leak in WindowProxyHandler through static

Signed-off-by: ede1998 <online@erik-hennig.me>

---------

Signed-off-by: ede1998 <online@erik-hennig.me>
2024-08-01 21:16:49 +00:00
dependabot[bot]
501950c2e3 build(deps): bump indexmap from 2.2.6 to 2.3.0 (#32908)
Bumps [indexmap](https://github.com/indexmap-rs/indexmap) from 2.2.6 to 2.3.0.
- [Changelog](https://github.com/indexmap-rs/indexmap/blob/master/RELEASES.md)
- [Commits](https://github.com/indexmap-rs/indexmap/compare/2.2.6...2.3.0)

---
updated-dependencies:
- dependency-name: indexmap
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-01 17:57:23 +00:00
Chocolate Pie
92866ab911 enhance: Add support for unsafe-eval and wasm-unsafe-eval (#32893)
Signed-off-by: Chocolate Pie <106949016+chocolate-pie@users.noreply.github.com>
2024-08-01 17:26:44 +00:00
Samson
2cf207ddc8 Free some space on android runners (#32907)
Signed-off-by: Samson <16504129+sagudev@users.noreply.github.com>
2024-08-01 15:46:31 +00:00
Samson
0ff4398380 Update mozjs to fix enforcerange for 64bit numbers (#32905)
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2024-08-01 08:00:41 +00:00
dependabot[bot]
b4e1ec4412 build(deps): bump bytemuck from 1.16.1 to 1.16.3 (#32902)
Bumps [bytemuck](https://github.com/Lokathor/bytemuck) from 1.16.1 to 1.16.3.
- [Changelog](https://github.com/Lokathor/bytemuck/blob/main/changelog.md)
- [Commits](https://github.com/Lokathor/bytemuck/compare/v1.16.1...v1.16.3)

---
updated-dependencies:
- dependency-name: bytemuck
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-31 16:49:39 +00:00
dependabot[bot]
b94e7e00a9 build(deps): bump bytes from 1.6.1 to 1.7.0 (#32901)
Bumps [bytes](https://github.com/tokio-rs/bytes) from 1.6.1 to 1.7.0.
- [Release notes](https://github.com/tokio-rs/bytes/releases)
- [Changelog](https://github.com/tokio-rs/bytes/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tokio-rs/bytes/compare/v1.6.1...v1.7.0)

---
updated-dependencies:
- dependency-name: bytes
  dependency-type: indirect
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-31 16:45:14 +00:00
dependabot[bot]
4a7b50fedb build(deps): bump target-lexicon from 0.12.15 to 0.12.16 (#32900)
Bumps [target-lexicon](https://github.com/bytecodealliance/target-lexicon) from 0.12.15 to 0.12.16.
- [Commits](https://github.com/bytecodealliance/target-lexicon/compare/v0.12.15...v0.12.16)

---
updated-dependencies:
- dependency-name: target-lexicon
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-31 16:30:25 +00:00
Oriol Brufau
ca6169990e Implement gaps in flexbox layout (#32891)
As per https://drafts.csswg.org/css-align/#gaps

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-07-31 07:25:54 +00:00
Oriol Brufau
f86493cd7e Enable flexbox for css-align tests (#32890)
Some css-align features like gaps or alignment properties need to have
some effect on flex layout.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-07-30 22:01:58 +00:00
dependabot[bot]
c69d59259e build(deps): bump ppv-lite86 from 0.2.17 to 0.2.19 (#32894)
Bumps [ppv-lite86](https://github.com/cryptocorrosion/cryptocorrosion) from 0.2.17 to 0.2.19.
- [Commits](https://github.com/cryptocorrosion/cryptocorrosion/commits/ppv-lite86-0.2.19)

---
updated-dependencies:
- dependency-name: ppv-lite86
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-30 17:31:06 +00:00
dependabot[bot]
506096222f build(deps): bump toml_datetime from 0.6.7 to 0.6.8 (#32895)
Bumps [toml_datetime](https://github.com/toml-rs/toml) from 0.6.7 to 0.6.8.
- [Commits](https://github.com/toml-rs/toml/compare/toml_datetime-v0.6.7...toml_datetime-v0.6.8)

---
updated-dependencies:
- dependency-name: toml_datetime
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-30 17:30:46 +00:00
Martin Robinson
a64f75b62f layout: Fix display of new text in textarea elements (#32886)
Previously `<textarea>` was just displaying node contents, which is the
original text content, not the one updated by later typing. This change
fixes that issue.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-07-30 14:39:17 +00:00
eri
c06a6a764e DevTools: Inline text and clean whitespace (#32884)
* feat: inline text contents

Signed-off-by: eri <eri@inventati.org>

* feat: filter whitespace only nodes

Signed-off-by: eri <eri@inventati.org>

* chore: cleanup

Signed-off-by: eri <eri@inventati.org>

* fix: url fix

Signed-off-by: eri <eri@inventati.org>

* fix: review fixes

Signed-off-by: eri <eri@inventati.org>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>

---------

Signed-off-by: eri <eri@inventati.org>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-07-30 10:18:21 +00:00
Martin Robinson
e23dc0bf6f layout: Port border-image support for legacy layout (#32874)
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-07-30 06:41:23 +00:00
Samson
29a4cca42d Update mozjs again (#32882)
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2024-07-29 20:42:14 +00:00
dependabot[bot]
a295c3e8aa build(deps): bump serde_json from 1.0.120 to 1.0.121 (#32881)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.120 to 1.0.121.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.120...v1.0.121)

---
updated-dependencies:
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-29 17:36:01 +00:00
dependabot[bot]
4fa1daa245 build(deps): bump tokio from 1.39.1 to 1.39.2 (#32879)
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.39.1 to 1.39.2.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.39.1...tokio-1.39.2)

---
updated-dependencies:
- dependency-name: tokio
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-29 17:03:32 +00:00
dependabot[bot]
15f7db273f build(deps): bump cc from 1.1.6 to 1.1.7 (#32878)
Bumps [cc](https://github.com/rust-lang/cc-rs) from 1.1.6 to 1.1.7.
- [Release notes](https://github.com/rust-lang/cc-rs/releases)
- [Changelog](https://github.com/rust-lang/cc-rs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/cc-rs/compare/cc-v1.1.6...cc-v1.1.7)

---
updated-dependencies:
- dependency-name: cc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-29 16:59:10 +00:00
dependabot[bot]
d8c09b8b14 build(deps): bump num_enum from 0.7.2 to 0.7.3 (#32876)
Bumps [num_enum](https://github.com/illicitonion/num_enum) from 0.7.2 to 0.7.3.
- [Commits](https://github.com/illicitonion/num_enum/compare/0.7.2...0.7.3)

---
updated-dependencies:
- dependency-name: num_enum
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-29 16:53:46 +00:00
dependabot[bot]
33bf31f212 build(deps): bump webxr from 89d7027 to 93ee726 (#32877)
Bumps [webxr](https://github.com/servo/webxr) from `89d7027` to `93ee726`.
- [Commits](89d702763d...93ee726f84)

---
updated-dependencies:
- dependency-name: webxr
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-29 16:53:41 +00:00
Samson
c5fe64a594 webgpu: update wgpu again (#32873)
* Update wgpu

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* expect

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2024-07-29 13:55:56 +00:00
Samson
976850d92d Fix debugmozjs compilation (#32875)
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2024-07-29 12:05:02 +00:00
Samson
d132a0273d Update mozjs (SpiderMonkey) to 128.0 (#32769)
* Update mozjs

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Fix changed readTransfer callback

https://bugzilla.mozilla.org/show_bug.cgi?id=1842713
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Use NewExternalArrayBuffer from glue

d33454be74
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Fix columnorigin and filename being in latin1

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* fixup newexternalarray

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Float16 (this might require more work for codegen support)

https://bugzilla.mozilla.org/show_bug.cgi?id=1833647
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* js.strict is removed

https://bugzilla.mozilla.org/show_bug.cgi?id=1621603
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* asm options are now somewhere else

https://hg.mozilla.org/mozilla-central/rev/26045c88e3972957087d535e7f259e08857bd2a2
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Comment out offthread compilation

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Set NDK to 26

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Fix 1-origin handling

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Expect `FinalizationRegistry` interface

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Good expectations

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* more expectations

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Add `WeakRef` to interfaces expectation

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* mozjs upgrade: fixes for Android

Android NDK's layout has changed in r26 and 'lib64' no longer exists
under `toolchain/llvm/prebuilt/linux-x86_64`. The libraries that used to
be it are now present in `lib` folder itself.

This patch updates the build configuration to use the `lib` folder
instead when configuring the LIBCLANG_PATH environment variable.

This patch also updates to a newer mozjs version that includes fixes for
linker errors faced on Android (see #32769).

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

* Patch libz-sys & update mozjs

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* update NDK version in README

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

* Use servo/mozjs

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Update mozjs again

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-07-29 07:20:15 +00:00
shanehandley
ed8def2896 Add the type IDL attribute to htmlfieldsetelement (#32869)
* Add the type IDL attribute to htmlfieldsetelement

Signed-off-by: Shane Handley <shanehandley@fastmail.com>

* Fix missing idlharness test expectations

Signed-off-by: Shane Handley <shanehandley@fastmail.com>

---------

Signed-off-by: Shane Handley <shanehandley@fastmail.com>
2024-07-28 15:01:01 +00:00
shanehandley
bc75bf4cfa Remove treatment of whitespace in the construction of a for data entry list, move it to the encoding stage (#32868)
Signed-off-by: Shane Handley <shanehandley@fastmail.com>
2024-07-28 11:37:53 +00:00
dependabot[bot]
9f151faf1d build(deps): bump webxr from 11a3727 to 89d7027 (#32865)
Bumps [webxr](https://github.com/servo/webxr) from `11a3727` to `89d7027`.
- [Commits](11a3727637...89d702763d)

---
updated-dependencies:
- dependency-name: webxr
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-26 20:13:58 +00:00
dependabot[bot]
bdc07eab75 build(deps): bump version_check from 0.9.4 to 0.9.5 (#32864)
Bumps [version_check](https://github.com/SergioBenitez/version_check) from 0.9.4 to 0.9.5.
- [Commits](https://github.com/SergioBenitez/version_check/compare/v0.9.4...v0.9.5)

---
updated-dependencies:
- dependency-name: version_check
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-26 17:01:03 +00:00
Martin Robinson
b6f1e3b22d dependencies: Upgrade cookie and rename Servo's Cookie to ServoCookie (#32861)
This changes updates to the new version of the `cookie` crate in Servo
which no longer uses the old `time@0.1` data types. This requires using
a new version of `time` while we transition off of the old one. This is
the first step in that process.

In addition, the overloading of the `cookie::Cookie` name was causing a
great deal of confusion, so I've renamed the Servo wrapper to
`ServoCookie` like we do with `ServoUrl`.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-07-26 16:13:39 +00:00
Luke Warlow
8f377a0cb1 Partially implement dialog.show() (#32681)
Signed-off-by: Luke Warlow <lwarlow@igalia.com>
2024-07-26 16:03:25 +00:00
eri
902bf57331 DevTools: Show HTML tree (#32655)
* feat: watch root node

Signed-off-by: eri <eri@inventati.org>

* reafactor: divide inspector in components

Signed-off-by: eri <eri@inventati.org>

* feat: add css properties actor

Signed-off-by: eri <eri@inventati.org>

* feat: accesibility actor

Signed-off-by: eri <eri@inventati.org>

* feat: layout actor

Signed-off-by: eri <eri@inventati.org>

* feat: network parent and refactor

Signed-off-by: eri <eri@inventati.org>

* feat: progress on the inspector messages

Signed-off-by: eri <eri@inventati.org>

* feat: more progress on inspector

Signed-off-by: eri <eri@inventati.org>

* feat: try to fix nodes showing

Signed-off-by: eri <eri@inventati.org>

* feat: initial dom tree

Signed-off-by: eri <eri@inventati.org>

* feat: some more messages

Signed-off-by: eri <eri@inventati.org>

* feat: clean and add documentation

Signed-off-by: eri <eri@inventati.org>

* refactor: add more docs and clean

Signed-off-by: eri <eri@inventati.org>

* fix: restore deleted node attributes field

Signed-off-by: eri <eri@inventati.org>

* Apply suggestions from code review

Fix a few nits in comments

Signed-off-by: Martin Robinson <mrobinson@igalia.com>

---------

Signed-off-by: eri <eri@inventati.org>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-07-26 15:17:54 +00:00
Martin Robinson
f7448b5d61 Remove the WebXR dependency on ancient time@0.1 crate (#32862)
`webxr` depends on a very old verison of `time`, which allowed serializing
monotonic clock output. This isn't possible on all platforms, so newer
versions of `time` do not allow this. In order to stop using the old
0.1 versions of `time` we have to stop relying on times passed from `webxr`
to Servo. This change does that, at the cost of removing the XR
profiling feature. It has to be rewritten in another way in the `webxr`
crate.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-07-26 13:53:34 +00:00
Rémy SAISSY
eac54183c1 clippy: components/script/realms (#32859)
Signed-off-by: Rémy Saissy <remy.saissy@gmail.com>
2024-07-26 10:15:02 +00:00
dependabot[bot]
bc1c71bd4d build(deps): bump serde_spanned from 0.6.6 to 0.6.7 (#32857)
Bumps [serde_spanned](https://github.com/toml-rs/toml) from 0.6.6 to 0.6.7.
- [Commits](https://github.com/toml-rs/toml/compare/serde_spanned-v0.6.6...serde_spanned-v0.6.7)

---
updated-dependencies:
- dependency-name: serde_spanned
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-25 17:15:00 +00:00
dependabot[bot]
f91792d9c3 build(deps): bump env_filter from 0.1.1 to 0.1.2 (#32856)
Bumps [env_filter](https://github.com/rust-cli/env_logger) from 0.1.1 to 0.1.2.
- [Release notes](https://github.com/rust-cli/env_logger/releases)
- [Changelog](https://github.com/rust-cli/env_logger/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-cli/env_logger/compare/env_filter-v0.1.1...env_filter-v0.1.2)

---
updated-dependencies:
- dependency-name: env_filter
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-25 17:12:00 +00:00
dependabot[bot]
4afa382733 build(deps): bump toml_datetime from 0.6.6 to 0.6.7 (#32855)
Bumps [toml_datetime](https://github.com/toml-rs/toml) from 0.6.6 to 0.6.7.
- [Commits](https://github.com/toml-rs/toml/compare/toml_datetime-v0.6.6...toml_datetime-v0.6.7)

---
updated-dependencies:
- dependency-name: toml_datetime
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-25 17:08:15 +00:00
Samson
ad74bfc4ea webgpu: Update wgpu to 22.0 (#32827)
* Update wgpu to c0e7c1ef94

This is few commits ahead of wgpu 22.0

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Make it compile

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Move usage checking to device timeline as per spec

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Add logging (trace) of WEBGPU messages

This is very useful when debugging

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* update wgpu again

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* set good

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* skip `webgpu:api,operation,memory_sync,texture,same_subresource` for flakyness

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* rm r.json

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2024-07-25 08:27:26 +00:00
dependabot[bot]
450aebc839 build(deps): bump gstreamer from 0.22.6 to 0.22.7 (#32851)
Bumps gstreamer from 0.22.6 to 0.22.7.

---
updated-dependencies:
- dependency-name: gstreamer
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-24 18:48:58 +00:00
dependabot[bot]
d53962abd5 build(deps): bump object from 0.36.1 to 0.36.2 (#32852)
Bumps [object](https://github.com/gimli-rs/object) from 0.36.1 to 0.36.2.
- [Changelog](https://github.com/gimli-rs/object/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gimli-rs/object/compare/0.36.1...0.36.2)

---
updated-dependencies:
- dependency-name: object
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-24 18:47:04 +00:00
Rémy SAISSY
bf8decbffb clippy: ports/servoshell/desktop (#32847)
Signed-off-by: Rémy Saissy <remy.saissy@gmail.com>
2024-07-24 18:30:06 +00:00
Martin Robinson
f2fbe44dc9 dependencies: Upgrade tokio, ipc-channel, and mio (#32844)
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-07-24 18:28:29 +00:00
Mukilan Thiyagarajan
dee03bf297 Bump nixpkgs and add cargo-deny in shell.nix (#32842)
* build: bump the nixpkgs snapshot

We need Android NDK r26c for the SM upgrade (#32769) and the fix in
nixpkgs to make r26 NDKs function correctly (NixOS/nixpkgs#298285). Both
of those are not available in the snapshot of nixpkgs we use currently.

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

* add cargo-deny to shell.nix

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

---------

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-07-24 17:59:54 +00:00
dependabot[bot]
33a48f76fb build(deps): bump webxr from bacb22f to 11a3727 (#32848)
Bumps [webxr](https://github.com/servo/webxr) from `bacb22f` to `11a3727`.
- [Commits](bacb22faec...11a3727637)

---
updated-dependencies:
- dependency-name: webxr
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-24 17:41:21 +00:00
Rémy SAISSY
7ace7b43dc clippy: components/canvas/canvas_data.rs (#32843)
Signed-off-by: Rémy Saissy <remy.saissy@gmail.com>
2024-07-24 15:49:11 +00:00
Martin Robinson
1906741704 layout: Add support for propagating baselines from flexbox (#32841)
Some tests are still broken due to missing preferred widths calculation
for flexbox and also for missing column layout.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Co-authored-by: Delan Azabani <dazabani@igalia.com>
2024-07-24 14:38:03 +00:00
Martin Robinson
569fd5d8b5 Upgrade stylo to 2024-07-16 (#32812)
* Upgrade stylo to 2024-07-16

Signed-off-by: Martin Robinson <mrobinson@igalia.com>

* Use the new `dom` crate from stylo

Signed-off-by: Martin Robinson <mrobinson@igalia.com>

---------

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2024-07-24 14:37:08 +00:00
valadaptive
60e65c175d Implement the aspect-ratio property for replaced elements (#32800)
* Add WPT tests for box-sizing with aspect-ratio

Signed-off-by: valadaptive <valadaptive@protonmail.com>

* Implement `aspect-ratio` for replaced elements

There are two regressions because we don't implement `object-fit`, and
one because we don't properly represent non-available <img>s with `alt`
attributes.

Signed-off-by: valadaptive <valadaptive@protonmail.com>

---------

Signed-off-by: valadaptive <valadaptive@protonmail.com>
2024-07-24 11:40:23 +00:00
Daniel Adams
e425ad0cb7 Remove googlevr feature (#32840)
* Remove googlevr feature

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Remove googlevr and oculusvr from python scripts

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Remove vr checks entirely

Signed-off-by: Daniel Adams <msub2official@gmail.com>

---------

Signed-off-by: Daniel Adams <msub2official@gmail.com>
2024-07-24 08:00:50 +00:00
dependabot[bot]
b6652f88d1 build(deps): bump jobserver from 0.1.31 to 0.1.32 (#32839)
Bumps [jobserver](https://github.com/rust-lang/jobserver-rs) from 0.1.31 to 0.1.32.
- [Commits](https://github.com/rust-lang/jobserver-rs/compare/0.1.31...0.1.32)

---
updated-dependencies:
- dependency-name: jobserver
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-23 17:23:52 +00:00
dependabot[bot]
69b16e02c4 build(deps): bump env_filter from 0.1.0 to 0.1.1 (#32837)
Bumps [env_filter](https://github.com/rust-cli/env_logger) from 0.1.0 to 0.1.1.
- [Release notes](https://github.com/rust-cli/env_logger/releases)
- [Changelog](https://github.com/rust-cli/env_logger/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-cli/env_logger/compare/env_filter-v0.1.0...env_filter-v0.1.1)

---
updated-dependencies:
- dependency-name: env_filter
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-23 17:06:34 +00:00
Delan Azabani
e8cf751e11 Clarify the Code of Conduct (closes servo/servo.org#164) (#32835) 2024-07-23 09:12:03 +00:00
Jonathan Schwender
d46c66f9da ohos: Bump ohos-sys to v0.2.1 (#32834)
* ohos: Use ohos-sys from crates.io

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>

* ohos: Bump ohos-sys to v0.2.1

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>

---------

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2024-07-23 07:58:54 +00:00
dependabot[bot]
2a31e62e2c build(deps): bump libloading from 0.8.4 to 0.8.5 (#32832)
Bumps [libloading](https://github.com/nagisa/rust_libloading) from 0.8.4 to 0.8.5.
- [Commits](https://github.com/nagisa/rust_libloading/compare/0.8.4...0.8.5)

---
updated-dependencies:
- dependency-name: libloading
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-23 03:55:23 +00:00
dependabot[bot]
835e4f4926 build(deps): bump pathfinder_simd from 0.5.3 to 0.5.4 (#32833)
Bumps [pathfinder_simd](https://github.com/servo/pathfinder) from 0.5.3 to 0.5.4.
- [Release notes](https://github.com/servo/pathfinder/releases)
- [Commits](https://github.com/servo/pathfinder/commits/pathfinder_simd-v0.5.4)

---
updated-dependencies:
- dependency-name: pathfinder_simd
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-22 17:33:36 +00:00
dependabot[bot]
47d702edc3 build(deps): bump syn from 2.0.71 to 2.0.72 (#32830)
Bumps [syn](https://github.com/dtolnay/syn) from 2.0.71 to 2.0.72.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/2.0.71...2.0.72)

---
updated-dependencies:
- dependency-name: syn
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-22 17:28:24 +00:00
dependabot[bot]
753dedbeba build(deps): bump arrayref from 0.3.7 to 0.3.8 (#32831)
Bumps [arrayref](https://github.com/droundy/arrayref) from 0.3.7 to 0.3.8.
- [Commits](https://github.com/droundy/arrayref/commits)

---
updated-dependencies:
- dependency-name: arrayref
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-22 17:27:57 +00:00
Jonathan Schwender
f040b821a3 ohos: Detect installed fonts (#32731)
* ohos: Add `ohos_mock` cfg.

This allows using the Linux build together with the `ohos`
font code, using the fonts ship in the `previewer` directory of the OH SDK.

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>

* ohos: Detect installed fonts

Scan the systems font folder to detect installed fonts,
derive their associated font names and generate the font list
based on that.

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>

* Use hardcoded filepaths for HMOS Color emojis

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>

* Also support parsing OH 4.x Noto fonts

Currently we don't have an easy way to test the OH version
from the fonts module, so the parsing code has to be extended.
Once the OH 5.0 beta has a reliable fontconfig.json filemap,
then we can probably get rid of most of the parsing code,
and hardcode the OH 4.x Note fonts as a fallback.

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>

---------

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
2024-07-22 14:03:26 +00:00
Mukilan Thiyagarajan
b5482e34c0 compositor: propagate scroll events across pipelines (#32829)
Currently we don't propagate the scroll events across pipeline and
scroll only nodes contained within the nearest pipeline that passes hit
test at a gived point. This causes iframes to "capture" the scroll and
halt the scrolling process once the iframe has been scrolled all the
way. The expected behaviour is that the parent page begins to scroll
once the iframe has been scrolled fully.

The issue is present in both desktop and mobile, but was more noticeable
on mobile, especially on the default servo.org page, because of the relative
sizes of the YouTube video's iframe wrt to the parent.

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-07-22 12:42:44 +00:00
shanehandley
45eabad169 Implement URL::parse() (#32819)
* Implement URL::parse()

Signed-off-by: Shane Handley <shanehandley@fastmail.com>

* fix: Make handling more idiomatic

Signed-off-by: Shane Handley <shanehandley@fastmail.com>

---------

Signed-off-by: Shane Handley <shanehandley@fastmail.com>
2024-07-22 08:48:16 +00:00
Mukilan Thiyagarajan
a007baa4cf deps: switch to tikv-jemallocator crates in Cargo.toml (#32828)
`jemallocator` and `jemallocator-sys` crates are same as the `tikv-*`
versions and these aliases were maintained for historical reasons, based
on crates.io documentation. For newer projects, it is recommended to use
the `tikv-` versions of the crate. Even though Servo is not a new
project, it makes sense to switch to the newer version for the sake of
clarity.

Also, more importantly, `tikv-jemallocator` has new release (0.6.0)
which includes a fix for #32720. There doesn't seem to be a
corresponding version publised for the `jemallocator` crate.

Fixes #32720

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-07-22 07:55:46 +00:00
Samson
f6dc35f11d chore: Update WebGPU CTS (#32825)
* Update WebGPU CTS to 50b6e7a743

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* expect

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2024-07-21 16:19:43 +00:00
Servo WPT Sync
2c4b96b872 Update web-platform-tests to revision b'5af3e9c2a2aba76ade00f0dbc3486e50a74a4506' (#32824)
Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
2024-07-21 07:59:39 +00:00
shanehandley
a7a380777d Remove a comment related to a TODO which has already been done. (#32822)
Signed-off-by: Shane Handley <shanehandley@fastmail.com>
2024-07-21 04:58:27 +00:00
Samson
b471f6473f Remove failure breaks from webgpu thread (#32814)
* Remove breaks from webgpu requests

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* expect

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* limit,out_of_range TIMEOUT->FAIL

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2024-07-20 19:57:53 +00:00
Daniel Adams
2c17de7fa7 Gamepad: Implement GamepadHapticActuator (#32046)
* Implement Servo side of GamepadHapticActuator

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Get build working

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Create effect handling on embedder side

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update tracing for GamepadHapticEffect

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update gilrs to point to commit with effect complete event

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Implement playing and preempting haptic effects

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update IDL to add trigger rumble

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update WPT expectations

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Handle stopping haptic effects from reset()

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* ./mach fmt, fix test-tidy issues

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Add extra validity checks for trigger rumble

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Retrieve supported haptic effects from embedder

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Fix test expectations

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Add missing spec link, pin gilrs commit

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* servoshell cargo formatting

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Fix Cargo.toml

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Additional comments, realm proof, naming

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* ./mach fmt

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Update gilrs rev to gilrs-core 0.5.12 release

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Implement sequence ids for gamepad haptic promises

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Take playing effect promise instead of cloning

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Implement listener for reset function

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Fix Cargo.lock

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Restructure IPC listeners, add comments, handle visibility change

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Check that haptic effect still exists before handling ff completion event

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Visibility steps, add InRealm bindings for promises

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Add Gamepad EmbedderMsg arms to egl servo_glue

Signed-off-by: Daniel Adams <msub2official@gmail.com>

---------

Signed-off-by: Daniel Adams <msub2official@gmail.com>
2024-07-20 06:29:27 +00:00
Daniel Adams
9212ed203a Enable OpenXR backend from the WebXR crate (#32817)
* Enable OpenXR backend from the WebXR crate

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Ensure openxr feature is only included on windows

Signed-off-by: Daniel Adams <msub2official@gmail.com>

* Add cfgs for OpenXR usages

Signed-off-by: Daniel Adams <msub2official@gmail.com>

---------

Signed-off-by: Daniel Adams <msub2official@gmail.com>
2024-07-20 06:24:40 +00:00
dependabot[bot]
a29e5c8115 build(deps): bump cc from 1.1.5 to 1.1.6 (#32815)
Bumps [cc](https://github.com/rust-lang/cc-rs) from 1.1.5 to 1.1.6.
- [Release notes](https://github.com/rust-lang/cc-rs/releases)
- [Changelog](https://github.com/rust-lang/cc-rs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/cc-rs/compare/cc-v1.1.5...cc-v1.1.6)

---
updated-dependencies:
- dependency-name: cc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-19 17:01:17 +00:00
Rodion Borovyk
4bf5024ee0 fix a couple of simple clipy warnings (#32813)
Signed-off-by: Rodion Borovyk <rodion.borovyk@gmail.com>
2024-07-19 13:18:34 +00:00
Martin Robinson
5eb77592ea layout: Reduce the complexity of FlexLine::layout (#32810)
Instead of a complex combination of iterators, use a flatter iteration
design when laying out a flex line.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Co-authored-by: Delan Azabani <dazabani@igalia.com>
2024-07-19 10:37:29 +00:00
rachaelspooky
8b3c9b744a Fix 5 clippy warnings (#32808)
Signed-off-by: Rachael Gentry <rachael.l.gentry@gmail.com>
2024-07-19 04:04:42 +00:00
dependabot[bot]
a6048c46d2 build(deps): bump thiserror from 1.0.62 to 1.0.63 (#32805)
Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.62 to 1.0.63.
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.62...1.0.63)

---
updated-dependencies:
- dependency-name: thiserror
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-18 17:03:57 +00:00
dependabot[bot]
f28b5419ab build(deps): bump wayland-cursor from 0.31.4 to 0.31.5 (#32806)
Bumps [wayland-cursor](https://github.com/smithay/wayland-rs) from 0.31.4 to 0.31.5.
- [Release notes](https://github.com/smithay/wayland-rs/releases)
- [Changelog](https://github.com/Smithay/wayland-rs/blob/master/historical_changelog.md)
- [Commits](https://github.com/smithay/wayland-rs/commits)

---
updated-dependencies:
- dependency-name: wayland-cursor
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-18 17:02:17 +00:00
dependabot[bot]
627f0b4f61 build(deps): bump xcursor from 0.3.5 to 0.3.6 (#32804)
Bumps [xcursor](https://github.com/esposm03/xcursor-rs) from 0.3.5 to 0.3.6.
- [Commits](https://github.com/esposm03/xcursor-rs/commits)

---
updated-dependencies:
- dependency-name: xcursor
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-18 16:52:33 +00:00
valadaptive
bb5ace7929 Bump stylo and enable aspect-ratio tests (#32803)
Signed-off-by: valadaptive <valadaptive@protonmail.com>
2024-07-18 13:28:39 +00:00
valadaptive
f6c9714286 Fix sizing of replaced elements with min/max sizes (#32777)
If a (min/max)-(height/width) property is set, we still need to respect
the intrinsic ratio of the element if it exists. The previous code was
simply clamping the element size after doing the sizing calculations
once, but this leads to an incorrect aspect ratio.

Signed-off-by: valadaptive <valadaptive@protonmail.com>
2024-07-18 07:07:13 +00:00
Delan Azabani
1b1f79305e flex: handle ‘align-self: [ first | last ]? && baseline’ (#32787)
* flex: handle ‘align-self: baseline’

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

* FIXME: css/css-flexbox/align-items-baseline-overflow-non-visible.html

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

* Fix baseline selection

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

* Fix baseline calculation with padding/border/margin

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

* Fix compile errors and warnings

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

* Implement ‘align-self: last baseline’

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

* Fix bug where non-baseline-aligned items affected max baseline

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

* Update expectations

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

* Rename method

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

---------

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-07-18 07:03:29 +00:00
Samson
34eed29037 Less nesting in webgpu response (#32799)
* Remove Option wrap of WebGPUResponse

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Replace WebGPUResponseResult with WebGPUResponse

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2024-07-17 20:37:52 +00:00
Chocolate Pie
1223335547 enhance: Implement CanvasRenderingContext2D.measureText (#32704)
Signed-off-by: Chocolate Pie <106949016+chocolate-pie@users.noreply.github.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-07-17 19:20:18 +00:00
dependabot[bot]
d82232d549 build(deps): bump wayland-client from 0.31.4 to 0.31.5 (#32798)
Bumps [wayland-client](https://github.com/smithay/wayland-rs) from 0.31.4 to 0.31.5.
- [Release notes](https://github.com/smithay/wayland-rs/releases)
- [Changelog](https://github.com/Smithay/wayland-rs/blob/master/historical_changelog.md)
- [Commits](https://github.com/smithay/wayland-rs/commits)

---
updated-dependencies:
- dependency-name: wayland-client
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-17 17:17:41 +00:00
dependabot[bot]
62c3d30b3d build(deps): bump wayland-scanner from 0.31.3 to 0.31.4 (#32797)
Bumps [wayland-scanner](https://github.com/smithay/wayland-rs) from 0.31.3 to 0.31.4.
- [Release notes](https://github.com/smithay/wayland-rs/releases)
- [Changelog](https://github.com/Smithay/wayland-rs/blob/master/historical_changelog.md)
- [Commits](https://github.com/smithay/wayland-rs/commits)

---
updated-dependencies:
- dependency-name: wayland-scanner
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-17 17:08:50 +00:00
dependabot[bot]
f8ebbdc0d1 build(deps): bump tokio from 1.38.0 to 1.38.1 (#32794)
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.38.0 to 1.38.1.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.38.0...tokio-1.38.1)

---
updated-dependencies:
- dependency-name: tokio
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-17 17:05:57 +00:00
dependabot[bot]
26beacdabd build(deps): bump wayland-backend from 0.3.5 to 0.3.6 (#32795)
Bumps [wayland-backend](https://github.com/smithay/wayland-rs) from 0.3.5 to 0.3.6.
- [Release notes](https://github.com/smithay/wayland-rs/releases)
- [Changelog](https://github.com/Smithay/wayland-rs/blob/master/historical_changelog.md)
- [Commits](https://github.com/smithay/wayland-rs/commits)

---
updated-dependencies:
- dependency-name: wayland-backend
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-17 17:02:42 +00:00
Danila Matveev
e4ad1d3ab9 [clippy] Rename enum FormSubmitter and its elements (#32791)
* [clippy] Renames enum FormSubmitter and its elements

Signed-off-by: Danila Matveev <usurname.r@gmail.com>

* fmt

Signed-off-by: Danila Matveev <usurname.r@gmail.com>

---------

Signed-off-by: Danila Matveev <usurname.r@gmail.com>
2024-07-17 16:46:32 +00:00
Martin Robinson
882a855b8c Convert layout to use Gecko's alignment style representation (#32790)
Signed-off-by: Nico Burns <nico@nicoburns.com>
Co-authored-by: Nico Burns <nico@nicoburns.com>
2024-07-17 14:18:55 +00:00
Danila Matveev
a0d2b36ad8 clippy: Fix four warnings (#32789)
* Fixes 4 clippy rules

Signed-off-by: Danila Matveev <usurname.r@gmail.com>

* Rollbacks changes in range.rs and silences clippy::neg_cmp_op_on_partial_ord

Signed-off-by: Danila Matveev <usurname.r@gmail.com>

* Fixes a fmt issue

Signed-off-by: Danila Matveev <usurname.r@gmail.com>

---------

Signed-off-by: Danila Matveev <usurname.r@gmail.com>
2024-07-17 09:05:02 +00:00
Nico Burns
5fd0d2f17b Mark flexbox-mbp-horiz-003 tests as only failing on linux (#32762)
Signed-off-by: Nico Burns <nico@nicoburns.com>
2024-07-17 07:49:41 +00:00
dependabot[bot]
bc1bf82f78 build(deps): bump webxr from 88fd368 to bacb22f (#32788)
Bumps [webxr](https://github.com/servo/webxr) from `88fd368` to `bacb22f`.
- [Commits](88fd368d1c...bacb22faec)

---
updated-dependencies:
- dependency-name: webxr
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-16 19:51:12 +00:00
Samson
946af8450c Update WebGPU CTS (#32783)
* Update CTS to 20425f60bb

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* expect

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
2024-07-16 17:24:52 +00:00
Delan Azabani
039631cfa5 layout: Properly handle min/max cross container size (#32785)
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-07-16 12:14:02 +00:00
Ville Lindholm
80559c829b Bump mozjs version (#32786)
Signed-off-by: Ville Lindholm <ville@lindholm.dev>
2024-07-16 10:13:48 +00:00
Danila Matveev
0189b89fd1 Fixes typo in clippy::enum_variant_names (#32784)
Signed-off-by: Danila Matveev <optician_owl@fastmail.com>
Signed-off-by: Danila Matveev <usurname.r@gmail.com>
2024-07-16 09:59:12 +00:00
dependabot[bot]
d5171c068c build(deps): bump setuptools from 68.2.2 to 70.0.0 in /python (#32781)
Bumps [setuptools](https://github.com/pypa/setuptools) from 68.2.2 to 70.0.0.
- [Release notes](https://github.com/pypa/setuptools/releases)
- [Changelog](https://github.com/pypa/setuptools/blob/main/NEWS.rst)
- [Commits](https://github.com/pypa/setuptools/compare/v68.2.2...v70.0.0)

---
updated-dependencies:
- dependency-name: setuptools
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-15 18:57:33 +00:00
dependabot[bot]
ddf3bb4957 build(deps): bump document-features from 0.2.8 to 0.2.10 (#32780)
Bumps [document-features](https://github.com/slint-ui/document-features) from 0.2.8 to 0.2.10.
- [Release notes](https://github.com/slint-ui/document-features/releases)
- [Changelog](https://github.com/slint-ui/document-features/blob/master/CHANGELOG.md)
- [Commits](https://github.com/slint-ui/document-features/commits)

---
updated-dependencies:
- dependency-name: document-features
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-15 17:27:52 +00:00
dependabot[bot]
bb201fb4ec build(deps): bump bytes from 1.6.0 to 1.6.1 (#32779)
Bumps [bytes](https://github.com/tokio-rs/bytes) from 1.6.0 to 1.6.1.
- [Release notes](https://github.com/tokio-rs/bytes/releases)
- [Changelog](https://github.com/tokio-rs/bytes/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tokio-rs/bytes/compare/v1.6.0...v1.6.1)

---
updated-dependencies:
- dependency-name: bytes
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-15 17:15:23 +00:00
dependabot[bot]
025b831862 build(deps): bump cc from 1.1.1 to 1.1.5 (#32778)
Bumps [cc](https://github.com/rust-lang/cc-rs) from 1.1.1 to 1.1.5.
- [Release notes](https://github.com/rust-lang/cc-rs/releases)
- [Changelog](https://github.com/rust-lang/cc-rs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/cc-rs/compare/cc-v1.1.1...cc-v1.1.5)

---
updated-dependencies:
- dependency-name: cc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-15 17:11:08 +00:00
Samson
e761b7d711 Auto merge all WPT and dependabot PRs (#32775)
* Auto merge all WPT and dependabot PRs

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Adjust name of action

Signed-off-by: Martin Robinson <mrobinson@igalia.com>

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-07-15 12:44:47 +00:00
Servo WPT Sync
968474a9fd Update web-platform-tests to revision b'f3dd9cba239a9655951ee62ec4dafc8fe37df2c5' (#32774)
Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
2024-07-14 09:16:30 +00:00
Patrycja
3118542a9e Use mallinfo only on target_env=gnu (#32772)
mallinfo isn't available on musl, causing linking issues on build;
make sure related functions are built only for GNU Libc

Signed-off-by: Patrycja Rosa <git@ptrcnull.me>
2024-07-14 07:20:52 +00:00
Jonathan Schwender
cd394af018 Bump duplicated nix to 0.29 (#32764)
Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
2024-07-13 07:48:01 +00:00
dependabot[bot]
d667b79739 build(deps): bump thiserror from 1.0.61 to 1.0.62 (#32768)
Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.61 to 1.0.62.
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.61...1.0.62)

---
updated-dependencies:
- dependency-name: thiserror
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-12 16:55:03 +00:00
dependabot[bot]
2fc0fd1312 build(deps): bump syn from 2.0.70 to 2.0.71 (#32767)
Bumps [syn](https://github.com/dtolnay/syn) from 2.0.70 to 2.0.71.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/2.0.70...2.0.71)

---
updated-dependencies:
- dependency-name: syn
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-12 16:50:52 +00:00
dependabot[bot]
42eb93624c build(deps): bump cc from 1.1.0 to 1.1.1 (#32765)
Bumps [cc](https://github.com/rust-lang/cc-rs) from 1.1.0 to 1.1.1.
- [Release notes](https://github.com/rust-lang/cc-rs/releases)
- [Changelog](https://github.com/rust-lang/cc-rs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/cc-rs/compare/cc-v1.1.0...cc-v1.1.1)

---
updated-dependencies:
- dependency-name: cc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-12 16:43:20 +00:00
Samson
91ca727eb9 webgpu: Divide message code into separate files (#32700)
* Spilt webgpu ipc messages even more

* Add license to mod.rs

* file docs
2024-07-12 11:01:15 +00:00
Ngo Iok Ui (Wu Yu Wei)
40bac8c3df script: document.visibilityState and document.hidden (#32635)
* Squashed commit of the following:

commit 5e0ea9996cb0d8137c3e1cd04487a1065b61289d
Author: Wu Yu Wei <yuweiwu@pm.me>
Date:   Thu Jul 11 13:37:51 2024 +0900

    Move lint to new_inherited

    Signed-off-by: Wu Yu Wei <yuweiwu@pm.me>

commit a8cbfb1eef2650d153ef41c232d9e80e1118fc37
Merge: b819968f3e 7a33f8f008
Author: Wu Yu Wei <yuweiwu@pm.me>
Date:   Thu Jul 11 13:32:18 2024 +0900

    Merge branch 'main' into visibility

commit b819968f3eaa361c8a2cf3af679943ae2065ab32
Merge: eda2ec4c22 1c6b74e1f1
Author: Wu Wayne <yuweiwu@pm.me>
Date:   Tue Jul 9 14:26:43 2024 +0900

    Merge branch 'main' into visibility

commit eda2ec4c225c63236d6851ea525455cad8874ce5
Author: Wu Wayne <yuweiwu@pm.me>
Date:   Thu Jul 4 14:25:05 2024 +0900

    Include page-visibility tests to wpt

commit 9da7b4ee39b141e59e4a21a64445c4b08499463f
Author: Wu Yu Wei <yuweiwu@pm.me>
Date:   Thu Jul 4 12:50:40 2024 +0900

    Add TODO comment for future update

commit 11f55fea3ead0c8fa07f16557a63cc6a77c15c3f
Author: Wu Yu Wei <yuweiwu@pm.me>
Date:   Wed Jul 3 11:01:51 2024 +0900

    Add spaces between steps

commit 408c3e51f25867e85f894cd77a6355bc32f2aa00
Author: Wu Wayne <yuweiwu@pm.me>
Date:   Tue Jul 2 18:33:53 2024 +0900

    Update MANIFEST.json

commit 679fe4ffdd28554b11b4018395fac22a08ccbc34
Author: Wu Wayne <yuweiwu@pm.me>
Date:   Tue Jul 2 18:27:02 2024 +0900

    Add VisibilityStateEntry to mozilla/interfaces.html

commit 4a456a2b4a473fa795274edf56ecf660616f90eb
Author: Wu Wayne <yuweiwu@pm.me>
Date:   Tue Jul 2 14:28:11 2024 +0900

    Update meta results

commit cd191447ff61de392526e00c13f765c2df7a269e
Merge: 7ff480a698 ad01342f00
Author: Ngo Iok Ui (Wu Yu Wei) <yuweiwu@pm.me>
Date:   Tue Jul 2 13:47:49 2024 +0900

    Merge branch 'main' into visibility

commit 7ff480a698413ac5526edfb1b8731373bb9d04ae
Author: Wu Yu Wei <yuweiwu@pm.me>
Date:   Tue Jul 2 13:12:44 2024 +0900

    Update description text of update_visibility_state

commit 0e496b7bce4fd5476a1919737b00e8f0c9e2fdc8
Author: Wu Yu Wei <yuweiwu@pm.me>
Date:   Tue Jul 2 12:59:40 2024 +0900

    Add specification link to VisibilityStateEntry methods

commit 3e4a061450621bd17f19ff81099dd4daaeaea478
Author: Wu Yu Wei <yuweiwu@pm.me>
Date:   Tue Jul 2 12:31:53 2024 +0900

    Add descriptive text to each step

commit 8bbdfcae97db5002b09e5f5ecec6ae80d080dc95
Author: Wu Wayne <yuweiwu@pm.me>
Date:   Fri Jun 28 19:15:34 2024 +0900

    mach fmt

commit dc1c7a4aec6aba56af7afcfee6feadbee242a643
Author: Wu Wayne <yuweiwu@pm.me>
Date:   Fri Jun 28 19:01:00 2024 +0900

    Add update_visibility_state

commit 6aa18143319044dc084a9585ab064cd853bccc21
Author: Wu Wayne <yuweiwu@pm.me>
Date:   Fri Jun 28 16:06:25 2024 +0900

    Add VisibilityStateEntry.webidl

commit 638ae3cd563004334d35cc3fbdc1f918d29833d0
Author: Wu Yu Wei <yuweiwu@pm.me>
Date:   Fri Jun 28 13:39:29 2024 +0900

    Add visibilityState and hidden in Document.webidl

Signed-off-by: Wu Yu Wei <yuweiwu@pm.me>

* Move creation into reflect call

Signed-off-by: Wu Yu Wei <yuweiwu@pm.me>

---------

Signed-off-by: Wu Yu Wei <yuweiwu@pm.me>
2024-07-12 08:32:25 +00:00
Jonathan Schwender
b206a0f4a3 ohos: Add default log filter (#32760)
Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
2024-07-12 04:12:25 +00:00
Jonathan Schwender
496ce717c5 Move legacy layout behind a feature flag (#32759)
* Move legacy layout behind a feature flag

For now the new feature flag would still be enabled by default,
but disabling the `layout_2013` feature, gives the following
binary size improvements for servoshell on Linux:
- in debug mode from 1278MB -> 1201 MB
- in release mode from 144MB -> 140MB
- in production mode from 108MB -> 106MB

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>

* Update components/servo/lib.rs

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
Signed-off-by: Jonathan Schwender <55576758+jschwe@users.noreply.github.com>

---------

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
Signed-off-by: Jonathan Schwender <55576758+jschwe@users.noreply.github.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-07-11 13:24:52 +00:00
Martin Robinson
4907e89656 canvas: Remove as much usage of font-kit as possible (#32758)
Do font selection using Servo's font backend, which is shared with the
rest of layout. In addition, delay the creation of the `font-kit` font
until just before rendering with `raqote`. The idea is that when
`raqote` is no longer used, we can drop the `font-kit` dependency.

This change has the side-effect of fixing text rendering in canvas,
adding support for font fallback in canvas, and also correcting a bug in
font selection with size overrides.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-07-11 04:25:38 +00:00
Bumsoo Kim
c6cb7ee981 script: Use the new C string literal in the DOM bindings (#32741)
* simple conversion to cstrings using as_ptr()

Signed-off-by: Bum Kim <bumcrystlbum@gmail.com>

* replaced byte strings with c strings using new helper functions

Signed-off-by: Bum Kim <bumcrystlbum@gmail.com>

* changed &[u8] type parameters to &CStr

Signed-off-by: Bum Kim <bumcrystlbum@gmail.com>

---------

Signed-off-by: Bum Kim <bumcrystlbum@gmail.com>
2024-07-11 04:18:54 +00:00
Ngo Iok Ui (Wu Yu Wei)
3e163bfcdb shell: set no-wgl flag in servoshell instead (#32753)
* Set no-wgl flag in servoshell instead

Signed-off-by: Wu Yu Wei <yuweiwu@pm.me>

* Remove unused comment

Signed-off-by: Wu Yu Wei <yuweiwu@pm.me>

---------

Signed-off-by: Wu Yu Wei <yuweiwu@pm.me>
2024-07-10 14:50:27 +00:00
dependabot[bot]
313536fd82 build(deps): bump cc from 1.0.106 to 1.1.0 (#32746)
Bumps [cc](https://github.com/rust-lang/cc-rs) from 1.0.106 to 1.1.0.
- [Release notes](https://github.com/rust-lang/cc-rs/releases)
- [Changelog](https://github.com/rust-lang/cc-rs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/cc-rs/compare/cc-v1.0.106...cc-v1.1.0)

---
updated-dependencies:
- dependency-name: cc
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-10 14:50:11 +00:00
dependabot[bot]
f455321f84 build(deps): bump syn from 2.0.69 to 2.0.70 (#32749)
Bumps [syn](https://github.com/dtolnay/syn) from 2.0.69 to 2.0.70.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/2.0.69...2.0.70)

---
updated-dependencies:
- dependency-name: syn
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-10 12:15:14 +00:00
dependabot[bot]
fc34137fda build(deps): bump vergen from 8.3.1 to 8.3.2 (#32748)
Bumps [vergen](https://github.com/rustyhorde/vergen) from 8.3.1 to 8.3.2.
- [Release notes](https://github.com/rustyhorde/vergen/releases)
- [Commits](https://github.com/rustyhorde/vergen/commits)

---
updated-dependencies:
- dependency-name: vergen
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-10 12:15:05 +00:00
dependabot[bot]
0c362329c3 build(deps): bump hyper from 0.14.29 to 0.14.30 (#32750)
Bumps [hyper](https://github.com/hyperium/hyper) from 0.14.29 to 0.14.30.
- [Release notes](https://github.com/hyperium/hyper/releases)
- [Changelog](https://github.com/hyperium/hyper/blob/v0.14.30/CHANGELOG.md)
- [Commits](https://github.com/hyperium/hyper/compare/v0.14.29...v0.14.30)

---
updated-dependencies:
- dependency-name: hyper
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-10 12:15:04 +00:00
dependabot[bot]
1ec1207099 build(deps): bump darling from 0.20.9 to 0.20.10 (#32747)
Bumps [darling](https://github.com/TedDriggs/darling) from 0.20.9 to 0.20.10.
- [Release notes](https://github.com/TedDriggs/darling/releases)
- [Changelog](https://github.com/TedDriggs/darling/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TedDriggs/darling/commits/v0.20.10)

---
updated-dependencies:
- dependency-name: darling
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-10 12:14:54 +00:00
atbrakhi
c6443f74a4 Remove unused implementation (#32754)
Signed-off-by: atbrakhi <atbrakhi@igalia.com>
2024-07-10 10:57:49 +00:00
dependabot[bot]
097b9a3d0b build(deps): bump uuid from 1.9.1 to 1.10.0 (#32751)
Bumps [uuid](https://github.com/uuid-rs/uuid) from 1.9.1 to 1.10.0.
- [Release notes](https://github.com/uuid-rs/uuid/releases)
- [Commits](https://github.com/uuid-rs/uuid/compare/1.9.1...1.10.0)

---
updated-dependencies:
- dependency-name: uuid
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-10 03:20:33 +00:00
atbrakhi
a3bb8048fc use au in inline (#32728)
Signed-off-by: atbrakhi <atbrakhi@igalia.com>
2024-07-09 19:18:59 +00:00
eri
33f3c34d28 DevTools: Display console messages and errors (#32727)
* feat: add streams to browsing context

* feat: console now works!

* feat: order console messages

* feat: add streams to new browsing contexts

* fix: apply suggestions

Co-authored-by: Martin Robinson <mrobinson@igalia.com>

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-07-09 18:27:47 +00:00
Delan Azabani
34d9be70f9 Update in-tree docs to point to the new book (#32743)
* Update in-tree docs to point to the new book

* Revive build setup section in README as quickstart guide

* Apply feedback about titles
2024-07-09 15:42:00 +00:00
Josh Matthews
72e6a1f007 Remove media element state changes triggered by network responses (#32643)
* Do not change media element ready state when network response is complete.

* Do not fire multiple error events for the same media content.

* Inform media backend when media response is complete.

* Continue delaying the load event when a complete media response is received.

* Only mark a media response as complete when the response is the active one.

* Update expectations for imagebitmap tests using video element.

* Update fetch ORB video test expectations.

* Update media CSS selector test expectation for non-implemented feature.

* Update expectations for media element tests that now work.

* Updat expected result for failing reftest.

* Update expected failure for test that loads an audio file in a video element.

* Update media test expectation for unimplemented track feature.

* Do not process media element ready state changes that are unchanged.

* Reset media element ready state to Current when playback finishes.

* Set media element ready state to Enough when appropriate player event is received.

* Update test expectations.
2024-07-09 06:48:44 +00:00
石蕊 (Pi-Cla)
f29dd64a7b Fix more clippy (#32740) 2024-07-09 04:47:43 +00:00
dependabot[bot]
4e1f623666 build(deps): bump target-lexicon from 0.12.14 to 0.12.15 (#32737)
Bumps [target-lexicon](https://github.com/bytecodealliance/target-lexicon) from 0.12.14 to 0.12.15.
- [Commits](https://github.com/bytecodealliance/target-lexicon/compare/v0.12.14...v0.12.15)

---
updated-dependencies:
- dependency-name: target-lexicon
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-09 03:57:54 +00:00
dependabot[bot]
1c6b74e1f1 build(deps): bump clipboard-win from 5.3.1 to 5.4.0 (#32736)
Bumps [clipboard-win](https://github.com/DoumanAsh/clipboard-win) from 5.3.1 to 5.4.0.
- [Commits](https://github.com/DoumanAsh/clipboard-win/commits)

---
updated-dependencies:
- dependency-name: clipboard-win
  dependency-type: indirect
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-08 21:09:33 +00:00
dependabot[bot]
84ec017625 build(deps): bump gilrs-core from 0.5.12 to 0.5.13 (#32733)
Bumps [gilrs-core](https://gitlab.com/gilrs-project/gilrs) from 0.5.12 to 0.5.13.
- [Commits](https://gitlab.com/gilrs-project/gilrs/compare/gilrs-core-v0.5.12...gilrs-core-v0.5.13)

---
updated-dependencies:
- dependency-name: gilrs-core
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-08 20:33:20 +00:00
dependabot[bot]
b7d9415a4a build(deps): bump cc from 1.0.104 to 1.0.106 (#32739)
Bumps [cc](https://github.com/rust-lang/cc-rs) from 1.0.104 to 1.0.106.
- [Release notes](https://github.com/rust-lang/cc-rs/releases)
- [Changelog](https://github.com/rust-lang/cc-rs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/cc-rs/compare/cc-v1.0.104...cc-v1.0.106)

---
updated-dependencies:
- dependency-name: cc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-08 17:32:44 +00:00
dependabot[bot]
7a8cdcd4ca build(deps): bump syn from 2.0.68 to 2.0.69 (#32738)
Bumps [syn](https://github.com/dtolnay/syn) from 2.0.68 to 2.0.69.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/2.0.68...2.0.69)

---
updated-dependencies:
- dependency-name: syn
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-08 17:31:36 +00:00
dependabot[bot]
b919ac0dad build(deps): bump serde from 1.0.203 to 1.0.204 (#32735)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.203 to 1.0.204.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.203...v1.0.204)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-08 17:25:57 +00:00
dependabot[bot]
d8283d1a42 build(deps): bump gilrs from 0.10.7 to 0.10.8 (#32734)
Bumps [gilrs](https://gitlab.com/gilrs-project/gilrs) from 0.10.7 to 0.10.8.
- [Commits](https://gitlab.com/gilrs-project/gilrs/compare/v0.10.7...v0.10.8)

---
updated-dependencies:
- dependency-name: gilrs
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-08 17:21:42 +00:00
Martin Robinson
77e9e3deba fonts: Add support for generic font families and font size configuration (#32673)
This adds support for generic font families in Servo and allows for
configuration of them as well as their default font sizes. One
interesting fix here is that now monospace default to 13px, like it does
in other browsers.

In addition to that, this exposes a new interface in Stylo which allows
setting a default style. This is quite useful for fonts, but also for
other kinds of default style settings -- like text zoom.

Fixes #8371.
Fixes #14773.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-07-08 17:17:48 +00:00
cybai (Haku)
956b7f62e0 Avoid unnecessary clones for URLs (#32694) 2024-07-08 16:11:55 +00:00
atbrakhi
d9b99723f5 Remove unused ToWebRender implementation (#32729) 2024-07-08 16:10:34 +00:00
Jonathan Schwender
8cd1e22f8d android/ohos: fonts: Ignore ascii case when searching for font family (#32725)
The input for this function commonly comes from a `LowercaseString`,
while our actual font family name has cases.
Since font family lookup should be case-neutral, we do a compare
ignoring the ascii case.
I'm not too familiar with the CSS standard so I'm not 100% sure
if this is sufficient, or if we need to use a different method
to compare strings for arbitrary non-ascii font names.

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
2024-07-08 13:53:41 +00:00
Martin Robinson
89944bd330 layout: Improve layout of table captions (#32695)
- Instead of treating captions as a `BlockFormattingContext`, treat it as
  a `NonReplacedFormattingContext`, which allows reusing flow layout for
  captions -- fixing some issues with sizing.
- Pass in the proper size of the containing block when laying out,
  fixing margin calculation.
- Follow the unspecified rules about how various size properties on
  captions affect their size.
- Improve linebreaking around atomics, which is tested by
  caption-related tests. This fixes intrinsic size calculation regarding
  soft wrap opportunities around atomic and also makes the code making
  these actual soft wrap opportunities a bit better.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-07-08 12:58:38 +00:00
eri
2888193cfe DevTools: Replace camel case variable names (#32726)
* refactor: rename to snake case

* refactor: more renaming

* chore: format

* chore: clean
2024-07-08 11:18:35 +00:00
Mukilan Thiyagarajan
b243457ccc ci: fix security issue in try job workflow (#32724)
This [issue][1] was reported by GitHub user @RedYetiDev via the Security
Advisory reporting mechanism on GitHub. The fix is also based on their
proposed solution.

The issue is that `refs/pull/{pr_number}/head` points to the latest
commit of a PR and so it could be different than the commit that was
reviewed when the try label was applied. The fix is to use the exact commit
sha at the point when the try job is triggered, which is available in
the `github` context as  `github.event.pull_request.head.sha`.

[1]: https://github.com/servo/servo/security/advisories/GHSA-fxqr-xgh8-3577

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Co-authored-by: Aviv Keller <38299977+RedYetiDev@users.noreply.github.com>
2024-07-08 10:08:23 +00:00
Martin Robinson
099b5607b9 readme: Clarify that rust and cargo must be in your path after rustup runs (#32722)
Fixes #32670.
2024-07-08 08:54:01 +00:00
Mukilan Thiyagarajan
24639bb540 android: sign release APK with a custom key. (#32721)
This PR adds support for signing all APKs we produce on the CI
with a custom signing key. Currently the logic falls back to
the debug key (which is generated by AGP and not persistent) if
the environment variable for the keystore is not set. This allows
local developer builds to work without requiring a key store.
Once #32720 is resolved, we could sign just the production builds
and remove the conditional logic.

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-07-08 08:36:00 +00:00
Ngo Iok Ui (Wu Yu Wei)
6cb95827a3 Set compositor's cursor_pos properly (#32718) 2024-07-08 07:41:27 +00:00
Keith Cirkel
db4cba4d6d Add customElements.getName (#32715)
* Add customElements.getName

* rebaseline
2024-07-07 15:22:57 +00:00
Servo WPT Sync
816359583c Update web-platform-tests to revision b'4e3b5de2eb8218cf18a1674618994efeb96e2cc0' (#32717)
Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
2024-07-07 07:23:54 +00:00
Bumsoo Kim
141a594e23 Replace null-byte terminated string literals with C-string literals (#32716)
* simple conversion from byte string to c-string

Signed-off-by: Bum Kim <bumcrystlbum@gmail.com>

* convert byte strings to c-strings to c_char ptr

Signed-off-by: Bum Kim <bumcrystlbum@gmail.com>

---------

Signed-off-by: Bum Kim <bumcrystlbum@gmail.com>
2024-07-06 20:14:15 +00:00
Samson
59d0f1fe1a script: Impl cloning of JSPrincipals (#32706)
* Impl cloning of JSPrincipals

* bincode as workspace dependency

* Update mozjs and cc
2024-07-06 10:25:38 +00:00
dependabot[bot]
5a9dc98f07 build(deps): bump egui_glow in the egui-related group (#32712)
Bumps the egui-related group with 1 update: [egui_glow](https://github.com/emilk/egui).


Updates `egui_glow` from 0.28.0 to 0.28.1
- [Release notes](https://github.com/emilk/egui/releases)
- [Changelog](https://github.com/emilk/egui/blob/master/CHANGELOG.md)
- [Commits](https://github.com/emilk/egui/compare/0.28.0...0.28.1)

---
updated-dependencies:
- dependency-name: egui_glow
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: egui-related
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-06 07:24:25 +00:00
Alex Touchet
1e5c844eb5 Add more crates to egui Dependabot group (#32711) 2024-07-06 05:51:31 +00:00
dependabot[bot]
438e99ca9a build(deps): bump the egui-related group with 2 updates (#32708)
Bumps the egui-related group with 2 updates: [egui](https://github.com/emilk/egui) and [egui-winit](https://github.com/emilk/egui).


Updates `egui` from 0.28.0 to 0.28.1
- [Release notes](https://github.com/emilk/egui/releases)
- [Changelog](https://github.com/emilk/egui/blob/master/CHANGELOG.md)
- [Commits](https://github.com/emilk/egui/compare/0.28.0...0.28.1)

Updates `egui-winit` from 0.28.0 to 0.28.1
- [Release notes](https://github.com/emilk/egui/releases)
- [Changelog](https://github.com/emilk/egui/blob/master/CHANGELOG.md)
- [Commits](https://github.com/emilk/egui/compare/0.28.0...0.28.1)

---
updated-dependencies:
- dependency-name: egui
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: egui-related
- dependency-name: egui-winit
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: egui-related
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-05 20:06:46 +00:00
dependabot[bot]
fabd7a178f build(deps): bump emath from 0.28.0 to 0.28.1 (#32710)
Bumps [emath](https://github.com/emilk/egui) from 0.28.0 to 0.28.1.
- [Release notes](https://github.com/emilk/egui/releases)
- [Changelog](https://github.com/emilk/egui/blob/master/CHANGELOG.md)
- [Commits](https://github.com/emilk/egui/compare/0.28.0...0.28.1)

---
updated-dependencies:
- dependency-name: emath
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-05 16:43:07 +00:00
dependabot[bot]
a16666db03 build(deps): bump ab_glyph from 0.2.27 to 0.2.28 (#32709)
Bumps [ab_glyph](https://github.com/alexheretic/ab-glyph) from 0.2.27 to 0.2.28.
- [Release notes](https://github.com/alexheretic/ab-glyph/releases)
- [Commits](https://github.com/alexheretic/ab-glyph/compare/ab-glyph-0.2.27...ab-glyph-0.2.28)

---
updated-dependencies:
- dependency-name: ab_glyph
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-05 16:37:56 +00:00
Martin Robinson
7eac599aa1 fonts: Stop using Stylesheet::effective_font_face_rules (#32699)
This function doesn't exist in upstream Stylo and is fairly unecessary.
Removing it will help reduce the difference between downstream Stylo and
upstream Stylo.
2024-07-04 21:53:14 +00:00
Martin Robinson
0f2139be27 layout_2013: Remove code preventing writing mode assertion failures (#32698)
It's actually kind of useful that this code crashes, as it points out a
problem. Additionally, we aren't going to be maintaining Layout 2013 any
longer so it is very unlikely that these bugs will ever be fixed. This
allows us to reduce our diff with upstream Stylo.

Closes #30577.
2024-07-04 21:08:02 +00:00
dependabot[bot]
10326f7e0f build(deps): bump wayland-cursor from 0.31.3 to 0.31.4 (#32701)
Bumps [wayland-cursor](https://github.com/smithay/wayland-rs) from 0.31.3 to 0.31.4.
- [Release notes](https://github.com/smithay/wayland-rs/releases)
- [Changelog](https://github.com/Smithay/wayland-rs/blob/master/historical_changelog.md)
- [Commits](https://github.com/smithay/wayland-rs/commits)

---
updated-dependencies:
- dependency-name: wayland-cursor
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-04 18:24:17 +00:00
Martin Robinson
4b63043c6a clippy: Fix warnings in shared and config, fonts, layout, and layout_2020 components (#32674) 2024-07-04 14:18:58 +00:00
Samson
99c1f886b8 webgpu: Update wgpu and revamp RenderPass (#32665)
* Update wgpu and revamp RenderPass

* Set good expectations

* Set one bad expectation

* send_render_command

* small fixups

* docs

* doc

* Put RenderPass inside PassState

* Use Pass enum for ComputePass too

* fix docs
2024-07-04 12:16:42 +00:00
Martin Robinson
26624a109f clippy: Fix a bunch of warnings in script (#32680)
This is just a portion of the errors that are remaining to be fixed.
2024-07-04 11:40:23 +00:00
Jonathan Schwender
93fdb8263d Make task_info as macos specific (#32693)
rust-analyzer breaks on Linux (when invoked without mach), because it
tries to compile the c files, and doesn't find `mach_init.h`
Since we don't need task_info on non-mac platforms, just make the
crate empty on other platforms.

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
2024-07-04 09:21:49 +00:00
eri
fb1c57da3e DevTools: Add parser tool (#32684)
* feat: add devtools parser tool

* feat: improve documentation
2024-07-04 09:15:31 +00:00
newmoneybigbucks
aae66cc33c Updated all kill_*_id functions defined in indentityhub.rs to free_*_id naming format for issue 32685 (#32688)
Signed-off-by: newmoneybigbucks <newmoneybigbucks@protonmail.com>
2024-07-04 09:03:13 +00:00
dependabot[bot]
42f42b39cc build(deps): bump wayland-client from 0.31.3 to 0.31.4 (#32691)
Bumps [wayland-client](https://github.com/smithay/wayland-rs) from 0.31.3 to 0.31.4.
- [Release notes](https://github.com/smithay/wayland-rs/releases)
- [Changelog](https://github.com/Smithay/wayland-rs/blob/master/historical_changelog.md)
- [Commits](https://github.com/smithay/wayland-rs/commits)

---
updated-dependencies:
- dependency-name: wayland-client
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-04 08:29:54 +00:00
dependabot[bot]
44c4fe32c4 build(deps): bump wayland-scanner from 0.31.2 to 0.31.3 (#32690)
Bumps [wayland-scanner](https://github.com/smithay/wayland-rs) from 0.31.2 to 0.31.3.
- [Release notes](https://github.com/smithay/wayland-rs/releases)
- [Changelog](https://github.com/Smithay/wayland-rs/blob/master/historical_changelog.md)
- [Commits](https://github.com/smithay/wayland-rs/commits)

---
updated-dependencies:
- dependency-name: wayland-scanner
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-04 08:27:40 +00:00
dependabot[bot]
81f40400b7 build(deps): bump windows_i686_gnullvm from 0.52.5 to 0.52.6 (#32689)
Bumps [windows_i686_gnullvm](https://github.com/microsoft/windows-rs) from 0.52.5 to 0.52.6.
- [Release notes](https://github.com/microsoft/windows-rs/releases)
- [Commits](https://github.com/microsoft/windows-rs/commits)

---
updated-dependencies:
- dependency-name: windows_i686_gnullvm
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-04 08:26:33 +00:00
Martin Robinson
e14e079fff servoshell: Update all egui dependencies and group them for dependabot (#32683)
This updates egui, making the necessary changes to maintain behavior. In
addition, it groups dependencies so that they are updated in a single PR
by dependabot, avoiding manual work.
2024-07-04 06:36:19 +00:00
派卡 (pi-cla)
650af7db92 webgpu: Remove mutex around Identities (#32682) 2024-07-03 18:39:45 +00:00
Martin Robinson
959ffad99a layout: Add support for table captions (#32657)
This adds initial support for table captions. To do this, the idea of
the table wrapper becomes a bit more concrete. Even so, the wrapper is
still reponsible for allocating space for the grid's border and padding,
as those properties are specified on the wrapper and not grid in CSS.

In order to account for this weirdness of HTML/CSS captions and grid are
now laid out and placed with a negative offset in the table wrapper
content rect.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2024-07-03 18:24:19 +00:00
dependabot[bot]
f8e4ae6040 build(deps): bump sctk-adwaita from 0.8.1 to 0.8.3 (#32679)
Bumps [sctk-adwaita](https://github.com/PolyMeilex/sctk-adwaita) from 0.8.1 to 0.8.3.
- [Release notes](https://github.com/PolyMeilex/sctk-adwaita/releases)
- [Changelog](https://github.com/PolyMeilex/sctk-adwaita/blob/master/CHANGELOG.md)
- [Commits](https://github.com/PolyMeilex/sctk-adwaita/commits)

---
updated-dependencies:
- dependency-name: sctk-adwaita
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-03 17:44:15 +00:00
dependabot[bot]
70697adeb9 build(deps): bump zerocopy from 0.7.34 to 0.7.35 (#32678)
Bumps [zerocopy](https://github.com/google/zerocopy) from 0.7.34 to 0.7.35.
- [Release notes](https://github.com/google/zerocopy/releases)
- [Changelog](https://github.com/google/zerocopy/blob/main/CHANGELOG.md)
- [Commits](https://github.com/google/zerocopy/commits)

---
updated-dependencies:
- dependency-name: zerocopy
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-03 17:40:08 +00:00
Martin Robinson
4e79ac5701 layout: Allow rendering LineItems independent of inline box (#32666)
Refactor inline layout to allow rendering line items in the second stage
to be rendered in any order, independent of their parent inline box.
This will allow line items to be reordered, effectively allowing the
splitting of inline boxes, for the purposes of BiDi and any other inline
reordering feature.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Rakhi Sharma <atbrakhi@igalia.com>
2024-07-03 15:15:31 +00:00
atbrakhi
4357751f28 use au in TextFragment (#32653) 2024-07-03 07:27:08 +00:00
dependabot[bot]
fe58a5f0a3 build(deps): bump idna from 1.0.1 to 1.0.2 (#32669)
Bumps [idna](https://github.com/servo/rust-url) from 1.0.1 to 1.0.2.
- [Release notes](https://github.com/servo/rust-url/releases)
- [Commits](https://github.com/servo/rust-url/compare/idna-v1.0.1...idna-v1.0.2)

---
updated-dependencies:
- dependency-name: idna
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-02 17:42:17 +00:00
dependabot[bot]
a958a0bb40 build(deps): bump serde_json from 1.0.119 to 1.0.120 (#32668)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.119 to 1.0.120.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.119...v1.0.120)

---
updated-dependencies:
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-02 17:32:09 +00:00
atbrakhi
044ab3eeab fix clippy warning (#32667) 2024-07-02 14:59:46 +00:00
Samson
c0105de82b webgpu: Implement ShaderCompilationInfo (#32642)
* ShaderCompilationInfo

* expectations

* Handle CompilationInfo promise in GPUShaderModule

* Fix my english
2024-07-02 13:39:06 +00:00
Jonathan Schwender
bd0a5eb4b7 Add production-stripped cargo profile (#32651)
* Add production-stripped cargo profile

Stripping the binary significantly reduces the size
significantly (in my tests to about 1/3 of the original size).
Enabling lto and setting `codegen-units = 1` allows further size
optimizations at the cost of increased compile-time.

Probably not everyone wants a stripped binary, since it makes
backtraces less useful.

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>

* Move lto and cgu option to production profile

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>

---------

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
2024-07-02 13:05:24 +00:00
Samson
7b324074b5 mark test/wpt as vendored in .gitattributes (#32663)
although expectation and _mozilla test are ours
2024-07-02 11:23:18 +00:00
dependabot[bot]
ad01342f00 build(deps): bump mime_guess from 2.0.4 to 2.0.5 (#32660)
* build(deps): bump mime_guess from 2.0.4 to 2.0.5

Bumps [mime_guess](https://github.com/abonander/mime_guess) from 2.0.4 to 2.0.5.
- [Commits](https://github.com/abonander/mime_guess/commits)

---
updated-dependencies:
- dependency-name: mime_guess
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Remove libloading from servo-tidy.toml

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alex Touchet <alextouchet@outlook.com>
2024-07-01 18:29:06 +00:00
dependabot[bot]
7ed5e804b5 build(deps): bump serde_json from 1.0.118 to 1.0.119 (#32661)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.118 to 1.0.119.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.118...v1.0.119)

---
updated-dependencies:
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-01 17:43:39 +00:00
dependabot[bot]
67e13e4991 build(deps): bump object from 0.36.0 to 0.36.1 (#32658)
Bumps [object](https://github.com/gimli-rs/object) from 0.36.0 to 0.36.1.
- [Changelog](https://github.com/gimli-rs/object/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gimli-rs/object/compare/0.36.0...0.36.1)

---
updated-dependencies:
- dependency-name: object
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-01 17:34:48 +00:00
Mukilan Thiyagarajan
0615428aa9 android: fix application name used in ./mach run (#32652)
This patch also switches the code to python format strings
so that the application name can be interpolated where
needed.

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-07-01 08:10:00 +00:00
Servo WPT Sync
e2e7476404 Sync WPT with upstream (30-06-2024) (#32649)
* Update web-platform-tests to revision b'639fa536940371f833fbbcc10104e20f435f9777'

Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>

* Delete tests/wpt/meta/css/css-values/cap-invalidation.html.ini

* Update css-font-face.https.sub.tentative.html.ini

---------

Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
Co-authored-by: Samson <16504129+sagudev@users.noreply.github.com>
2024-06-30 11:14:33 +00:00
dependabot[bot]
3a0f564916 build(deps): bump log from 0.4.21 to 0.4.22 (#32638)
Bumps [log](https://github.com/rust-lang/log) from 0.4.21 to 0.4.22.
- [Release notes](https://github.com/rust-lang/log/releases)
- [Changelog](https://github.com/rust-lang/log/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/log/compare/0.4.21...0.4.22)

---
updated-dependencies:
- dependency-name: log
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-28 17:02:51 +00:00
dependabot[bot]
14ef3f55aa build(deps): bump zerovec from 0.10.3 to 0.10.4 (#32639)
Bumps [zerovec](https://github.com/unicode-org/icu4x) from 0.10.3 to 0.10.4.
- [Release notes](https://github.com/unicode-org/icu4x/releases)
- [Changelog](https://github.com/unicode-org/icu4x/blob/main/CHANGELOG.md)
- [Commits](https://github.com/unicode-org/icu4x/commits)

---
updated-dependencies:
- dependency-name: zerovec
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-28 17:01:11 +00:00
dependabot[bot]
40878c654e build(deps): bump ab_glyph from 0.2.26 to 0.2.27 (#32637)
Bumps [ab_glyph](https://github.com/alexheretic/ab-glyph) from 0.2.26 to 0.2.27.
- [Release notes](https://github.com/alexheretic/ab-glyph/releases)
- [Commits](https://github.com/alexheretic/ab-glyph/compare/ab-glyph-0.2.26...ab-glyph-0.2.27)

---
updated-dependencies:
- dependency-name: ab_glyph
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-28 16:54:53 +00:00
Jonathan Schwender
9455169813 Add OpenHarmony support to servoshell (#32594)
* Generate EGL bindings for ohos

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>

* Adjust servoshell `bin` error message for android/ohos

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>

* ohos: disable WebGL

offscreen buffers are not implemented yet on ohos.

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>

* Add OpenHarmony support to servoshell

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>

* Share ResourceReaderInstance

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>

* Share android/ohos HostTrait

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>

* Share servo glue

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>

* Pass Init options from ArkTS to Servo

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>

* f rebase ResourceReaderMethods

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>

* fixup! Share ResourceReaderInstance

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>

* Fix typo

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>

* Update Cargo.lock

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>

* ohos: Move WebGL check to webgl thread

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>

* Remove commented code

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>

* Remove commented and duplicate / unused code

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>

---------

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2024-06-28 12:51:50 +00:00
Mu Xian Ming
a7ebc28738 Replace null-byte terminated string literals with C-string literals (#32631)
Signed-off-by: Mu Xianming <mu.xianming@lmwn.com>
Co-authored-by: Mu Xianming <mu.xianming@lmwn.com>
2024-06-28 12:19:11 +00:00
Martin Robinson
adc0fc984d layout: Make geom.rs logical geoemetry types more ergonomic (#32633)
Make using the logical geometry types more ergonomic by having them all
implement `Copy` (at most 4 64-bit numbers), similar to what `euclid`
does. In addition add an implementation of `Neg` for `LogicalVec` and
`LogicalSides` as it will be used in upcoming table implementation code.
2024-06-28 08:20:50 +00:00
Samson
e9cf4d4971 webgpu: Update wgpu and revamp computepass (#32575)
* Do not wait on drop, but rather wake poller thread

* Update wgpu and render stuff

* Set some good expectations

* Update wgpu again

* handle IPC error as warning

* More good expectations

* Some more expectations

CTS does not match the spec: https://github.com/gpuweb/cts/issues/3806

* This expectations are due to other changes in servo

also happening on main

* Explain error_command_encoders and remove RefCell around it

* fixup

* store validness of passes

* More good expectations

* More docs

* this assert is wrong

* This is even more right per CTS/spec

Only Command encoder state errors are allowed here, but wgpu does not exposes them.

* More good expectations

* One bad expectation

* Fix my english
2024-06-28 04:49:35 +00:00
atbrakhi
fced0b4940 use au in AtomicLineItem (#32630) 2024-06-27 11:12:32 +00:00
Delan Azabani
9ff900e166 CONTRIBUTING: add AI contributions policy (#32287)
* CONTRIBUTING: add AI contributions policy

Co-authored-by: Martin Robinson <mrobinson@igalia.com>

* Be more explicit about how the policy may be revised

* Reword point about copyright issues

* Fix missing word in ethical issues

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-06-27 06:05:07 +00:00
Manuel Rego Casasnovas
574a22a6cd Avoid Esc shortcut to close Servo (#32603)
* Avoid Esc shortcut to close Servo

Keep Esc shortcut to leave fullscreen, but avoid to close Servo
(as this is not common in other similar apps,
and can be shortcut used in some web apps for other things).

* Send Esc to the page
2024-06-27 03:43:05 +00:00
dependabot[bot]
aa99c85645 build(deps): bump either from 1.12.0 to 1.13.0 (#32627)
Bumps [either](https://github.com/rayon-rs/either) from 1.12.0 to 1.13.0.
- [Commits](https://github.com/rayon-rs/either/compare/1.12.0...1.13.0)

---
updated-dependencies:
- dependency-name: either
  dependency-type: indirect
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-27 03:39:11 +00:00
Martin Robinson
da2de4fc68 html: Parse a comma-separated list of faces in the <font> tag (#32622)
This change parses a comma-separated list of faces in the `<font>` tag
and also moves the parsing code from `stylo` to Servo. This means that
the servo-specific code can be removed from stylo decreasing the
differences between Gecko and Servo's version of `stylo`.
2024-06-26 18:28:35 +00:00
dependabot[bot]
47678a61b9 build(deps): bump the gstreamer-related group with 2 updates (#32626)
Bumps the gstreamer-related group with 2 updates: [glib](https://github.com/gtk-rs/gtk-rs-core) and [glib-macros](https://github.com/gtk-rs/gtk-rs-core).


Updates `glib` from 0.19.8 to 0.19.9
- [Release notes](https://github.com/gtk-rs/gtk-rs-core/releases)
- [Changelog](https://github.com/gtk-rs/gtk-rs-core/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gtk-rs/gtk-rs-core/compare/0.19.8...0.19.9)

Updates `glib-macros` from 0.19.8 to 0.19.9
- [Release notes](https://github.com/gtk-rs/gtk-rs-core/releases)
- [Changelog](https://github.com/gtk-rs/gtk-rs-core/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gtk-rs/gtk-rs-core/compare/0.19.8...0.19.9)

---
updated-dependencies:
- dependency-name: glib
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: gstreamer-related
- dependency-name: glib-macros
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: gstreamer-related
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-26 16:40:34 +00:00
Martin Robinson
e16291f14e layout: Enable parallel layout for tables (#32477)
This simply wraps row and column-based layout of table sells in a
`par_iter()` unconditionally enabling parallel layout for tables. In the
future we can choose to adjust the conditions under which layout is done
in parallel.
2024-06-26 16:33:48 +00:00
Oriol Brufau
f055964792 Switch replaced layout to app units (#32625) 2024-06-26 16:19:24 +00:00
Mukilan Thiyagarajan
a730469b70 script: Implement the FontFaceSet DOM API (#32576)
Add a skeleton implementation of FontFaceSet interface with support
for resolving the `document.fonts.ready` Promise when the loading of
web fonts is completed.

This change exposes new failures in the web platform tests.

These were ERROR before the change because `document.fonts.ready` caused
a `ReferenceError` causing the tests to be aborted and they now FAIL:
- /css/CSS2/linebox/vertical-align-top-bottom-001.html
- /css/css-flexbox/flex-one-sets-flex-basis-to-zero-px.html
- /css/css-fonts/generic-family-keywords-001.html
- /css/css-fonts/math-script-level-and-math-style/math-script-level-004.tentative.html
- /css/css-fonts/math-script-level-and-math-style/math-script-level-002.tentative.html
- /css/css-text/text-autospace/text-autospace-ligature-001.html
- /css/css-values/calc-size/calc-size-width.tentative.html

These were TIMEOUT before the change because `document.fonts.ready` was
a ReferenceError and the tests were asynchronous (reftest-wait). These now
FAIL because the assertions are now executed after fonts are loaded:
- /css/css-fonts/matching/fixed-stretch-style-over-weight.html
- /css/css-fonts/matching/range-descriptor-reversed.html
- /css/css-fonts/matching/stretch-distance-over-weight-distance.html
- /css/css-fonts/matching/style-ranges-over-weight-direction.html
- /css/css-fonts/variations/variable-box-font.html
- /css/css-fonts/variations/variable-gpos-m2b.html
- /css/css-fonts/variations/variable-gsub.html
- /css/css-fonts/variations/variable-opsz-size-adjust.html
- /css/css-position/sticky/position-sticky-change-top.html
- /css/css-position/sticky/position-sticky-fixed-ancestor.html
- /css/css-position/sticky/position-sticky-flexbox.html
- /css/css-position/sticky/position-sticky-grid.html
- /css/css-position/sticky/position-sticky-inline.html
- /css/css-position/sticky/position-sticky-rendering.html
- /css/css-position/sticky/position-sticky-stacking-context.html
- /css/css-position/sticky/position-sticky-table-td-left.html
- /css/css-position/sticky/position-sticky-table-td-right.html
- /css/css-position/sticky/position-sticky-table-tfoot-bottom.html
- /css/css-position/sticky/position-sticky-table-th-right.html
- /css/css-position/sticky/position-sticky-table-thead-top.html
- /css/css-position/sticky/position-sticky-table-tr-bottom.html
- /css/css-position/sticky/position-sticky-table-tr-top.html
- /css/css-position/sticky/position-sticky-writing-modes.html
- /css/css-pseudo/marker-intrinsic-contribution-001.html
- /css/css-text/hyphens/hyphens-character.html

These tests now PASS due to this patch:
* FAIL -> PASS
  - /html/canvas/element/text/2d.text.draw.fill.maxWidth.fontface.html
  - /html/canvas/element/text/2d.text.measure.width.empty.html
* TIMEOUT -> PASS
  - /css/css-fonts/variations/font-descriptor-range-reversed.html
  - /css/css-fonts/variations/variable-opsz.html
  - /css/css-position/sticky/position-sticky-table-th-left.html
* ERROR -> PASS
  - /css/css-fonts/generic-family-keywords-002.html
  - /css/css-fonts/generic-family-keywords-003.html
* These two tests only PASS in Layout 2020:
  - /css/CSS2/positioning/inline-static-position-001.html
  - /css/cssom-view/getBoundingClientRect-empty-inline.html

These two tests have subtests that PASS intermittenttly:
- /fetch/metadata/generated/css-font-face.sub.tentative.html
- /css/css-fonts/generic-family-keywords-001.html

These tests are new TIMEOUTS that used to FAIL because
`documents.fonts.ready` was undefined:
- /resource-timing/TAO-match.html
- /resource-timing/content-type.html
- /resource-timing/nextHopProtocol-is-tao-protected.https.html

The failure in `/resize-observer/change-layout-in-error.html` could be
due to an issue in the ResizeObserver implementation that is now exposed
with this change, but this needs more investigation.

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-06-26 09:44:47 +00:00
Martin Robinson
7ea894774f Add a directory listing feature for file URLs (#32580)
Signed-off-by: Bobulous <Bobulous@users.noreply.github.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Bobulous <Bobulous@users.noreply.github.com>
2024-06-26 08:02:50 +00:00
dependabot[bot]
b3d99a607f build(deps): bump bitflags from 2.5.0 to 2.6.0 (#32613)
Bumps [bitflags](https://github.com/bitflags/bitflags) from 2.5.0 to 2.6.0.
- [Release notes](https://github.com/bitflags/bitflags/releases)
- [Changelog](https://github.com/bitflags/bitflags/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bitflags/bitflags/compare/2.5.0...2.6.0)

---
updated-dependencies:
- dependency-name: bitflags
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-26 01:54:50 +00:00
dependabot[bot]
7a76f4ed20 build(deps): bump zerovec-derive from 0.10.2 to 0.10.3 (#32611)
Bumps [zerovec-derive](https://github.com/unicode-org/icu4x) from 0.10.2 to 0.10.3.
- [Release notes](https://github.com/unicode-org/icu4x/releases)
- [Changelog](https://github.com/unicode-org/icu4x/blob/main/CHANGELOG.md)
- [Commits](https://github.com/unicode-org/icu4x/commits)

---
updated-dependencies:
- dependency-name: zerovec-derive
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-25 18:53:06 +00:00
dependabot[bot]
b42208a20e build(deps): bump zerovec from 0.10.2 to 0.10.3 (#32614)
Bumps [zerovec](https://github.com/unicode-org/icu4x) from 0.10.2 to 0.10.3.
- [Release notes](https://github.com/unicode-org/icu4x/releases)
- [Changelog](https://github.com/unicode-org/icu4x/blob/main/CHANGELOG.md)
- [Commits](https://github.com/unicode-org/icu4x/commits)

---
updated-dependencies:
- dependency-name: zerovec
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-25 17:55:33 +00:00
dependabot[bot]
e51c15d84f build(deps): bump icu_properties from 1.5.0 to 1.5.1 (#32612)
Bumps [icu_properties](https://github.com/unicode-org/icu4x) from 1.5.0 to 1.5.1.
- [Release notes](https://github.com/unicode-org/icu4x/releases)
- [Changelog](https://github.com/unicode-org/icu4x/blob/main/CHANGELOG.md)
- [Commits](https://github.com/unicode-org/icu4x/commits)

---
updated-dependencies:
- dependency-name: icu_properties
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-25 17:39:07 +00:00
dependabot[bot]
3a30fa9977 build(deps): bump serde_json from 1.0.117 to 1.0.118 (#32609)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.117 to 1.0.118.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.117...v1.0.118)

---
updated-dependencies:
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-25 17:18:53 +00:00
dependabot[bot]
92378ac3d6 build(deps): bump serde_bytes from 0.11.14 to 0.11.15 (#32610)
Bumps [serde_bytes](https://github.com/serde-rs/bytes) from 0.11.14 to 0.11.15.
- [Release notes](https://github.com/serde-rs/bytes/releases)
- [Commits](https://github.com/serde-rs/bytes/compare/0.11.14...0.11.15)

---
updated-dependencies:
- dependency-name: serde_bytes
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-25 17:18:08 +00:00
dependabot[bot]
6d3c67d469 build(deps): bump uuid from 1.9.0 to 1.9.1 (#32608)
Bumps [uuid](https://github.com/uuid-rs/uuid) from 1.9.0 to 1.9.1.
- [Release notes](https://github.com/uuid-rs/uuid/releases)
- [Commits](https://github.com/uuid-rs/uuid/compare/1.9.0...1.9.1)

---
updated-dependencies:
- dependency-name: uuid
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-25 17:14:47 +00:00
Oriol Brufau
7b6aa64aca Clean up some unused dependencies (#32600) 2024-06-25 13:02:59 +00:00
dependabot[bot]
52e6e59ebd build(deps): bump uuid from 1.8.0 to 1.9.0 (#32589)
Bumps [uuid](https://github.com/uuid-rs/uuid) from 1.8.0 to 1.9.0.
- [Release notes](https://github.com/uuid-rs/uuid/releases)
- [Commits](https://github.com/uuid-rs/uuid/compare/1.8.0...1.9.0)

---
updated-dependencies:
- dependency-name: uuid
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-25 12:27:03 +00:00
Oriol Brufau
a972e5c200 Switch flex layout to app units (#32599) 2024-06-25 07:05:16 +00:00
ItsSunnyMonster
42e090a1eb clippy: fix some warnings in desktop and some components (#32583)
* clippy: fix some warnings in ports/servoshell/desktop

Signed-off-by: ItsSunnyMonster <100400733+ItsSunnyMonster@users.noreply.github.com>

* style: fix formatting

Signed-off-by: ItsSunnyMonster <100400733+ItsSunnyMonster@users.noreply.github.com>

* clippy: fix warnings in bluetooth, devtools and servo components

Signed-off-by: ItsSunnyMonster <100400733+ItsSunnyMonster@users.noreply.github.com>

* clippy: remove comments

Signed-off-by: ItsSunnyMonster <100400733+ItsSunnyMonster@users.noreply.github.com>

---------

Signed-off-by: ItsSunnyMonster <100400733+ItsSunnyMonster@users.noreply.github.com>
2024-06-25 07:04:23 +00:00
dependabot[bot]
6738902d45 build(deps): bump lazy_static from 1.4.0 to 1.5.0 (#32591)
Bumps [lazy_static](https://github.com/rust-lang-nursery/lazy-static.rs) from 1.4.0 to 1.5.0.
- [Release notes](https://github.com/rust-lang-nursery/lazy-static.rs/releases)
- [Commits](https://github.com/rust-lang-nursery/lazy-static.rs/compare/1.4.0...1.5.0)

---
updated-dependencies:
- dependency-name: lazy_static
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-24 22:48:38 +00:00
Oriol Brufau
b1fdfb88bb Upgrade stylo to 2024-05-31 (#32474)
* Upgrade stylo to 2024-05-31

* Fixup for https://phabricator.services.mozilla.com/D211731

* Fixup for https://phabricator.services.mozilla.com/D207779

* Fixup for https://phabricator.services.mozilla.com/D207781

* Update test expectations
2024-06-24 20:03:50 +00:00
dependabot[bot]
680735ed73 build(deps): bump syn from 2.0.67 to 2.0.68 (#32588)
Bumps [syn](https://github.com/dtolnay/syn) from 2.0.67 to 2.0.68.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/2.0.67...2.0.68)

---
updated-dependencies:
- dependency-name: syn
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-24 17:33:35 +00:00
dependabot[bot]
75423656d4 build(deps): bump libloading from 0.8.3 to 0.8.4 (#32590)
Bumps [libloading](https://github.com/nagisa/rust_libloading) from 0.8.3 to 0.8.4.
- [Commits](https://github.com/nagisa/rust_libloading/compare/0.8.3...0.8.4)

---
updated-dependencies:
- dependency-name: libloading
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-24 17:28:43 +00:00
Martin Robinson
e331cc67c3 mach: Expose a --skip-static-analysis to mach boostrap (#32587)
This should speed up runners which just need to run the WPT tests.

Fixes #32582.
2024-06-24 17:13:09 +00:00
Martin Robinson
30dad2565f android: Rename the Android app to reflect servo.org ownership and servoshell (#32554)
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-06-24 15:39:57 +00:00
Jonathan Schwender
7d7574373b android: Use location_bar_input_to_url instead of re-implementing (#32586)
We can use the same function as the desktop version

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
2024-06-24 15:25:07 +00:00
Jonathan Schwender
26bbfe9b55 Make crown optional (#32494)
* Make `crown` optional

Add the optional `--use-crown` flag to mach

* --use-crown for all platforms in CI

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>

* Add documentation for `--use-crown`

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>

* Update python/servo/command_base.py

Co-authored-by: Mukilan Thiyagarajan <mukilanthiagarajan@gmail.com>
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>

* Raise Error if CARGO_BUILD_RUSTC conflicts with --use-crown

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>

* add dummy RUSTFLAG to trigger re-checking

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>

---------

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Co-authored-by: Mukilan Thiyagarajan <mukilanthiagarajan@gmail.com>
2024-06-24 11:46:43 +00:00
Erik Hennig
8121c98834 Add suppression comments + Suppress lazy_static (#32584)
Co-authored-by: Jonas Zeunert <jonas@zeunert.org>
2024-06-23 17:21:16 +00:00
Servo WPT Sync
62b230e85d Update web-platform-tests to revision b'f46bf6aa167e2838a8b93501a1a998ffde90d879' (#32581)
Signed-off-by: WPT Sync Bot <ghbot+wpt-sync@servo.org>
2024-06-23 06:21:30 +00:00
dependabot[bot]
130eef300b build(deps): bump syn from 2.0.66 to 2.0.67 (#32579)
Bumps [syn](https://github.com/dtolnay/syn) from 2.0.66 to 2.0.67.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/2.0.66...2.0.67)

---
updated-dependencies:
- dependency-name: syn
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-21 17:41:36 +00:00
dependabot[bot]
56d4759993 build(deps): bump proc-macro2 from 1.0.85 to 1.0.86 (#32577)
Bumps [proc-macro2](https://github.com/dtolnay/proc-macro2) from 1.0.85 to 1.0.86.
- [Release notes](https://github.com/dtolnay/proc-macro2/releases)
- [Commits](https://github.com/dtolnay/proc-macro2/compare/1.0.85...1.0.86)

---
updated-dependencies:
- dependency-name: proc-macro2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-21 17:02:35 +00:00
dependabot[bot]
a084813a1f build(deps): bump displaydoc from 0.2.4 to 0.2.5 (#32578)
Bumps [displaydoc](https://github.com/yaahc/displaydoc) from 0.2.4 to 0.2.5.
- [Changelog](https://github.com/yaahc/displaydoc/blob/master/CHANGELOG.md)
- [Commits](https://github.com/yaahc/displaydoc/commits/v0.2.5)

---
updated-dependencies:
- dependency-name: displaydoc
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-21 17:00:18 +00:00
eri
5eb8813448 DevTools: Implement watcher actor (#32509)
* feat: base for watcher

* feat: some more watcher tests

* feat: implement getWatcher

* refactor: clean up getWatcher

* feat: implement watchTargets

* feat: implement watchResources

* feat: very messy watchTargets fix

* refactor: clean browsing context

* feat: target configuration

* refactor: start cleanup

* refactor: more doc coments

* refactor: clean browsing context
2024-06-21 16:06:55 +00:00
atbrakhi
26c585a0c5 use app unit in box_fragement (#32349) 2024-06-21 14:54:21 +00:00
Martin Robinson
66edef8065 layout: Simplify Contents a little (#32487)
Instead of duplicating some of `NonReplacedContents` in `Contents`,
divide it into either replaced and non-replaced content, since this is
how the layout system processes `Contents` always. In addition, stop
using `TryInto` to match replaced or non-replaced contents, as it is
quite confusing to handle an `Err` as a success case.
2024-06-21 10:13:31 +00:00
Martin Robinson
44064b1439 layout: Add very basic support for showing text in input boxes (#32365)
This only paints text in input fields. Selection and cursor are still
not painted.

In addition to adding this feature, the change also updates the
user-agent.css with the latest from the HTML specification. Extra
padding and extraneous settings (such as a bogus line-height and
min-height) are also removed from servo.css. This leads to some new
passes.

There are some new passes, this introduces failures as inserting text
reveals issues that were hidden before. Notably:

- failures in `/html/editing/editing-0/spelling-and-grammar-checking/`:
  We do not support spell-checking.
- Most of the rest of the new failures are missing features of input
  boxes that are also missing in legacy layout.
2024-06-20 10:13:50 +00:00
Jonathan Schwender
3d6accbbe3 android: Remove serde-json build-dependency (#32573)
There is no need to add `serde-json` as a
build-dependency (which causes serde to be built
twice when cross-compiling - once for host and once
for the target)

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2024-06-20 08:50:15 +00:00
Mukilan Thiyagarajan
ee2acaeacf config: fix panic in PrefValue to [f64; 4] conversion (#32571)
The `Iterator::all` method consumes the input iterator `f` so when
we reuse `f` in `f.flatten().collect()` it yields an empty Vector
in the case where all the elements are successfully converted using
try_into(). This causes out of bounds access when indexing into
the resulting Vector to extract the individual components.

Fixes #32570.

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-06-20 08:47:13 +00:00
Gregory Terzian
64b872ec0d add codeowners file, set gterzian as owner for components/script (#32568) 2024-06-20 08:37:58 +00:00
Jonathan Schwender
7957d11b5d ohos: Add fallback font for serif (#32555)
The fallback behavior seems to have changed recently.
Now we need to explicitly add a fallback for `serif`
otherwise no font is selected.

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
2024-06-20 06:51:38 +00:00
Mukilan Thiyagarajan
cc1c31ef3f crown: remove references to workspace manifest (#32567)
The way our shell.nix works requires crown's Cargo.toml to be
self-contained so that it can be built as a nix derivation in
isolation.

Fixes #32552.

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-06-20 06:50:50 +00:00
Samson
bf99cf7f30 Proper GPUDevice cleanup (#32520)
* Make device cleanup right

* Use weakref for GPUDevice in globalscope

* No need to destroy device on drop

* DeviceReason early return

* make remove_gpu_device to be the only way to remove device
2024-06-20 05:56:59 +00:00
dependabot[bot]
256c55eb81 build(deps): bump the gstreamer-related group with 22 updates (#32565)
Bumps the gstreamer-related group with 22 updates:

| Package | From | To |
| --- | --- | --- |
| gstreamer | `0.22.5` | `0.22.6` |
| gstreamer-base | `0.22.0` | `0.22.6` |
| gstreamer-gl | `0.22.0` | `0.22.6` |
| gstreamer-gl-sys | `0.22.5` | `0.22.6` |
| gstreamer-sys | `0.22.5` | `0.22.6` |
| gstreamer-video | `0.22.5` | `0.22.6` |
| gstreamer-app | `0.22.0` | `0.22.6` |
| gstreamer-app-sys | `0.22.5` | `0.22.6` |
| gstreamer-audio | `0.22.5` | `0.22.6` |
| gstreamer-audio-sys | `0.22.5` | `0.22.6` |
| gstreamer-base-sys | `0.22.5` | `0.22.6` |
| gstreamer-gl-egl | `0.22.0` | `0.22.6` |
| gstreamer-gl-egl-sys | `0.22.5` | `0.22.6` |
| gstreamer-gl-x11 | `0.22.0` | `0.22.6` |
| gstreamer-gl-x11-sys | `0.22.5` | `0.22.6` |
| gstreamer-player | `0.22.0` | `0.22.6` |
| gstreamer-player-sys | `0.22.5` | `0.22.6` |
| gstreamer-sdp | `0.22.0` | `0.22.6` |
| gstreamer-sdp-sys | `0.22.5` | `0.22.6` |
| gstreamer-video-sys | `0.22.5` | `0.22.6` |
| gstreamer-webrtc | `0.22.5` | `0.22.6` |
| gstreamer-webrtc-sys | `0.22.5` | `0.22.6` |


Updates `gstreamer` from 0.22.5 to 0.22.6

Updates `gstreamer-base` from 0.22.0 to 0.22.6

Updates `gstreamer-gl` from 0.22.0 to 0.22.6

Updates `gstreamer-gl-sys` from 0.22.5 to 0.22.6

Updates `gstreamer-sys` from 0.22.5 to 0.22.6

Updates `gstreamer-video` from 0.22.5 to 0.22.6

Updates `gstreamer-app` from 0.22.0 to 0.22.6

Updates `gstreamer-app-sys` from 0.22.5 to 0.22.6

Updates `gstreamer-audio` from 0.22.5 to 0.22.6

Updates `gstreamer-audio-sys` from 0.22.5 to 0.22.6

Updates `gstreamer-base-sys` from 0.22.5 to 0.22.6

Updates `gstreamer-gl-egl` from 0.22.0 to 0.22.6

Updates `gstreamer-gl-egl-sys` from 0.22.5 to 0.22.6

Updates `gstreamer-gl-x11` from 0.22.0 to 0.22.6

Updates `gstreamer-gl-x11-sys` from 0.22.5 to 0.22.6

Updates `gstreamer-player` from 0.22.0 to 0.22.6

Updates `gstreamer-player-sys` from 0.22.5 to 0.22.6

Updates `gstreamer-sdp` from 0.22.0 to 0.22.6

Updates `gstreamer-sdp-sys` from 0.22.5 to 0.22.6

Updates `gstreamer-video-sys` from 0.22.5 to 0.22.6

Updates `gstreamer-webrtc` from 0.22.5 to 0.22.6

Updates `gstreamer-webrtc-sys` from 0.22.5 to 0.22.6

---
updated-dependencies:
- dependency-name: gstreamer
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: gstreamer-related
- dependency-name: gstreamer-base
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: gstreamer-related
- dependency-name: gstreamer-gl
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: gstreamer-related
- dependency-name: gstreamer-gl-sys
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: gstreamer-related
- dependency-name: gstreamer-sys
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: gstreamer-related
- dependency-name: gstreamer-video
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: gstreamer-related
- dependency-name: gstreamer-app
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: gstreamer-related
- dependency-name: gstreamer-app-sys
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: gstreamer-related
- dependency-name: gstreamer-audio
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: gstreamer-related
- dependency-name: gstreamer-audio-sys
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: gstreamer-related
- dependency-name: gstreamer-base-sys
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: gstreamer-related
- dependency-name: gstreamer-gl-egl
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: gstreamer-related
- dependency-name: gstreamer-gl-egl-sys
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: gstreamer-related
- dependency-name: gstreamer-gl-x11
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: gstreamer-related
- dependency-name: gstreamer-gl-x11-sys
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: gstreamer-related
- dependency-name: gstreamer-player
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: gstreamer-related
- dependency-name: gstreamer-player-sys
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: gstreamer-related
- dependency-name: gstreamer-sdp
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: gstreamer-related
- dependency-name: gstreamer-sdp-sys
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: gstreamer-related
- dependency-name: gstreamer-video-sys
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: gstreamer-related
- dependency-name: gstreamer-webrtc
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: gstreamer-related
- dependency-name: gstreamer-webrtc-sys
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: gstreamer-related
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-19 21:23:46 +00:00
Martin Robinson
cd2ab36759 Rename gfx to fonts (#32556)
This crate only takes care of fonts now as graphics related things are
split into other crates. In addition, this exposes data structures at
the top of the crate, hiding the implementation details and making it
simpler to import them.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-06-19 20:26:19 +00:00
Martin Robinson
9f8118abc7 servoshell: Clean up keyboard event conversion a little (#32564)
- Use a trait to make all conversions standard
- Alphabetize all enums so they are in a consistent order
- Remove some comments about unhandled which no longer apply after the
  winit upgrade.
- Use the winit `Location` property to get the `keyboard_types`
  Location instead of relying on the physical key.
2024-06-19 19:38:56 +00:00
Martin Robinson
6a48c72a62 dependabot: Combine more GStreamer / GLib-related crates (#32563)
GLib, GIO, and GObject all release together, so these should be grouped
to prevent having so many dependabot PRs.
2024-06-19 19:34:51 +00:00
dependabot[bot]
c4c86af496 build(deps): bump idna from 1.0.0 to 1.0.1 (#32562)
Bumps [idna](https://github.com/servo/rust-url) from 1.0.0 to 1.0.1.
- [Release notes](https://github.com/servo/rust-url/releases)
- [Commits](https://github.com/servo/rust-url/compare/v1.0.0...idna-v1.0.1)

---
updated-dependencies:
- dependency-name: idna
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-19 17:07:04 +00:00
dependabot[bot]
9615abac7e build(deps): bump bytemuck from 1.16.0 to 1.16.1 (#32560)
Bumps [bytemuck](https://github.com/Lokathor/bytemuck) from 1.16.0 to 1.16.1.
- [Changelog](https://github.com/Lokathor/bytemuck/blob/main/changelog.md)
- [Commits](https://github.com/Lokathor/bytemuck/compare/v1.16.0...v1.16.1)

---
updated-dependencies:
- dependency-name: bytemuck
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-19 17:00:52 +00:00
dependabot[bot]
7aecd6f126 build(deps): bump gio-sys from 0.19.5 to 0.19.8 (#32559)
Bumps [gio-sys](https://github.com/gtk-rs/gtk-rs-core) from 0.19.5 to 0.19.8.
- [Release notes](https://github.com/gtk-rs/gtk-rs-core/releases)
- [Changelog](https://github.com/gtk-rs/gtk-rs-core/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gtk-rs/gtk-rs-core/compare/0.19.5...0.19.8)

---
updated-dependencies:
- dependency-name: gio-sys
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-19 17:00:07 +00:00
dependabot[bot]
137ded3e30 build(deps): bump gobject-sys from 0.19.5 to 0.19.8 (#32558)
Bumps [gobject-sys](https://github.com/gtk-rs/gtk-rs-core) from 0.19.5 to 0.19.8.
- [Release notes](https://github.com/gtk-rs/gtk-rs-core/releases)
- [Changelog](https://github.com/gtk-rs/gtk-rs-core/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gtk-rs/gtk-rs-core/compare/0.19.5...0.19.8)

---
updated-dependencies:
- dependency-name: gobject-sys
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-19 16:48:11 +00:00
dependabot[bot]
7edf9e3d79 build(deps): bump the gstreamer-related group with 3 updates (#32557)
Bumps the gstreamer-related group with 3 updates: [glib](https://github.com/gtk-rs/gtk-rs-core), [glib-macros](https://github.com/gtk-rs/gtk-rs-core) and [glib-sys](https://github.com/gtk-rs/gtk-rs-core).


Updates `glib` from 0.19.7 to 0.19.8
- [Release notes](https://github.com/gtk-rs/gtk-rs-core/releases)
- [Changelog](https://github.com/gtk-rs/gtk-rs-core/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gtk-rs/gtk-rs-core/compare/0.19.7...0.19.8)

Updates `glib-macros` from 0.19.7 to 0.19.8
- [Release notes](https://github.com/gtk-rs/gtk-rs-core/releases)
- [Changelog](https://github.com/gtk-rs/gtk-rs-core/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gtk-rs/gtk-rs-core/compare/0.19.7...0.19.8)

Updates `glib-sys` from 0.19.5 to 0.19.8
- [Release notes](https://github.com/gtk-rs/gtk-rs-core/releases)
- [Changelog](https://github.com/gtk-rs/gtk-rs-core/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gtk-rs/gtk-rs-core/compare/0.19.5...0.19.8)

---
updated-dependencies:
- dependency-name: glib
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: gstreamer-related
- dependency-name: glib-macros
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: gstreamer-related
- dependency-name: glib-sys
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: gstreamer-related
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-19 16:43:24 +00:00
Martin Robinson
e74075255b layout: Flatten inline box storage in InlineFormattingContexts (#32539)
This accomplishes two things:

1. Makes it easier to iterate through all inline formatting context
   items.
2. Will make it possible to easily move back and forth through the tree
   of inline boxes, in order to enable reordering and splitting inline
   boxes on lines -- necessary for BiDi.

Co-authored-by: Rakhi Sharma <atbrakhi@igalia.com>
2024-06-19 08:51:10 +00:00
Mukilan Thiyagarajan
4803514196 mach: fix test-tidy to handle missing merge commit (#32551)
This restores the behaviour prior to #32540 where the case where no
merge commit being found (which happens on CI in forks because we do
a shallow clone) is handled as if no changes where found.

Fixes #32550.

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-06-19 07:01:58 +00:00
Jonathan Schwender
24906e1c21 Move android port code to servoshell (#32533)
Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2024-06-19 03:34:08 +00:00
Martin Robinson
6f64a5afad Mark some ResizeObserver tests as flaky (#32546)
ResizeObserver isn't completed.
2024-06-18 19:40:01 +00:00
dependabot[bot]
eaf9055745 build(deps): bump miniz_oxide from 0.7.3 to 0.7.4 (#32547)
Bumps [miniz_oxide](https://github.com/Frommi/miniz_oxide) from 0.7.3 to 0.7.4.
- [Changelog](https://github.com/Frommi/miniz_oxide/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Frommi/miniz_oxide/commits)

---
updated-dependencies:
- dependency-name: miniz_oxide
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-18 17:10:03 +00:00
Martin Robinson
946e41e59d ci: Use a servo.org email address for the servo-wpt-sync GitHub bot (#32515)
This is the new address of the WPT sync bot.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-06-18 16:38:26 +00:00
Martin Robinson
70982dfa5a layout: Allocate inline box start space on segment (#32486)
Instead of allocating the inline padding and border space on the line,
allocate it on the segment -- which where the inline box start goes.

Co-authored-by: Rakhi Sharma <atbrakhi@igalia.com>
2024-06-18 16:19:00 +00:00
Ngo Iok Ui (Wu Yu Wei)
63889b732f fix: codegen on callback (#32537)
* Fix codegen on callback

* Add test callbacks to testbinding.rs
2024-06-18 16:00:14 +00:00
dependabot[bot]
d4db08113d build(deps): bump android_logger from 0.13.3 to 0.14.1 (#32523)
Bumps [android_logger](https://github.com/rust-mobile/android_logger-rs) from 0.13.3 to 0.14.1.
- [Release notes](https://github.com/rust-mobile/android_logger-rs/releases)
- [Changelog](https://github.com/rust-mobile/android_logger-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-mobile/android_logger-rs/commits/0.14.1)

---
updated-dependencies:
- dependency-name: android_logger
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-18 15:28:45 +00:00
dependabot[bot]
668b8df9da build(deps): bump polling from 3.7.1 to 3.7.2 (#32529)
Bumps [polling](https://github.com/smol-rs/polling) from 3.7.1 to 3.7.2.
- [Release notes](https://github.com/smol-rs/polling/releases)
- [Changelog](https://github.com/smol-rs/polling/blob/master/CHANGELOG.md)
- [Commits](https://github.com/smol-rs/polling/compare/v3.7.1...v3.7.2)

---
updated-dependencies:
- dependency-name: polling
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-18 14:59:51 +00:00
Martin Robinson
fef1337da0 fonts: Clean up WebRender web fonts when they are no longer used (#32545)
This is the first part of cleaning up unused WebRender resources.
Currently this only cleans up web font resources, but a more
full-featured implementation in the future could also clean up unused
system fonts.

Fixes #32345.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-06-18 14:02:27 +00:00
webbeef
bd15a4fbd8 servoshell: Reset link status when loading a new document (#32518)
* Reset link status when loading a new document

* Reset hover link when navigating back or forward
2024-06-18 11:10:14 +00:00
Jonathan Schwender
1d2949f2b3 CI: Cache cargo-deny (#32543)
Use the `cargo-install` action to cache the cargo-deny output.
`cargo-deny` is currently unconditionally installed during bootstrap,
and takes around 2 minutes to install, so caching should give a
significant speedup

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
2024-06-18 09:55:13 +00:00
Martin Robinson
4a7f3bac7c Use workspace definitions for all crates and update to the 2021 edition (#32544) 2024-06-18 09:22:08 +00:00
Mukilan Thiyagarajan
42b09d483f mach: fix test-tidy to not skip Cargo.lock (#32540)
PR #32465 broke the lint because it initializes FileList with a
file name (./Cargo.lock). This causes it to always return an empty
list when the `only_changed_files` parameter is `False` since `os.walk`
requires a directory and not a file.

Fixes #32530.

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-06-18 07:39:38 +00:00
Martin Robinson
57b64d8123 fonts: Respect emoji variation selector when selecting fonts (#32493)
This uses a pretty simple heuristic to select a font likely to contain
color emoji. In the future Servo should actually check if the font also
contains a color representation of the character in question. For now
the code assumes that when a font supports color glyphs of some kind and
supports the character in question at all, it supports the color
version.

This fixes support for rendering keycap emoji clusters such as 1️⃣ .

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Rakhi Sharma <atbrakhi@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-06-18 04:37:47 +00:00
Jonathan Schwender
79cd87a3c3 Fix android build on Fedora 40. (#32532)
* Postfix PATH with android toolchain:
  We only need to edit path for the linker specified
  in the `.cargo/config.toml` to be found. Adding the
  NDK clang to the end of PATH is sufficient for that.
  Adding the NDK clang to the front can cause problems
  however, since it causes the NDK `clang` to be
  preferred over the system clang. This can cause
  problems on some systems, where compiling
  e.g. buildscripts for HOST subsequently fails.
* Prefix target compiler and compiler flags variables
  with `TARGET_` so as not to influence compilation
  for HOST targets.
 * SET `CLANG_PATH` to avoid [bindgen #2682]

 [bindgen #2682]: https://github.com/rust-lang/rust-bindgen/issues/2682

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2024-06-18 04:15:29 +00:00
dependabot[bot]
be290533c4 build(deps): bump derive_more from 0.99.17 to 0.99.18 (#32528)
Bumps [derive_more](https://github.com/JelteF/derive_more) from 0.99.17 to 0.99.18.
- [Release notes](https://github.com/JelteF/derive_more/releases)
- [Changelog](https://github.com/JelteF/derive_more/blob/v0.99.18/CHANGELOG.md)
- [Commits](https://github.com/JelteF/derive_more/compare/v0.99.17...v0.99.18)

---
updated-dependencies:
- dependency-name: derive_more
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-17 16:45:51 +00:00
Gregory Terzian
3d78d60619 implement basic infra for ResizeObserver (#31108) 2024-06-17 16:44:07 +00:00
Erik Hennig
3c1c395dfc Restore accidentally deleted suppression file and suppress intentional leak in stylo #32223 (#32527)
Co-authored-by: Jonas Zeunert <jonas@zeunert.org>
2024-06-17 16:42:01 +00:00
dependabot[bot]
6a3ccb656d build(deps): bump httparse from 1.9.3 to 1.9.4 (#32526)
Bumps [httparse](https://github.com/seanmonstar/httparse) from 1.9.3 to 1.9.4.
- [Release notes](https://github.com/seanmonstar/httparse/releases)
- [Commits](https://github.com/seanmonstar/httparse/compare/v1.9.3...v1.9.4)

---
updated-dependencies:
- dependency-name: httparse
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-17 16:41:14 +00:00
dependabot[bot]
c3648e3eab build(deps): bump etagere from 0.2.12 to 0.2.13 (#32524)
Bumps [etagere](https://github.com/nical/etagere) from 0.2.12 to 0.2.13.
- [Commits](https://github.com/nical/etagere/commits)

---
updated-dependencies:
- dependency-name: etagere
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-17 16:34:57 +00:00
dependabot[bot]
83b4dcf444 build(deps): bump gilrs-core from 0.5.11 to 0.5.12 (#32522)
Bumps [gilrs-core](https://gitlab.com/gilrs-project/gilrs) from 0.5.11 to 0.5.12.
- [Commits](https://gitlab.com/gilrs-project/gilrs/compare/gilrs-core-v0.5.11...gilrs-core-v0.5.12)

---
updated-dependencies:
- dependency-name: gilrs-core
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-17 16:32:06 +00:00
dependabot[bot]
fe5faf0ded build(deps): bump rustfix from 0.8.2 to 0.8.4 (#32521)
Bumps [rustfix](https://github.com/rust-lang/cargo) from 0.8.2 to 0.8.4.
- [Changelog](https://github.com/rust-lang/cargo/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/cargo/commits)

---
updated-dependencies:
- dependency-name: rustfix
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-17 16:31:35 +00:00
Samson
cbc9304c20 webgpu: Implement device lost (#32354)
* device lost promise should be init at creation of device object

* device lost impl

* lock for device poll

workaround for wgpu deadlocks

* expect

* Less lost reason reasoning in script
2024-06-17 12:47:25 +00:00
Jonathan Schwender
3381f2a704 Add OpenHarmony support to mach and CI (#32507)
* Add ohos to mach

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>

* Add OpenHarmony build to CI

* Rename ohos sdk action

I decided to rename the upstream ohos sdk action to
setup-ohos-sdk, making it clearer that is a github
action repository.

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>

* Remove commented line

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>

---------

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2024-06-17 11:27:23 +00:00
Erik Hennig
bea181f5d5 asan: Add a leak suppression file with known false positives (#32511)
Co-authored-by: Jonas Zeunert <jonas@zeunert.org>
2024-06-17 10:00:22 +00:00
Martin Robinson
2c0d0d57b1 fonts: Fix loading SFNT tables on Windows (#32499)
DirectWrite APIs expect the bytes of table tags to be reversed when
reading them. Servo was doing this when loading font tables, but not all
of them. This led to shaping being broken on Windows. This fixes that
issue in a more comprehensive way and adds a comment to avoid this
failing in the future.
2024-06-17 08:53:04 +00:00
Martin Robinson
e902d63732 deps: Switch from winapi to windows_sys in Servo code (#32516)
This is part of the switch from `winapi` to `windows-sys`. `windows-sys` is
maintained by Microsoft, so is more "official." More and more crates are
switching to it.
2024-06-17 08:27:50 +00:00
Samson
8b35c4094a Add --with-asan (#31429) 2024-06-16 09:24:07 +00:00
Samson
f0191c0a75 Bump mozjs (#32510) 2024-06-16 06:01:43 +00:00
Servo WPT Sync
d439faf6fb Update web-platform-tests to revision b'ed9e9309618bdf76de06ff85757edbc8e1d7da82' (#32512)
Signed-off-by: WPT Sync Bot <josh+wptsync@joshmatthews.net>
2024-06-16 04:41:02 +00:00
Martin Robinson
7982f0dc27 build: Fix build warnings on Windows (#32500)
Disable some code for Windows, which is causing build warnings. When it
cannot be easily disabled (mainly for the incomplete BHM and sandbox
feature), allow dead code.
2024-06-15 14:31:36 +00:00
shanehandley
6b6872831c htmlmetaelement: improve parsing of meta http-equiv (#32508) 2024-06-15 14:29:08 +00:00
Ngo Iok Ui (Wu Yu Wei)
8eed3b442b Update WebIDL.py (#32495)
* Update WebIDL.py

* Update WebIDL.py

* Add builtin-array.patch

* Fix CodegenRust.py and Configuration.py

* Fix missing downcasts

* mach fmt

* Update check and comment to explain why we need this check

* Update Global of DissimilarOriginWindow.webidl
2024-06-15 04:22:42 +00:00
Jonathan Schwender
19067366df Fix cross-compiling servoshell on Mac hosts (#32504)
`#[cfg(target_os = "xxx")]` when used in build scripts checks which
platform the **build script** is compiled for - i.e. the Host OS.
Since ware interested in the actual target os, we need to read
`CARGO_CFG_TARGET_OS`, a value that is set at **runtime of the build
script**.

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2024-06-14 22:38:53 +00:00
Martin Robinson
3370146490 Sign off commits by WPT importer (#32502)
This will be important to enforce signing off commits in the project.
2024-06-14 20:51:23 +00:00
Martin Robinson
d297ae0af5 ci: Rename "try_labels.yml" to "try-label.yml" (#32503)
This makes the name consistent with the other files in the directory
which all use dashes and the singular "label" is a little bit more
natural.
2024-06-14 20:48:49 +00:00
Jonathan Schwender
30c4831c11 build(deps): bump mozjs from 8603cb to df2365fa (#32501)
Notably allows `mozjs` to respect the `TARGET_AR`
environment variable.

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2024-06-14 17:42:39 +00:00
dependabot[bot]
1e1f4de8e4 build(deps): bump memchr from 2.7.3 to 2.7.4 (#32498)
Bumps [memchr](https://github.com/BurntSushi/memchr) from 2.7.3 to 2.7.4.
- [Commits](https://github.com/BurntSushi/memchr/compare/2.7.3...2.7.4)

---
updated-dependencies:
- dependency-name: memchr
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-14 16:35:10 +00:00
Jonathan Schwender
ff4cd4af96 Split servoshell into Desktop and common part (#32457)
* servoshell: Move desktop files

Move files related to winit into a desktop module.
This is a preparation to merge the android and ohos apps into
servoshell.

* servoshell: Format imports

* servoshell: Move panic hook into separate file

* servoshell: Move desktop main

* Consider ohos as not desktop

* servoshell: Adjust dependencies for shared code

* servoshell: Remove native-bluetooth from default features

There currently is no good way to have target specific default features.

* Rename desktop_main.rs to cli.rs

* Remove todo
2024-06-14 06:26:35 +00:00
Martin Robinson
bae9f6d844 layout: Linebreak the entire InlineFormattingContext at once (#32483)
Instead of linebreaking inside each single-font text segment, linebreak
the entire inline formatting context at once. This has several benefits:

1. It allows us to use `icu_segmenter` (already in use from style),
   which is written against a newer version of the Unicode spec --
   preventing breaking emoji clusters.
2. Opens up the possibility of changing the way that linebreaking and
   shaping work -- eventually allowing shaping across inline box
   boundaries and line breaking *after* shaping.

Co-authored-by: Rakhi Sharma <atbrakhi@igalia.com>
2024-06-13 20:12:14 +00:00
dependabot[bot]
43a7dd5da0 build(deps): bump url from 2.5.0 to 2.5.1 (#32478)
Bumps [url](https://github.com/servo/rust-url) from 2.5.0 to 2.5.1.
- [Release notes](https://github.com/servo/rust-url/releases)
- [Commits](https://github.com/servo/rust-url/compare/v2.5.0...v2.5.1)

---
updated-dependencies:
- dependency-name: url
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-13 17:08:45 +00:00
dependabot[bot]
d4ead7f85e build(deps): bump memchr from 2.7.2 to 2.7.3 (#32491)
Bumps [memchr](https://github.com/BurntSushi/memchr) from 2.7.2 to 2.7.3.
- [Commits](https://github.com/BurntSushi/memchr/compare/2.7.2...2.7.3)

---
updated-dependencies:
- dependency-name: memchr
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-13 16:39:29 +00:00
dependabot[bot]
c755c14157 build(deps): bump backtrace from 0.3.72 to 0.3.73 (#32489)
Bumps [backtrace](https://github.com/rust-lang/backtrace-rs) from 0.3.72 to 0.3.73.
- [Release notes](https://github.com/rust-lang/backtrace-rs/releases)
- [Commits](https://github.com/rust-lang/backtrace-rs/compare/0.3.72...0.3.73)

---
updated-dependencies:
- dependency-name: backtrace
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-13 16:31:39 +00:00
dependabot[bot]
801a15a9a1 build(deps): bump httparse from 1.9.2 to 1.9.3 (#32490)
Bumps [httparse](https://github.com/seanmonstar/httparse) from 1.9.2 to 1.9.3.
- [Release notes](https://github.com/seanmonstar/httparse/releases)
- [Commits](https://github.com/seanmonstar/httparse/compare/v1.9.2...v1.9.3)

---
updated-dependencies:
- dependency-name: httparse
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-13 16:31:24 +00:00
Martin Robinson
3ccc79c5e7 fonts: Merge Noto fallback lists (#32463)
On platforms that ship Noto, the list of fallback fonts can be shared.
This reduces code duplcation and makes it easier to keep up to date with
changes in Noto.
2024-06-13 13:49:24 +00:00
Rexiel Scarlet
996715fe10 Signed-off-by: Rexiel Scarlet <37258415+Rexcrazy804@users.noreply.github.com> (#32468)
Shell.nix: cleaned up unused rec instances + tidied up LIBCLANG_PATH using
makeLibraryPath.
2024-06-13 10:48:47 +00:00
Taym Haddadi
1d048f4f6a Implement HTMLImageElement decode (#31269)
* Implement HTMLImageElement decode

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Fix Decode doc link

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Temp

* Decode HTML Image

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Fix doc link

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Move image decode to process_image_response_for_environment_change

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Update some wpt test result

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Handle multiple image decode promises

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Remove unnecessary promise calls

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Update more wpt test result

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Undo body-size-cross-origin.https.html.ini changes

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Reject decode when src and srcset are missing

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Revert "Reject decode when src and srcset are missing"

This reverts commit 1b57ab978f9fc24facafc8af97ee8851d5142533.

* Drain promises vec and run update_the_image_data when element is created

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* resolve decode promise in abort_request when request is CompletelyAvailable

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Update wpt test

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Move storing promise in decode task

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Remove the resolve logic from decode task

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Revert "Remove the resolve logic from decode task"

This reverts commit eee6096d50.

* reject or reject current promise before storing it

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Add comment to explain why resolve promise when state is CompletelyAvailable

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

---------

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
2024-06-13 10:15:49 +00:00
Jonathan Schwender
43df0a48ee mach: Use cargo rustc instead of cargo build (#32484)
This allows passing `--crate-type` and rustflags which only apply
to the top-level-crate.
The former is useful to merge the android and ohos apps
into servoshell, while the later may be useful in the
future.

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2024-06-13 10:03:32 +00:00
Peter Mikola
0a641816bf clippy fixes regarding clone_from (#32482) 2024-06-12 17:09:56 +00:00
Jonathan Schwender
fd472ebd0e Add cargo-deny to mach-tidy to check license compliance. (#32465)
* Use cargo-deny to check license compliance.

All licenses should be MPL-2.0 or weaker.

* Run cargo-deny check licenses in mach tidy

* fmt

* Fix inverted boolean

* Move cargo deny to tidy.py

* Add quotes around license in error message

* Integrate `cargo-deny` into tidy fully

* Fix script tests

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-06-12 09:54:45 +00:00
eri
370fbf0331 DevTools: Display tabs and processes (#32475)
* feat: show tabs and processes on devtools

Co-authored-by: fabricedesre <fabrice@desre.org>

* chore: clean for pr

* fix: use serde renaming to avoid camel case

Co-authored-by: Martin Robinson <mrobinson@igalia.com>

* fix: serde rename all to camel case

* refactor: reduce getTab nesting level

---------

Co-authored-by: fabricedesre <fabrice@desre.org>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-06-12 09:23:09 +00:00
Nylme
699f6960f5 minibrowser: Disables urlbar when in fullscreen (#32425)
* minibrowser: Disables urlbar when in fullscreen

Signed-off-by: Nylme <nylme@protonmail.com>

* Added a TODO to minibrowser about: "Hiding URL bar in fullscreen is a phishing risk"

Signed-off-by: Nylme <nylme@protonmail.com>

* Ran ./mach fmt

Signed-off-by: Nylme <nylme@protonmail.com>

* Fixed typo.

Signed-off-by: Nylme <nylme@protonmail.com>

* Fixed `./mach tidy-test` failing for reason: "Line is longer than 120 characters" on a comment.
And deleted an unecessary comment.

Signed-off-by: Nylme <nylme@protonmail.com>

---------

Signed-off-by: Nylme <nylme@protonmail.com>
2024-06-12 08:53:56 +00:00
Oriol Brufau
b4e41d8727 Fix table track offsets when there is visibility: collapse (#32469)
Each non-collapsed track used to increase the offset by the subsequent
border spacing. Now they will take care of their preceding spacing
instead.

This way, if a cell spans two rows, and the second is collapsed, the
cell won't be forced to be at least as tall as the border spacing.
This matches Gecko and Blink (WebKit lacks `visibility: collapse`).

This makes visibility-collapse-border-spacing-001.html fail because we
generate outlines in a different way than Blink. Gecko also fails it
in a similar (but different) way.
2024-06-11 18:59:09 +00:00
Peter Mikola
3c06536cb6 clippy: fix some leftover warnings in components/net (#32476) 2024-06-11 17:50:21 +00:00
dependabot[bot]
55d067091c build(deps): bump regex from 1.10.4 to 1.10.5 (#32481)
Bumps [regex](https://github.com/rust-lang/regex) from 1.10.4 to 1.10.5.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.10.4...1.10.5)

---
updated-dependencies:
- dependency-name: regex
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-11 17:05:07 +00:00
dependabot[bot]
c4528a5da8 build(deps): bump surfman from 0.9.3 to 0.9.4 (#32480)
Bumps [surfman](https://github.com/servo/surfman) from 0.9.3 to 0.9.4.
- [Release notes](https://github.com/servo/surfman/releases)
- [Commits](https://github.com/servo/surfman/compare/0.9.3...v0.9.4)

---
updated-dependencies:
- dependency-name: surfman
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-11 16:55:59 +00:00
dependabot[bot]
20c99a13c0 build(deps): bump httparse from 1.9.1 to 1.9.2 (#32479)
Bumps [httparse](https://github.com/seanmonstar/httparse) from 1.9.1 to 1.9.2.
- [Release notes](https://github.com/seanmonstar/httparse/releases)
- [Commits](https://github.com/seanmonstar/httparse/compare/v1.9.1...v1.9.2)

---
updated-dependencies:
- dependency-name: httparse
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-11 16:51:04 +00:00
dependabot[bot]
10fd7e6e17 build(deps): bump httparse from 1.8.0 to 1.9.1 (#32473)
Bumps [httparse](https://github.com/seanmonstar/httparse) from 1.8.0 to 1.9.1.
- [Release notes](https://github.com/seanmonstar/httparse/releases)
- [Commits](https://github.com/seanmonstar/httparse/compare/v1.8.0...v1.9.1)

---
updated-dependencies:
- dependency-name: httparse
  dependency-type: indirect
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-11 04:54:05 +00:00
dependabot[bot]
98057799ac build(deps): bump regex-automata from 0.4.6 to 0.4.7 (#32472)
Bumps [regex-automata](https://github.com/rust-lang/regex) from 0.4.6 to 0.4.7.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/regex-automata-0.4.6...regex-automata-0.4.7)

---
updated-dependencies:
- dependency-name: regex-automata
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-10 17:29:48 +00:00
dependabot[bot]
59806309c9 build(deps): bump regex-syntax from 0.8.3 to 0.8.4 (#32470)
Bumps [regex-syntax](https://github.com/rust-lang/regex) from 0.8.3 to 0.8.4.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/regex-syntax-0.8.3...regex-syntax-0.8.4)

---
updated-dependencies:
- dependency-name: regex-syntax
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-10 17:07:10 +00:00
Martin Robinson
f4c9b310d5 layout: Take into account display: table etc in offset* queries (#32448)
* layout: Take into account `display: table` etc in offset* queries

The specification says that for deciding whether an element should be
used for offset* queries, a browser should take into account whether the
element is a table cell or table. This change makes that happen.

Co-authored-by: Oriol Brufau <obrufau@igalia.com>

* Only tag HTML elements if they are in the HTML namespace

---------

Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2024-06-10 15:05:57 +00:00
Martin Robinson
35bbcc0d95 script: Remove explicit reflow for web font loads (#32455)
Instead of using an explicit reflow when a web font laods, queue a
pending reflow. This should be able to eliminate multiple reflows some
situations. A followup should ensure that only nodes that have pending
fonts loading are reflows, but this change is the first step.
2024-06-10 13:32:30 +00:00
Gae24
e6ea4a9c29 Android: fix url resolution (#32422)
* fix localhost

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* android: parse search bar field in rust

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* Update comment to reflect new function behavior

---------

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-06-10 10:03:07 +00:00
Oriol Brufau
6f414df867 Fix and unify 'span' attribute for table columns (#32467)
The attribute was only taken into account on columns that are immediate
children of tables, and on column groups. It was ignored on columns
within column groups.

This patch moves the logic into a helper function that is then called
from the three consumers.
2024-06-10 09:26:46 +00:00
Jonathan Schwender
712f751d48 gfx: font_list: Fix OpenHarmony build (#32466)
Adapt changes from 1c9120c293
to the OpenHarmony font_list.rs.
2024-06-10 07:34:31 +00:00
Ngo Iok Ui (Wu Yu Wei)
a91faa7207 Fix missing alpha value when using CompositeTarget::Fbo (#32453) 2024-06-10 07:04:27 +00:00
Servo WPT Sync
855f32013f Update web-platform-tests to revision b'68f7e630c2646830a3ee274e21a3efcb001fbd65' (#32464) 2024-06-09 05:48:28 +00:00
Hieu Do
4f5184b6e2 webgpu: Enable gles support (#32452) 2024-06-09 04:35:27 +00:00
dependabot[bot]
b178a2b6e2 build(deps): bump xkeysym from 0.2.0 to 0.2.1 (#32462)
Bumps [xkeysym](https://github.com/notgull/xkeysym) from 0.2.0 to 0.2.1.
- [Release notes](https://github.com/notgull/xkeysym/releases)
- [Changelog](https://github.com/rust-windowing/xkeysym/blob/master/CHANGELOG.md)
- [Commits](https://github.com/notgull/xkeysym/compare/v0.2.0...v0.2.1)

---
updated-dependencies:
- dependency-name: xkeysym
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-07 17:32:47 +00:00
dependabot[bot]
333630ae70 build(deps): bump cc from 1.0.98 to 1.0.99 (#32461)
Bumps [cc](https://github.com/rust-lang/cc-rs) from 1.0.98 to 1.0.99.
- [Release notes](https://github.com/rust-lang/cc-rs/releases)
- [Commits](https://github.com/rust-lang/cc-rs/compare/1.0.98...1.0.99)

---
updated-dependencies:
- dependency-name: cc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-07 17:31:45 +00:00
dependabot[bot]
ceb6bc6743 build(deps): bump dtoa-short from 0.3.4 to 0.3.5 (#32460)
Bumps [dtoa-short](https://github.com/upsuper/dtoa-short) from 0.3.4 to 0.3.5.
- [Commits](https://github.com/upsuper/dtoa-short/commits)

---
updated-dependencies:
- dependency-name: dtoa-short
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-07 17:27:28 +00:00
Oriol Brufau
d10d01757d Don't shrink table columns when handling cells with greater spanning (#32458)
For example:
```html
<table border="1">
  <tr>  <td></td>  <td></td>  </tr>
  <tr>  <td colspan="2"></td>  </tr>
</table>
```
We should initially size the columns according to the cells in the first
row since they have a span of 1. Then we handle the cell in the second
row with a span of 2, this should be able to increase the size of the
columns, but never decrease them.
2024-06-07 16:37:12 +00:00
Martin Robinson
674edb4df0 layout: Properly size absolutely positioned tables (#32447)
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2024-06-07 16:21:08 +00:00
Martin Robinson
764021751d Add a workaround for actions/runner-images#10001 (#32456)
Until GitHub updates their runner images, this workaround should allow
the bots to work.
2024-06-07 14:36:04 +00:00
dependabot[bot]
bd14541b99 build(deps): bump xml5ever from 0.18.0 to 0.18.1 (#32446)
Bumps [xml5ever](https://github.com/servo/html5ever) from 0.18.0 to 0.18.1.
- [Commits](https://github.com/servo/html5ever/compare/xml5ever-v0.18.0...xml5ever-x0.18.1)

---
updated-dependencies:
- dependency-name: xml5ever
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-06 08:57:55 +00:00
dependabot[bot]
ff73a5158a build(deps): bump etagere from 0.2.11 to 0.2.12 (#32444)
Bumps [etagere](https://github.com/nical/etagere) from 0.2.11 to 0.2.12.
- [Commits](https://github.com/nical/etagere/commits)

---
updated-dependencies:
- dependency-name: etagere
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-05 17:19:02 +00:00
dependabot[bot]
cc01991400 build(deps): bump tar from 0.4.40 to 0.4.41 (#32445)
Bumps [tar](https://github.com/alexcrichton/tar-rs) from 0.4.40 to 0.4.41.
- [Commits](https://github.com/alexcrichton/tar-rs/compare/0.4.40...0.4.41)

---
updated-dependencies:
- dependency-name: tar
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-05 17:17:57 +00:00
Martin Robinson
6eaccbc297 layout: Don't default to fallback fonts for spaces (#32442)
Previously, when deciding the font for a space, preference was given to
the previous used font. This could means that the font chosen was a
fallback font instead of the first font that supporting the space
character in the font preference list.

This caused an issue rendering emojis surrounded by spaces with "Noto
Color Emoji" which has a space character the same size as the emoji,
leading to too much spacing between them.

Co-authored-by: Rakhi Sharma <atbrakhi@igalia.com>
2024-06-05 15:00:57 +00:00
Ngo Iok Ui (Wu Yu Wei)
49e15269c9 Remove unused items in gfx (#32423) 2024-06-05 07:07:36 +00:00
Oriol Brufau
5f538b89e0 Fix getComputedStyle for width and height (#32437)
It was providing a length whenever the element generates a box.
However, these properties don't apply to non-replaced inlines,
so the computed value should be provided instead.
2024-06-04 18:36:19 +00:00
dependabot[bot]
804c74e6e5 build(deps): bump unicode-width from 0.1.12 to 0.1.13 (#32439)
Bumps [unicode-width](https://github.com/unicode-rs/unicode-width) from 0.1.12 to 0.1.13.
- [Commits](https://github.com/unicode-rs/unicode-width/compare/v0.1.12...v0.1.13)

---
updated-dependencies:
- dependency-name: unicode-width
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-04 16:58:31 +00:00
dependabot[bot]
d3eb74d7bf build(deps): bump hyper from 0.14.28 to 0.14.29 (#32440)
Bumps [hyper](https://github.com/hyperium/hyper) from 0.14.28 to 0.14.29.
- [Release notes](https://github.com/hyperium/hyper/releases)
- [Changelog](https://github.com/hyperium/hyper/blob/v0.14.29/CHANGELOG.md)
- [Commits](https://github.com/hyperium/hyper/compare/v0.14.28...v0.14.29)

---
updated-dependencies:
- dependency-name: hyper
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-04 16:57:32 +00:00
dependabot[bot]
8548172bc2 build(deps): bump etagere from 0.2.10 to 0.2.11 (#32438)
Bumps [etagere](https://github.com/nical/etagere) from 0.2.10 to 0.2.11.
- [Commits](https://github.com/nical/etagere/commits)

---
updated-dependencies:
- dependency-name: etagere
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-04 16:54:53 +00:00
dependabot[bot]
c24183096f build(deps): bump wayland-cursor from 0.31.1 to 0.31.3 (#32435)
Bumps [wayland-cursor](https://github.com/smithay/wayland-rs) from 0.31.1 to 0.31.3.
- [Release notes](https://github.com/smithay/wayland-rs/releases)
- [Changelog](https://github.com/Smithay/wayland-rs/blob/master/historical_changelog.md)
- [Commits](https://github.com/smithay/wayland-rs/commits)

---
updated-dependencies:
- dependency-name: wayland-cursor
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-04 05:02:48 +00:00
dependabot[bot]
e73cf03900 build(deps): bump polling from 3.7.0 to 3.7.1 (#32434)
Bumps [polling](https://github.com/smol-rs/polling) from 3.7.0 to 3.7.1.
- [Release notes](https://github.com/smol-rs/polling/releases)
- [Changelog](https://github.com/smol-rs/polling/blob/master/CHANGELOG.md)
- [Commits](https://github.com/smol-rs/polling/compare/v3.7.0...v3.7.1)

---
updated-dependencies:
- dependency-name: polling
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-03 17:16:45 +00:00
dependabot[bot]
e9966e0186 build(deps): bump proc-macro2 from 1.0.84 to 1.0.85 (#32433)
Bumps [proc-macro2](https://github.com/dtolnay/proc-macro2) from 1.0.84 to 1.0.85.
- [Release notes](https://github.com/dtolnay/proc-macro2/releases)
- [Commits](https://github.com/dtolnay/proc-macro2/compare/1.0.84...1.0.85)

---
updated-dependencies:
- dependency-name: proc-macro2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-03 17:14:36 +00:00
Martin Robinson
f8985c5521 base: Remove ucd dependency (#32424)
Remove the `ucd` dependency which has not been updated in 8 years. In
addition, replace it with a generated UnicodeBlock enum which reflects
the modern Unicode standard. This is generated via a Python script which
is included in the repository. The generation is not part of the build
process, because the Unicode database is hosted on the web and it does
not change the frequently.

This is done instead of bringing in the more up-to-date `unicode_blocks`
dependency. `unicode_blocks` defines each block as constant, which means
that they cannot be used in match statements -- which we do in Servo.

Co-authored-by: Lauryn Menard <lauryn.menard@gmail.com>
2024-06-03 17:10:01 +00:00
Martin Robinson
48ab8d8847 layout: Add a InlineFormattingContextBuilder (#32415)
The main change here is that collapsed and `text-transform`'d text is
computed as it's processed by DOM traversal. This single transformed
text is stored in the root of the `InlineFormattingContext`.

This will eventually allow performing linebreaking and shaping of the
entire inline formatting context at once. Allowing for intelligent
processing of linebreaking and also shaping across elements. This
matches more closely what LayoutNG does.

This shouldn't have any (or negligable) behavioral changes, but will
allow us to prevent linebreaking inside of clusters in a followup
change.

Co-authored-by: Rakhi Sharma <atbrakhi@igalia.com>
2024-06-03 14:46:53 +00:00
Jonathan Schwender
00b77ce73c mach: Read .servobuild as utf-8 (#32431)
Without this on my windows machine  `open` seems to default
to the `gbk` codec, and then fails to read the file if it
contains Windows style paths (e.g. both `ndk = D:\my_path` or
`ndk = D:\\my_path` cause the `f.read()` to fail ).
2024-06-03 10:54:45 +00:00
Ngo Iok Ui (Wu Yu Wei)
2ca6c4b52b Document library crates only in mach doc (#32429)
* Document library crates only in mach doc

* Fix typo

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-06-02 06:59:44 +00:00
Servo WPT Sync
dd2de1836b Update web-platform-tests to revision b'17375f41ccf41e081764d2786ec535dede108c47' (#32426) 2024-06-02 03:56:27 +00:00
Samson
b28314d33e Update to Rust 1.78 (#32217)
* Update to rust 1.78

* Update crown for rust 1.78

* rust 1.78 is now stable

* Update for nix

* Update comment

Co-authored-by: Martin Robinson <mrobinson@igalia.com>

* Update support/crown/src/common.rs

* Update support/crown/Cargo.toml

* Update support/crown/src/common.rs

* Fix ipc problem

* Update ipc-channel to 0.18.1

* fixed fixme

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-06-01 06:49:28 +00:00
dependabot[bot]
1f4341e628 build(deps): bump tokio from 1.37.0 to 1.38.0 (#32418)
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.37.0 to 1.38.0.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.37.0...tokio-1.38.0)

---
updated-dependencies:
- dependency-name: tokio
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-01 04:05:16 +00:00
Hieu Do
3d70243438 webgpu: Parse and forward backend prefs to wgpu (#32410)
Signed-off-by: Hieu Do <hieudn.uh@gmail.com>
2024-05-31 17:51:36 +00:00
dependabot[bot]
500a475217 build(deps): bump wayland-client from 0.31.2 to 0.31.3 (#32420)
Bumps [wayland-client](https://github.com/smithay/wayland-rs) from 0.31.2 to 0.31.3.
- [Release notes](https://github.com/smithay/wayland-rs/releases)
- [Changelog](https://github.com/Smithay/wayland-rs/blob/master/historical_changelog.md)
- [Commits](https://github.com/smithay/wayland-rs/commits)

---
updated-dependencies:
- dependency-name: wayland-client
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-31 16:52:40 +00:00
dependabot[bot]
2760db0e1a build(deps): bump wayland-backend from 0.3.3 to 0.3.4 (#32419)
Bumps [wayland-backend](https://github.com/smithay/wayland-rs) from 0.3.3 to 0.3.4.
- [Release notes](https://github.com/smithay/wayland-rs/releases)
- [Changelog](https://github.com/Smithay/wayland-rs/blob/master/historical_changelog.md)
- [Commits](https://github.com/smithay/wayland-rs/commits)

---
updated-dependencies:
- dependency-name: wayland-backend
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-31 16:38:06 +00:00
dependabot[bot]
cb99fab62d build(deps): bump wayland-scanner from 0.31.1 to 0.31.2 (#32417)
Bumps [wayland-scanner](https://github.com/smithay/wayland-rs) from 0.31.1 to 0.31.2.
- [Release notes](https://github.com/smithay/wayland-rs/releases)
- [Changelog](https://github.com/Smithay/wayland-rs/blob/master/historical_changelog.md)
- [Commits](https://github.com/smithay/wayland-rs/compare/wayland-scanner-v0.31.1...wayland-client-v0.31.2)

---
updated-dependencies:
- dependency-name: wayland-scanner
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-31 16:31:13 +00:00
dependabot[bot]
dc0ba03d68 build(deps): bump bytemuck_derive from 1.6.1 to 1.7.0 (#32395)
Bumps [bytemuck_derive](https://github.com/Lokathor/bytemuck) from 1.6.1 to 1.7.0.
- [Changelog](https://github.com/Lokathor/bytemuck/blob/main/changelog.md)
- [Commits](https://github.com/Lokathor/bytemuck/compare/bytemuck_derive-v1.6.1...bytemuck_derive-v1.7.0)

---
updated-dependencies:
- dependency-name: bytemuck_derive
  dependency-type: indirect
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-31 09:30:59 +00:00
dependabot[bot]
5fafc82730 build(deps): bump compiletest_rs from 0.10.2 to 0.11.0 (#32408)
Bumps [compiletest_rs](https://github.com/Manishearth/compiletest-rs) from 0.10.2 to 0.11.0.
- [Release notes](https://github.com/Manishearth/compiletest-rs/releases)
- [Commits](https://github.com/Manishearth/compiletest-rs/compare/v0.10.2...v0.11.0)

---
updated-dependencies:
- dependency-name: compiletest_rs
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-31 08:01:34 +00:00
dependabot[bot]
48bcdacfbe build(deps): bump icu_segmenter from 1.4.0 to 1.5.0 (#32398)
Bumps [icu_segmenter](https://github.com/unicode-org/icu4x) from 1.4.0 to 1.5.0.
- [Release notes](https://github.com/unicode-org/icu4x/releases)
- [Changelog](https://github.com/unicode-org/icu4x/blob/main/CHANGELOG.md)
- [Commits](https://github.com/unicode-org/icu4x/compare/icu@1.4.0...icu@1.5.0)

---
updated-dependencies:
- dependency-name: icu_segmenter
  dependency-type: indirect
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-31 06:50:58 +00:00
Farid
bea7020258 clippy: Fix warnings in components/layout_2020/flow/text_run.rs (#32393)
* clippy: Fix warnings in `components/layout_2020/flow/text_run.rs`

Signed-off-by: Jujumba <far77578@gmail.com>

* clippy: Fix warnings in `components/layout_2020/flow/text_run.rs`

Signed-off-by: Jujumba <far77578@gmail.com>

---------

Signed-off-by: Jujumba <far77578@gmail.com>
2024-05-31 06:50:08 +00:00
Farid
0ccf129be0 clippy: Fix warnings in components/webgpu/wgpu_thread.rs (#32392)
* clippy: Fix warnings in `components/webgpu/wgpu_thread.rs`

Signed-off-by: Jujumba <far77578@gmail.com>

* clippy: `test-tidy` failure in `components/webgpu/wgpu_thread.rs`

Signed-off-by: Jujumba <far77578@gmail.com>

---------

Signed-off-by: Jujumba <far77578@gmail.com>
2024-05-31 06:49:57 +00:00
Delan Azabani
5a7891fbed Bump deps that only failed due to CI issues (#32414)
* build(deps): bump zerovec from 0.10.1 to 0.10.2 (closes #32394)

* build(deps): bump zerofrom-derive from 0.1.3 to 0.1.4 (closes #32396)

* build(deps): bump writeable from 0.5.4 to 0.5.5 (closes #32397)

* build(deps): bump tinystr from 0.7.5 to 0.7.6 (closes #32400)

* build(deps): bump yoke-derive from 0.7.3 to 0.7.4 (closes #32402)

---------

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-31 06:49:26 +00:00
Martin Robinson
d92c291552 ci: Disable legacy layout tests when landing PRs (#32405)
This disables Layout 2013 checks when landing PRs. This means that
results might get out of sync for 2013, but they should be updated
weekly during WPT imports.
2024-05-31 04:01:46 +00:00
Farid
fb6f6d2788 font_template.rs: apply clippy lints (#32391)
Signed-off-by: Jujumba <far77578@gmail.com>
2024-05-30 17:27:40 +00:00
Martin Robinson
60b4b6c9f0 layout: Add support for white-space-collapse: break-spaces (#32388)
This change adds support for `white-space-collapse: break-spaces` and
adds initial parsing support for `overflow-wrap` and `word-break`. The
later two properties are not fully supported, only in their interaction
with `break-spaces`. This is a preliminary change preparing to implement
them.

In addition, `break_and_shape` is now forked and added to Layout 2020.
This function is going to change a lot soon and forking is preparation
for this. More code that is only used by Layout 2013 is moved from `gfx`
to that crate.

Co-authored-by: Rakhi Sharma <atbrakhi@igalia.com>
2024-05-30 05:33:07 +00:00
dependabot[bot]
c0dedf06d6 build(deps): bump zerofrom from 0.1.3 to 0.1.4 (#32403)
Bumps [zerofrom](https://github.com/unicode-org/icu4x) from 0.1.3 to 0.1.4.
- [Release notes](https://github.com/unicode-org/icu4x/releases)
- [Changelog](https://github.com/unicode-org/icu4x/blob/main/CHANGELOG.md)
- [Commits](https://github.com/unicode-org/icu4x/commits)

---
updated-dependencies:
- dependency-name: zerofrom
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-29 19:08:07 +00:00
dependabot[bot]
42061ccafe build(deps): bump backtrace from 0.3.71 to 0.3.72 (#32389)
Bumps [backtrace](https://github.com/rust-lang/backtrace-rs) from 0.3.71 to 0.3.72.
- [Release notes](https://github.com/rust-lang/backtrace-rs/releases)
- [Commits](https://github.com/rust-lang/backtrace-rs/compare/0.3.71...0.3.72)

---
updated-dependencies:
- dependency-name: backtrace
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-28 17:30:12 +00:00
Martin Robinson
0289377091 Move RenderingContext to webrender_traits (#32386)
The `gfx_traits` crate is gradually become just about text and fonts and
this is one of the few things there that is standing in the way of this.
Eventually `webrender_traits` will be the general cross-process
compositor API, so this sort of makes sense as well.
2024-05-28 12:48:55 +00:00
dependabot[bot]
277eb87cc0 build(deps): bump clang-sys from 1.7.0 to 1.8.0 (#32384)
Bumps [clang-sys](https://github.com/KyleMayes/clang-sys) from 1.7.0 to 1.8.0.
- [Release notes](https://github.com/KyleMayes/clang-sys/releases)
- [Changelog](https://github.com/KyleMayes/clang-sys/blob/master/CHANGELOG.md)
- [Commits](https://github.com/KyleMayes/clang-sys/commits)

---
updated-dependencies:
- dependency-name: clang-sys
  dependency-type: indirect
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-28 08:38:55 +00:00
dependabot[bot]
93785a8a3a build(deps): bump proc-macro2 from 1.0.83 to 1.0.84 (#32385)
Bumps [proc-macro2](https://github.com/dtolnay/proc-macro2) from 1.0.83 to 1.0.84.
- [Release notes](https://github.com/dtolnay/proc-macro2/releases)
- [Commits](https://github.com/dtolnay/proc-macro2/compare/1.0.83...1.0.84)

---
updated-dependencies:
- dependency-name: proc-macro2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-27 17:31:44 +00:00
dependabot[bot]
e8e8c23a30 build(deps): bump hashbrown from 0.14.3 to 0.14.5 (#32383)
Bumps [hashbrown](https://github.com/rust-lang/hashbrown) from 0.14.3 to 0.14.5.
- [Changelog](https://github.com/rust-lang/hashbrown/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/hashbrown/compare/v0.14.3...v0.14.5)

---
updated-dependencies:
- dependency-name: hashbrown
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-27 17:26:24 +00:00
dependabot[bot]
8322cb9b82 build(deps): bump serde from 1.0.202 to 1.0.203 (#32382)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.202 to 1.0.203.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.202...v1.0.203)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-27 17:22:00 +00:00
Oriol Brufau
453ac11e3d Upgrade stylo to 2024-05-15 (#32334)
* Upgrade stylo to 2024-05-15

* Fixup for https://phabricator.services.mozilla.com/D208599

* Fixup for https://phabricator.services.mozilla.com/D208569

* Fixup for https://phabricator.services.mozilla.com/D207796

* Fixup for https://phabricator.services.mozilla.com/D209690

* hashbrown and indexmap are no longer duplicated
2024-05-27 15:24:34 +00:00
Martin Robinson
43a3c9c319 fonts: Improve font fallback (#32286)
- Better detect situations where emoji is necessary by looking ahead one
  character while laying out. This allow processing Unicode presentation
  selectors. When detecting emoji, put emoji fonts at the front of
  fallback lists for all platforms.

  This enables monochrome emoji on Windows. Full-color emoji on Windows
  probably needs full support for processing the COLR table and drawing
  separate glyph color layers.

- Improve the font fallback list on FreeType platforms. Ideally, Servo
  would be able to look through the entire font list to find the best
  font for a certain character, but until that time we can make sure the
  font list contains the "Noto Sans" fonts which cover most situations.

Fixes #31664.
Fixes #12944.
2024-05-27 10:02:26 +00:00
Martin Robinson
5f0866379a Remove more IPC messages between script and layout (#32377)
Instead of bouncing messages from the compositor to script and then to
layout, just have script call methods on Layout. Additionally, we do not
need to send any followup messages to script for these messages. Instead
just execute code after calling the method on Layout.
2024-05-27 07:30:51 +00:00
Servo WPT Sync
a7bf099cb1 Update web-platform-tests to revision b'f2cdcb7e9550e74d07ed6cf17bbcb9643aeedb99' (#32381) 2024-05-26 03:58:17 +00:00
dependabot[bot]
512e67f6d1 build(deps): bump itertools from 0.12.1 to 0.13.0 (#32372)
Bumps [itertools](https://github.com/rust-itertools/itertools) from 0.12.1 to 0.13.0.
- [Changelog](https://github.com/rust-itertools/itertools/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-itertools/itertools/compare/v0.12.1...v0.13.0)

---
updated-dependencies:
- dependency-name: itertools
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-25 05:40:46 +00:00
dependabot[bot]
373481e420 build(deps): bump bytemuck_derive from 1.6.0 to 1.6.1 (#32380)
Bumps [bytemuck_derive](https://github.com/Lokathor/bytemuck) from 1.6.0 to 1.6.1.
- [Changelog](https://github.com/Lokathor/bytemuck/blob/main/changelog.md)
- [Commits](https://github.com/Lokathor/bytemuck/compare/bytemuck_derive-v1.6.0...bytemuck_derive-v1.6.1)

---
updated-dependencies:
- dependency-name: bytemuck_derive
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-25 02:39:20 +00:00
dependabot[bot]
4c09b11274 build(deps): bump parking_lot from 0.12.2 to 0.12.3 (#32379)
Bumps [parking_lot](https://github.com/Amanieu/parking_lot) from 0.12.2 to 0.12.3.
- [Changelog](https://github.com/Amanieu/parking_lot/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Amanieu/parking_lot/compare/0.12.2...0.12.3)

---
updated-dependencies:
- dependency-name: parking_lot
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-25 02:34:48 +00:00
dependabot[bot]
327ccc7f28 build(deps): bump gstreamer-video from 0.22.4 to 0.22.5 (#32369)
Bumps gstreamer-video from 0.22.4 to 0.22.5.

---
updated-dependencies:
- dependency-name: gstreamer-video
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-24 22:52:07 +00:00
Martin Robinson
f97753df6d dependabot: Group all GStreamer dependencies together for upgrades (#32378)
The GStreamer we use is a bracing 24 crates, which tends to flood our CI
infrastructure. Group them together in order to make things more
manageable.
2024-05-24 21:48:58 +00:00
dependabot[bot]
bc976cb054 build(deps): bump syn from 2.0.65 to 2.0.66 (#32368)
Bumps [syn](https://github.com/dtolnay/syn) from 2.0.65 to 2.0.66.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/2.0.65...2.0.66)

---
updated-dependencies:
- dependency-name: syn
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-24 19:27:25 +00:00
dependabot[bot]
fdd814ef7d build(deps): bump gstreamer-webrtc from 0.22.0 to 0.22.5 (#32374)
Bumps gstreamer-webrtc from 0.22.0 to 0.22.5.

---
updated-dependencies:
- dependency-name: gstreamer-webrtc
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-24 17:31:41 +00:00
dependabot[bot]
85c1070889 build(deps): bump gstreamer-base-sys from 0.22.0 to 0.22.5 (#32376)
Bumps gstreamer-base-sys from 0.22.0 to 0.22.5.

---
updated-dependencies:
- dependency-name: gstreamer-base-sys
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-24 17:31:19 +00:00
dependabot[bot]
af82ac65de build(deps): bump gstreamer-video-sys from 0.22.1 to 0.22.5 (#32375)
Bumps gstreamer-video-sys from 0.22.1 to 0.22.5.

---
updated-dependencies:
- dependency-name: gstreamer-video-sys
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-24 17:28:45 +00:00
dependabot[bot]
891a4ffd80 build(deps): bump gstreamer-sdp-sys from 0.22.0 to 0.22.5 (#32370)
Bumps gstreamer-sdp-sys from 0.22.0 to 0.22.5.

---
updated-dependencies:
- dependency-name: gstreamer-sdp-sys
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-24 17:26:24 +00:00
dependabot[bot]
805ad72e04 build(deps): bump gstreamer-gl-sys from 0.22.0 to 0.22.5 (#32371)
Bumps gstreamer-gl-sys from 0.22.0 to 0.22.5.

---
updated-dependencies:
- dependency-name: gstreamer-gl-sys
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-24 17:23:54 +00:00
dependabot[bot]
9690964f8f build(deps): bump gstreamer-gl-egl-sys from 0.22.0 to 0.22.5 (#32373)
Bumps gstreamer-gl-egl-sys from 0.22.0 to 0.22.5.

---
updated-dependencies:
- dependency-name: gstreamer-gl-egl-sys
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-24 17:23:49 +00:00
dependabot[bot]
69cdfe92d7 build(deps): bump libz-sys from 1.1.16 to 1.1.18 (#32367)
Bumps [libz-sys](https://github.com/rust-lang/libz-sys) from 1.1.16 to 1.1.18.
- [Release notes](https://github.com/rust-lang/libz-sys/releases)
- [Commits](https://github.com/rust-lang/libz-sys/compare/1.1.16...1.1.18)

---
updated-dependencies:
- dependency-name: libz-sys
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-24 17:17:40 +00:00
Martin Robinson
60a81a7032 fonts: Add support for the CSS font matching algorithm (#32366)
* fonts: Add support for the CSS font matching algorithm

This is a port from Gecko of the CSS font matching algorithm distance
functions as well as the "simple family" concept for optimizing
matching when dealing with simple fonts.

Fixes #189.
Fixes #190.
Fixes #20686.
Fixes #20684.

Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>

* Ensure that simple faces are removed for removed stylesheets

---------

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-05-24 16:40:22 +00:00
dependabot[bot]
45ef2c4abf build(deps): bump gstreamer-gl-x11-sys from 0.22.0 to 0.22.5 (#32362)
Bumps gstreamer-gl-x11-sys from 0.22.0 to 0.22.5.

---
updated-dependencies:
- dependency-name: gstreamer-gl-x11-sys
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-24 06:25:29 +00:00
Ngo Iok Ui (Wu Yu Wei)
b1031d68c7 Move webgl_channel into base crate (#32339)
* Move webgl_channel into a shared crate

* Add license header

* Rename channle types and simplify module

* Move module to base
2024-05-24 06:13:20 +00:00
dependabot[bot]
fc08bd1aa7 build(deps): bump gstreamer-app-sys from 0.22.0 to 0.22.5 (#32363)
Bumps gstreamer-app-sys from 0.22.0 to 0.22.5.

---
updated-dependencies:
- dependency-name: gstreamer-app-sys
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-23 16:47:57 +00:00
dependabot[bot]
61a616e98e build(deps): bump gstreamer from 0.22.4 to 0.22.5 (#32364)
Bumps gstreamer from 0.22.4 to 0.22.5.

---
updated-dependencies:
- dependency-name: gstreamer
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-23 16:47:39 +00:00
dependabot[bot]
400498bab9 build(deps): bump gstreamer-webrtc-sys from 0.22.0 to 0.22.5 (#32361)
Bumps gstreamer-webrtc-sys from 0.22.0 to 0.22.5.

---
updated-dependencies:
- dependency-name: gstreamer-webrtc-sys
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-23 16:40:39 +00:00
dependabot[bot]
f4488f2a86 build(deps): bump glib-macros from 0.19.5 to 0.19.7 (#32360)
Bumps [glib-macros](https://github.com/gtk-rs/gtk-rs-core) from 0.19.5 to 0.19.7.
- [Release notes](https://github.com/gtk-rs/gtk-rs-core/releases)
- [Changelog](https://github.com/gtk-rs/gtk-rs-core/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gtk-rs/gtk-rs-core/compare/0.19.5...0.19.7)

---
updated-dependencies:
- dependency-name: glib-macros
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-23 16:38:58 +00:00
dependabot[bot]
c259389a16 build(deps): bump gstreamer-sys from 0.22.2 to 0.22.5 (#32359)
Bumps gstreamer-sys from 0.22.2 to 0.22.5.

---
updated-dependencies:
- dependency-name: gstreamer-sys
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-23 16:37:39 +00:00
dependabot[bot]
57e7816560 build(deps): bump gstreamer-audio-sys from 0.22.0 to 0.22.5 (#32358)
Bumps gstreamer-audio-sys from 0.22.0 to 0.22.5.

---
updated-dependencies:
- dependency-name: gstreamer-audio-sys
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-23 16:35:56 +00:00
dependabot[bot]
6ea2beceab build(deps): bump gstreamer-audio from 0.22.4 to 0.22.5 (#32357)
Bumps gstreamer-audio from 0.22.4 to 0.22.5.

---
updated-dependencies:
- dependency-name: gstreamer-audio
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-23 16:32:50 +00:00
dependabot[bot]
8d178844e0 build(deps): bump glib from 0.19.6 to 0.19.7 (#32356)
Bumps [glib](https://github.com/gtk-rs/gtk-rs-core) from 0.19.6 to 0.19.7.
- [Release notes](https://github.com/gtk-rs/gtk-rs-core/releases)
- [Changelog](https://github.com/gtk-rs/gtk-rs-core/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gtk-rs/gtk-rs-core/compare/0.19.6...0.19.7)

---
updated-dependencies:
- dependency-name: glib
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-23 16:32:41 +00:00
dependabot[bot]
342f1e3f6a build(deps): bump gstreamer-player-sys from 0.22.0 to 0.22.5 (#32355)
Bumps gstreamer-player-sys from 0.22.0 to 0.22.5.

---
updated-dependencies:
- dependency-name: gstreamer-player-sys
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-23 16:31:47 +00:00
Delan Azabani
ff166ea1e3 mach: fix crash when sending notifications on Windows Server 2019 (#32352) 2024-05-23 07:30:32 +00:00
Martin Robinson
14286d913d fonts: Remove web fonts when their stylsheet is removed (#32346)
This is the first part of ensuring that unused fonts do not leak. This
change makes it so that when a stylesheet is removed, the corresponding
web fonts are removed from the `FontContext`.

Note: WebRender assets are still leaked, which was the situation before
for all fonts. A followup change will fix this issue.

Fixes #15139.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-05-23 06:49:31 +00:00
Munish Mummadi
a772ecf786 Uprade stylo to include servo/style#33 (#32147)
This adds support for text decoration color and style.
2024-05-23 05:18:46 +00:00
dependabot[bot]
6451b1a21b --- (#32348)
updated-dependencies:
- dependency-name: font-kit
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-22 16:55:26 +00:00
Samson
794110ebe5 webgpu: Move errorscopes to WGPU thread (#32304)
* Prepare errorscopes logic in wgpu_thread

* remove scope_id from ipc

* new GPUErrors per spec

* remove cotent timeline error_scope

* fixup poperrorscope types

* device_scope -> gpu_error and nice errors

* Handle errors detection more elegantly

* good expectations

* new expectations

* Make error_scope.errors Vec as per spec
2024-05-22 16:47:35 +00:00
Martin Robinson
9f32809671 fonts: Clean up messaging during web fonts loads (#32332)
Instead of sending a message to the script thread via IPC when a web
font loads and then sending another, just give the `FontContext` a
callback that send a single message to the script thread. This moves all
the cache invalidation internally into `FontContext` as well.

Additionally, the unused LayoutControlMessage::ExitNow enum variant is
removed.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-05-22 08:30:35 +00:00
Delan Azabani
d47c8ff2ae Fix mach bootstrap --skip-platform (#32341) 2024-05-22 06:23:57 +00:00
Oriol Brufau
5d5ac4ec64 Implement 'visibility: collapse' on table parts (#32333)
https://drafts.csswg.org/css2/#dynamic-effects

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-05-21 18:02:53 +00:00
dependabot[bot]
add18db67e --- (#32337)
updated-dependencies:
- dependency-name: objc-sys
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-21 17:12:36 +00:00
dependabot[bot]
9f245d3a23 --- (#32336)
updated-dependencies:
- dependency-name: euclid
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-21 17:05:34 +00:00
dependabot[bot]
c51c1f91cb --- (#32335)
updated-dependencies:
- dependency-name: crossbeam-utils
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-21 17:02:11 +00:00
Oriol Brufau
5b13604bd8 Implement 'empty-cells' for layout 2020 (#32331)
https://drafts.csswg.org/css-tables/#empty-cell-rendering

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-05-21 11:08:08 +00:00
iterminatorheart
9d57c0de77 feat: add status tooltips (#32011)
* feat: add status tooltips

* rebase and review fix

---------

Co-authored-by: atbrakhi <atbrakhi@igalia.com>
2024-05-21 10:56:58 +00:00
Martin Robinson
67e556e3be fonts: Depend directly on freetype-sys (#32318)
Instead of depending on `rust-freetype`, depend directly on
`freetype-sys` which is a transitive dependency. This provides almost
everything we need (apart from one function call). This will help us
eliminate one crate in the dependency chain.
2024-05-21 10:47:15 +00:00
Mukilan Thiyagarajan
1bcb4787d2 ci: enable sccache for Rust compilation. (#32330)
This was previously disabled in #30508 due to sccache not
working well with crown. The sccache issue (mozilla/sccache#861)
linked in that PR is now closed and [testing][1] on my fork also
seems to indicated we should be able to turn on sccache again.

[1]: https://github.com/mukilan/servo/actions/runs/9154196647

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-05-21 06:10:54 +00:00
dependabot[bot]
f7affae95e build(deps): bump raw-window-handle from 0.6.0 to 0.6.2 (#32323)
Bumps [raw-window-handle](https://github.com/rust-windowing/raw-window-handle) from 0.6.0 to 0.6.2.
- [Release notes](https://github.com/rust-windowing/raw-window-handle/releases)
- [Changelog](https://github.com/rust-windowing/raw-window-handle/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-windowing/raw-window-handle/compare/v0.6.0...v0.6.2)

---
updated-dependencies:
- dependency-name: raw-window-handle
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-21 04:18:34 +00:00
dependabot[bot]
98e3ae52f4 build(deps): bump crc32fast from 1.4.0 to 1.4.2 (#32328)
Bumps [crc32fast](https://github.com/srijs/rust-crc32fast) from 1.4.0 to 1.4.2.
- [Commits](https://github.com/srijs/rust-crc32fast/compare/v1.4.0...v1.4.2)

---
updated-dependencies:
- dependency-name: crc32fast
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-20 17:30:45 +00:00
dependabot[bot]
a913d6d046 build(deps): bump miniz_oxide from 0.7.2 to 0.7.3 (#32327)
Bumps [miniz_oxide](https://github.com/Frommi/miniz_oxide) from 0.7.2 to 0.7.3.
- [Changelog](https://github.com/Frommi/miniz_oxide/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Frommi/miniz_oxide/compare/0.7.2...0.7.3)

---
updated-dependencies:
- dependency-name: miniz_oxide
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-20 17:27:29 +00:00
dependabot[bot]
8e914d6f38 build(deps): bump syn from 2.0.64 to 2.0.65 (#32321)
Bumps [syn](https://github.com/dtolnay/syn) from 2.0.64 to 2.0.65.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/2.0.64...2.0.65)

---
updated-dependencies:
- dependency-name: syn
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-20 17:27:16 +00:00
dependabot[bot]
2b61a35381 build(deps): bump cc from 1.0.97 to 1.0.98 (#32326)
Bumps [cc](https://github.com/rust-lang/cc-rs) from 1.0.97 to 1.0.98.
- [Release notes](https://github.com/rust-lang/cc-rs/releases)
- [Commits](https://github.com/rust-lang/cc-rs/compare/1.0.97...1.0.98)

---
updated-dependencies:
- dependency-name: cc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-20 17:25:41 +00:00
dependabot[bot]
e43d9f477a build(deps): bump proc-macro2 from 1.0.82 to 1.0.83 (#32325)
Bumps [proc-macro2](https://github.com/dtolnay/proc-macro2) from 1.0.82 to 1.0.83.
- [Release notes](https://github.com/dtolnay/proc-macro2/releases)
- [Commits](https://github.com/dtolnay/proc-macro2/compare/1.0.82...1.0.83)

---
updated-dependencies:
- dependency-name: proc-macro2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-20 17:24:52 +00:00
dependabot[bot]
c768c047d0 build(deps): bump anyhow from 1.0.83 to 1.0.86 (#32324)
Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.83 to 1.0.86.
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.83...1.0.86)

---
updated-dependencies:
- dependency-name: anyhow
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-20 17:22:41 +00:00
dependabot[bot]
14f4a9cc55 build(deps): bump thiserror from 1.0.60 to 1.0.61 (#32322)
Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.60 to 1.0.61.
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.60...1.0.61)

---
updated-dependencies:
- dependency-name: thiserror
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-20 17:18:41 +00:00
dependabot[bot]
ca331a35df build(deps): bump crossbeam-channel from 0.5.12 to 0.5.13 (#32320)
Bumps [crossbeam-channel](https://github.com/crossbeam-rs/crossbeam) from 0.5.12 to 0.5.13.
- [Release notes](https://github.com/crossbeam-rs/crossbeam/releases)
- [Changelog](https://github.com/crossbeam-rs/crossbeam/blob/master/CHANGELOG.md)
- [Commits](https://github.com/crossbeam-rs/crossbeam/compare/crossbeam-channel-0.5.12...crossbeam-channel-0.5.13)

---
updated-dependencies:
- dependency-name: crossbeam-channel
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-20 17:13:24 +00:00
dependabot[bot]
7548a80ac7 build(deps): bump libc from 0.2.154 to 0.2.155 (#32319)
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.154 to 0.2.155.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.154...0.2.155)

---
updated-dependencies:
- dependency-name: libc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-20 17:11:21 +00:00
Martin Robinson
be5b527ea3 fonts: Store web fonts in the per-Layout FontContext (#32303)
This moves mangement of web fonts to the per-Layout `FontContext`,
preventing web fonts from being available in different Documents.

Fixes #12920.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-05-20 14:13:03 +00:00
Delan Azabani
8d2d955bbb Upgrade jni to 0.21.1 (#32216)
JNI methods in `jniapi` now have explicit lifetime
annotations to adapt it to the new `jni` version.

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-05-20 13:46:09 +00:00
Martin Robinson
53c0726ef4 script: Have Document own Layout (#32316)
Have `Document` own `Layout`. This makes it impossible to have a
`Document` without `Layout`, which was true, but now the compiler checks
it. In addition, `Layout` is now released when the `Document` is,
avoiding leaking the entire `Layout`.
2024-05-20 13:04:32 +00:00
Mukilan Thiyagarajan
2af6fe0b30 compositor: Move WebRender-ish messages and types to webrender_traits (#32315)
* Move WebRender related types to `webrender_traits`

This refactor moves several WebRender related types
from `compositing_traits`, `script_traits` and `net_traits`
crates to the `webrender_traits` crate.

This change also moves the `Image` type and associated
function out of `net_traits` and into the `pixels` crate.

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

* Move `script_traits::WebrenderIpcSender` to `webrender_traits::WebRenderScriptApi`

---------

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-05-20 10:35:18 +00:00
Ngo Iok Ui (Wu Yu Wei)
c2076580f3 Add unit test to EmbedderCoordinates (#32314)
* Add unit test to EmbedderCoordinates

* Fix typo
2024-05-20 07:22:17 +00:00
Servo WPT Sync
b44d064fae Update web-platform-tests to revision b'cb53e377321267af4f5a1f05b3b851aab6fa8ede' (#32313) 2024-05-19 17:33:02 +00:00
aBit19
8868c1372b clippy: Fix warnings in components/gfx (#32311)
Co-authored-by: antreas <andreas.bitzilis@redpill-linpro.com>
2024-05-18 15:25:16 +00:00
Martin Robinson
0cd9c3f2c4 tables: Add a naive implementation of border-collapse (#32309)
This change adds a very simple implementation of `border-collapse` for
tables. No harmonization or merging is done at all for borders. Instead,
the largest border for every continuous border sets the size. Instead of
merging different border styles, they are squashed to half size -- which
isn't great, but ensures appropriate positioning.

Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2024-05-18 08:24:23 +00:00
dependabot[bot]
5cac276997 build(deps): bump either from 1.11.0 to 1.12.0 (#32305)
Bumps [either](https://github.com/rayon-rs/either) from 1.11.0 to 1.12.0.
- [Commits](https://github.com/rayon-rs/either/compare/1.11.0...1.12.0)

---
updated-dependencies:
- dependency-name: either
  dependency-type: indirect
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-17 19:38:29 +00:00
dependabot[bot]
eade8f5566 build(deps): bump linux-raw-sys from 0.4.13 to 0.4.14 (#32307)
Bumps [linux-raw-sys](https://github.com/sunfishcode/linux-raw-sys) from 0.4.13 to 0.4.14.
- [Commits](https://github.com/sunfishcode/linux-raw-sys/compare/v0.4.13...v0.4.14)

---
updated-dependencies:
- dependency-name: linux-raw-sys
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-17 17:02:25 +00:00
dependabot[bot]
a5409ad72f build(deps): bump syn from 2.0.63 to 2.0.64 (#32306)
Bumps [syn](https://github.com/dtolnay/syn) from 2.0.63 to 2.0.64.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/2.0.63...2.0.64)

---
updated-dependencies:
- dependency-name: syn
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-17 16:57:10 +00:00
Martin Robinson
3398fc017b Move non-gfx things out of gfx_traits and create a base crate (#32296)
For a long time, `gfx_traits` has held a lot of things unrelated to graphics
and also unrelated to the `gfx` crate (which is mostly about fonts).
This is a cleanup which does a few things:

1. Move non `gfx` crate things out of `gfx_traits`. This is important in
   order to prevent dependency cycles with a different integration between
   layout, script, and fonts.
2. Rename the `msg` crate to `base`. It didn't really contain anything
   to do with messages and instead mostly holds ids, which are used
   across many different crates in Servo. This new crate will hold the
   *rare* data types that are widely used.

Details:

 - All BackgroundHangMonitor-related things from base to a new
   `background_hang_monitor_api` crate.
 - Moved `TraversalDirection` to `script_traits`
 - Moved `Epoch`-related things from `gfx_traits` to `base`.
 - Moved `PrintTree` to base. This should be widely useful in Servo.
 - Moved `WebrenderApi` from `base` to `webrender_traits` and renamed it
   to `WebRenderFontApi`.
2024-05-17 12:28:58 +00:00
Martin Robinson
1017533297 fonts: Add color emoji support for FreeType (#32278)
Color emoji support with "Noto Color Emoji" requires two things:

1. Support for bitmap fonts in the FreeType backend. This requires
   specially handling bitmap fonts which have different characteristics
   in the FreeType API (such as requiring metrics scaling). This support
   is generally ported from Gecko's implementation.
2. When a character is an emoji it "Noto Color Emoji" needs to be in the
   fallback list. Ensure that this is high on the list -- this will be
   improved in a later PR.
2024-05-17 10:59:05 +00:00
Mukilan Thiyagarajan
c9ab743c85 android: Trim whitespace around font filenames. (#32298)
This is a speculative fix for #32161. A similar failure is
reproducible on the Android x86_64 emulator with API 35
system image. The fix has not been validated on the actual
device so potentially there might be other issues that need
to be fixed to complete #32161.

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-05-17 04:15:10 +00:00
atbrakhi
903c516fb5 use au in HoistedSharedFragment (#32288) 2024-05-16 18:21:29 +00:00
dependabot[bot]
c89fb1f381 build(deps): bump toml_datetime from 0.6.5 to 0.6.6 (#32294)
Bumps [toml_datetime](https://github.com/toml-rs/toml) from 0.6.5 to 0.6.6.
- [Commits](https://github.com/toml-rs/toml/compare/toml_datetime-v0.6.5...toml_datetime-v0.6.6)

---
updated-dependencies:
- dependency-name: toml_datetime
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-16 17:48:35 +00:00
dependabot[bot]
735064a307 build(deps): bump smol_str from 0.2.1 to 0.2.2 (#32295)
Bumps [smol_str](https://github.com/rust-analyzer/smol_str) from 0.2.1 to 0.2.2.
- [Commits](https://github.com/rust-analyzer/smol_str/commits/v0.2.2)

---
updated-dependencies:
- dependency-name: smol_str
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-16 17:48:20 +00:00
shanehandley
96d1894574 Rename NavigationType to NavigationTimingType (#32299)
This was renamed in the spec:

https://github.com/w3c/navigation-timing/pull/172

The NavigationType enum name is now part of the navigation history apis:

https://html.spec.whatwg.org/multipage/nav-history-apis.html\#navigationtype
2024-05-16 17:48:08 +00:00
Samson
7039cccbd9 Set RUSTUP_WINDOWS_PATH_ADD_BIN in CI (#32301) 2024-05-16 16:40:44 +00:00
dependabot[bot]
575aa37ff3 build(deps): bump svg_fmt from 0.4.2 to 0.4.3 (#32292)
Bumps [svg_fmt](https://github.com/nical/rust_debug) from 0.4.2 to 0.4.3.
- [Commits](https://github.com/nical/rust_debug/commits)

---
updated-dependencies:
- dependency-name: svg_fmt
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-15 16:59:46 +00:00
dependabot[bot]
bcdce3aaac build(deps): bump serde_spanned from 0.6.5 to 0.6.6 (#32293)
Bumps [serde_spanned](https://github.com/toml-rs/toml) from 0.6.5 to 0.6.6.
- [Commits](https://github.com/toml-rs/toml/compare/serde_spanned-v0.6.5...serde_spanned-v0.6.6)

---
updated-dependencies:
- dependency-name: serde_spanned
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-15 16:59:09 +00:00
dependabot[bot]
03360b86b7 build(deps): bump serde from 1.0.201 to 1.0.202 (#32291)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.201 to 1.0.202.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.201...v1.0.202)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-15 16:55:53 +00:00
dependabot[bot]
724eef3d39 build(deps): bump darling from 0.20.8 to 0.20.9 (#32290)
Bumps [darling](https://github.com/TedDriggs/darling) from 0.20.8 to 0.20.9.
- [Release notes](https://github.com/TedDriggs/darling/releases)
- [Changelog](https://github.com/TedDriggs/darling/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TedDriggs/darling/commits)

---
updated-dependencies:
- dependency-name: darling
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-15 16:54:37 +00:00
dependabot[bot]
64cad45813 build(deps): bump rustversion from 1.0.16 to 1.0.17 (#32289)
Bumps [rustversion](https://github.com/dtolnay/rustversion) from 1.0.16 to 1.0.17.
- [Release notes](https://github.com/dtolnay/rustversion/releases)
- [Commits](https://github.com/dtolnay/rustversion/compare/1.0.16...1.0.17)

---
updated-dependencies:
- dependency-name: rustversion
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-15 16:49:13 +00:00
Samson
00f267e289 webgpu: Use WGPU poller thread for poll_all_devices (#32266)
* Use special WGPU poller thread for poll_all_devices

* Switch to latest wgpu

This is required to fix some deadlocks.

* non-blocking poll unconditionally

* small fixes
2024-05-15 03:36:01 +00:00
Mukilan Thiyagarajan
bb5906eeec android: Enable JIT compilation on 64-bit Android. (#32284)
Based on the investigation in [#31134][1], the [bug][2] in
SpiderMonkey JIT affects only 32-bit systems. Therefore, we
can safely enable JIT compilation again on 64-bit systems.

[1]: https://github.com/servo/servo/issues/31134
[2]: https://bugzilla.mozilla.org/show_bug.cgi?id=1892374

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-05-14 06:41:49 +00:00
Magnus Larsen
6c3cf81230 Make MouseButtons Forward & Back navigate (#32283) 2024-05-14 06:21:34 +00:00
dependabot[bot]
1cd30c4c7a build(deps): bump bytemuck from 1.15.0 to 1.16.0 (#32281)
Bumps [bytemuck](https://github.com/Lokathor/bytemuck) from 1.15.0 to 1.16.0.
- [Changelog](https://github.com/Lokathor/bytemuck/blob/main/changelog.md)
- [Commits](https://github.com/Lokathor/bytemuck/compare/v1.15.0...v1.16.0)

---
updated-dependencies:
- dependency-name: bytemuck
  dependency-type: indirect
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-13 21:49:19 +00:00
dependabot[bot]
f2c9833244 build(deps): bump ttf-parser from 0.21.0 to 0.21.1 (#32282)
Bumps [ttf-parser](https://github.com/RazrFalcon/ttf-parser) from 0.21.0 to 0.21.1.
- [Changelog](https://github.com/RazrFalcon/ttf-parser/blob/master/CHANGELOG.md)
- [Commits](https://github.com/RazrFalcon/ttf-parser/compare/v0.21.0...v0.21.1)

---
updated-dependencies:
- dependency-name: ttf-parser
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-13 17:41:44 +00:00
dependabot[bot]
14be8b8534 build(deps): bump syn from 2.0.61 to 2.0.63 (#32279)
Bumps [syn](https://github.com/dtolnay/syn) from 2.0.61 to 2.0.63.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/2.0.61...2.0.63)

---
updated-dependencies:
- dependency-name: syn
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-13 17:37:20 +00:00
dependabot[bot]
f039226154 build(deps): bump font-kit from 0.13.0 to 0.13.1 (#32280)
Bumps [font-kit](https://github.com/servo/font-kit) from 0.13.0 to 0.13.1.
- [Commits](https://github.com/servo/font-kit/compare/v0.13.0...v0.13.1)

---
updated-dependencies:
- dependency-name: font-kit
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-13 17:36:26 +00:00
Samson
a483cb5144 Fix RefCell borrows (#32276)
* Fix RefCell borrows

* Update document.rs

fmt
2024-05-13 16:01:44 +00:00
Magnus Larsen
c0494e2e83 servoshell: Support Cursor::None and all winit keys (#32228)
keyboard-types has been bumped to 0.7, and stylo bumped to latest main
(as of 2024-05-05) for their bump to kbd-types 0.7.
2024-05-13 12:22:01 +00:00
Mukilan Thiyagarajan
385f6f93bf android: use jemalloc on Android (#32273)
This is a fix for the crash issue in 64-bit ARM [#32175][1].

When targeting Android 11 and above, 64-bit ARM platforms
have the 'Tagged Pointer' feature enabled by default which
causes memory allocated using the system allocator to have
a non-zero 'tag' set in the highest byte of heap addresses.

This is incompatible with SpiderMonkey which assumes that
only the bottom 48 bits are set and asserts this at various
points.

Both Servo and Gecko have a similar architecture where
the pointer to a heap allocated DOM struct is encoded as
a JS::Value and stored in the DOM_OBJECT_SLOT (reserved
slot) of the JSObject which reflects the native DOM struct.

As observed in #32175, even Gecko crashes with `jemalloc`
disabled which suggests that support for using the native
system allocator with tagged pointers enabled by default
is not present at the moment.

[1]: https://github.com/servo/servo/issues/32175

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-05-13 11:07:19 +00:00
Gregory Terzian
1d66ea2b27 script: Start rework to better match the specification HTML event loop (#31505)
* Fix the HTML event-loop: add a update the rendering task

add rendering task source

sketch structure to update the rendering

resize steps

composition events

fix warnings in rendering task source

refactor handling of composition events: put window and doc for pipeline on top

set script as user interacting in update the rendering task

fmt

add todos for other steps, put all compositor handling logic in one place

update the rendering: evaluate media queries and report changes

update the rendering: update animations and send events

update the rendering: run animation frames

update the rendering: order docs

put rendering related info on documents map

tidy

update the rendering: add issue numbers to todos

update the rendering: reflow as last step

update the rendering: add todo for top layer removals

note rendering opportunity when ticking animations for testing

fix double borrow crash in css/basic-transition

fix faster reversing of transitions test

undo ordering of docs

bypass not fully-active pipeline task throttling for rendering tasks

ensure tasks are dequed from task queue

prioritize update the rendering task

remove servo media stuff from set activity

tidy

debug

update the rendering: perform microtask checkpoint after task

tidy-up

only run evaluate media queries if resized

re-add evaluation of media queries for each rendering task, re-prioritize rendering tasks, re-add microtask checkpoint for all sequential messages

re-structure resize steps, and their interaction with evaluating media queries and reacting to environment changes

update the rendering: remove reflow call at the end

update webmessaging expectations

update to FAIL /html/browsers/browsing-the-web/navigating-across-documents/initial-empty-document/load-pageshow-events-iframe-contentWindow.html

update to FAIL load-pageshow-events-window-open.html

add issue number for ordering of docs

nits

move batching of mouse move event to document info

nits

add doc for mouse move event index

reset mouse move event index when taking pending compositor events

fix replacing mouse move event

nits

* move update the rendering related data to document

* move re-taking of tasks to try_recv

* address nits

* change task queue try_recv into take_tasks_and_recv, with nits

* refactor process_pending_compositor_events

* when updating the rendering, return early if script cannot continue running

* use an instant for the last render opportunity time

* nits

* remove handle_tick_all_animations

* use a vec for pending resize and compositor events

* fix spec links

* Fix a few other nits before landing

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-05-13 09:23:03 +00:00
Martin Robinson
77c50ad356 layout: When line-height is not Normal use metrics of first font not fallback (#32165)
This fixes an issue revealed by more consistent font fallback.
2024-05-13 08:26:31 +00:00
shanehandley
8eeb888010 fix: Implement additional logic in DOMString::set_best_representation_of_the_floating_point_number in order to correct some failing tests related to -0 values. (#32272) 2024-05-13 08:07:48 +00:00
Pi-Cla
3d4fd0e550 clippy: Fix last few warnings (#32270)
* Fix clippy in components/script

warning: writing `&mut Vec` instead of `&mut [_]` involves a new object where a slice will do (components/script/dom/htmlformelement.rs:896:20)

warning: `Box::new(_)` of default value (components/script/dom/paintworkletglobalscope.rs:291:29)

warning: this creates an owned instance just for comparison (components/script/dom/radionodelist.rs:105:50)

* Fix clippy in layout_thread (2013 and 2020)

warning: this `if` statement can be collapsed (components/layout_thread/lib.rs:876:17)

warning: the following explicit lifetimes could be elided: 'a (components/layout_thread/lib.rs:239 and 2020 same line)

warning: deref which would be done by auto-deref (components/layout_thread/lib.rs:500 and 1289)

warning: dereferencing a tuple pattern where every element takes a reference (components/layout_thread/lib.rs:503,1562 and 2020 line 1153)

warning: useless conversion to the same type: `style::invalidation::element::restyle_hints::RestyleHint` (components/layout_thread_2020/lib.rs:742:36)

* Fix clippy in components/servo

warning: constants have by default a `'static` lifetime (components/servo/lib.rs:1238:31)

warning: creating a `let` binding to a value of unit type, which usually
can't be used afterwards (5 occurances in components/servo/lib.rs)

* FIx clippy in ports/servoshell

warning: this expression creates a reference which is immediately dereferenced by the compiler (ports/servoshell/app.rs:251:89)

warning: using `clone` on type `Option<TopLevelBrowsingContextId>` which implements the `Copy` trait (ports/servoshell/webview.rs:122:9)
2024-05-12 08:43:08 +00:00
Servo WPT Sync
1f6d358cf9 Update web-platform-tests to revision b'8f48f40aab7f7f8a8118dc1a46972d070622be52' (#32271) 2024-05-12 04:42:20 +00:00
shanehandley
2904c32e05 Implement attributes for the <meter> element (#32230)
* Implement attributes for the meter element

* Remove checks for min < max before clamping
2024-05-11 05:06:44 +00:00
dependabot[bot]
c2325cd738 build(deps): bump ab_glyph from 0.2.25 to 0.2.26 (#32268)
Bumps [ab_glyph](https://github.com/alexheretic/ab-glyph) from 0.2.25 to 0.2.26.
- [Release notes](https://github.com/alexheretic/ab-glyph/releases)
- [Commits](https://github.com/alexheretic/ab-glyph/compare/ab-glyph-0.2.25...ab-glyph-0.2.26)

---
updated-dependencies:
- dependency-name: ab_glyph
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-10 17:54:12 +00:00
dependabot[bot]
985aded857 build(deps): bump glib from 0.19.5 to 0.19.6 (#32267)
Bumps [glib](https://github.com/gtk-rs/gtk-rs-core) from 0.19.5 to 0.19.6.
- [Release notes](https://github.com/gtk-rs/gtk-rs-core/releases)
- [Changelog](https://github.com/gtk-rs/gtk-rs-core/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gtk-rs/gtk-rs-core/compare/0.19.5...0.19.6)

---
updated-dependencies:
- dependency-name: glib
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-10 17:34:12 +00:00
Samson
b5be89aebc Update flake8 to work on python3.12 (#32264) 2024-05-09 15:47:01 +00:00
sergiitomusiak
aaf3d1bfd9 clippy: Fix vtable_address_comparisons error (#32262)
* clippy: Fix vtable_address_comparisons error

* Update components/script/dom/bindings/root.rs

Co-authored-by: Mukilan Thiyagarajan <mukilanthiagarajan@gmail.com>

---------

Co-authored-by: Sergii Tomusiak <sergiitomusiak@github.com>
Co-authored-by: Mukilan Thiyagarajan <mukilanthiagarajan@gmail.com>
2024-05-09 12:06:30 +00:00
dependabot[bot]
16803bc0f8 build(deps): bump serde from 1.0.200 to 1.0.201 (#32261)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.200 to 1.0.201.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.200...v1.0.201)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-08 19:35:34 +00:00
dependabot[bot]
eec9c4af10 build(deps): bump prettyplease from 0.2.19 to 0.2.20 (#32259)
Bumps [prettyplease](https://github.com/dtolnay/prettyplease) from 0.2.19 to 0.2.20.
- [Release notes](https://github.com/dtolnay/prettyplease/releases)
- [Commits](https://github.com/dtolnay/prettyplease/compare/0.2.19...0.2.20)

---
updated-dependencies:
- dependency-name: prettyplease
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-08 17:20:58 +00:00
dependabot[bot]
6aaabe4143 build(deps): bump num-rational from 0.4.1 to 0.4.2 (#32260)
Bumps [num-rational](https://github.com/rust-num/num-rational) from 0.4.1 to 0.4.2.
- [Changelog](https://github.com/rust-num/num-rational/blob/master/RELEASES.md)
- [Commits](https://github.com/rust-num/num-rational/compare/num-rational-0.4.1...num-rational-0.4.2)

---
updated-dependencies:
- dependency-name: num-rational
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-08 17:20:51 +00:00
dependabot[bot]
06f22fdd98 build(deps): bump errno from 0.3.8 to 0.3.9 (#32258)
Bumps [errno](https://github.com/lambda-fairy/rust-errno) from 0.3.8 to 0.3.9.
- [Changelog](https://github.com/lambda-fairy/rust-errno/blob/main/CHANGELOG.md)
- [Commits](https://github.com/lambda-fairy/rust-errno/commits)

---
updated-dependencies:
- dependency-name: errno
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-08 17:20:46 +00:00
dependabot[bot]
8db471b9d7 build(deps): bump serde_json from 1.0.116 to 1.0.117 (#32257)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.116 to 1.0.117.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.116...v1.0.117)

---
updated-dependencies:
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-08 17:15:58 +00:00
Samson
168d43f24a webgpu: Refactor webgpu crate (#32255)
* wgpu(_core) -> wgc

* Refactor webgpu crate

split lib.rs into multiple modules
2024-05-08 13:53:39 +00:00
Samson
c4f8599404 webgpu: Update to wgpu 0.20 (#32173)
* Update wgpu to 0.20

* good expectations

* Throw TypeError in configure on unsupported format instead of panic

* Expect

* `into_command_buffer_id`,`into_command_encoder_id`
2024-05-08 05:38:11 +00:00
Diego Pino
5298ccb0eb Skip installing 'clang' if 'clang' binary already exists (#32242)
Simply installing 'clang' installs the default version of Clang for
Linux. For instance, the command: 'apt install clang' installs
'clang-14' in Ubuntu 22.04.

It might be possible that a more recent version of clang is
already installed in the system. For instance, package 'clang-17'.

In the case a 'clang' binary is already installed in the system, skip
the installation of 'clang'.
2024-05-08 04:13:24 +00:00
Olivier Tilloy
6a2e4a61f7 Devtools device description: improve how Servo is advertised in Firefox's about:debugging (fixes #27528) (#32227)
* Devtools device description: fix the case of the 'platformversion' property

* Devtools device description: expose the properties Firefox expects for the display name and version of the server

When connecting to Servo from Firefox (about:debugging), it will display "Servo (71.0)" instead of "{$name} (${version})".

* Devtools device description: update versions to match those in the UA string

* Devtools device description: expose a property (appbuildid) Firefox expects to compare versions for compatibility (_compareVersionCompatibility function)

* Devtools device description: advertise a current platform version to remove the incompatibility warning in Firefox's about:debugging

* Devtools preference actor: fix retrieving the actual preference by its key

* Devtools preference actor: translate Firefox preference names onto the corresponding Servo preference names

* Devtools device description: downgrade the platform version to prevent a confusing warning in about:debugging if the build ID is newer than that of Firefox (likely)

* Devtools device description: add comments

* Devtools device description: use CARGO_PKG_VERSION for the user-visible version number
2024-05-08 04:12:18 +00:00
dependabot[bot]
ec3b3c006c build(deps): bump anyhow from 1.0.82 to 1.0.83 (#32253)
Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.82 to 1.0.83.
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.82...1.0.83)

---
updated-dependencies:
- dependency-name: anyhow
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-07 19:26:36 +00:00
dependabot[bot]
66dc62a08d build(deps): bump thiserror from 1.0.59 to 1.0.60 (#32252)
Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.59 to 1.0.60.
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.59...1.0.60)

---
updated-dependencies:
- dependency-name: thiserror
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-07 18:27:02 +00:00
dependabot[bot]
db82efa620 build(deps): bump syn from 2.0.60 to 2.0.61 (#32251)
Bumps [syn](https://github.com/dtolnay/syn) from 2.0.60 to 2.0.61.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/2.0.60...2.0.61)

---
updated-dependencies:
- dependency-name: syn
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-07 18:26:15 +00:00
dependabot[bot]
162f142fad build(deps): bump zerocopy from 0.7.33 to 0.7.34 (#32250)
Bumps [zerocopy](https://github.com/google/zerocopy) from 0.7.33 to 0.7.34.
- [Release notes](https://github.com/google/zerocopy/releases)
- [Changelog](https://github.com/google/zerocopy/blob/main/CHANGELOG.md)
- [Commits](https://github.com/google/zerocopy/commits)

---
updated-dependencies:
- dependency-name: zerocopy
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-07 18:26:12 +00:00
dependabot[bot]
d2153f46d7 build(deps): bump rustversion from 1.0.15 to 1.0.16 (#32245)
Bumps [rustversion](https://github.com/dtolnay/rustversion) from 1.0.15 to 1.0.16.
- [Release notes](https://github.com/dtolnay/rustversion/releases)
- [Commits](https://github.com/dtolnay/rustversion/compare/1.0.15...1.0.16)

---
updated-dependencies:
- dependency-name: rustversion
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-07 17:15:50 +00:00
dependabot[bot]
832d024a94 build(deps): bump ryu from 1.0.17 to 1.0.18 (#32249)
Bumps [ryu](https://github.com/dtolnay/ryu) from 1.0.17 to 1.0.18.
- [Release notes](https://github.com/dtolnay/ryu/releases)
- [Commits](https://github.com/dtolnay/ryu/compare/1.0.17...1.0.18)

---
updated-dependencies:
- dependency-name: ryu
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-07 17:09:54 +00:00
dependabot[bot]
c6597977ff build(deps): bump proc-macro2 from 1.0.81 to 1.0.82 (#32248)
Bumps [proc-macro2](https://github.com/dtolnay/proc-macro2) from 1.0.81 to 1.0.82.
- [Release notes](https://github.com/dtolnay/proc-macro2/releases)
- [Commits](https://github.com/dtolnay/proc-macro2/compare/1.0.81...1.0.82)

---
updated-dependencies:
- dependency-name: proc-macro2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-07 17:07:33 +00:00
dependabot[bot]
0266094bf9 build(deps): bump semver from 1.0.22 to 1.0.23 (#32247)
Bumps [semver](https://github.com/dtolnay/semver) from 1.0.22 to 1.0.23.
- [Release notes](https://github.com/dtolnay/semver/releases)
- [Commits](https://github.com/dtolnay/semver/compare/1.0.22...1.0.23)

---
updated-dependencies:
- dependency-name: semver
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-07 17:06:42 +00:00
dependabot[bot]
79b7f53340 build(deps): bump paste from 1.0.14 to 1.0.15 (#32246)
Bumps [paste](https://github.com/dtolnay/paste) from 1.0.14 to 1.0.15.
- [Release notes](https://github.com/dtolnay/paste/releases)
- [Commits](https://github.com/dtolnay/paste/compare/1.0.14...1.0.15)

---
updated-dependencies:
- dependency-name: paste
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-07 17:05:59 +00:00
dependabot[bot]
d5fb4dd0ce build(deps): bump rustc-demangle from 0.1.23 to 0.1.24 (#32244)
Bumps [rustc-demangle](https://github.com/rust-lang/rustc-demangle) from 0.1.23 to 0.1.24.
- [Commits](https://github.com/rust-lang/rustc-demangle/compare/0.1.23...0.1.24)

---
updated-dependencies:
- dependency-name: rustc-demangle
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-07 17:02:58 +00:00
dependabot[bot]
b7b7799a90 build(deps): bump autocfg from 1.2.0 to 1.3.0 (#32237)
Bumps [autocfg](https://github.com/cuviper/autocfg) from 1.2.0 to 1.3.0.
- [Commits](https://github.com/cuviper/autocfg/compare/1.2.0...1.3.0)

---
updated-dependencies:
- dependency-name: autocfg
  dependency-type: indirect
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-07 10:00:29 +00:00
dependabot[bot]
8f30af4221 build(deps): bump zerocopy from 0.7.32 to 0.7.33 (#32234)
Bumps [zerocopy](https://github.com/google/zerocopy) from 0.7.32 to 0.7.33.
- [Release notes](https://github.com/google/zerocopy/releases)
- [Changelog](https://github.com/google/zerocopy/blob/main/CHANGELOG.md)
- [Commits](https://github.com/google/zerocopy/compare/v0.7.32...v0.7.33)

---
updated-dependencies:
- dependency-name: zerocopy
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-07 07:30:10 +00:00
dependabot[bot]
74b15bda84 build(deps): bump getrandom from 0.2.14 to 0.2.15 (#32235)
Bumps [getrandom](https://github.com/rust-random/getrandom) from 0.2.14 to 0.2.15.
- [Changelog](https://github.com/rust-random/getrandom/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-random/getrandom/compare/v0.2.14...v0.2.15)

---
updated-dependencies:
- dependency-name: getrandom
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-07 07:30:02 +00:00
dependabot[bot]
1324951e1e build(deps): bump num-traits from 0.2.18 to 0.2.19 (#32236)
Bumps [num-traits](https://github.com/rust-num/num-traits) from 0.2.18 to 0.2.19.
- [Changelog](https://github.com/rust-num/num-traits/blob/master/RELEASES.md)
- [Commits](https://github.com/rust-num/num-traits/compare/num-traits-0.2.18...num-traits-0.2.19)

---
updated-dependencies:
- dependency-name: num-traits
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-07 07:29:50 +00:00
dependabot[bot]
46152401aa build(deps): bump cc from 1.0.96 to 1.0.97 (#32238)
Bumps [cc](https://github.com/rust-lang/cc-rs) from 1.0.96 to 1.0.97.
- [Release notes](https://github.com/rust-lang/cc-rs/releases)
- [Commits](https://github.com/rust-lang/cc-rs/compare/1.0.96...1.0.97)

---
updated-dependencies:
- dependency-name: cc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-07 07:29:27 +00:00
dependabot[bot]
3921f32db8 build(deps): bump tokio-util from 0.7.10 to 0.7.11 (#32239)
Bumps [tokio-util](https://github.com/tokio-rs/tokio) from 0.7.10 to 0.7.11.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-util-0.7.10...tokio-util-0.7.11)

---
updated-dependencies:
- dependency-name: tokio-util
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-07 07:29:19 +00:00
Samson
8bc49299c8 Revert "script: implement AbortController (#31361)" (#32243)
This reverts commit 7fce850cff.
2024-05-07 06:23:14 +00:00
Servo WPT Sync
45f2433d76 Update web-platform-tests to revision b'536297144c737f84096d1f448e790de0fb654956' (#32232) 2024-05-06 05:30:47 +00:00
Jonathan Schwender
ff3cd1494e android: Remove outdated #[allow(bare_trait_objects)] (#32225)
This was added in 1d38bc04, but has since been fixed upstream.
2024-05-04 15:00:41 +00:00
Smitty
7fce850cff script: implement AbortController (#31361)
* Implement AbortController

Signed-off-by: syvb <me@iter.ca>

* Update WPT tests

Signed-off-by: syvb <me@iter.ca>

* Address review comments

* Fix duplicate import generation

* Update WPT test expectations

* Change expectation to FAIL for flaky test

---------

Signed-off-by: syvb <me@iter.ca>
2024-05-04 15:00:01 +00:00
Samson
383607d01e Do not use crown when building docs (#32220) 2024-05-04 06:00:00 +00:00
Alex Touchet
d297eb1f06 Cargo.toml cleanup (#32224) 2024-05-04 04:05:28 +00:00
Martin Robinson
1c9120c293 fonts: Add MallocSizeOf implementation for FontContext (#32206)
* fonts: Add `MallocSizeOf` implementation for `FontContext`

Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>

* android: remove unused imports in font_list.rs

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

---------

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-05-03 09:54:29 +00:00
Pi-Cla
160c7c0b0f Fix some clippy warnings in components/gfx and components/script (#32215)
* clippy: Squish warnings and errors in gfx

warning: redundant closure (gfx/font.rs:415:18)

warning: useless conversion to the same type (gfx/font.rs:534:9)

warning: the following explicit lifetimes could be elided: 'a (gfx/font.rs:619:16)

error: this loop never actually loops (gfx/font_cache_thread.rs:112:9)

warning: this expression creates a reference which is immediately dereferenced by the compiler  (gfx/font_cache_thread.rs:229:51)

warning: redundant closure (gfx/font_cache_thread.rs:551:18)

3 instances of:
warning: casting integer literal to `f64` is unnecessary (gfx/platform/freetype/font_list.rs:271-273)

* clippy: methods called `from_*` usually take no `self`

It reports that by standard convention, from_* methods should not take any `&self` parameter

* clippy: you should consider adding a `Default` implementation

It reports that public types with a pub fn new() -> Self should have a Default implementation since they can be constructed without arguments

* clippy: casting to the same type is unnecessary (`f32` -> `f32`)

* clippy: use of `unwrap_or_else` to construct default value

* clippy: methods called `is_*` usually take `self` by mutable reference or `self` by reference or no `self`

* clippy: manual `!RangeInclusive::contains` implementation

contains expresses the intent better and has less failure modes (such as fencepost errors or using || instead of &&)

* clippy: this function has an empty `#[must_use]` attribute, but returns a type already marked as `#[must_use]`

* clippy: Fix some new warnings

warning: this `if` statement can be collapsed (gfx/font.rs:468:130)

warning: this lifetime isn't used in the impl (gfx/platform/freetype/font.rs:341:6)

warning: field assignment outside of initializer for an instance created with Default::default() (compositor.rs:881:17)
2024-05-02 20:02:21 +00:00
Jonathan Schwender
ca064eaa51 Add font-fallback on OpenHarmony and fix several compilation issues (#32141)
* Add OpenHarmony support for allocator / profile

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>

* gfx: Build harfbuzz from source on OHOS

Updates `freetype-sys` to v0.20.1, which includes a build
fix for OpenHarmony.

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>

* gfx: Don't depend on fontconfig on OpenHarmony

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>

* gfx: Add ohos font fallback

Hardcode HarmonyOS_Sans_SC_Regular for Chinese

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>

* libservo: OHOS useragent, and explicitly opt out of sandboxing

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>

* libservo: Disable get_native_media_display_and_gl_context on ohos

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>

---------

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
2024-05-02 18:32:51 +00:00
Magnus Larsen
9acf2182cd servoshell: Upgrade egui and many other dependencies (#31278)
* servoshell: Upgrade `egui` and many other dependencies

This upgrades:
 - `core-graphics`
 - `core-text`
 - `egui` and friends
 - `font-kit`
 - `glow` and friends
 - `harfbuzz-sys`
 - `jni`
 - `nix`
 - `raqote`
 - `raw-window-handle`
 - `winit`

* Downgrade jni until we can properly upgrade

* Update some test results

It's unclear why these are now passing, but they are.

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-05-02 16:21:07 +00:00
Martin Robinson
556bfb7dff fonts: Make FontContext thread-safe and share it per-Layout (#32205)
This allows sharing font templates, fonts, and platform fonts across
layout threads. It's the first step toward storing web fonts in the
layout versus the shared `FontCacheThread`. Now fonts and font groups
have some locking (especially on FreeType), which will probably affect
performance. On the other hand, we measured memory usage and this saves
roughly 40 megabytes of memory when loading servo.org based on data from
the memory profiler.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-05-02 10:34:10 +00:00
Andreu Botella
8ec5344f70 feat: Support font-relative ch and ic units (#32171)
* feat: Support font-relative `ch` and `ic` units

After #31966, which made it possible for the first time to resolve
font-relative CSS units, this change adds support for the `ch` and
`ic` units.

One difference with the `ex` unit that was added in that PR is that
these units must reflect the advance width of a character (the zero
digit in the case of `ch`, and the CJK water radical for `ic`) as it
would be rendered by the current font group. This means that the size
of these units don't only depend on the first available font, in the
case where that font does not contain a glyph for that character.

This is implemented by adding the advance width for these two
characters as optional fields of `FontMetrics`, so the advance width
computation happens in advance. Then, when the font metrics are
queried as part of unit resolution, the font group is searched for the
first font containing that character.

This change only implements support for these units in upright
typesetting modes, since Servo does not yet have support for vertical
writing modes. This means that many of the WPT tests that test for the
behavior of these units with vertical writing modes do not pass.

This change also makes a number of WPT tests pass, which relied on the
`ch` and `ic` units. It, however, also makes the test
`/css/css-text/white-space/text-wrap-balance-overflow-002.html` fail,
since it tests `text-wrap: balance`, which Servo does not yet
implement, and it was only previously passing by chance due to the
previous behavior of these units.

* Revert Python 3.10-related changes to wss

* Fix formatting

* Remove test expectation
2024-05-02 07:17:32 +00:00
Martin Robinson
928214518c fonts: Use FontInstanceFlags::EMBEDDED_BITMAPS for color fonts on MacOS (#32203)
This flag ensures that these fonts are rendered full color in WebRender,
allowing for full color emoji.
2024-05-02 06:50:59 +00:00
Servo WPT Sync
60613e77c5 Update web-platform-tests to revision b'9b5719f9756aba6e4aa3c855db9cc54648df815f' (#32214) 2024-05-02 05:54:54 +00:00
Martin Robinson
0df79b939a compositor: Do not handle embedder events during or after shutdown (#32207)
This is a speculative fix for #32202, which I cannot reproduce
consistently. This prevents handling any embedder events while
shutting down or after shutdown is complete. It doesn't make sense to do
this as the compositor can be in a very inconsistent state during this
time and lead to panics.

Fixes ##32202.
2024-05-02 03:58:15 +00:00
dependabot[bot]
50c2e18347 build(deps): bump x11rb from 0.13.0 to 0.13.1 (#32211)
Bumps [x11rb](https://github.com/psychon/x11rb) from 0.13.0 to 0.13.1.
- [Changelog](https://github.com/psychon/x11rb/blob/master/doc/changelog.md)
- [Commits](https://github.com/psychon/x11rb/compare/v0.13.0...v0.13.1)

---
updated-dependencies:
- dependency-name: x11rb
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-01 17:19:47 +00:00
dependabot[bot]
4cfbc515c7 build(deps): bump serde from 1.0.199 to 1.0.200 (#32210)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.199 to 1.0.200.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.199...v1.0.200)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-01 17:07:38 +00:00
dependabot[bot]
32c9f44377 build(deps): bump x11rb-protocol from 0.13.0 to 0.13.1 (#32209)
Bumps [x11rb-protocol](https://github.com/psychon/x11rb) from 0.13.0 to 0.13.1.
- [Changelog](https://github.com/psychon/x11rb/blob/master/doc/changelog.md)
- [Commits](https://github.com/psychon/x11rb/compare/v0.13.0...v0.13.1)

---
updated-dependencies:
- dependency-name: x11rb-protocol
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-01 17:03:23 +00:00
Martin Robinson
814bf5b6e8 mach: Upgrade boto3 and remove Python < 3.10 dependencies (#32208)
This change upgrades boto3, which will fix an upcoming urllib3 version
conflict in the WPT and also removes all remaining dependencies for
Python version < 3.10. The requirement for Servo is 3.10 now.

Fixes #32201.
2024-05-01 16:28:14 +00:00
Samson
eb7484de5e Update web-platform-tests to revision b'86de4ffa4e439098e05f05de7d8cae1c24ff84fb' (#32200)
Co-authored-by: Servo WPT Sync <josh+wptsync@joshmatthews.net>
2024-05-01 15:47:11 +00:00
Mukilan Thiyagarajan
6065abcb6b script: Include layout when collecting memory reports (#32204)
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-05-01 09:35:46 +00:00
Taym Haddadi
bccbc87db7 Remove unused import (#32192)
Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
2024-04-30 19:10:42 +00:00
dependabot[bot]
b30fb90b8e build(deps): bump cc from 1.0.95 to 1.0.96 (#32198)
Bumps [cc](https://github.com/rust-lang/cc-rs) from 1.0.95 to 1.0.96.
- [Release notes](https://github.com/rust-lang/cc-rs/releases)
- [Commits](https://github.com/rust-lang/cc-rs/compare/1.0.95...1.0.96)

---
updated-dependencies:
- dependency-name: cc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-30 16:50:25 +00:00
dependabot[bot]
f6b1182f88 build(deps): bump glib-sys from 0.19.0 to 0.19.5 (#32197)
Bumps [glib-sys](https://github.com/gtk-rs/gtk-rs-core) from 0.19.0 to 0.19.5.
- [Release notes](https://github.com/gtk-rs/gtk-rs-core/releases)
- [Changelog](https://github.com/gtk-rs/gtk-rs-core/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gtk-rs/gtk-rs-core/compare/0.19.0...0.19.5)

---
updated-dependencies:
- dependency-name: glib-sys
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-30 16:49:24 +00:00
dependabot[bot]
8a8926225a build(deps): bump libc from 0.2.153 to 0.2.154 (#32196)
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.153 to 0.2.154.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.153...0.2.154)

---
updated-dependencies:
- dependency-name: libc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-30 16:46:45 +00:00
dependabot[bot]
52d46431fc build(deps): bump serde from 1.0.198 to 1.0.199 (#32195)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.198 to 1.0.199.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.198...v1.0.199)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-30 16:44:16 +00:00
dependabot[bot]
9d4a173b66 build(deps): bump glib-macros from 0.19.4 to 0.19.5 (#32194)
Bumps [glib-macros](https://github.com/gtk-rs/gtk-rs-core) from 0.19.4 to 0.19.5.
- [Release notes](https://github.com/gtk-rs/gtk-rs-core/releases)
- [Changelog](https://github.com/gtk-rs/gtk-rs-core/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gtk-rs/gtk-rs-core/compare/0.19.4...0.19.5)

---
updated-dependencies:
- dependency-name: glib-macros
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-30 16:41:59 +00:00
Samson
f6dc09c1c6 Disable /fetch/api/crashtests/huge-fetch.any.js (#32188)
* Disable huge-fetch test

for https://github.com/servo/servo/issues/32168

* Disable huge-fetch on layout 2013

* Add issue link
2024-04-30 12:46:51 +00:00
Samson
b6748db69d webgpu: Use safe callbacks & try_recv_timeout (#32008)
* Use safe callback in SwapChainPresent and remove present_buffer_maps

* Use rust closure in BufferMapAsync

* Remove buffer_maps and dead code elimination

* scope id passthrough

* Inline callbacks

* try_recv timeout and halve DEVICE_POLL_INTERVAL
2024-04-30 11:47:57 +00:00
dependabot[bot]
1e186e9251 build(deps): bump gio-sys from 0.19.0 to 0.19.5 (#32187)
Bumps [gio-sys](https://github.com/gtk-rs/gtk-rs-core) from 0.19.0 to 0.19.5.
- [Release notes](https://github.com/gtk-rs/gtk-rs-core/releases)
- [Changelog](https://github.com/gtk-rs/gtk-rs-core/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gtk-rs/gtk-rs-core/compare/0.19.0...0.19.5)

---
updated-dependencies:
- dependency-name: gio-sys
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-30 06:13:28 +00:00
dependabot[bot]
35a8e793f3 build(deps): bump socket2 from 0.5.6 to 0.5.7 (#32186)
Bumps [socket2](https://github.com/rust-lang/socket2) from 0.5.6 to 0.5.7.
- [Release notes](https://github.com/rust-lang/socket2/releases)
- [Changelog](https://github.com/rust-lang/socket2/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/socket2/compare/v0.5.6...v0.5.7)

---
updated-dependencies:
- dependency-name: socket2
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-30 06:12:21 +00:00
dependabot[bot]
14221ed822 build(deps): bump data-encoding from 2.5.0 to 2.6.0 (#32178)
Bumps [data-encoding](https://github.com/ia0/data-encoding) from 2.5.0 to 2.6.0.
- [Commits](https://github.com/ia0/data-encoding/commits)

---
updated-dependencies:
- dependency-name: data-encoding
  dependency-type: indirect
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-30 05:33:20 +00:00
dependabot[bot]
7d39b9d933 build(deps): bump fastrand from 2.0.2 to 2.1.0 (#32185)
Bumps [fastrand](https://github.com/smol-rs/fastrand) from 2.0.2 to 2.1.0.
- [Release notes](https://github.com/smol-rs/fastrand/releases)
- [Changelog](https://github.com/smol-rs/fastrand/blob/master/CHANGELOG.md)
- [Commits](https://github.com/smol-rs/fastrand/compare/v2.0.2...v2.1.0)

---
updated-dependencies:
- dependency-name: fastrand
  dependency-type: indirect
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-30 05:32:56 +00:00
dependabot[bot]
4715f64f6b build(deps): bump glib from 0.19.4 to 0.19.5 (#32182)
Bumps [glib](https://github.com/gtk-rs/gtk-rs-core) from 0.19.4 to 0.19.5.
- [Release notes](https://github.com/gtk-rs/gtk-rs-core/releases)
- [Changelog](https://github.com/gtk-rs/gtk-rs-core/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gtk-rs/gtk-rs-core/compare/0.19.4...0.19.5)

---
updated-dependencies:
- dependency-name: glib
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-29 17:02:09 +00:00
Martin Robinson
4732da3477 fonts: Add support for more @font-face features (#32164)
There are a couple major changes here:

1. Support is added for the `weight`, `style`, `stretch` and
   `unicode-range` declarations in `@font-face`.
2. Font matching in the font cache can return templates and
   `FontGroupFamily` can own mulitple templates. This is due to needing
   support for "composite fonts". These are `@font-face` declarations
   that only differ in their `unicode-range` definition.

This fixes a lot of non-determinism in font selection especially when
dealing with pages that define "composite faces." A notable example of
such a page is servo.org, which now consistently displays the correct
web font.

One test starts to fail due to an uncovered bug, but this will be fixed
in a followup change.

Fixes #20686.
Fixes #20684.

Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-04-29 17:02:07 +00:00
dependabot[bot]
628e33bfa9 build(deps): bump gobject-sys from 0.19.0 to 0.19.5 (#32183)
Bumps [gobject-sys](https://github.com/gtk-rs/gtk-rs-core) from 0.19.0 to 0.19.5.
- [Release notes](https://github.com/gtk-rs/gtk-rs-core/releases)
- [Changelog](https://github.com/gtk-rs/gtk-rs-core/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gtk-rs/gtk-rs-core/compare/0.19.0...0.19.5)

---
updated-dependencies:
- dependency-name: gobject-sys
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-29 17:02:00 +00:00
dependabot[bot]
047609fcae build(deps): bump gilrs from 0.10.6 to 0.10.7 (#32180)
Bumps [gilrs](https://gitlab.com/gilrs-project/gilrs) from 0.10.6 to 0.10.7.
- [Commits](https://gitlab.com/gilrs-project/gilrs/compare/v0.10.6...v0.10.7)

---
updated-dependencies:
- dependency-name: gilrs
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-29 17:01:49 +00:00
dependabot[bot]
039c4b8c5c build(deps): bump unicode-width from 0.1.11 to 0.1.12 (#32181)
Bumps [unicode-width](https://github.com/unicode-rs/unicode-width) from 0.1.11 to 0.1.12.
- [Commits](https://github.com/unicode-rs/unicode-width/compare/v0.1.11...v0.1.12)

---
updated-dependencies:
- dependency-name: unicode-width
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-29 17:01:25 +00:00
dependabot[bot]
8a321c7f36 build(deps): bump flate2 from 1.0.29 to 1.0.30 (#32179)
Bumps [flate2](https://github.com/rust-lang/flate2-rs) from 1.0.29 to 1.0.30.
- [Release notes](https://github.com/rust-lang/flate2-rs/releases)
- [Commits](https://github.com/rust-lang/flate2-rs/compare/1.0.29...1.0.30)

---
updated-dependencies:
- dependency-name: flate2
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-29 17:00:17 +00:00
Martin Robinson
f68a2e7743 layout: Ensure empty list items are at least as tall as outside markers (#32152)
While <https://drafts.csswg.org/css-lists/#list-style-position-property> says:

> The size or contents of the marker box may affect the height of the
> principal block box and/or the height of its first line box, and in some
> cases may cause the creation of a new line box; this interaction is also
> not defined.

All other browsers ensure that the first line of list item content is
the same block size as the marker. Doing this is complicated, but we can
ensure that the entire list item is at least as tall as the marker. This
should handle the majority of cases and we can make refinements later
for stranger situations, such as when the marker is very tall.

Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2024-04-29 16:58:14 +00:00
Martin Robinson
adcaf2e881 url: Only truncate data URLs for Debug (#32177)
Other types of URLs aren't so long that they need to be truncated.
2024-04-29 15:29:47 +00:00
Martin Robinson
4a12c06309 bootstrap: Add a --skip-platform option (#32176)
This allows installign `taplo` and `crown` when you are installing
dependencies manually.
2024-04-29 15:29:11 +00:00
Nolan Lawson
3014e201ab script: implement autofocus IDL reflection (#32170)
* script: implement autofocus IDL reflection

* test: update wpt results files
2024-04-29 15:05:15 +00:00
Samson
6ca3bb440e Run platform_bootstrap first (#31840) 2024-04-29 13:33:12 +00:00
Gae24
fe6e1cfb29 Android: load url from Intent, plus fixed some warnings (#32160)
* update gitignore folder with android build files

* address some warnings

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* fix servo not loading url from Intent

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* format

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* InitOptions, added url field to avoid override homepage url

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* actually there is a gitignore file in the android folder

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* Restore buildToolsVersion property

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

---------

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
2024-04-29 13:14:10 +00:00
komuhangi
5a4c81f841 Fixe some clippy warnings (#32131) 2024-04-29 12:22:30 +00:00
Oriol Brufau
d490fdf83c Turn white-space into a shorthand (#32146)
Bumps Stylo to servo/stylo#37

`white-space` is split into `white-space-collapse` and `text-wrap-mode`:

| white-space | white-space-collapse | text-wrap-mode |
| ----------- | -------------------- | -------------- |
| normal      | collapse             | wrap           |
| nowrap      | collapse             | nowrap         |
| pre-wrap    | preserve             | wrap           |
| pre         | preserve             | nowrap         |
| pre-line    | preserve-breaks      | wrap           |
| -           | preserve-breaks      | nowrap         |

Note this introduces a combination that wasn't previously possible,
but I think the existing logic can handle it well enough.

The old `allow_wrap()` is replaced by checking whether `text-wrap-mode`
is set to `wrap`.

The old `preserve_newlines()` is replaced by checking whether
`white-space-collapse` is *not* set to `collapse`.

The old `preserve_spaces()` is replaced by checking whether
`white-space-collapse` is set to `preserve`.
2024-04-29 10:40:44 +00:00
Ngo Iok Ui (Wu Yu Wei)
a1f8c19355 Fix flip_rect calculation (#32174) 2024-04-29 08:01:31 +00:00
Ngo Iok Ui (Wu Yu Wei)
74897c3851 Update WebView variants of ConstellationMsg (#32163)
* Add ConstellationMsg::WebViewOpened

* Remove unused variants

* Send the message on first webview as well
2024-04-29 07:59:52 +00:00
Nico Burns
1d6be62454 layout2020 (flexbox): Implement start, end, and space-evenly content alignment (#31724)
* Upgrade to stylo 6faedad

* Implement start, end, space-evenly content alignment + fix others

Update test expectations for content alignment fixes

Revert test expectations that are still generating the old results in CI

Update layout2013 test expectation for content alignment

Update content alignment fallback to use safe alignment

Implement fallback alignment

Update content alignment with recent spec changes
2024-04-28 23:17:11 +00:00
Nolan Lawson
02b3dd0b61 feat: implement ARIA string reflection on Element (#32080)
* feat: implement ARIA string reflection

* Update components/script/dom/element.rs

Co-authored-by: Martin Robinson <mrobinson@igalia.com>

* fix: respond to PR comments

* fix: make functions non-public

* fix: use proper ARIAMixin mixin

* fix: tidy issues

* fix: double newline at end of file

* fix: move role before aria-* to match spec order

* fix: fix link to spec and format as spec does

* fix: delete now-passing WPT tests

* fix: remove legacy-layout test

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-04-27 16:31:32 +00:00
dependabot[bot]
66563ed027 build(deps): bump parking_lot from 0.12.1 to 0.12.2 (#32159)
Bumps [parking_lot](https://github.com/Amanieu/parking_lot) from 0.12.1 to 0.12.2.
- [Changelog](https://github.com/Amanieu/parking_lot/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Amanieu/parking_lot/compare/0.12.1...0.12.2)

---
updated-dependencies:
- dependency-name: parking_lot
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-26 17:15:10 +00:00
dependabot[bot]
f8ffa2e8d1 build(deps): bump flate2 from 1.0.28 to 1.0.29 (#32158)
Bumps [flate2](https://github.com/rust-lang/flate2-rs) from 1.0.28 to 1.0.29.
- [Release notes](https://github.com/rust-lang/flate2-rs/releases)
- [Commits](https://github.com/rust-lang/flate2-rs/compare/1.0.28...1.0.29)

---
updated-dependencies:
- dependency-name: flate2
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-26 17:14:20 +00:00
dependabot[bot]
a8d0bdb323 build(deps): bump parking_lot_core from 0.9.9 to 0.9.10 (#32157)
Bumps [parking_lot_core](https://github.com/Amanieu/parking_lot) from 0.9.9 to 0.9.10.
- [Changelog](https://github.com/Amanieu/parking_lot/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Amanieu/parking_lot/compare/core-0.9.9...core-0.9.10)

---
updated-dependencies:
- dependency-name: parking_lot_core
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-26 17:13:41 +00:00
dependabot[bot]
e6cb2242b6 build(deps): bump rustls from 0.21.11 to 0.21.12 (#32155)
Bumps [rustls](https://github.com/rustls/rustls) from 0.21.11 to 0.21.12.
- [Release notes](https://github.com/rustls/rustls/releases)
- [Changelog](https://github.com/rustls/rustls/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rustls/rustls/compare/v/0.21.11...v/0.21.12)

---
updated-dependencies:
- dependency-name: rustls
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-26 17:13:00 +00:00
dependabot[bot]
8647b9fb0b build(deps): bump lock_api from 0.4.11 to 0.4.12 (#32156)
Bumps [lock_api](https://github.com/Amanieu/parking_lot) from 0.4.11 to 0.4.12.
- [Changelog](https://github.com/Amanieu/parking_lot/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Amanieu/parking_lot/compare/lock_api-0.4.11...lock_api-0.4.12)

---
updated-dependencies:
- dependency-name: lock_api
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-26 17:12:40 +00:00
Oriol Brufau
fdb6fb7920 Let legacy layout serialize shorthands in getComputedStyle (#32149)
* Let legacy layout serialize shorthands in getComputedStyle

This ports #31277 (with the changes from #32066) into legacy layout.

Otherwise, turning white-space into a shorthand (#32146) would fail
some tests that expect the property to be serializable.

* Update text expecatations
2024-04-26 15:37:46 +00:00
Oriol Brufau
1a0565bbec Cleanup obsolete expectations for /css/css-values/round-function.html (#32151) 2024-04-26 14:46:10 +00:00
Oriol Brufau
a14ee03de3 Implement special table sizing for floats (#32150)
Tables should always be at least as big as their min-content size, even
if we would expect a smaller size according to CSS sizing properties.

#31455 implemented it for in-flow tables participting in flow layout,
but a few cases remained. This patch addresses floated tables.
2024-04-26 14:42:20 +00:00
Oriol Brufau
18a4c7503a Bump Stylo to servo/stylo#34 and upgrade html5ever and xml5ever (#32145)
See https://github.com/servo/stylo/commit/81a55ac
"Switch to markup5ever's version of Atom and upgrade xml5ever"
2024-04-26 09:06:24 +00:00
Samson
4af413cd04 webgpu: Update wgpu to 0.19 (#31995)
* Update wgpu to 32e70bc163 (0.19)

* Update expect only good

* reexpect

* remove dbg stuff

* Remove all occurrences of dx11_hub
2024-04-26 07:04:15 +00:00
dependabot[bot]
81c4f2ae7a build(deps): bump winapi-util from 0.1.7 to 0.1.8 (#32144)
Bumps [winapi-util](https://github.com/BurntSushi/winapi-util) from 0.1.7 to 0.1.8.
- [Commits](https://github.com/BurntSushi/winapi-util/compare/0.1.7...0.1.8)

---
updated-dependencies:
- dependency-name: winapi-util
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-25 17:32:48 +00:00
Oriol Brufau
401e49010f Upgrade Stylo to 2024-04-16 (#32128)
* Upgrade Stylo to 2024-04-16

* Fixup for https://phabricator.services.mozilla.com/D205051

* Fixup for https://phabricator.services.mozilla.com/D203153

* Fixup for https://phabricator.services.mozilla.com/D202460

* Fixup for https://phabricator.services.mozilla.com/D205718

* Fixup for https://phabricator.services.mozilla.com/D206428

* Update test expectations
2024-04-25 14:48:07 +00:00
Martin Robinson
1440406e91 script: Prevent "scroll to fragment" from scrolling offscreen (#32129)
Previously, the "scroll to fragment" operation could scroll past the end
of the screen, because the scroll position was not clamped to viewport
boundaries. Correct this by using the `Window::scroll()` method which
handles this case.

In addition, ensure that `Window`'s `current_viewport` member is
initialized properly when it is created.
2024-04-25 00:12:16 +00:00
Delan Azabani
bef6c295aa Stop publishing the Rust book in mach doc and doc.servo.org (#32142) 2024-04-24 07:22:18 +00:00
dependabot[bot]
2272944627 build(deps): bump freetype from 0.7.1 to 0.7.2 (#32139)
Bumps [freetype](https://github.com/servo/rust-freetype) from 0.7.1 to
0.7.2.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="888591701b"><code>8885917</code></a>
Update freetype-sys and bump version to v0.7.2 (<a
href="https://redirect.github.com/servo/rust-freetype/issues/72">#72</a>)</li>
<li><a
href="62bf49822d"><code>62bf498</code></a>
Rename <code>master</code> branch to <code>main</code> (<a
href="https://redirect.github.com/servo/rust-freetype/issues/71">#71</a>)</li>
<li>See full diff in <a
href="https://github.com/servo/rust-freetype/compare/v0.7.1...v0.7.2">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=freetype&package-manager=cargo&previous-version=0.7.1&new-version=0.7.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-23 20:39:43 +00:00
dependabot[bot]
2781728e90 build(deps): bump rustix from 0.38.33 to 0.38.34 (#32140)
Bumps [rustix](https://github.com/bytecodealliance/rustix) from 0.38.33
to 0.38.34.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="14a88ef008"><code>14a88ef</code></a>
chore: Release rustix version 0.38.34</li>
<li><a
href="1d287501f0"><code>1d28750</code></a>
Make the libc &quot;extra_traits&quot; feature optional. (<a
href="https://redirect.github.com/bytecodealliance/rustix/issues/1049">#1049</a>)</li>
<li>See full diff in <a
href="https://github.com/bytecodealliance/rustix/compare/v0.38.33...v0.38.34">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=rustix&package-manager=cargo&previous-version=0.38.33&new-version=0.38.34)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-23 17:16:12 +00:00
dependabot[bot]
925d942036 build(deps): bump winapi-util from 0.1.6 to 0.1.7 (#32138)
Bumps [winapi-util](https://github.com/BurntSushi/winapi-util) from
0.1.6 to 0.1.7.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="c7384c2e1a"><code>c7384c2</code></a>
0.1.7</li>
<li><a
href="5710191184"><code>5710191</code></a>
doc: add a note about the name</li>
<li><a
href="732de05aa8"><code>732de05</code></a>
deps: port from winapi to windows-sys</li>
<li>See full diff in <a
href="https://github.com/BurntSushi/winapi-util/compare/0.1.6...0.1.7">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=winapi-util&package-manager=cargo&previous-version=0.1.6&new-version=0.1.7)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-23 16:54:20 +00:00
Mukilan Thiyagarajan
3b1bbc1aaf android: add CI build for aarch64 (#32137)
I haven't tested the APK since I don't have a device with 64-bit ARM.

---

- [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 the PR only modifies CI
workflow.

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-04-23 14:15:03 +00:00
Martin Robinson
de47dfe5c1 fonts: Merge multiple methods into PlatformFont::descriptor() (#32115)
This combines `style()`, `boldness()`, `stretchiness()` into a
`descriptor()` method which is used when creating `FontTemplate`s for
web fonts. Eventually this method will simply read font tables using
skrifa. This is the first step.

In addition, `family_name()` and `face_name()` are removed. They were
only used for debugging and the `FontIdentifier` serves for that. On
Windows, this was adding another way in which font loading could fail,
without buying us very much. The path or URL to the font is more
important when debugging than the names in the font tables.

Closes #15103.

---
<!-- 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 do not require tests because they should not change
observable behavior.

<!-- 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. -->
2024-04-23 13:27:32 +00:00
dependabot[bot]
7ca920927c build(deps): bump thiserror from 1.0.58 to 1.0.59 (#32135)
Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.58 to
1.0.59.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/dtolnay/thiserror/releases">thiserror's
releases</a>.</em></p>
<blockquote>
<h2>1.0.59</h2>
<ul>
<li>Unblock testing of rustc <code>debug-fmt-detail</code> option (<a
href="https://redirect.github.com/dtolnay/thiserror/issues/297">#297</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="e7ad85ee6b"><code>e7ad85e</code></a>
Release 1.0.59</li>
<li><a
href="af477ecbe5"><code>af477ec</code></a>
Merge pull request <a
href="https://redirect.github.com/dtolnay/thiserror/issues/297">#297</a>
from dtolnay/traitident</li>
<li><a
href="f3fbd99048"><code>f3fbd99</code></a>
Implement ToTokens without reliance on {:?}</li>
<li><a
href="508ece867d"><code>508ece8</code></a>
Revert &quot;Temporarily disable miri on doctests&quot;</li>
<li><a
href="c8c804ce80"><code>c8c804c</code></a>
Explicitly install a Rust toolchain for cargo-outdated job</li>
<li><a
href="6969595f5f"><code>6969595</code></a>
Merge pull request <a
href="https://redirect.github.com/dtolnay/thiserror/issues/293">#293</a>
from dtolnay/workspacewrapper</li>
<li><a
href="488d52f111"><code>488d52f</code></a>
Apply RUSTC_WORKSPACE_WRAPPER</li>
<li><a
href="ba33438c88"><code>ba33438</code></a>
Temporarily disable miri on doctests</li>
<li>See full diff in <a
href="https://github.com/dtolnay/thiserror/compare/1.0.58...1.0.59">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=thiserror&package-manager=cargo&previous-version=1.0.58&new-version=1.0.59)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-22 20:21:32 +00:00
Martin Robinson
a0640c8524 Address issues uncovered by rust-1.78 beta (#32130)
This change makes changes to allow Servo to compile with the 1.78
version of Rust:

 - Dead code is removd (Rust seems to have gotten better at detecting
   it).
 - The `FlowRef` `DerefMut` is updated according to @SimonSapin's advice
   [^1].
 - The `imports.rs` now explicitly silences warnings about unused
   imports.

[^1]: https://github.com/servo/servo/issues/6503#issuecomment-2066088179

<!-- 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 do not require tests because they should not change
behavior.

<!-- 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. -->
2024-04-22 18:20:47 +00:00
dependabot[bot]
f65010c97d build(deps): bump cc from 1.0.94 to 1.0.95 (#32136)
Bumps [cc](https://github.com/rust-lang/cc-rs) from 1.0.94 to 1.0.95.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/rust-lang/cc-rs/releases">cc's
releases</a>.</em></p>
<blockquote>
<h2>1.0.95</h2>
<h2>What's Changed</h2>
<ul>
<li>Update windows-bindgen requirement from 0.55 to 0.56 by <a
href="https://github.com/dependabot"><code>@​dependabot</code></a> in <a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1035">rust-lang/cc-rs#1035</a></li>
<li>Bump msrv to 1.63 by <a
href="https://github.com/NobodyXu"><code>@​NobodyXu</code></a> in <a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1031">rust-lang/cc-rs#1031</a></li>
<li>Optimize jobserver <code>try_acquire</code> by <a
href="https://github.com/NobodyXu"><code>@​NobodyXu</code></a> in <a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1037">rust-lang/cc-rs#1037</a></li>
<li>Release cc 1.0.95 by <a
href="https://github.com/NobodyXu"><code>@​NobodyXu</code></a> in <a
href="https://redirect.github.com/rust-lang/cc-rs/pull/1038">rust-lang/cc-rs#1038</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/rust-lang/cc-rs/compare/1.0.94...1.0.95">https://github.com/rust-lang/cc-rs/compare/1.0.94...1.0.95</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="7649f129f5"><code>7649f12</code></a>
Release cc 1.0.95 (<a
href="https://redirect.github.com/rust-lang/cc-rs/issues/1038">#1038</a>)</li>
<li><a
href="9af6b9591b"><code>9af6b95</code></a>
Optimize jobserver <code>try_acquire</code> (<a
href="https://redirect.github.com/rust-lang/cc-rs/issues/1037">#1037</a>)</li>
<li><a
href="c2845662e6"><code>c284566</code></a>
Bump msrv to 1.63 (<a
href="https://redirect.github.com/rust-lang/cc-rs/issues/1031">#1031</a>)</li>
<li><a
href="84d04e84cc"><code>84d04e8</code></a>
Update windows-bindgen requirement from 0.55 to 0.56 (<a
href="https://redirect.github.com/rust-lang/cc-rs/issues/1035">#1035</a>)</li>
<li>See full diff in <a
href="https://github.com/rust-lang/cc-rs/compare/1.0.94...1.0.95">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=cc&package-manager=cargo&previous-version=1.0.94&new-version=1.0.95)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-22 17:46:15 +00:00
dependabot[bot]
60fcb033ff build(deps): bump rustix from 0.38.32 to 0.38.33 (#32133)
Bumps [rustix](https://github.com/bytecodealliance/rustix) from 0.38.32
to 0.38.33.
<details>
<summary>Commits</summary>
<ul>
<li><a
href="63dd84aef7"><code>63dd84a</code></a>
chore: Release rustix version 0.38.33</li>
<li><a
href="95a83024c4"><code>95a8302</code></a>
Probe for <code>statx</code> availability even when <code>statx</code>
returns <code>ENOSYS</code>. (<a
href="https://redirect.github.com/bytecodealliance/rustix/issues/1048">#1048</a>)</li>
<li><a
href="76143e18d3"><code>76143e1</code></a>
Move to using <code>IpAddr</code> and other types from core. (<a
href="https://redirect.github.com/bytecodealliance/rustix/issues/1047">#1047</a>)</li>
<li><a
href="a5af48ee8a"><code>a5af48e</code></a>
Add &quot;visionos&quot; as an apple target. (<a
href="https://redirect.github.com/bytecodealliance/rustix/issues/1046">#1046</a>)</li>
<li><a
href="48eeb83648"><code>48eeb83</code></a>
Pass null instead of empty slices to getxattr and fgetxattr on macos (<a
href="https://redirect.github.com/bytecodealliance/rustix/issues/1045">#1045</a>)</li>
<li><a
href="fa21a6dc15"><code>fa21a6d</code></a>
Disable Haiku in CI due to upstream breakage, and fix a no_std error.
(<a
href="https://redirect.github.com/bytecodealliance/rustix/issues/1042">#1042</a>)</li>
<li><a
href="6f72de5e51"><code>6f72de5</code></a>
Add ELF aux vector AT_MINSIGSTKSZ (<a
href="https://redirect.github.com/bytecodealliance/rustix/issues/1041">#1041</a>)</li>
<li><a
href="7077238492"><code>7077238</code></a>
Expose <code>OFlags::LARGEFILE</code> and document its behavior (<a
href="https://redirect.github.com/bytecodealliance/rustix/issues/1020">#1020</a>)</li>
<li><a
href="7ed40bccbc"><code>7ed40bc</code></a>
Fix typo in MemfdFlags (<a
href="https://redirect.github.com/bytecodealliance/rustix/issues/1038">#1038</a>)</li>
<li><a
href="2c270053ea"><code>2c27005</code></a>
Add warning comment to <code>setgroups</code>. (<a
href="https://redirect.github.com/bytecodealliance/rustix/issues/1037">#1037</a>)</li>
<li>See full diff in <a
href="https://github.com/bytecodealliance/rustix/compare/v0.38.32...v0.38.33">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=rustix&package-manager=cargo&previous-version=0.38.32&new-version=0.38.33)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-22 17:40:32 +00:00
dependabot[bot]
8a4b419e3a build(deps): bump jobserver from 0.1.30 to 0.1.31 (#32134)
Bumps [jobserver](https://github.com/rust-lang/jobserver-rs) from 0.1.30
to 0.1.31.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/rust-lang/jobserver-rs/commits">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=jobserver&package-manager=cargo&previous-version=0.1.30&new-version=0.1.31)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-22 17:37:44 +00:00
Martin Robinson
7d63c7607f script_layout: Remove script to layout messages (#32081)
Instead of communicating with layout via messages, script can simply
call methods on the layout trait. This simplifies the way that script
communicates with layout and opens the path to sharing more data
structures between the two systems. This is part of a continuing 
series of cleanups after removing the layout thread.

<!-- 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 do not require tests because they should not change
behavior.

<!-- 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. -->
2024-04-22 15:28:14 +00:00
Martin Robinson
97376e6d96 layout: Add a basic support for list-style-position: outside (#32114)
This change adds very basic support for `list-style-position`.
Currently, the marker does not do any kind of baseline alignment with
the rest
of the list item contents and it also doesn't force the list item to be
at least as tall as the marker.

This adds a few new failures:

- Four failures because markers do not ensure that list-items have at
least the same block size as they do:
  - FAIL [expected PASS] /css/CSS2/lists/list-style-applies-to-012.xht
  - FAIL [expected PASS] /css/CSS2/lists/list-style-applies-to-014.xht
- FAIL [expected PASS]
/css/CSS2/lists/list-style-type-applies-to-012.xht
- FAIL [expected PASS]
/css/CSS2/lists/list-style-type-applies-to-014.xht
- One failure because we don't yet support the `::marker`
pseudo-selector:
- FAIL [expected PASS]
/css/css-position/position-absolute-dynamic-list-marker.html
- One failure because we don't support the list item exception for the
line height quirk:
  - FAIL [expected PASS] /quirks/line-height-in-list-item.tentative.html

Co-authored-by: Oriol Brufau <obrufau@igalia.com>

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

Fixes #27383.

---
<!-- 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 #27383.
- [ ] 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. -->

Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2024-04-22 14:23:35 +00:00
Martin Robinson
363651c7f7 fonts: Fix emoji font selection on macOS (#32122)
This fixes two issues that were preventing emojis from being properly
selected from fonts on macOS.

1. `CTFont::get_glyphs_for_characters` takes the input characters as
   UniChar which are UTF-16 encoded characters. We need to encode the
   input `char` as UTF-16 before passing it to CoreText.
2. The font fallback list is updated with the latest logic from Gecko,
   which importantly adds "Apple Color Emoji" to the list of fallback
   fonts. Sorry for the big change, but this is just a direct port of
   the code from Gecko.

With these two changes, emojis display but in grayscale. 😅 To fix this,
another part of the font stack will need to detect when the font
supports color and pass that information to WebRender when creating the
font instance. We will likely do this in platform independent way later
that will depend on some more preliminary changes.

<!-- 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 are part of #17267.
- [x] There are tests for these changes, but the macOS CI does not
currently run WPT so we cannot observe the updated results.

<!-- 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. -->
2024-04-22 10:40:55 +00:00
Mukilan Thiyagarajan
821893b2ee fonts: Rework platform font initialization (#32127)
This change reworks the way that platform fonts are created and
descriptor data is on `FontTemplate` is initialized.

The main change here is that platform fonts for local font faces are
always initialized using the font data loaded into memory from disk.
This means that there is now only a single path for creating platform
fonts.

In addition, the font list is now responsible for getting the
`FontTemplateDescriptor` for local `FontTemplate`s. Before the font had
to be loaded into memory to get the weight, style, and width used for
the descriptor. This is what fonts lists are for though, so for every
platform we have that information before needing to load the font. In
the future, hopefully this will allow discarding fonts before needing to
load them into memory. Web fonts still get the descriptor from the
platform handle, but hopefully that can be done with skrifa in the
future.

Thsese two fixes together allow properly loading indexed font variations
on Linux machines. Before only the first variation could be
instantiated.

Fixes https://github.com/servo/servo/issues/13317.
Fixes https://github.com/servo/servo/issues/24554.

Co-authored-by: Martin Robinson <mrobinson@igalia.com>

----

- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #13317 and #24554 
- [x] There are tests for these changes

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-04-22 09:38:21 +00:00
Nolan Lawson
25b182c372 fix(user-timing): fix clearing marks/measures by name (#32120)
This fixes several tests in
[wpt/user-timing](https://wpt.fyi/results/user-timing?label=master&product=chrome%5Bexperimental%5D&product=firefox%5Bexperimental%5D&product=safari%5Bexperimental%5D&product=servo&aligned)
by fixing some logic errors in how marks/measures are cleared (via
[`clearMarks`](https://developer.mozilla.org/en-US/docs/Web/API/Performance/clearMarks)
and
[`clearMeasures`](https://developer.mozilla.org/en-US/docs/Web/API/Performance/clearMeasures)).

There are two changes:

1. Fix the boolean logic in `clear_entries_by_name_and_type` so that,
when `clearMarks('foo')` or `clearMeasures('foo')` is called, the
presence of the entry name correctly filters based on existing entry
names.
2. Make the `entry_name` param a `DOMString` rather than an
`Option<DOMString>` since every API call has it as `Some` anyway, and
I'm not aware of any [Performance
APIs](https://developer.mozilla.org/en-US/docs/Web/API/Performance)
where you can clear all entries regardless of type. (This is not
strictly required for the fix, but I think it makes the code easier to
read.)

~~I also considered adding the expected WPT results using `mach
update-wpt`. But I'm not sure if you want these changes, since the
expectations are currently missing (i.e. `tests/wpt/meta/user-timing`
does not exist).~~ (_Update: added!_)

For the record, this PR fixes the following tests:

- `clearMarks.html.ini`
- `clearMeasures.html.ini`
- `clear_non_existent_mark.any.js.ini`
- `clear_non_existent_measure.any.js.ini`
- `clear_one_mark.any.js.ini`
- `clear_one_measure.any.js.ini`

~~In case you do want these meta files, here they are:
510e6146ba~~

---
<!-- 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. -->
2024-04-22 09:16:05 +00:00
Oriol Brufau
f9e154af55 Fix InsertRule to use the right CssRuleTypes (#32125)
`CSSRule::Type()` returns an u16 for CSSOM. `InsertRule()` was
incorrectly using this to create a `CssRuleTypes`.

Instead of `CssRuleTypes::from_bits(rule_type)`, it should be something
like `CssRuleTypes::from_bits(1 << rule_type)`.

However, that would only work when `Type()` provides an actual value,
which per https://drafts.csswg.org/cssom/#dom-cssrule-type only happens
for old rule types. New rule types just return 0.

Therefore, this patch changes the signature of `SpecificCSSRule::ty()`
to return the actual `CssRuleType`, and then `CSSRule::Type()` can zero
it out when necessary.

The fix is only relevant for CSS Nesting, which is currently disabled on
Servo, so no test is necessary.

<!-- 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 do not require tests because the fix is only
relevant for CSS Nesting, which is currently disabled

<!-- 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. -->
2024-04-22 07:06:36 +00:00
Kitsu
67f239d1ba clippy: fix several lint warns (#32126)
As seems #31500 still remain opened here's the next partial fix.

Fixed list: `unused_mut`, `clippy::needless_borrow`,
`clippy::match_ref_pats`, `clippy::borrow_deref_ref`, `clippy::ptr_eq`,
`clippy::unnecessary_cast`, `clippy::derivable_impls`,
`clippy::collapsible_match`, `clippy::extra_unused_lifetimes`,
`clippy::map_clone`, `clippy::manual_filter`.


- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes are part of #31500.
- [x] These changes do not require tests because are only cosmetic.
2024-04-22 06:45:39 +00:00
Nolan Lawson
025a987732 docs: update README instructions for updating WPT (#32124)
I noticed in #32123 that there are two issues with the docs for updating
Web Platform Tests:

- `./mach update-wpt --sync` fails with an error (`Are you sure you
don't want a patch?`) because it expects a `--patch` arg.
- The `tests/wpt/meta-legacy-layout/` test results need to be updated
with a separate command.

This updates `tests/wpt/README.md` with more complete instructions.

---
<!-- 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 this is a docs-only
change

<!-- 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. -->
2024-04-21 20:50:09 +00:00
Martin Robinson
a7838ae7cc layout: Have TextRun::glyph_run_is_preserved_newline take into account TextRunSegment offset (#32119)
A `TextRun` is composed of `TextRunSegment`s that are composed of
`GlyphRun`s.
`TextRun::glyph_run_is_preserved_newline` is indexing into the `TextRun`
text, but the `GlyphRun` indexes that it uses are relative to the
`TextRunSegment`
offset. Before the code was using the offset without incorporating the
`TextRunSegment` offset. This led to miscalculation of preserved newline
location while processing text content.

<!-- 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] 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. -->
2024-04-21 20:09:49 +00:00
Nolan Lawson
fa92b0f65f test: add WPT user-timing tests (#32123)
As discussed in
https://github.com/servo/servo/pull/32120#issuecomment-2068017033, this
adds the WPT `user-timing` tests to the default list of WPT tests, and
also commits the current status of the `user-timing` tests.


---
<!-- 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] 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. -->
2024-04-21 16:37:55 +00:00
Servo WPT Sync
f3c2edb743 Update web-platform-tests to revision b'015f19c5b653f51f2e38ebe97ec0ff62523f57de' (#32121) 2024-04-21 05:02:25 +00:00
dependabot[bot]
bcf538dbc8 build(deps): bump rustls from 0.21.10 to 0.21.11 (#32116)
Bumps [rustls](https://github.com/rustls/rustls) from 0.21.10 to 0.21.11.
- [Release notes](https://github.com/rustls/rustls/releases)
- [Changelog](https://github.com/rustls/rustls/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rustls/rustls/compare/v/0.21.10...v/0.21.11)

---
updated-dependencies:
- dependency-name: rustls
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-19 18:04:30 +00:00
Ekta Siwach
96c9a2a8bb layout: Have current_block_direction_position in PlacementState use Au (#31948) 2024-04-19 14:30:32 +00:00
komuhangi
007a72fe4d Fixed some clippy warnings in components (#32107)
* Fixed some clippy warnings in components

* Updated handling of NaN values in comparison

* Updated formatting using ./mach fmt
2024-04-19 08:48:01 +00:00
Son of Binary
f70413baba script: Add an implementation of Default for Documents (#32048) 2024-04-19 08:45:38 +00:00
Oluwatobi Sofela
df4c56efa4 clippy: Fix collapsible_if warning (#32109) 2024-04-19 08:29:01 +00:00
Oluwatobi Sofela
21ea6d21f0 clippy: Fix explicit_auto_deref warnings in components/script (#32113)
* clippy: Fix explicit_auto_deref warnings

* refactor: Change basic comments to rustdoc comments
2024-04-19 02:47:40 +00:00
dependabot[bot]
5ac756fd09 build(deps): bump syn from 2.0.59 to 2.0.60 (#32111)
Bumps [syn](https://github.com/dtolnay/syn) from 2.0.59 to 2.0.60.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/2.0.59...2.0.60)

---
updated-dependencies:
- dependency-name: syn
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-18 16:51:54 +00:00
Oluwatobi Sofela
2a967119c7 clippy: Fix map_flatten warning in components/script (#32110)
* clippy: Fix map_flatten warning

* refactor: Change plain comments to rustdoc comments
2024-04-18 15:43:53 +00:00
Oluwatobi Sofela
f89c53bd51 clippy: Fix clone_on_copy warnings (#32108) 2024-04-18 14:18:14 +00:00
Martin Robinson
5393d30a8e Simplify FontHandle and rename it to PlatformFont (#32101)
* Simplify `FontHandle` and rename it to `PlatformFont`

Rename it to `PlatformFont` and move the `FontTemplate` member to
`Font`, because it's shared by all platforms.

* Update components/gfx/platform/freetype/font.rs

Co-authored-by: Mukilan Thiyagarajan <mukilanthiagarajan@gmail.com>

* Fix build for MacOS and Windows

---------

Co-authored-by: Mukilan Thiyagarajan <mukilanthiagarajan@gmail.com>
2024-04-17 17:44:34 +00:00
dependabot[bot]
e9e46f4c0b build(deps): bump proc-macro2 from 1.0.80 to 1.0.81 (#32105)
Bumps [proc-macro2](https://github.com/dtolnay/proc-macro2) from 1.0.80 to 1.0.81.
- [Release notes](https://github.com/dtolnay/proc-macro2/releases)
- [Commits](https://github.com/dtolnay/proc-macro2/compare/1.0.80...1.0.81)

---
updated-dependencies:
- dependency-name: proc-macro2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-17 17:15:29 +00:00
dependabot[bot]
03a64cf06c build(deps): bump serde from 1.0.197 to 1.0.198 (#32104)
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.197 to 1.0.198.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.197...v1.0.198)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-17 17:10:06 +00:00
Martin Robinson
4ec61c2cdc layout: Add support for clear on <br> elements (#32094)
`<br>` elements are a bit "special" in the sense that they defer a
linebreak, but can also have `clear` applied to them. The `clear` that
they supply should be applie *after* the linebreak is processed. This
change adds special processing for this situation.

Fixes #15402.
2024-04-17 14:15:06 +00:00
Martin Robinson
83dec920dd Rename FontTemplateInfo to FontTemplateAndWebRenderFontKey (#32100)
This clarifies what this type does a bit. Based on a suggestion by
@mukilan.
2024-04-17 07:26:39 +00:00
Delan Azabani
ab2b001265 Nix: allow nix-shell without explicit path to shell.nix (#32035) 2024-04-17 07:02:31 +00:00
Martin Robinson
6b2fa91357 gfx: Remove FontTemplateData (#32034)
Now that `FontTemplateData` is more or less the same on all platforms,
it can be removed. This is a preparatory change for a full refactor of
the font system on Servo. The major changes here are:

 - Remove `FontTemplateData` and move its members into `FontTemplate`
 - Make `FontTemplate` have full interior mutability instead of only
   the `FontTemplateData` member. This is preparation for having these
   data types `Send` and `Sync` with locking.
 - Remove the strong/weak reference concept for font data. In practice,
   all font data references were strong, so this was never fully
   complete. Instead of using this approach, the new font system will
   use a central font data cache with references associated to layouts.
 - The `CTFont` cache is now a global cache, so `CTFont`s can be shared
   between threads. The cache is cleared when clearing font caches.

A benefit of this change (apart from `CTFont` sharing) is that font data
loading is platform-independent now.
2024-04-16 17:50:50 +00:00
dependabot[bot]
689c144714 build(deps): bump clipboard-win from 5.3.0 to 5.3.1 (#32099)
Bumps [clipboard-win](https://github.com/DoumanAsh/clipboard-win) from 5.3.0 to 5.3.1.
- [Commits](https://github.com/DoumanAsh/clipboard-win/commits)

---
updated-dependencies:
- dependency-name: clipboard-win
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-16 17:33:10 +00:00
dependabot[bot]
2d7f764d7f build(deps): bump prettyplease from 0.2.17 to 0.2.19 (#32098)
Bumps [prettyplease](https://github.com/dtolnay/prettyplease) from 0.2.17 to 0.2.19.
- [Release notes](https://github.com/dtolnay/prettyplease/releases)
- [Commits](https://github.com/dtolnay/prettyplease/compare/0.2.17...0.2.19)

---
updated-dependencies:
- dependency-name: prettyplease
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-16 17:25:23 +00:00
dependabot[bot]
544fb0c4ba build(deps): bump syn from 2.0.58 to 2.0.59 (#32097)
Bumps [syn](https://github.com/dtolnay/syn) from 2.0.58 to 2.0.59.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/2.0.58...2.0.59)

---
updated-dependencies:
- dependency-name: syn
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-16 17:21:54 +00:00
dependabot[bot]
c7ad74a9af build(deps): bump serde_json from 1.0.115 to 1.0.116 (#32096)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.115 to 1.0.116.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.115...v1.0.116)

---
updated-dependencies:
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-16 17:17:31 +00:00
Philip Lamb
7a507a4d5b Backout Host-header related change from #32024. (#32093)
#32024 broke a different set of nginx sites, and a more sophisticated fix for the case of a missing HTTP 1.1 `Host` header is required.
2024-04-16 12:38:25 +00:00
Oriol Brufau
f5bdfdfe94 Upgrade Stylo to 2024-03-01 (#32089)
* Upgrade Stylo to 2024-03-01

* Fixup for https://bugzil.la/1882754

* Update test expectations
2024-04-16 12:27:51 +00:00
dependabot[bot]
0678136b17 build(deps): bump chrono from 0.4.37 to 0.4.38 (#32083)
Bumps [chrono](https://github.com/chronotope/chrono) from 0.4.37 to 0.4.38.
- [Release notes](https://github.com/chronotope/chrono/releases)
- [Changelog](https://github.com/chronotope/chrono/blob/main/CHANGELOG.md)
- [Commits](https://github.com/chronotope/chrono/compare/v0.4.37...v0.4.38)

---
updated-dependencies:
- dependency-name: chrono
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-16 08:33:04 +00:00
dependabot[bot]
4cc1ecd2a1 build(deps): bump either from 1.10.0 to 1.11.0 (#32088)
Bumps [either](https://github.com/rayon-rs/either) from 1.10.0 to 1.11.0.
- [Commits](https://github.com/rayon-rs/either/compare/1.10.0...1.11.0)

---
updated-dependencies:
- dependency-name: either
  dependency-type: indirect
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-16 08:32:08 +00:00
Martin Robinson
8bcb316c92 layout: Add support for background-attachment: fixed (#32068)
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2024-04-15 20:24:37 +00:00
Martin Robinson
f379041597 layout: Add support for <object> with image data URLs (#32069)
This is enough support for `<object>` to get Acid2 working.

Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2024-04-15 20:20:55 +00:00
dependabot[bot]
a77c15ee16 build(deps): bump proc-macro2 from 1.0.79 to 1.0.80 (#32087)
Bumps [proc-macro2](https://github.com/dtolnay/proc-macro2) from 1.0.79 to 1.0.80.
- [Release notes](https://github.com/dtolnay/proc-macro2/releases)
- [Commits](https://github.com/dtolnay/proc-macro2/compare/1.0.79...1.0.80)

---
updated-dependencies:
- dependency-name: proc-macro2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-15 17:22:30 +00:00
dependabot[bot]
1311c26344 build(deps): bump ab_glyph from 0.2.24 to 0.2.25 (#32085)
Bumps [ab_glyph](https://github.com/alexheretic/ab-glyph) from 0.2.24 to 0.2.25.
- [Release notes](https://github.com/alexheretic/ab-glyph/releases)
- [Commits](https://github.com/alexheretic/ab-glyph/compare/ab-glyph-0.2.24...ab-glyph-0.2.25)

---
updated-dependencies:
- dependency-name: ab_glyph
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-15 17:17:28 +00:00
dependabot[bot]
2f0c6c41d5 build(deps): bump cc from 1.0.92 to 1.0.94 (#32084)
Bumps [cc](https://github.com/rust-lang/cc-rs) from 1.0.92 to 1.0.94.
- [Release notes](https://github.com/rust-lang/cc-rs/releases)
- [Commits](https://github.com/rust-lang/cc-rs/compare/1.0.92...1.0.94)

---
updated-dependencies:
- dependency-name: cc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-15 17:17:23 +00:00
dependabot[bot]
c2b40b5632 build(deps): bump jobserver from 0.1.29 to 0.1.30 (#32082)
Bumps [jobserver](https://github.com/rust-lang/jobserver-rs) from 0.1.29 to 0.1.30.
- [Commits](https://github.com/rust-lang/jobserver-rs/commits)

---
updated-dependencies:
- dependency-name: jobserver
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-15 17:11:31 +00:00
Oriol Brufau
1898394cb3 Keep 1st collapsible space after a preserved one (#32037)
The logic was to remove any collapsible white space preceded by other
white space. However, this should only happen if the preceding space
is also collapsible.

Also fixing the logic in ContentSizesComputation, which was wrong
but previously it didn't matter.
2024-04-15 12:02:09 +00:00
Ngo Iok Ui (Wu Yu Wei)
5083dc7d17 Add minibrowser update on window resize event (#32067)
* Add minibrowser update on resize event

* Give a more clear reason
2024-04-15 11:54:44 +00:00
Servo WPT Sync
5083f3c4fb Update web-platform-tests to revision b'daa07cf3c47652ed67e637f2a39bbc34f91cfe10' (#32071) 2024-04-14 04:39:35 +00:00
Oriol Brufau
a5e97525a0 Upgrade Stylo to 2024-01-16 (#32066)
* Upgrade Stylo to 2024-01-16

* Fixup for https://phabricator.services.mozilla.com/D187736

* Fixup for https://phabricator.services.mozilla.com/D196415

* Fixup for https://phabricator.services.mozilla.com/D197147

* Fixup for https://phabricator.services.mozilla.com/D196194

* Fixup for https://phabricator.services.mozilla.com/D196195

* Update test expectations
2024-04-13 17:42:09 +00:00
Alex Touchet
93bb276602 Update some dependencies (#32065) 2024-04-13 13:18:00 +00:00
dependabot[bot]
b74664d242 build(deps): bump allocator-api2 from 0.2.16 to 0.2.18 (#32063)
Bumps [allocator-api2](https://github.com/zakarumych/allocator-api2) from 0.2.16 to 0.2.18.
- [Changelog](https://github.com/zakarumych/allocator-api2/blob/main/CHANGELOG.md)
- [Commits](https://github.com/zakarumych/allocator-api2/compare/v0.2.16...v0.2.18)

---
updated-dependencies:
- dependency-name: allocator-api2
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-12 17:03:29 +00:00
Oriol Brufau
bc7cced03c Element collapsing thru should collapse with its children (#32060)
If the top and bottom margins of an element collapse through, then this
patch treats the bottom margin as collapsing with its children, even if
`height` doesn't compute to zero.

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-04-12 15:06:12 +00:00
Oriol Brufau
95654b789c Treat indefinite percentages as auto for margin collapse (#32059)
The top and bottom margins of an element can collapse through if its
height is auto or zero. Indefinite percentages behave as auto, so they
shouldn't prevent the margins from collapsing.

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-04-12 12:14:35 +00:00
Martin Robinson
efa0d45757 Remove FontContextHandle (#32038)
The `FontContextHandle` was really only used on FreeType platforms to
store the `FT_Library` handle to use for creating faces. Each
`FontContext` and `FontCacheThread` would create its own
`FontContextHandle`. This change removes this data structure in favor of
a mutex-protected shared `FontContextHandle` for an entire Servo
process. The handle is initialized using a `OnceLock` to ensure that it
only happens once and also that it stays alive for the entire process
lifetime.

In addition to greatly simplifying the code, this will make it possible
for different threads to share platform-specific `FontHandle`s, avoiding
multiple allocations for a single font.

The only downside to all of this is that memory usage of FreeType fonts
isn't measured (though the mechanism is still there). This is because
the `FontCacheThread` currently doesn't do any memory measurement.
Eventually this *will* happen though, during the font system redesign.
In exchange, this should reduce the memory usage since there is only a
single FreeType library loaded into memory now.

This is part of #32033.
2024-04-12 10:39:32 +00:00
Oriol Brufau
e9591ce62f Obey min-height and max-height on floated elements (#32057)
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-04-12 10:21:02 +00:00
eri
88d4aff595 clippy: Fix comparison_* warnings (#32058) 2024-04-12 08:08:38 +00:00
Gae24
509b858f15 mach: Remove unused --angle command line argument (#32050)
* removed unused angle command line argument

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

* Removed argument from smoketest in Windows workflows

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>

---------

Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
2024-04-12 08:06:09 +00:00
Philip Lamb
10ec8565ea Fixes for HTTP header compliance. (#32024)
- Fix 400 errors from nginx in response to Servo requests by implementing conformant albeit non-normative removal of whitespace from `Accept` and `Accept-Language` HTTP headers. (To match behaviour of Firefox, Safari, and Chrome) https://datatracker.ietf.org/doc/html/rfc7231#section-5.3.2
- Provide `Host` header as REQUIRED by HTTP protocol https://www.rfc-editor.org/rfc/rfc9110#field.host
- Update tests.
2024-04-11 21:51:23 +00:00
Oluwatobi Sofela
62a25fdcc4 clippy: Fix question_mark warning (#32051) 2024-04-11 21:48:43 +00:00
Oluwatobi Sofela
9db9dddb88 clippy: Fix iter_cloned_collect warning (#32053) 2024-04-11 21:46:48 +00:00
eri
b3d9924396 clippy: Fix redundant_* warnings (#32056)
* clippy: Fix `redundant_field_names` warnings

* clippy: Fix other `redundant_*` warnings

* docs: Update docstring comments
2024-04-11 21:46:18 +00:00
Oluwatobi Sofela
e3ad76d994 clippy: Fix needless_late_init warning (#32052) 2024-04-11 21:44:08 +00:00
Oluwatobi Sofela
e8e909b78c clippy: Fix needless_lifetimes warning (#32049) 2024-04-11 21:43:35 +00:00
dependabot[bot]
0a860bd928 build(deps): bump pathfinder_simd from 0.5.2 to 0.5.3 (#32055)
Bumps [pathfinder_simd](https://github.com/servo/pathfinder) from 0.5.2 to 0.5.3.
- [Release notes](https://github.com/servo/pathfinder/releases)
- [Commits](https://github.com/servo/pathfinder/commits)

---
updated-dependencies:
- dependency-name: pathfinder_simd
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-11 17:29:24 +00:00
dependabot[bot]
cd642f2e6b build(deps): bump jobserver from 0.1.28 to 0.1.29 (#32054)
Bumps [jobserver](https://github.com/alexcrichton/jobserver-rs) from 0.1.28 to 0.1.29.
- [Commits](https://github.com/alexcrichton/jobserver-rs/commits)

---
updated-dependencies:
- dependency-name: jobserver
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-11 17:22:18 +00:00
cathiechen
4e4a4c0a28 Implement form-associated custom elements and their ElementInternals (#31980)
* FACEs work, setFormValue test is awful so now has _mozilla backup

* 1. Impl Validatable in ElementInternals instead of HTMLElement. 2. Reuse the code in Validatable trait. 3. The form associated custom element is not a customized built-in element.

* add some comments

* support readonly attribute and complete barred from constraint validation

* Addressed the code review comments

* Updated the legacy-layout results

* Fixed the WPT failures in ElementInternals-validation.html

* Addressed the code review comments

* Review suggestions

* Fixed silly mistakes and update the test result outside elementinternals

* update the test results

---------

Co-authored-by: Patrick Shaughnessy <pshaughn@comcast.net>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-04-11 13:17:11 +00:00
Alex Touchet
2eb959a159 Update core-graphics (#32045) 2024-04-11 12:54:41 +00:00
dependabot[bot]
d9f067e998 build(deps): bump combine from 4.6.6 to 4.6.7 (#32041)
Bumps [combine](https://github.com/Marwes/combine) from 4.6.6 to 4.6.7.
- [Changelog](https://github.com/Marwes/combine/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Marwes/combine/compare/v4.6.6...v4.6.7)

---
updated-dependencies:
- dependency-name: combine
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-10 22:22:58 +00:00
dependabot[bot]
29a7396878 build(deps): bump anyhow from 1.0.81 to 1.0.82 (#32042)
Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.81 to 1.0.82.
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.81...1.0.82)

---
updated-dependencies:
- dependency-name: anyhow
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-10 19:37:49 +00:00
dependabot[bot]
927faec82e build(deps): bump cfg-expr from 0.15.7 to 0.15.8 (#32044)
Bumps [cfg-expr](https://github.com/EmbarkStudios/cfg-expr) from 0.15.7 to 0.15.8.
- [Release notes](https://github.com/EmbarkStudios/cfg-expr/releases)
- [Changelog](https://github.com/EmbarkStudios/cfg-expr/blob/main/CHANGELOG.md)
- [Commits](https://github.com/EmbarkStudios/cfg-expr/compare/0.15.7...0.15.8)

---
updated-dependencies:
- dependency-name: cfg-expr
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-10 17:11:54 +00:00
dependabot[bot]
797b3f9618 build(deps): bump encoding_rs from 0.8.33 to 0.8.34 (#32043)
Bumps [encoding_rs](https://github.com/hsivonen/encoding_rs) from 0.8.33 to 0.8.34.
- [Commits](https://github.com/hsivonen/encoding_rs/compare/v0.8.33...v0.8.34)

---
updated-dependencies:
- dependency-name: encoding_rs
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-10 17:07:50 +00:00
dependabot[bot]
fb3b3032ae build(deps): bump quote from 1.0.35 to 1.0.36 (#32040)
Bumps [quote](https://github.com/dtolnay/quote) from 1.0.35 to 1.0.36.
- [Release notes](https://github.com/dtolnay/quote/releases)
- [Commits](https://github.com/dtolnay/quote/compare/1.0.35...1.0.36)

---
updated-dependencies:
- dependency-name: quote
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-10 16:58:52 +00:00
Oriol Brufau
5acfce5b89 Upgrade Stylo to 2023-12-01 (#32032)
* Upgrade Stylo to 2023-12-01

* Fixup for https://phabricator.services.mozilla.com/D191362

* Fixup for https://phabricator.services.mozilla.com/D191522

* Fixup for https://phabricator.services.mozilla.com/D191613

* Fixup for https://phabricator.services.mozilla.com/D191161

* Fixup for https://phabricator.services.mozilla.com/D191615

* Fixup for https://phabricator.services.mozilla.com/D193048

* Fixup for https://phabricator.services.mozilla.com/D193547

* Update test expectations
2024-04-10 13:03:56 +00:00
komuhangi
89a4820519 Fixed some clippy warnings in components (#32025)
* Fixed some clippy warnings in components

* Updated the simplification of bolean expressions in componets/script/dom/range.rs
2024-04-10 07:50:01 +00:00
dependabot[bot]
245269c649 build(deps): bump gstreamer from 0.22.3 to 0.22.4 (#32029)
Bumps gstreamer from 0.22.3 to 0.22.4.

---
updated-dependencies:
- dependency-name: gstreamer
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-09 20:45:22 +00:00
dependabot[bot]
267320c127 build(deps): bump glib from 0.19.3 to 0.19.4 (#32031)
Bumps [glib](https://github.com/gtk-rs/gtk-rs-core) from 0.19.3 to 0.19.4.
- [Release notes](https://github.com/gtk-rs/gtk-rs-core/releases)
- [Changelog](https://github.com/gtk-rs/gtk-rs-core/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gtk-rs/gtk-rs-core/compare/0.19.3...0.19.4)

---
updated-dependencies:
- dependency-name: glib
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-09 17:19:07 +00:00
dependabot[bot]
7f4608b200 build(deps): bump rustversion from 1.0.14 to 1.0.15 (#32030)
Bumps [rustversion](https://github.com/dtolnay/rustversion) from 1.0.14 to 1.0.15.
- [Release notes](https://github.com/dtolnay/rustversion/releases)
- [Commits](https://github.com/dtolnay/rustversion/compare/1.0.14...1.0.15)

---
updated-dependencies:
- dependency-name: rustversion
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-09 17:14:33 +00:00
dependabot[bot]
9e1831876b build(deps): bump backtrace from 0.3.69 to 0.3.71 (#32028)
Bumps [backtrace](https://github.com/rust-lang/backtrace-rs) from 0.3.69 to 0.3.71.
- [Release notes](https://github.com/rust-lang/backtrace-rs/releases)
- [Commits](https://github.com/rust-lang/backtrace-rs/compare/0.3.69...0.3.71)

---
updated-dependencies:
- dependency-name: backtrace
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-09 17:12:34 +00:00
Oriol Brufau
586a70887d Bump Stylo to servo/stylo#28 (#31991) 2024-04-09 14:26:32 +00:00
Azhar Ismagulova
581913f77e clippy: fix warnings in components/script (#32023) 2024-04-09 09:34:52 +00:00
iterminatorheart
8d513cf4c7 feat: use set_poll, set_wait, set_exit of control_flow (#32012)
Co-authored-by: xiandu.wl <xiandu.wl@antgroup.com>
2024-04-09 09:17:10 +00:00
dependabot[bot]
0a8b461dbc build(deps): bump uluru from 3.0.0 to 3.1.0 (#32013)
Bumps [uluru](https://github.com/servo/uluru) from 3.0.0 to 3.1.0.
- [Release notes](https://github.com/servo/uluru/releases)
- [Commits](https://github.com/servo/uluru/compare/v3.0.0...v3.1.0)

---
updated-dependencies:
- dependency-name: uluru
  dependency-type: indirect
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-09 08:32:19 +00:00
dependabot[bot]
810d76460c build(deps): bump bumpalo from 3.15.4 to 3.16.0 (#32020)
Bumps [bumpalo](https://github.com/fitzgen/bumpalo) from 3.15.4 to 3.16.0.
- [Changelog](https://github.com/fitzgen/bumpalo/blob/main/CHANGELOG.md)
- [Commits](https://github.com/fitzgen/bumpalo/compare/3.15.4...3.16.0)

---
updated-dependencies:
- dependency-name: bumpalo
  dependency-type: indirect
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-09 08:31:43 +00:00
Martin Robinson
dd9f62adcc chore: Clean up use of gfx and constellation types (#31981)
This change contains three semi-related clean ups:

1. the `to_webrender()` and `from_webrender()` functions on Pipeline are
   turned into more-idiomatic `From` and `Into` implementations.
2. `combine_id_with_fragment_type` now returns a `u64` as that is what is
   expected for all callers and not a `usize`.
3. The `query_scroll_id` query is removed entirely. The
   `ExternalScrollId` that this queries is easily generated directly
   from the node's opaque id. Querying into layout isn't necessary at
   all.
2024-04-09 06:43:48 +00:00
dependabot[bot]
b79e2a0b65 build(deps): bump cc from 1.0.89 to 1.0.92 (#32021)
Bumps [cc](https://github.com/rust-lang/cc-rs) from 1.0.89 to 1.0.92.
- [Release notes](https://github.com/rust-lang/cc-rs/releases)
- [Commits](https://github.com/rust-lang/cc-rs/compare/1.0.89...1.0.92)

---
updated-dependencies:
- dependency-name: cc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-08 16:58:46 +00:00
dependabot[bot]
09b20c87b8 build(deps): bump getrandom from 0.2.12 to 0.2.14 (#32022)
Bumps [getrandom](https://github.com/rust-random/getrandom) from 0.2.12 to 0.2.14.
- [Changelog](https://github.com/rust-random/getrandom/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-random/getrandom/compare/v0.2.12...v0.2.14)

---
updated-dependencies:
- dependency-name: getrandom
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-08 16:58:18 +00:00
dependabot[bot]
309f54a8f8 build(deps): bump gstreamer-audio from 0.22.0 to 0.22.4 (#32019)
Bumps gstreamer-audio from 0.22.0 to 0.22.4.

---
updated-dependencies:
- dependency-name: gstreamer-audio
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-08 16:51:39 +00:00
dependabot[bot]
6b006c015d build(deps): bump glib-macros from 0.19.3 to 0.19.4 (#32017)
Bumps [glib-macros](https://github.com/gtk-rs/gtk-rs-core) from 0.19.3 to 0.19.4.
- [Release notes](https://github.com/gtk-rs/gtk-rs-core/releases)
- [Changelog](https://github.com/gtk-rs/gtk-rs-core/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gtk-rs/gtk-rs-core/compare/0.19.3...0.19.4)

---
updated-dependencies:
- dependency-name: glib-macros
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-08 16:51:00 +00:00
dependabot[bot]
20faebace6 build(deps): bump downcast-rs from 1.2.0 to 1.2.1 (#32016)
Bumps [downcast-rs](https://github.com/marcianx/downcast-rs) from 1.2.0 to 1.2.1.
- [Changelog](https://github.com/marcianx/downcast-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/marcianx/downcast-rs/compare/v1.2.0...v1.2.1)

---
updated-dependencies:
- dependency-name: downcast-rs
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-08 16:50:22 +00:00
dependabot[bot]
641699dbd9 build(deps): bump gstreamer-video from 0.22.1 to 0.22.4 (#32018)
Bumps gstreamer-video from 0.22.1 to 0.22.4.

---
updated-dependencies:
- dependency-name: gstreamer-video
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-08 16:49:42 +00:00
dependabot[bot]
3d431d9e0f build(deps): bump warp from 0.3.6 to 0.3.7 (#32014)
Bumps [warp](https://github.com/seanmonstar/warp) from 0.3.6 to 0.3.7.
- [Release notes](https://github.com/seanmonstar/warp/releases)
- [Changelog](https://github.com/seanmonstar/warp/blob/master/CHANGELOG.md)
- [Commits](https://github.com/seanmonstar/warp/compare/v0.3.6...v0.3.7)

---
updated-dependencies:
- dependency-name: warp
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-08 16:49:14 +00:00
dependabot[bot]
04a537a2da build(deps): bump half from 2.4.0 to 2.4.1 (#32015)
Bumps [half](https://github.com/starkat99/half-rs) from 2.4.0 to 2.4.1.
- [Release notes](https://github.com/starkat99/half-rs/releases)
- [Changelog](https://github.com/starkat99/half-rs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/starkat99/half-rs/compare/v2.4.0...v2.4.1)

---
updated-dependencies:
- dependency-name: half
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-08 16:47:25 +00:00
Daniel Adams
e38b34a629 Gamepad: Remove GamepadList and fix dropped connection event on startup (#31684)
* Replace GamepadList

* Fix initial gamepad connection event from gilrs getting dropped

* Fix gamepad reconnection issues, use MutNullableDom

* Reduce some repetition in handle_gamepad_events

* Address feedback, move some steps to navigator methods

* Refactor internal navigator gamepad methods

* Add note re: unused gilrs index, adjust navigator gamepad methods
2024-04-08 09:43:48 +00:00
shanehandley
ddbec46e1f fix: Handle table.deleteRow with no rows (#32009)
* fix: Handle table.deleteRow with no rows

* Respond to review, update legacy layout expectations
2024-04-07 15:09:22 +00:00
komuhangi
e0e3408650 Fixed some clippy warnings by replacing 'match' with 'if' (#32007) 2024-04-07 07:39:05 +00:00
Servo WPT Sync
05f1bbf0a9 Update web-platform-tests to revision b'b73a0a32890ff293961eb55bb90ba57a5a711f48' (#32010) 2024-04-07 02:58:36 +00:00
dependabot[bot]
1ffa61aabf build(deps): bump ab_glyph from 0.2.23 to 0.2.24 (#32006)
Bumps [ab_glyph](https://github.com/alexheretic/ab-glyph) from 0.2.23 to 0.2.24.
- [Release notes](https://github.com/alexheretic/ab-glyph/releases)
- [Commits](https://github.com/alexheretic/ab-glyph/compare/ab-glyph-0.2.23...ab-glyph-0.2.24)

---
updated-dependencies:
- dependency-name: ab_glyph
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-05 17:10:19 +00:00
Aarya Khandelwal
275fad8b78 Clippy: Fix the error of variants having the same prefix. (#31953)
* fix error: all variants have same prefix

* made the suggested changes

* fixed errors caused by commit

* silenced the clippy warning.

* ran ./mach fmt

* Update components/script/dom/htmlmediaelement.rs

Co-authored-by: Samson <16504129+sagudev@users.noreply.github.com>

---------

Co-authored-by: Samson <16504129+sagudev@users.noreply.github.com>
2024-04-05 16:31:41 +00:00
Martin Robinson
9ee45425e9 ci: Retry hdiutil create with randomize backoff (#32005)
Regularly we see that `hdiutil creat` when creating a DMG on the MacOS
builder fails with "Resource busy." This change is an attempt to
mitigate that by retrying the command 3 time with a randomized backoff.
2024-04-05 10:51:24 +00:00
Martin Robinson
77b2e88fb7 gfx: Do not apply scale to CoreText font metrics (#31996)
Since the original version of the CoreText font code, it has scaled the
metrics from CoreText by an unusual scale:

```
    let scale = px_to_pt(self.ctfont.pt_size()) / (ascent + descent);
```

It's unclear what this scale was trying to accomplish. Note that it's
passing the return value of `pt_size()` to `px_to_pt` which seems
backward. This scale seems bogus, but perhaps it's based on a
misconception about what its returned from CoreText. Unlike the return
values of `CGFont` methods, which are returned in font units, the ones
from `CTFont` are "scaled according to the point size and matrix of the
font reference."

Indeed, when just interpreting these values as pixel values, the results
more or less match Firefox and Chrome. This becomes much more obvious
now that we have support for `ex` units. Even when not using `ex`, you
can sometimes see the top parts of glyphs cut off due to this scaling.

This change removes the scaling and simply interpets the return values
of `CTFont` methods as pixels. It addresses all of the issues mentioned
above. Note that this path will eventually just be a fallback path and
metrics will come from sfnt tables in the future.
2024-04-05 10:22:36 +00:00
dependabot[bot]
14bf1c5434 build(deps): bump h2 from 0.3.25 to 0.3.26 (#31999)
Bumps [h2](https://github.com/hyperium/h2) from 0.3.25 to 0.3.26.
- [Release notes](https://github.com/hyperium/h2/releases)
- [Changelog](https://github.com/hyperium/h2/blob/v0.3.26/CHANGELOG.md)
- [Commits](https://github.com/hyperium/h2/compare/v0.3.25...v0.3.26)

---
updated-dependencies:
- dependency-name: h2
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-05 08:26:01 +00:00
eri
f902a9fecf Show poster over first video frame if available (#32001) 2024-04-05 03:44:23 +00:00
dependabot[bot]
c7542b273b build(deps): bump servo-media-gstreamer from c04bb30 to 45756be (#31998)
Bumps [servo-media-gstreamer](https://github.com/servo/media) from `c04bb30` to `45756be`.
- [Release notes](https://github.com/servo/media/releases)
- [Commits](c04bb30253...45756bef67)

---
updated-dependencies:
- dependency-name: servo-media-gstreamer
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-04 18:03:25 +00:00
dependabot[bot]
770130a563 build(deps): bump servo-media from c04bb30 to 45756be (#31997)
Bumps [servo-media](https://github.com/servo/media) from `c04bb30` to `45756be`.
- [Release notes](https://github.com/servo/media/releases)
- [Commits](c04bb30253...45756bef67)

---
updated-dependencies:
- dependency-name: servo-media
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-04 18:03:22 +00:00
Martin Robinson
fe8b23d14a layout: Add a FontMetricsProvider for resolving font-relative units (#31966)
The only font relative unit that Servo knows how to resolve currently is
`rem` (relative to the root font size). This is because Stylo cannot do
any font queries. This adds a mechanism to allow this, exposing the
ability to properly render `ex` units in Servo.

This change only allows resolving some font size relative units thoug,
as Servo doesn't collect all the FontMetrics it needs to resolve them
all. This capability will be added in followup changes.

Some new tests fail:
 - ex-unit-001.html: This test fails because Servo does not yet have
   support for setting the weight using @font-face rules on web fonts.
 - ex-unit-004.html: This test fails because Servo does not yet have
   support for setting the Unicode range of a web font using @font-face
   rules.
 - first-available-font-001.html: This test fails because the above
   two feature are missing.
2024-04-04 12:35:15 +00:00
Martin Robinson
24c3a2df1e script: Make layout DOM wrappers not generic on layout data (#31994)
Remove the type parameter from the layout DOM wrappers. This is possible
now that style and layout data are separate and the `Any` nature of the
layout data is exposed in the wrappers.

Removing the phantom data member of the wrappers also allows using the
default `derive` implementations for things like `Clone`, `Copy`, and
`PartialEq`.
2024-04-04 11:34:35 +00:00
komuhangi
df457c43c8 Fixed some clippy warning by adding default implementations (#31989)
* Fixed some clippy warning by adding default implementations

* Updated PR that adds default implementation of structs

* Clean up and extend `Default` implementations

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-04-04 09:33:30 +00:00
Samson
62a916ce5c webgpu: Implement onSubmittedWorkDone (#31772)
* Implement onSubmittedWorkDone

* Use rust closures for callback & actually remove entries from hashmap.

* Remove hashmap

* Fix warnings

* Update expectations

* clean flaky crashes

* re

* Update components/script/dom/gpuqueue.rs

Co-authored-by: Martin Robinson <mrobinson@igalia.com>

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-04-04 08:12:40 +00:00
Martin Robinson
08ef158d4e script: Split style and layout data in DOM nodes (#31985)
This change splits the style and layout data in DOM nodes that is
populated by style and layout passes. This makes Servo's data design
more like Gecko's. This allows:

1. Removing the various `StyleAndLayout` data structures used by layout.
2. Removing the `GetStyleAndLayoutData` and
   `GetStyleAndOpaqueLayoutData` traits. Accessing style and layout data
   are now just functions on the `LayoutNode` and `ThreadSafeLayoutNode`
   traits.
3. Styling now doesn't populate layout data. This is is postponed until
   layout itself.
4. Allows the DOM wrappers to no longer have to be generic over the
   layout data. This data was already stored using `std::any::Any` and
   the new code just makes layout responsible for downcasting. Cleaning
   up the generic type parameter in the DOM wrappers can happen in a
   followup change.

The main benefit to all of this is that we should be able to remove
unsafe creation of `ServoLayoutNode` in layout and
`TrustedLayoutNodeAddress` entirely, because `ServoLayoutNode` will be
able to be passed directly from script to layout. In addition, this
removes one more abstraction layer from the layout DOM wrappers, making
the code a lot more understandable.

Note: This increases the measured size of DOM types, but the same data
is stored. It's simply that before that data was stored behind a heap
pointer.
2024-04-04 07:56:51 +00:00
Samson
1ed6b96684 Update mozjs (#31824) 2024-04-03 19:24:50 +00:00
Oluwatobi Sofela
31e0b33e73 clippy: Fix vec_box warnings in components/script (#31986)
* clippy: Fix vec_box warnings

* refactor: Allow heap values to stay boxed

* refactor: Move comments above allow directives

* Apply suggestions from code review

Adjust comments slightly

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-04-03 19:24:39 +00:00
Oluwatobi Sofela
fcc7a1be53 clippy: Fix toplevel_ref_arg warning in components/script (#31984)
* clippy: Fix toplevel_ref_arg warnings

* refactor: Make the let binding more idiomatic
2024-04-03 18:54:28 +00:00
Azhar Ismagulova
37cf4cf207 clippy: Fix several warnings in components/script/dom/bindings (#31945)
* clippy: fix several warnings in components/script/dom/bindings

* fix: allow non_canonical_clone_impl in components/script/dom/bindings

* chore: removed unnecessary curly braces

* fix: removed vtable_address_comparisons allow
2024-04-03 17:19:53 +00:00
Azhar Ismagulova
03b752289e clippy: fix warnings in components/compositing (#31987) 2024-04-03 17:19:15 +00:00
dependabot[bot]
3c249b0d5b build(deps): bump syn from 2.0.57 to 2.0.58 (#31988)
Bumps [syn](https://github.com/dtolnay/syn) from 2.0.57 to 2.0.58.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/2.0.57...2.0.58)

---
updated-dependencies:
- dependency-name: syn
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-03 16:55:30 +00:00
Oluwatobi Sofela
b228d7869d clippy: Fix option_map_or_none warnings (#31983) 2024-04-03 11:39:52 +00:00
Ngo Iok Ui (Wu Yu Wei)
66878fb834 Initial internal support for multiple webviews (#31417)
* Add multiple concurrent top-level browsing contexts

Co-authored-by: Delan Azabani <dazabani@igalia.com>

* Rename variables and comments

There are some variable and comments still use browser as names.
This commit renames them to webview.

* Update log message from web view to webview

* Revert offscreen_framebuffer_id rename

* Rename all web view to webview

* Cargo fmt

* Fix viewport/event/clear coordinates when multiview is disabled

* Only deprecate things when multiview is enabled

* Update WebViewManger with shown and invisible sets

Replace visible_webviews and native_window_is_visible with shown_webviews
and invisible_webviews. Add 4 more methods to set them accordingly. The
behavior of is_effectively_visible will return true if the wbview is in
shown_webviews set but not in invisible_webviews.

* Update variant behaviors

* Rename WebViewVisibilityChanged to MarkWebViewInvisible

* Fix unit test by marking id 3 visible again

* Update MarkWebViewInvisible and add UnmarkWebViewInvisible

* Update format and doc comments

* Clean up doc comments

* Address style and naming changes

* Rename UpdateWebView to UpdateFrameTreeForWebView

* constellation: send frame tree unconditionally over focus and feature

* Clarify shown and invisible sets in constellation WebViewManager

* Eliminate forward_to_constellation!()

* Actually remove the unused macro

* Don’t gate compositor changes on multiview feature flag

* Update todo in mouse event dispatch

* Pass all visible webview ids in a single ReadyToPresent message

* Fix compile and lint errors

* servoshell: fix gap between minibrowser toolbar and webview

* Fix failure in /_mozilla/mozilla/window_resizeTo.html

* Fix compile warnings

* Remove stray dbg!()

* Remove confusing “effectively visible” logic (see #31815, #31816)

* Allow embedder to show/hide/raise webviews without ipc

* Update root pipeline only when painting order actually changes

* Stop gating old focus and SetFrameTree behaviour behind Cargo feature

* Use webview_id and WebViewId in webview-related code

* Improve logging of webview-related embedder events

* Allow webview Show and Raise events to optionally hide all others

* Don’t do anything in response to WebViewPaintingOrder

* Remove WebViewPaintingOrder, since its payload is unreliable

* On MoveResizeWebView, only update root pipeline if rect changed

* Rename IOCompositor methods for clarity

* compositor: add event tracing; log webview ops even without ipc

* Add temporary debug logging

* Add more temporary debug logging

* Remove temporary logging in compositor

* Remove temporary debug logging

* Add temporary debug logging, but defer I/O until panic

* Capture a backtrace with each crash log entry

* Proper error handling without panicking in WebViewManager

* Clean up imports in constellation

---------

Co-authored-by: Delan Azabani <dazabani@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-04-03 11:06:28 +00:00
Martin Robinson
18b37e676b script: Reduce the use of unsafe in LayoutDom (#31979)
Remove the use of unsafe code in the layout wrappers of the DOM. The
main change here is that `unsafe_get()` no longer needs to be an unsafe
method, which allows us to transitively remove or reduce unsafe blocks
from callers. The function itself is not renamed, because it's still
a bit dangerous to start removing the layers of abstraction from actual
DOM nodes.

In addition `init_style_and_opaque_layout_data` can be merged into
`initialize_data`, which removes one more unsafe method.

Finally, a "Safety" section is added to some unsafe methods.
2024-04-03 08:41:19 +00:00
Martin Robinson
8aaff61334 compositing: Send entire scene's scroll offsets when sending WebRender display lists (#31892)
WebRender does not preserve spatial tree offsets when updating the
spatial tree. Updating the spatial tree of a pipeline can also
update the spatial tree of child pipelines. This change ensures that
WebRender always gets the scroll offsets of the entire scene when
modifying display lists in a way that may rebuild the spatial tree.

Fixes #31807.
2024-04-03 06:34:16 +00:00
eri
cc082efbfd clippy: Allow too_many_arguments for existing functions (#31974)
* Allow `too_many_arguments` for existing functions

* fix: Surround ASCII with code block in rustdoc
2024-04-02 12:50:45 +00:00
Yashasvi Chaudhary
f613159cba clippy:partialeq_to_none (#31972) 2024-04-02 10:25:06 +00:00
Munish Mummadi
2a517f786b Implementation of baseline-source (#31904)
Updating Stylo and test expectations.
2024-04-02 10:20:13 +00:00
Oluwatobi Sofela
da3991c8f3 clippy: Fix search_is_some warnings (#31971) 2024-04-02 04:01:52 +00:00
dependabot[bot]
71f4c5c916 build(deps): bump syn from 2.0.55 to 2.0.57 (#31970)
Bumps [syn](https://github.com/dtolnay/syn) from 2.0.55 to 2.0.57.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/2.0.55...2.0.57)

---
updated-dependencies:
- dependency-name: syn
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-02 03:49:28 +00:00
dependabot[bot]
4227f2f8a1 build(deps): bump pin-project-lite from 0.2.13 to 0.2.14 (#31969)
Bumps [pin-project-lite](https://github.com/taiki-e/pin-project-lite) from 0.2.13 to 0.2.14.
- [Release notes](https://github.com/taiki-e/pin-project-lite/releases)
- [Changelog](https://github.com/taiki-e/pin-project-lite/blob/main/CHANGELOG.md)
- [Commits](https://github.com/taiki-e/pin-project-lite/compare/v0.2.13...v0.2.14)

---
updated-dependencies:
- dependency-name: pin-project-lite
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-01 17:36:39 +00:00
dependabot[bot]
5008b6c420 build(deps): bump xml-rs from 0.8.19 to 0.8.20 (#31967)
Bumps [xml-rs](https://github.com/kornelski/xml-rs) from 0.8.19 to 0.8.20.
- [Changelog](https://github.com/kornelski/xml-rs/blob/main/Changelog.md)
- [Commits](https://github.com/kornelski/xml-rs/compare/0.8.19...0.8.20)

---
updated-dependencies:
- dependency-name: xml-rs
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-04-01 17:23:34 +00:00
Oluwatobi Sofela
0a40a800fd clippy: Fix filter_next warnings (#31965) 2024-04-01 15:44:07 +00:00
Oluwatobi Sofela
c7b73e1ef4 clippy: Fix let_and_return warnings (#31964) 2024-04-01 15:43:24 +00:00
komuhangi
0da2508e4d clippy: Allow too_many_arguments for all functions (#31962)
This is the start of preventing this in the future.

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-04-01 14:53:33 +00:00
shanehandley
8c1a72f130 Update webidl and implement setter for the files property of a file input (#31934)
The files attribute was previously readonly, but was later updated to allow mutation via input.files = ...

see https://github.com/whatwg/html/issues/2861
2024-04-01 09:12:07 +00:00
Samson
8c25336e9a Override timeout in WebGPU CTS to always be "long" (#31952)
* Long webgpu timeout

* Update expectations

* reupdate expectations 2

* re

* update-webgpu

* Update testing_commands.py with better comment
2024-04-01 08:27:46 +00:00
Rosemary Ajayi
2f5a4354e7 clippy: fixed various clippy warnings in components/scripts (#31960)
* fixed various clippy warnings

* fixed various clippy warnings

* fixed various clippy warnings

* fixed various clippy warnings
2024-04-01 08:25:42 +00:00
Rosemary Ajayi
fd8235e409 clippy: Fix a few problems in components/script (#31961)
* fixed various clippy warnings

* fixed various clippy warnings
2024-04-01 07:18:32 +00:00
Rosemary Ajayi
52a74287fc clippy: Fix a few problems in components/scripts (#31959)
* fixed various clippy warnings

* fixed various clippy warnings
2024-04-01 05:34:48 +00:00
Rosemary Ajayi
00c4d798c9 clippy: Fix a few problems in components/script/dom (#31955)
* fixed various clippy warnings

* fixed various clippy warnings

* fixed various clippy warnings
2024-03-31 23:15:13 +00:00
Ekta Siwach
9401102691 updated components/layout_thread/lib.rs (#31958) 2024-03-31 22:54:04 +00:00
Rosemary Ajayi
673eaa569a clippy: Fix various clippy problems in components/scripts/dom (#31910)
* boxing is unnecessary

* boxing is unnecessary

* boxing is unnecessary

* boxing is unnecessary

* fix

* fix

* fix

* Update globalscope.rs
2024-03-31 20:21:52 +00:00
Ekta Siwach
9243e8cf71 clippy: Fix some issues issues in ports/servoshell (#31939)
* fix warnings in ports/servoshell

* fixed formatting
2024-03-31 20:03:37 +00:00
Rosemary Ajayi
bd287df0d4 fixed various clippy warnings (#31954) 2024-03-31 19:58:37 +00:00
komuhangi
c3360df918 Fixed some clippy warnings in components/script (#31950)
* Fixd some clippy warnings in components/script

* Update node.rs

Removed the  ```# Safety ``` section.

* Update shadow_root.rs

Removed the ``` # Safety ``` section from components/script/layout_dom

* Updated fixes to some clippy warnings in components/script

* Revert "Updated fixes to some clippy warnings in components/script"

This reverts commit 2a37c3dec8.

* Updated fixes to clippy warnings in components/script

* Revert "Updated fixes to clippy warnings in components/script"

This reverts commit 5780dc3a0a.

* Revert "Revert "Updated fixes to some clippy warnings in components/script""

This reverts commit 98c411354a.

* Revert "Updated fixes to some clippy warnings in components/script"

This reverts commit 2a37c3dec8.

* Update shadow_root.rs (Ignore change)

* Update node.rs (Ignore changes)

* Updated fixes to clippy warnings in components/script

* Removed  trailing white space in componets/script/layout_dom_root.rs

* Revert "Removed  trailing white space in componets/script/layout_dom_root.rs"

This reverts commit 1976fd0405.

* Revert "Updated fixes to clippy warnings in components/script"

This reverts commit 5c71b925fb.

* Updated fixes to clippy warnings in components/script including review suggestions.
2024-03-31 19:51:16 +00:00
Servo WPT Sync
8c8d68e415 Update web-platform-tests to revision b'16f18d8135a80e89f2e910ca7548999fa2f7937e' (#31951) 2024-03-31 05:15:08 +00:00
Oriol Brufau
fff9ef87e6 Update Stylo to 2023-10-16 (#31932)
* Update Stylo to 2023-10-16

* Fixup for https://phabricator.services.mozilla.com/D185154

* Fixup for https://phabricator.services.mozilla.com/D188216

* Fixup for https://phabricator.services.mozilla.com/D185677

* Fixup for https://phabricator.services.mozilla.com/D188566

* Fixup for https://phabricator.services.mozilla.com/D188727

* Fixup for https://phabricator.services.mozilla.com/D189475

* Fixup for https://phabricator.services.mozilla.com/D189521

* Fixup for https://phabricator.services.mozilla.com/D188812

* Fixup for https://phabricator.services.mozilla.com/D189484

* Update test expectations
2024-03-30 13:30:13 +00:00
eri
a7ad92d9a3 clippy: Fix from_over_into warnings (#31946) 2024-03-30 11:30:14 +00:00
eri
e3d6b66d5f clippy: Fix match_like_matches warnings (#31947)
* clippy: Fix `match_like_matches` warnings

* Fix link to custom element state in specification.

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-03-30 10:06:26 +00:00
Azhar Ismagulova
92d9081366 fix: remove unused imports in components/script (#31943) 2024-03-29 18:15:13 +00:00
Martin Robinson
b7d089930e layout: Remove LayoutRPC and query layout via the Layout trait (#31937)
Instead of the tricky `LayoutRPC` interface, query layout using the
`Layout` trait. This means that now queries will requires calling layout
and then running the query. During layout an enum is used to indicate
what kind of layout is necessary.

This change also removes the mutex-locked `rw_data` from both layout
threads. It's no longer necessary since layout runs synchronously. The
one downside here is that for resolved style queries, we now have to
create two StyleContexts. One for layout and one for the query itself.
The creation of this context should not be very expensive though.

`LayoutRPC` used to be necessary because layout used to run
asynchronously from script, but that no longer happens. With this
change, it becomes possible to safely pass nodes to layout from script
-- a cleanup that can happen in a followup change.
2024-03-29 16:25:47 +00:00
Oriol Brufau
07391e346b Obey white-space: pre-wrap when intrinsically sizing an IFC (#31930)
It was being treated like `pre`, but it allows wrapping lines.
2024-03-29 15:02:47 +00:00
Ekta Siwach
b0196ad373 clippy: Fix a variety of warnings in components/script/dom (#31894) 2024-03-29 14:43:10 +00:00
Oluwatobi Sofela
4a68243f65 clippy: Fix needless_lifetimes warnings (#31933) 2024-03-29 11:59:07 +00:00
Oluwatobi Sofela
a8976ff00a clippy: Fix option_as_ref_deref warnings (#31936) 2024-03-29 11:52:45 +00:00
Oluwatobi Sofela
c3b6d40f90 clippy: Fix len_zero warnings (#31935) 2024-03-29 10:05:20 +00:00
Munish Mummadi
49c6b2668f wpt: Enable tests in /css/css-inline/baseline-source/ (#31913)
* updated-baseline-source

* updated-for-tests-with-fmt
2024-03-29 09:36:10 +00:00
Azhar Ismagulova
c4739675d8 clippy: Fix needless_borrow warnings in components/script (#31928) 2024-03-29 08:58:22 +00:00
dependabot[bot]
2d5a1cd02e build(deps): bump tokio from 1.36.0 to 1.37.0 (#31926)
Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.36.0 to 1.37.0.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/commits)

---
updated-dependencies:
- dependency-name: tokio
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-29 00:27:05 +00:00
Azhar Ismagulova
4d5bcdc057 fix: remove unused imports (#31929) 2024-03-28 23:20:20 +00:00
Samson
72628303fb Update servo's testharnessreport (#31920)
* Update testharnessreport-servo.js with new props

* Update manifest
2024-03-28 17:33:04 +00:00
dependabot[bot]
32e82d0382 build(deps): bump memchr from 2.7.1 to 2.7.2 (#31925)
Bumps [memchr](https://github.com/BurntSushi/memchr) from 2.7.1 to 2.7.2.
- [Commits](https://github.com/BurntSushi/memchr/compare/2.7.1...2.7.2)

---
updated-dependencies:
- dependency-name: memchr
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-28 17:16:32 +00:00
Ekta Siwach
7ce78f5a74 clippy: Fix some warnings in script/dom (#31915)
* fixed some clippy warnings

* resolved conflict

* updated texttracklist.rs

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-03-28 16:57:25 +00:00
Azhar Ismagulova
9303c90159 clippy: refactor struct literals to use shorthands (#31924) 2024-03-28 16:39:50 +00:00
Azhar Ismagulova
0728378424 clippy: remove unneeded return statements (#31923) 2024-03-28 16:17:47 +00:00
Oluwatobi Sofela
7349ce5b6a clippy: Fix manual_map warnings (#31922) 2024-03-28 15:58:36 +00:00
Ekta Siwach
5d518ca8dc layout: Use Au in ResolvedMargins and CollapsedMargin (#31848)
* change ResolvedMargins to use Au instead of length

* made suggested changes

removed whitespace changes

made suggested changes

* Update components/layout_2020/flexbox/layout.rs

Co-authored-by: Oriol Brufau <obrufau@igalia.com>

* Update components/layout_2020/flow/mod.rs

Co-authored-by: Oriol Brufau <obrufau@igalia.com>

* fixed errors

fixed errors

fixed formatting

fixed errors

* modified changes

made suggested changes

* Update components/layout_2020/fragment_tree/fragment.rs

Co-authored-by: Oriol Brufau <obrufau@igalia.com>

updated components/layout_2020/fragment_tree/fragment.rs

* Update components/layout_2020/flow/mod.rs

Co-authored-by: Oriol Brufau <obrufau@igalia.com>

* Update components/layout_2020/flow/mod.rs

Co-authored-by: Oriol Brufau <obrufau@igalia.com>

* updated changes

updated changes

* unified all the suggested changes here

* fixed formatting

* reverted unnecessary changes

* fixed unnecessary warnings

---------

Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2024-03-28 14:20:14 +00:00
Oluwatobi Sofela
66ad795014 clippy: Fix mem_replace_with_default warnings (#31921) 2024-03-28 13:10:37 +00:00
Rosemary Ajayi
7100465d1a clippy: Fix various clippy warnings in components/scripts/dom/bindings (#31901)
* single-character string constant used as pattern

* singuse of  with literal radix of 16
2024-03-28 11:49:36 +00:00
Rosemary Ajayi
18054d0737 clippy: Fix another set of clippy problems in components/script/dom (#31909)
* a reference to a reference

* length comparison to zero

* length comparison to zero

* length comparison to zero
2024-03-28 11:33:29 +00:00
Rosemary Ajayi
af358f51db clippy: Fix another batch of clippy warnings in components/scripts (#31912)
* boolean can be simplified

* boolean can be simplified

* boolean can be simplified
2024-03-28 11:28:33 +00:00
Rosemary Ajayi
3ddb47e902 clippy: Fix more clippy warnings in components/scripts/dom (#31914)
* refrence to a reference

* refrence to a reference
2024-03-28 11:26:39 +00:00
Rosemary Ajayi
5aae820f6d clippy: Fix a few clippy problems in components/scripts/dom (#31905)
* option_as_ref_deref

* fix
2024-03-28 11:24:39 +00:00
Ekta Siwach
1bc63801e7 fix redundant closures in component/script/dom (#31917)
* fixed unnecessary conversions

* resolved conflicts

* resolved conflicts

* fix redundant closures in component/script/dom

* resolved conflicts

* fixed formatting
2024-03-28 09:06:02 +00:00
Azhar Ismagulova
f183170786 clippy: Fix all errors in components/script (#31911)
* clippy: Fix errors in components/script/dom

* clippy: fixed remaining errors in components/script
2024-03-28 09:03:18 +00:00
Rosemary Ajayi
eccb60e548 deref on an immutable reference (#31899) 2024-03-28 08:57:56 +00:00
Rosemary Ajayi
072b892706 clippy:fix various clippy problems in components/scripts (#31907)
* manual implementation of an assign operation

* manual implementation of an assign operation

* single-character string

* manual cjheck for common ascii range
2024-03-27 22:14:41 +00:00
eri
1c8c287f01 WebIDL: Replace NonNull<JSObject> in xmlhttprequest (#31880)
* WebIDL: Replace `NonNull<JSObject>` in `xmlhttprequest.rs`

* doc: Update functions comments to docstring

* fix: Actually allocate `response_arraybuffer`

* fix: Change step descriptions

* fix: change step numbers
2024-03-27 20:28:51 +00:00
Azhar Ismagulova
ff95ce5abd fix: omitted the let bindings (#31908) 2024-03-27 20:22:51 +00:00
Oluwatobi Sofela
da76ebabe9 clippy: Fix option_map_unit_fn warnings (#31906) 2024-03-27 18:43:56 +00:00
Rosemary Ajayi
a5bcae212a clippy: Fix clippy problems in components/script/dom (#31891)
* deref on an immutable reference

* use of  with literal radix of 10

* fix
2024-03-27 18:36:16 +00:00
dependabot[bot]
b476bbafde build(deps): bump chrono from 0.4.36 to 0.4.37 (#31903)
Bumps [chrono](https://github.com/chronotope/chrono) from 0.4.36 to 0.4.37.
- [Release notes](https://github.com/chronotope/chrono/releases)
- [Changelog](https://github.com/chronotope/chrono/blob/main/CHANGELOG.md)
- [Commits](https://github.com/chronotope/chrono/compare/v0.4.36...v0.4.37)

---
updated-dependencies:
- dependency-name: chrono
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-27 17:36:02 +00:00
dependabot[bot]
ba11475b24 build(deps): bump regex-syntax from 0.8.2 to 0.8.3 (#31902)
Bumps [regex-syntax](https://github.com/rust-lang/regex) from 0.8.2 to 0.8.3.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/regex-syntax-0.8.2...regex-syntax-0.8.3)

---
updated-dependencies:
- dependency-name: regex-syntax
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-27 17:18:19 +00:00
Oriol Brufau
b77ec08ab6 Ignore spaces before atomic inline for the min-content size (#31896)
* Ignore spaces before atomic inline for the min-content size

For the min-content size we should wrap lines wherever is possible,
so wrappable spaces shouldn't increase the length of the line,
they will just be removed or hang at the end of the line.

* Add a clarifying comment

Co-authored-by: Martin Robinson <mrobinson@igalia.com>

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-03-27 16:46:54 +00:00
Oluwatobi Sofela
da518823ff clippy: Fix op_ref warnings (#31900) 2024-03-27 16:45:58 +00:00
Oluwatobi Sofela
773e881971 clippy: Fix unnecessary_lazy_evaluations warnings (#31898) 2024-03-27 16:16:48 +00:00
Martin Robinson
65db6e3b08 wpt: Limit the console output sent to the intermittent tracker (#31895)
This is a speculative fix for #31845. Instead of sending all of the
output to the dashboard, send just the first 1024 characters. This value
can be adjusted in the future if it is too large or too small.

Fixes #31845.
2024-03-27 14:55:00 +00:00
Rosemary Ajayi
bb7778774d clippy:Fix clippy problems in components/scripts/binding (#31893)
* constants have by default a static lifetime

* constants have by default a static lifetime

* unneeded unit expression

* unneeded unit expression

* Box of default value

* casting raw pointers

* casting raw pointers
2024-03-27 12:32:04 +00:00
Aarya Khandelwal
1f31609952 clippy: Fix warnings in components/script/dom/request.rs (#31867) 2024-03-27 12:10:43 +00:00
Martin Robinson
b8c82c1ab0 layout: Allow transforming inline replaced elements (#31833)
This requires passing through information about whether or not the
element in question is replaced when checking to see if it's
transformable and transitively all functions that make decisions about
containing blocks. A new FragmentFlag is added to help track this -- it
will be set on both the replaced items BoxFragment container as well as
the Fragment for the replaced item itself.

Fixes #31806.
2024-03-27 11:57:27 +00:00
Rosemary Ajayi
15cb9dd5fc clippy: Fix various warnings in components/script/dom (#31890)
* redundant field names in struct initialization

* reduthis pattern creates a reference to a reference
2024-03-27 10:19:49 +00:00
komuhangi
29f796a1de clippy: Fix some warnings in components/script/timers.rs (#31878)
* Fixed some clippy warnings in components/script/timers.rs

* Formatted changes in components/script/timers.rs

* Updated changes in components/script/timers.rs

* Updated Default implementation of JsTimers in components/script/timers.rs

* UPDATED DEFAULT METHOD IMPLEMENTATION OF JsTimers in components/script/timers.rs
2024-03-27 10:15:15 +00:00
Samson
9b50a6be77 Update mozjs to include 0172cf4b1e (#31889) 2024-03-27 08:06:16 +00:00
Ekta Siwach
92b557867c clippy: fixed some warnings in components/script (#31888) 2024-03-26 21:25:42 +00:00
Martin Robinson
8dece05980 fonts: Add support for WOFF2 and properly load web fonts from @imports (#31879)
This change also makes two fixes that are necessary to get WOFF2 fonts
working:

1. It adds support for loading web fonts from stylesheets included via
   @import rules.
2. It ensure that when web fonts are loaded synchronusly they invalidate
   the font cache. This led to incorrect font rendering when running
   tests before.

Fixes #31598.
2024-03-26 20:31:52 +00:00
Oluwatobi Sofela
b55d0a2053 clippy: Fix clone-on-copy warnings (#31877) 2024-03-26 19:55:20 +00:00
Frederik Reiter
5f7baf31c2 dom: Abort media element load on decode errors (#31748)
Signed-off-by: Frederik Reiter <hi@frereit.de>
2024-03-26 19:05:37 +00:00
dependabot[bot]
4da9d39cca build(deps): bump autocfg from 1.1.0 to 1.2.0 (#31883)
Bumps [autocfg](https://github.com/cuviper/autocfg) from 1.1.0 to 1.2.0.
- [Commits](https://github.com/cuviper/autocfg/compare/1.1.0...1.2.0)

---
updated-dependencies:
- dependency-name: autocfg
  dependency-type: indirect
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-26 18:52:56 +00:00
dependabot[bot]
2649e4d4b2 build(deps): bump chrono from 0.4.35 to 0.4.36 (#31886)
Bumps [chrono](https://github.com/chronotope/chrono) from 0.4.35 to 0.4.36.
- [Release notes](https://github.com/chronotope/chrono/releases)
- [Changelog](https://github.com/chronotope/chrono/blob/main/CHANGELOG.md)
- [Commits](https://github.com/chronotope/chrono/compare/v0.4.35...v0.4.36)

---
updated-dependencies:
- dependency-name: chrono
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-26 17:45:51 +00:00
dependabot[bot]
a05c0a9a31 build(deps): bump itoa from 1.0.10 to 1.0.11 (#31885)
Bumps [itoa](https://github.com/dtolnay/itoa) from 1.0.10 to 1.0.11.
- [Release notes](https://github.com/dtolnay/itoa/releases)
- [Commits](https://github.com/dtolnay/itoa/compare/1.0.10...1.0.11)

---
updated-dependencies:
- dependency-name: itoa
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-26 17:42:24 +00:00
dependabot[bot]
17e9a534f1 build(deps): bump serde_json from 1.0.114 to 1.0.115 (#31881)
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.114 to 1.0.115.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.114...v1.0.115)

---
updated-dependencies:
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-26 17:21:14 +00:00
Martin Robinson
bf3798bbde layout: More conservatively replace Stylist's Device (#31857)
Instead of replacing Stylist's device on every reflow, only replace it
when the viewport changes. In addition, preserve the root font size from
the previous reflow fixing an issue where `rem` units were not properly
computed between reflows.

This fixes a bug where fonts that are sized using `rem` units change
size on reload.
2024-03-26 15:00:50 +00:00
Oluwatobi Sofela
b71de92569 clippy: Fix single_match warnings (#31876) 2024-03-26 14:01:10 +00:00
Oriol Brufau
d16f259e1d Fix table with rows but no column (#31862)
* Fix table with rows but no column

We weren't generating any fragment for the rows, which meant that JS
APIs like clientWidth would be 0, and also outlines weren't painted.

This aligns Servo with Blink and WebKit. Gecko is broken, it distributes
twice the table height among the rows.

* Feedback

* Avoid conflict with #31874
2024-03-26 12:36:43 +00:00
Ekta Siwach
68b0be6dc7 clippy: Map to an error type instead of using allowing result_unit_err in components/url (#31834)
* clippy: fix warnings in components/url

* Fix code formatting issues in components/url/lib.rs

* Update components/url/lib.rs

Co-authored-by: eri <eri@inventati.org>

* made requested changes

---------

Co-authored-by: Ekta Siwach <ektasiwach@Ektas-MacBook-Air.local>
Co-authored-by: eri <eri@inventati.org>
2024-03-26 12:23:07 +00:00
Martin Robinson
2463017c49 tidy: Make sure to run WPT lints when --all is passed to tidy (#31874)
This also fixes the checked in WPT manifest.
2024-03-26 10:47:16 +00:00
Ekta Siwach
188f3caff1 clippy: fix some warnings in components/script (#31865) 2024-03-26 10:31:22 +00:00
Samson
58f170c97a Update python detection in codegen (#31873)
* Update python detection in codegen

* Update build.rs
2024-03-26 10:14:06 +00:00
Oluwatobi Sofela
f8a2eaea47 clippy: Fix collapsible_else_if warnings (#31853) 2024-03-26 09:15:04 +00:00
Aarya Khandelwal
d814d05539 fixed the unneeded return statement warnings. (#31863) 2024-03-26 08:58:34 +00:00
Aarya Khandelwal
f7669b5238 fixes dereferencing on an immutable reference (#31864) 2024-03-26 08:37:44 +00:00
Frederik Reiter
585e0d69cd minibrowser: Add loading spinner (#31713)
* minibrowser: Rename "history_changed" flag to "need_update"

There are other data points in the toolbar that might need to be
updated. This commit prepares for that by generaliziing the
"history_changed" flag to a more generic "need_update" flag.

Signed-off-by: Frederik Reiter <hi@frereit.de>

* minibrowser: Add spinner to indicate loading status of the webview

Signed-off-by: Frederik Reiter <hi@frereit.de>

---------

Signed-off-by: Frederik Reiter <hi@frereit.de>
2024-03-26 06:56:44 +00:00
dependabot[bot]
5f65a09d3a build(deps): bump bytes from 1.5.0 to 1.6.0 (#31858)
Bumps [bytes](https://github.com/tokio-rs/bytes) from 1.5.0 to 1.6.0.
- [Release notes](https://github.com/tokio-rs/bytes/releases)
- [Changelog](https://github.com/tokio-rs/bytes/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tokio-rs/bytes/compare/v1.5.0...v1.6.0)

---
updated-dependencies:
- dependency-name: bytes
  dependency-type: indirect
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-25 20:43:14 +00:00
dependabot[bot]
f4e9e22310 build(deps): bump rayon from 1.9.0 to 1.10.0 (#31859)
Bumps [rayon](https://github.com/rayon-rs/rayon) from 1.9.0 to 1.10.0.
- [Changelog](https://github.com/rayon-rs/rayon/blob/main/RELEASES.md)
- [Commits](https://github.com/rayon-rs/rayon/compare/rayon-core-v1.9.0...rayon-core-v1.10.0)

---
updated-dependencies:
- dependency-name: rayon
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-25 20:42:16 +00:00
dependabot[bot]
44f39921ce build(deps): bump regex from 1.10.3 to 1.10.4 (#31861)
Bumps [regex](https://github.com/rust-lang/regex) from 1.10.3 to 1.10.4.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.10.3...1.10.4)

---
updated-dependencies:
- dependency-name: regex
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-25 18:07:37 +00:00
dependabot[bot]
0dbd60615c build(deps): bump indexmap from 2.2.5 to 2.2.6 (#31860)
Bumps [indexmap](https://github.com/indexmap-rs/indexmap) from 2.2.5 to 2.2.6.
- [Changelog](https://github.com/indexmap-rs/indexmap/blob/master/RELEASES.md)
- [Commits](https://github.com/indexmap-rs/indexmap/compare/2.2.5...2.2.6)

---
updated-dependencies:
- dependency-name: indexmap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-25 17:59:39 +00:00
dependabot[bot]
e948388779 build(deps): bump syn from 2.0.53 to 2.0.55 (#31856)
Bumps [syn](https://github.com/dtolnay/syn) from 2.0.53 to 2.0.55.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/2.0.53...2.0.55)

---
updated-dependencies:
- dependency-name: syn
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-25 17:36:00 +00:00
dependabot[bot]
5ee4480660 build(deps): bump prettyplease from 0.2.16 to 0.2.17 (#31854)
Bumps [prettyplease](https://github.com/dtolnay/prettyplease) from 0.2.16 to 0.2.17.
- [Release notes](https://github.com/dtolnay/prettyplease/releases)
- [Commits](https://github.com/dtolnay/prettyplease/compare/0.2.16...0.2.17)

---
updated-dependencies:
- dependency-name: prettyplease
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-25 17:28:35 +00:00
dependabot[bot]
5bf9ac3e54 build(deps): bump fastrand from 2.0.1 to 2.0.2 (#31855)
Bumps [fastrand](https://github.com/smol-rs/fastrand) from 2.0.1 to 2.0.2.
- [Release notes](https://github.com/smol-rs/fastrand/releases)
- [Changelog](https://github.com/smol-rs/fastrand/blob/master/CHANGELOG.md)
- [Commits](https://github.com/smol-rs/fastrand/compare/v2.0.1...v2.0.2)

---
updated-dependencies:
- dependency-name: fastrand
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-25 17:27:14 +00:00
Oriol Brufau
e77dc36842 Pick the first or last baseline as appropriate (#31705)
The old logic was always picking the last baseline, but this should only
happen for inline-blocks.

Since replaced elements and flex containers aren't currently setting
their baselines, this is only an improvement for inline-tables.
2024-03-25 16:19:06 +00:00
Oluwatobi Sofela
a53632c0e5 clippy: Fix collapsible_if warnings (#31852) 2024-03-25 13:55:45 +00:00
Rosemary Ajayi
3d10dbae32 clippy: Fix some clippy warnings in components/script (#31843)
* deref on an immutable reference

* fix deref on an immutable reference

* fix deref on an immutable reference
2024-03-25 12:57:35 +00:00
Bastiaan van der Plaat
97144ddf71 script: Add pre element obsolete width attribute support (#31792) 2024-03-25 11:36:48 +00:00
Aarya Khandelwal
bd39e03eeb changed match to 'matches!' (#31850) 2024-03-25 11:28:12 +00:00
eri
9a76dd9325 clippy: Fix remaining warnings in generated code (#31844)
* clippy: fix warnings in generated code

* clippy: fix wrap_panic closure warnings
2024-03-25 11:12:36 +00:00
Ekta Siwach
d8adeb1b44 clippy: Fix some warnings in components/script (#31849)
* clippy: fixed some warnings in components/script

* fixed formatting

* fix formatting
2024-03-25 10:22:21 +00:00
Oriol Brufau
dbe3cb8a3c Don't update row baseline if cell is empty (#31831)
Gecko, Blink and WebKit agree that the if a row only has empty cells,
its baseline should be at the bottom, not at the top.

There isn't interoperability when the cells are just empty-ish, so this
patch takes the simplest approach, aligning with Blink: any out-of-flow
or in-flow content other than collapsed whitespace counts as not empty.
2024-03-25 09:39:02 +00:00
Mukilan Thiyagarajan
c50df5ccbe nix build: replace fetchCargoTarball with importCargoLock (#31825)
[`importCargoLock`][1] allows us to use the existing Cargo.lock
file. This means we no longer need to update the sha256 hash
whenever the dependencies are upgraded. It also integrates
with nix's rustToolchain support via `cargoSetupHooks` and
automatically vendors the dependencies, allowing us to simplify
the logic for `filterlock` derivation.

[1]: https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks/rust.section.md#vendoring-of-dependencies-vendoring-of-dependencies

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-03-25 05:32:55 +00:00
eri
58081579e9 WebIDL: Remove JSObject from Document::NamedGetter (#31841)
* WebIDL: Remove `JSObject` from `Document::NamedGetter`

* fix: update rustdoc comment
2024-03-24 18:04:04 +00:00
Oluwatobi Sofela
1ab38fcd3f clippy: Fix default_constructed_unit_structs warnings in components (#31827)
* clippy: Fix default constructed unit structs warnings

* refactor: Allow default constructed unit structs to avoid gfx build error
2024-03-24 17:24:34 +00:00
Rosemary Ajayi
0a771169b8 fix redundant closure (#31842) 2024-03-23 16:51:41 +00:00
Aarya Khandelwal
566fd475d9 Clippy: Fixed some clippy warnings (#31818)
* Fixed clippy warnings

* made changes for lowercase characters.

* changed is_lowercase() to is_ascii_lowercase()

* added std library function `is_ascii_uppercase()` and `is_ascii_lowercase()`

* made recommended changes
2024-03-23 12:48:49 +00:00
Oluwatobi Sofela
3c05b58221 clippy: Fix explicit_auto_deref warnings in components/script (#31837)
* clippy: Fix explicit auto-deref warnings

* clippy: Fix explicit auto-deref warnings

* refactor: Tidy up code

* refactor: Fix method not found errors
2024-03-23 11:29:20 +00:00
atbrakhi
3fc157338e remove unused code (#31826) 2024-03-23 04:25:52 +00:00
dependabot[bot]
e22b61c935 build(deps): bump libz-sys from 1.1.15 to 1.1.16 (#31829)
Bumps [libz-sys](https://github.com/rust-lang/libz-sys) from 1.1.15 to 1.1.16.
- [Release notes](https://github.com/rust-lang/libz-sys/releases)
- [Commits](https://github.com/rust-lang/libz-sys/compare/1.1.15...1.1.16)

---
updated-dependencies:
- dependency-name: libz-sys
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-22 17:08:31 +00:00
cathiechen
cb275e086c Implement StaticRange (#31809)
* Add DOM interface for AbstractRange

* Add DOM interface for StaticRange

* Update WPT tests for StaticRange-constructor.html

* Fix formatting

* Add AbstractRange & StaticRange in interfaces.html

* rebased the code and fixed the failures

Signed-off-by: Cathie Chen <cathiechen@igalia.com>

* update the expected result in idlharness.window.js.ini file

* Addressed the code review comments

* updae the test result of legacy layout

---------

Signed-off-by: Cathie Chen <cathiechen@igalia.com>
Co-authored-by: Nipun Garg <nipung271@gmail.com>
2024-03-22 15:02:01 +00:00
Oluwatobi Sofela
bae77671f8 clippy: Fix unnecessary_cast warnings in components/script (#31823)
* clippy: Fix unnecessary cast warnings

* clippy: Replace redundant field names with their shorthand alternatives

* clippy: Delete struct pattern dereferencings
2024-03-22 13:48:03 +00:00
Tumuhairwe
3e9b808938 Fix some clippy warnings in components/script/webdriver_handlers.rs (#31784)
* Fixed some clippy warnings in components/script/webdriver_handlers.rs

* Updated fixes for clippy warnings in components/script/webdriver_handlers.rs

* Updated the formatting of components/script/webdriver_handlers.rs

* Updated components/script/webdriver_handler.rs to fix some clippy warnings.
2024-03-22 11:08:07 +00:00
sandeep
77f5175efc removed mutable compile warnings (#31822)
Signed-off-by: Sandeep Pillai <sandeeppillai@Sandeeps-MacBook-Air.local>
Co-authored-by: Sandeep Pillai <sandeeppillai@Sandeeps-MacBook-Air.local>
2024-03-22 09:58:27 +00:00
Jonathan Schwender
99bad9d9b8 Bump fontsan version (#31821)
Fixes a build regression on Nix-OS reported on zulip.
2024-03-22 09:31:52 +00:00
Martin Robinson
34dd38b4cb Replace remutex with parking_lot's ReentrantMutex (#31817)
Many things in Servo depend on `parking_lot`, so we can replace our
homegrown remutex with `parking_lot`'s version.

Fixes #12641.
2024-03-22 08:16:39 +00:00
Delan Azabani
8882507ad0 Rework “visible” to “throttled” in constellation + script + compositor (#31816) 2024-03-22 06:06:28 +00:00
Aarya Khandelwal
9b26dca141 Fixed the .clone() warnings. (#31819) 2024-03-22 05:41:17 +00:00
atbrakhi
95e69fe4ff layout: use Au in BoxFragment (#31794)
* use au in BoxFragement

* review fix
2024-03-22 04:30:39 +00:00
Delan Azabani
0b863de846 Rework “visible” to “throttled” in embedder-to-constellation + jniapi (#31815) 2024-03-21 18:48:17 +00:00
Alex Touchet
49c6f9e463 Update some dependencies (#31814) 2024-03-21 18:17:18 +00:00
Oluwatobi Sofela
3e63f8d6ee clippy: Fix needless borrow warnings (#31813) 2024-03-21 17:48:54 +00:00
Oluwatobi Sofela
694e86ecff clippy: Fix dereferencing a tuple pattern warnings (#31811) 2024-03-21 17:04:18 +00:00
Richard Dushime
b22281d94f Fix WPT reference no_red_3x3_monospace_table-ref.xht (#31802)
* Fix WPT reference no_red_3x3_monospace_table-ref.xht

* wpt Update manifest.json
2024-03-21 17:03:55 +00:00
Martin Robinson
841bd91784 layout: Take into account text-indent for justification (#31777)
This change makes it so that when calculating the space added between
words for justification, text-indent is taken into account.

Fixes #31775.
2024-03-21 15:58:03 +00:00
Martin Robinson
755701f4f6 crown: Do not warn about crown for rustdoc or clippy (#31805)
Fixes #31804.
2024-03-21 15:33:06 +00:00
Jonathan Schwender
32a2b06073 Update fontsan to 0.5.2 (#31810) 2024-03-21 15:00:21 +00:00
eri
8c7e9a15e1 Remove repeated imports from generated code (#31711)
* feat: try to deduplicate imports in codegen

* feat: another attempt

* feat: start testing imports

* feat: clean all global imports

* feat: remove shared imports from CGDescriptor

* feat: remove redundant imports from CGDescriptor

* fix: formatting

* fix: remove libc (base level import)

* feat: roll back named path changes

* feat: last changes and tidy

* experiment: move imports into a separate file

* fix: extra parenthesis

* fix: remove repeated allow statement
2024-03-21 13:38:16 +00:00
Jonathan Schwender
f5c4988dcb Use C-ABI for JNI functions (#31808)
`#[no_mangle]` alone does not imply "C"-ABI,
however the JNI layer will use the C-ABI to call the function.
See also the relevant [clippy-lint](https://rust-lang.github.io/rust-clippy/master/index.html#/no_mangle)
2024-03-21 13:12:31 +00:00
eri
da696b7e57 clippy: fix result_unit_err warnings (#31791)
* clippy: fix `result_unit_err` warnings

* feat: fix result warnings in script

* doc: document `generate_key` return type

Co-authored-by: Martin Robinson <mrobinson@igalia.com>

* feat: add back result to RangeRequestBounds::get_final

Co-authored-by: Martin Robinson <mrobinson@igalia.com>

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-03-21 12:51:45 +00:00
Oriol Brufau
ea62a5e24f Use --locked when building in CI (#31720)
Thus the build will immediately fail if a PR modifies Cargo.toml but
forgets to include the changes in Cargo.lock

This was previously checked by lockfile_changed.sh after building
normally, wasting resources.
2024-03-21 11:54:02 +00:00
Oriol Brufau
ecabdc2583 Don't trim leading whitespace of anonymous table cells (#31803)
A sequence of whitespace shouldn't generate an anonymous table row/cell,
but we can't just throw away the leading whitespace, because afterwards
we may encounter some other content, and then the leading whitespace
should appear in the cell (noticeable with e.g. `white-space: pre`).
2024-03-21 11:48:39 +00:00
Rosemary Ajayi
ce0d456469 clipping: Fix some warnings in components/script/dom (#31799)
* fix clippy websocket errors

* fix clippy window errors

* fix clippy window errors

* fix clippy window errors
2024-03-21 11:46:18 +00:00
Samson
4b408a3724 Update mozjs to use SM 115.9 (#31757) 2024-03-21 09:19:49 +00:00
Aarya Khandelwal
7cdff9dd06 Clippy: Fixed warnings in htmlimageelement.rs (#31800)
* Fixed warnings in htmlimageelement.rs

* making changes for test-tidy to run without errors.
2024-03-21 08:00:24 +00:00
Aarya Khandelwal
da3288dd00 Clippy: Fixed clippy warnings in components/script/dom (#31801)
* fixed clippy warnings in htmlformelement.rs

* Fixed clippy warnings

* Fixed warnings related to matches!

* made changes to compile "test-tidy" successfully
2024-03-21 07:14:12 +00:00
tannal
5c0199b568 Net: fold websocket and http tokio runtime into one (#31771)
* net: use the same tokio runtime in websocket loader

#31648

* readability

* license
2024-03-21 06:13:03 +00:00
Oluwatobi Sofela
2789e98876 clippy: Fix redundant field names warnings (#31793) 2024-03-20 23:05:29 +00:00
dependabot[bot]
f55d1d288e build(deps): bump smallvec from 1.13.1 to 1.13.2 (#31798)
Bumps [smallvec](https://github.com/servo/rust-smallvec) from 1.13.1 to 1.13.2.
- [Release notes](https://github.com/servo/rust-smallvec/releases)
- [Commits](https://github.com/servo/rust-smallvec/compare/v1.13.1...v1.13.2)

---
updated-dependencies:
- dependency-name: smallvec
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-20 23:04:54 +00:00
sandeep
efba769fa3 fixed unused import warning in minibrowser (#31797)
Signed-off-by: Sandeep Pillai <sandeeppillai@Sandeeps-MacBook-Air.local>
Co-authored-by: Sandeep Pillai <sandeeppillai@Sandeeps-MacBook-Air.local>
2024-03-20 21:54:26 +00:00
Samson
63d7af54d1 Ignore stylo crates in dependabot.yml (#31790)
* Ignore stylo crates in dependabot.yml

* Update .github/dependabot.yml

Co-authored-by: Martin Robinson <mrobinson@igalia.com>

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-03-20 20:34:34 +00:00
Rhea-Eve
b3dc5c6958 Attempt using version of Stylo with -x-lang enabled (#31737)
* Attempt using version of Stylo with -x-lang enabled

Signed-off-by: Rhea Karty <rheakarty@gmail.com>

* Added x-lang to initializer list to address failing tests.

Signed-off-by: Rhea Karty <rheakarty@gmail.com>

* Fix formatting (sorry)

Signed-off-by: Rhea Karty <rheakarty@gmail.com>

* Revert changes in Cargo.toml, update Cargo.lock.

Signed-off-by: Rhea Karty <rheakarty@gmail.com>

* Removed .git suffix from Stylo

Signed-off-by: Rhea Karty <rheakarty@gmail.com>

---------

Signed-off-by: Rhea Karty <rheakarty@gmail.com>
2024-03-20 18:52:06 +00:00
Rosemary Ajayi
058319aa0b clippy: Fix some clippy problems in components/script (#31778)
* fix clippy problems in stylesheet

* fix clippy problems in task_manager

* fix clippy problems in task_queue

* fix clippy problems in task_queue

* fix clippy problems in file_reading

* fix clippy problems in dom_manipulation

* fix clippy problems in gamepad

* fix clippy problems in networking

* fix clippy problems in performance

* fix clippy problems in port_message

* fix clippy problems in port_message

* fix clippy problems in timer

* fix clippy problems in stylesheet

* fix clippy problems

* fix clippy problems

* fix clippy problems
2024-03-20 18:41:07 +00:00
dependabot[bot]
3651b650c4 build(deps): bump rustix from 0.38.31 to 0.38.32 (#31788)
Bumps [rustix](https://github.com/bytecodealliance/rustix) from 0.38.31 to 0.38.32.
- [Release notes](https://github.com/bytecodealliance/rustix/releases)
- [Commits](https://github.com/bytecodealliance/rustix/compare/v0.38.31...v0.38.32)

---
updated-dependencies:
- dependency-name: rustix
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-20 18:35:37 +00:00
dependabot[bot]
e16b87db14 build(deps): bump webxr from 614420b to 88fd368 (#31789)
Bumps [webxr](https://github.com/servo/webxr) from `614420b` to `88fd368`.
- [Commits](614420b983...88fd368d1c)

---
updated-dependencies:
- dependency-name: webxr
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-20 17:57:59 +00:00
dependabot[bot]
c546c675a2 build(deps): bump aho-corasick from 1.1.2 to 1.1.3 (#31786)
Bumps [aho-corasick](https://github.com/BurntSushi/aho-corasick) from 1.1.2 to 1.1.3.
- [Commits](https://github.com/BurntSushi/aho-corasick/compare/1.1.2...1.1.3)

---
updated-dependencies:
- dependency-name: aho-corasick
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-20 17:08:31 +00:00
Oluwatobi Sofela
15bf32a4e6 clippy: Fix unneeded return statement warnings (#31776) 2024-03-20 14:11:40 +00:00
Martin Robinson
d63615354c Make Cargo.toml a little friendlier (#31773)
Instead of using a strange number of spaces (5) for the example
override, use a single space. This makes it much easier to undo changes
to this file when switching between overriding a dependency and not
overriding a dependency.

Also switch from depending on `https://github.com/servo/style.git` to
the more common `https://github.com/servo/style`.
2024-03-20 11:51:17 +00:00
Delan Azabani
94d2f2183a servoshell: fix gap between minibrowser toolbar and webview (#31774) 2024-03-20 11:11:51 +00:00
Oluwatobi Sofela
02a0cdd6fa clippy: Fix dereferenced warnings (#31770) 2024-03-20 08:07:22 +00:00
dependabot[bot]
0cf2caba06 build(deps): bump bitflags from 2.4.2 to 2.5.0 (#31761)
Bumps [bitflags](https://github.com/bitflags/bitflags) from 2.4.2 to 2.5.0.
- [Release notes](https://github.com/bitflags/bitflags/releases)
- [Changelog](https://github.com/bitflags/bitflags/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bitflags/bitflags/compare/2.4.2...2.5.0)

---
updated-dependencies:
- dependency-name: bitflags
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-19 23:14:55 +00:00
dependabot[bot]
646fca5c49 build(deps): bump uuid from 1.7.0 to 1.8.0 (#31764)
Bumps [uuid](https://github.com/uuid-rs/uuid) from 1.7.0 to 1.8.0.
- [Release notes](https://github.com/uuid-rs/uuid/releases)
- [Commits](https://github.com/uuid-rs/uuid/compare/1.7.0...1.8.0)

---
updated-dependencies:
- dependency-name: uuid
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-19 23:14:04 +00:00
Tumuhairwe
e3809dfd06 Fix clippy warnings in components/script/textinput.rs (#31769) 2024-03-19 23:13:28 +00:00
Rosemary Ajayi
865f6e621f clippy: Fix clippy Problems in components/scripts (#31759)
* revert cargo

* revert cargo

* fic clippy problems
2024-03-19 22:22:37 +00:00
dependabot[bot]
96e5e776d2 build(deps): bump gstreamer from 0.22.2 to 0.22.3 (#31763)
Bumps gstreamer from 0.22.2 to 0.22.3.

---
updated-dependencies:
- dependency-name: gstreamer
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-19 17:06:32 +00:00
dependabot[bot]
c53e0f9709 build(deps): bump glib from 0.19.2 to 0.19.3 (#31762)
Bumps [glib](https://github.com/gtk-rs/gtk-rs-core) from 0.19.2 to 0.19.3.
- [Release notes](https://github.com/gtk-rs/gtk-rs-core/releases)
- [Changelog](https://github.com/gtk-rs/gtk-rs-core/blob/master/CHANGELOG.md)
- [Commits](https://github.com/gtk-rs/gtk-rs-core/compare/0.19.2...0.19.3)

---
updated-dependencies:
- dependency-name: glib
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-19 17:05:52 +00:00
dependabot[bot]
af612f33bd build(deps): bump git2 from 0.18.2 to 0.18.3 (#31760)
Bumps [git2](https://github.com/rust-lang/git2-rs) from 0.18.2 to 0.18.3.
- [Changelog](https://github.com/rust-lang/git2-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/git2-rs/compare/git2-0.18.2...git2-0.18.3)

---
updated-dependencies:
- dependency-name: git2
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-19 16:55:29 +00:00
Richard Dushime
01ca220f83 clippy: Fix many warnings in components/script (#31717)
* Fix Several clippy warnings

* Fix Build errors

* Fix Unused import

* Fix requested changes

* Fix rustfmt

* Minor fixes

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-03-19 16:05:56 +00:00
Oluwatobi Sofela
676f655647 clippy: Fix dereferenced warning (#31758) 2024-03-19 15:04:43 +00:00
Azhar Ismagulova
d0fcbb0898 rustdoc: fix warnings in components/layout_2020/table (#31738)
* fix: fixed rustdoc warnings caused by private intra-doc links

* fix: fixed private link warning by allowing private intra doc links
2024-03-19 14:51:28 +00:00
Martin Robinson
f175679434 gfx: Derive line-through metrics for fonts on MacOS (#31756)
There is now platform-specific way to get metrics for `line-through` on
MacOS and currently striking through simply does not work. The correct
approach here is likely to first search for these metrics in font tables
and then falling back to deriving them. Searching the font tables is a
larger change, so this change adds the fallback mechanism first. This at
least makes sure that strike through renders at all on Mac.

In a followup change we can add support for getting metrics via HarfBuzz
in a platform-independent way, which is what Gecko does.

Fixes #942.
2024-03-19 13:55:12 +00:00
Oluwatobi Sofela
d3b03a20b5 rustdoc: Fix broken link to FontFace in components/gfx (#31745)
* rustdoc: Fix fontface broken link error

* Correct link to `Font`

* Reduce the diff a bit

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-03-19 13:06:16 +00:00
Oluwatobi Sofela
36d9ab8b28 rustdoc: Convert url text to anchor link (#31755) 2024-03-19 11:48:09 +00:00
Martin Robinson
05d9373bc5 compositor: Handle synchronous messages while shutting down (#31733)
During the shutdown process, various threads (such as the
font cache thread) may be finishing up their work. If those threads make
synchronous requests to the compositor, answer them -- even if the
results will be unused. This is at least enough processing for them to
finish their work and exit cleanly.

This addresses crashes that are sometimes seen at exit, particuarly when
the font cache thread tries to register a font during shutdown.

In addition, this change also removes an unused compositor message.
2024-03-19 11:40:06 +00:00
Martin Robinson
2ec995a56f layout: Enable text-shadow (#31734)
`text-shadow` is enabled for legacy layout, so this just extends support
to the modern layout system.
2024-03-19 10:29:20 +00:00
Martin Robinson
8cf47e6009 bootstrap: Make unknown distro instructions more helpful (#31750)
It doesn't make sense to ask everyone to file a bug if their
distribution is unsupported. We have manual build instructions for some
distributions and we can add instructions for more easily.
2024-03-19 08:43:07 +00:00
Aarya Khandelwal
2a02f94d76 rustdoc: Correct unresolved link to `handle_cell. (#31708) 2024-03-19 08:41:18 +00:00
Ekta Siwach
03c11f7907 rustdoc: Fix some typos in components/layout_2020/table/mod.rs (#31644)
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-03-19 08:23:14 +00:00
Rosemary Ajayi
06a021db55 clippy: Fix some warnings in components/script (#31735)
* fix clippy problems

* fix clippy error

* fix clippy error

* fix clippy error

* fix clippy error

* fix clippy error

* fix clippy errors
2024-03-19 08:01:23 +00:00
dependabot[bot]
291fbce434 build(deps): bump gilrs from 0.10.4 to 0.10.6 (#31740)
Bumps [gilrs](https://gitlab.com/gilrs-project/gilrs) from 0.10.4 to 0.10.6.
- [Commits](https://gitlab.com/gilrs-project/gilrs/compare/v0.10.4...v0.10.6)

---
updated-dependencies:
- dependency-name: gilrs
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-19 05:43:39 +00:00
Samson
c25069161d Add pseudo async Create*PipelineAsync methods (#31695)
* Create fake CreatePipelineAsync

* Update WebGPU CTS

* Update expectations and disable some webgpu tests
2024-03-19 05:39:42 +00:00
dependabot[bot]
228f4fb2fc build(deps): bump syn from 2.0.52 to 2.0.53 (#31743)
Bumps [syn](https://github.com/dtolnay/syn) from 2.0.52 to 2.0.53.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/2.0.52...2.0.53)

---
updated-dependencies:
- dependency-name: syn
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-18 22:36:02 +00:00
dependabot[bot]
d6d903c5a1 build(deps): bump brotli from 3.4.0 to 3.5.0 (#31742)
Bumps [brotli](https://github.com/dropbox/rust-brotli) from 3.4.0 to 3.5.0.
- [Release notes](https://github.com/dropbox/rust-brotli/releases)
- [Commits](https://github.com/dropbox/rust-brotli/commits)

---
updated-dependencies:
- dependency-name: brotli
  dependency-type: indirect
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-18 16:57:45 +00:00
dependabot[bot]
b2d2bfcc5a build(deps): bump new_debug_unreachable from 1.0.4 to 1.0.6 (#31744)
Bumps [new_debug_unreachable](https://github.com/mbrubeck/rust-debug-unreachable) from 1.0.4 to 1.0.6.
- [Commits](https://github.com/mbrubeck/rust-debug-unreachable/compare/v1.0.4...v1.0.6)

---
updated-dependencies:
- dependency-name: new_debug_unreachable
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-18 16:56:26 +00:00
dependabot[bot]
9562c33ff4 build(deps): bump smallbitvec from 2.5.2 to 2.5.3 (#31741)
Bumps [smallbitvec](https://github.com/servo/smallbitvec) from 2.5.2 to 2.5.3.
- [Release notes](https://github.com/servo/smallbitvec/releases)
- [Commits](https://github.com/servo/smallbitvec/compare/v2.5.2...v2.5.3)

---
updated-dependencies:
- dependency-name: smallbitvec
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-18 16:49:20 +00:00
dependabot[bot]
32d6c2e512 build(deps): bump io-kit-sys from 0.4.0 to 0.4.1 (#31739)
Bumps [io-kit-sys](https://github.com/jtakakura/io-kit-rs) from 0.4.0 to 0.4.1.
- [Commits](https://github.com/jtakakura/io-kit-rs/commits)

---
updated-dependencies:
- dependency-name: io-kit-sys
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-18 16:40:36 +00:00
Oriol Brufau
c07484fcb6 Update Stylo to 2023-09-01 (#31609)
* Update Stylo to 2023-09-01

* Fixup for https://phabricator.services.mozilla.com/D184929

* Fixup for https://phabricator.services.mozilla.com/D184526

* Fixup for https://phabricator.services.mozilla.com/D184525

* Fixup for https://phabricator.services.mozilla.com/D185154

* Fixup for https://phabricator.services.mozilla.com/D184685

* Fixup for https://phabricator.services.mozilla.com/D185916

* Fixup for https://phabricator.services.mozilla.com/D185492

* Fixup for https://phabricator.services.mozilla.com/D186626

* Update test expectations
2024-03-18 13:52:40 +00:00
sandeep
94c1f2c992 fonts: Consider Tertiary Ideographic Plane to be CJK (#31670)
* added check for Tertiary Ideographic Plane

* added unit test for is_cjk function

Signed-off-by: Sandeep Pillai <sandeeppillai@Sandeeps-MacBook-Air.local>

* fixed formatting

Signed-off-by: Sandeep Pillai <sandeeppillai@Sandeeps-MacBook-Air.local>

* removed for loop assertions & added TIP chars

Signed-off-by: Sandeep Pillai <sandeeppillai@Sandeeps-MacBook-Air.local>

---------

Signed-off-by: Sandeep Pillai <sandeeppillai@Sandeeps-MacBook-Air.local>
Co-authored-by: Sandeep Pillai <sandeeppillai@Sandeeps-MacBook-Air.local>
2024-03-18 11:45:52 +00:00
Mukilan Thiyagarajan
55bb289b30 android: fix broken rendering in emulators (#31727)
Android's OpenGL emulation layer (goldfish-opengl) has pre-processing
logic that looks for samplers of the type `samplerExternalOES` and
does a simple textual [replacement to change the type][1] to `sampler2D`
before compilation. It also [marks the sampler][2] as 'replaced' so
it can emulate the correct type at runtime.

However, this logic can lead to false positives when the sampler is
declared inside conditional macros. Hence, the sampler's type can be
incorrectly marked as `samplerExternalOES` even though the #if, #ifdef
conditional logic would have declared the type as `sampler2D`.
This seems to be a [known limitation][3].

WebRender (in particular the shared.glsl include) has such conditional
declaration of the texture units used from the shaders.
In particular, the sampler [sColor0 here][4] is declared within ifdefs
to have different types depending on the flags enabled, to allow the
shader to work with different image target kinds.

WebRender also maintain two versions of the compiled shaders in its cache:
  1. An unoptimized version with all the conditional logic preserved
     in the source until the shader is compiled at runtime on Android,
     when the shader is actually used.
  2. Multiple optimized versions for combinations of features required
     These versions are produced during Servo [build][5]. Thus the
     optimized versions eliminate most of the conditional declarations
     at build time.

The bug in Servo with current code is because, [by default][6], WebRender
uses the *unoptimized* versions of the shaders. This means the conditional
GLSL source is evaluated at runtime by the Android emulator and thus ends
up with the incorrect type for the sColor0 sampler unit, which breaks the
[texture sampling in the fragment shader][7], causing it to always return
Vec4(0, 0, 0, 1) and rendering all elements on the page black.

This change forces WebRender to use the *optimized* version as a
workaround - the optimized versions have unconditional code for the
sampler declarations so are not susceptible to the emulator issue.

[1]: https://android.googlesource.com/device/generic/goldfish-opengl/+/refs/tags/android-platform-11.0.0_r40/system/GLESv2_enc/GL2Encoder.cpp#1644
[2]: https://android.googlesource.com/device/generic/goldfish-opengl/+/refs/tags/android-platform-11.0.0_r40/system/GLESv2_enc/GL2Encoder.cpp#1673
[3]: https://android.googlesource.com/device/generic/goldfish-opengl/+/refs/tags/android-platform-11.0.0_r40/system/GLESv2_enc/GL2Encoder.cpp#1571
[4]: b36399019c/webrender/res/shared.glsl (L206)
[5]: b36399019c/webrender/build.rs (L289)
[6]: b36399019c/webrender/src/renderer/init.rs (L214)
[7]: b36399019c/webrender/res/composite.glsl (L189)

Fixes #31726.

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-03-18 10:57:42 +00:00
Rosemary Ajayi
3ac0ab2e4e clippy: Fix some warnings in the script crate (#31719)
* Fix InlineFormatting error

* BoxFrament

* fix clippy error

* clippy:fix clipy errors

* fix clippy errors

* fix clippy errors

* fix clippy errors

* Remove changes to `layout_2020`

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-03-18 10:05:18 +00:00
Mukilan Thiyagarajan
4bca55e27a android: add support for x86_64 images (#31725)
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-03-18 09:44:10 +00:00
Tumuhairwe
b2f2ae61db Updated inconsistent context for crates (#31718) 2024-03-18 08:38:42 +00:00
RustAndMetal
f6a975fc58 clippy: Fix several warnings (#31710)
Signed-off-by: RustAndMetal <111676747+RustAndMetal@users.noreply.github.com>
2024-03-18 08:33:43 +00:00
Rhea-Eve
1ab8fa2895 rustdoc: Fix two warnings in components/layout_2020 (#31712)
* Fix BoxFragment reference.

Signed-off-by: Rhea Karty <rheakarty@gmail.com>

* Fix reference to InlineFormattingContext.

Signed-off-by: Rhea Karty <rheakarty@gmail.com>

* Rewrap lines to avoid long length

* Remove trailing whitesapce

---------

Signed-off-by: Rhea Karty <rheakarty@gmail.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-03-18 08:33:15 +00:00
eri
99ddab43e8 clippy: Fix warnings in generated code (#31721)
* clippy: remove extra static lifetimes in generated code

* clippy: fix return and cast in generated code

* clippy: fix more warnings in codegen

* clippy: fix all errors from generated files
2024-03-17 21:32:47 +00:00
Oriol Brufau
1a46529560 build(deps): bump Stylo from 7dd8840 to 2c775e4 (#31709) 2024-03-17 20:13:05 +00:00
Servo WPT Sync
52c2b1e3a8 Sync WPT with upstream (17-03-2024) (#31715)
* Update raw lags path for WPT import

I forgot to do this in #31616

* Update web-platform-tests to revision b'298d1599dbf6255aea63506daaa1702ff0c4fdc5'

---------

Co-authored-by: Samson <16504129+sagudev@users.noreply.github.com>
2024-03-17 10:51:07 +00:00
Smitty
d2dcb20bea Implement console.count/countReset (#31635)
* Implement console.count/countReset

* Address review comment

Signed-off-by: syvb <me@iter.ca>

---------

Signed-off-by: syvb <me@iter.ca>
2024-03-17 09:50:40 +00:00
Samson
f98975bbbe Update raw lags path for WPT import (#31714)
I forgot to do this in #31616
2024-03-17 09:48:12 +00:00
Tumuhairwe
8cfc6a1898 Updated comment with 'layout_traits' to 'script_layout_interface' (#31707)
* Updated comment with 'layout_traits' to 'script_layout_interface'

* Rewrap text

* Remove trailing whitespace

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-03-15 22:15:14 +00:00
Oriol Brufau
82128d3838 Don't null out the baselines of anonymous tables (#31704) 2024-03-15 20:46:41 +00:00
Richard Dushime
d211cfc978 documentation: Add instructions for creating a shallow clone of the Servo repository (#31697)
* Add support for partial and shallow clones for contributors with limited internet access

* Fix requested changes

* small typo

* Removed Trailing spaces and Fixed req changes

* Small fixes to the new documentation

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-03-15 19:06:02 +00:00
dependabot[bot]
30db7a9a5f build(deps): bump tokio-test from 0.4.3 to 0.4.4 (#31703)
Bumps [tokio-test](https://github.com/tokio-rs/tokio) from 0.4.3 to 0.4.4.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-test-0.4.3...tokio-test-0.4.4)

---
updated-dependencies:
- dependency-name: tokio-test
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-15 17:28:20 +00:00
Richard Dushime
8a6481c341 clippy: Fix warnings in components/script (#31700)
* Fix warnings: immediate dereferencing of references and unneeded  statement

* Fix warnings in Components/script
2024-03-15 17:27:50 +00:00
Martin Robinson
47a4ce467f layout: Add basic support for getClientRects() queries (#31696)
This adds basic support for `getClientRects()` by sharing code with the
implementation of `getBoundingClientRect()`. In addition to sharing
code, it also shares all of the bugs. Primarily, scrolilng positions are
not taken into account when return boundary rectangles.
2024-03-15 17:20:47 +00:00
dependabot[bot]
3f3820b3dc build(deps): bump tokio-stream from 0.1.14 to 0.1.15 (#31702)
Bumps [tokio-stream](https://github.com/tokio-rs/tokio) from 0.1.14 to 0.1.15.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/compare/tokio-stream-0.1.14...tokio-stream-0.1.15)

---
updated-dependencies:
- dependency-name: tokio-stream
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-15 17:12:15 +00:00
dependabot[bot]
94b68ccb0c build(deps): bump h2 from 0.3.24 to 0.3.25 (#31701)
Bumps [h2](https://github.com/hyperium/h2) from 0.3.24 to 0.3.25.
- [Release notes](https://github.com/hyperium/h2/releases)
- [Changelog](https://github.com/hyperium/h2/blob/v0.3.25/CHANGELOG.md)
- [Commits](https://github.com/hyperium/h2/compare/v0.3.24...v0.3.25)

---
updated-dependencies:
- dependency-name: h2
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-15 17:12:05 +00:00
Tumuhairwe
4cd3c056e5 rustdoc: Fix errors in components and ports (#31654)
* Fixed warnings in components/gfx/text/shaping/harfbuzz-rs  components/layout_2020/fragment_tree  ports/servoshell/minibrowser.rs

* Fixed warnings in components/gfx/text/shaping/harfbuzz-rs  components/layout_2020/fragment_tree  ports/servoshell/minibrowser.rs.

* Update minibrowser.rs

Returned "if" back to "iff"

* Update minibrowser.rs

Changed ```BrowserManager``` to ```WebViewManager```

* Update fragment.rs

Changed ```[SequentialLayoutState]``` to ```[crate::flow::float::SequentialLayoutState]```

* Update fragment.rs

Balanced the length of paragraph lines in fragment.rs

* Fix tidy errors

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-03-15 16:24:11 +00:00
Oriol Brufau
39f660f520 Allow pre-wrap whitespace to hang at the end of the line (#31681)
* Allow pre-wrap whitespace to hang at the end of the line

* Use bitflags
2024-03-15 16:12:41 +00:00
Manuel Rego Casasnovas
ac24cd6139 Update new issue URL in SECURITY.md (#31698)
* Update new issue URL in SECURITY.md

Update URL for new issue so it uses the security template: https://github.com/servo/servo/issues/new?template=security-report.md

* Link to https://github.com/servo/servo/security/advisories/new instead
2024-03-15 15:03:49 +00:00
Oriol Brufau
99c14c83ed Obey white-space when intrinsically sizing an IFC (#31660)
The old logic was assuming that all whitespace was a break opportunity,
and that no newlines would be preserved.

Note that text shaping considers the advance of a newline to be the same
as a space. This was problematic because if we have a segment with a
preserved space and newline, only the advance of the space should
contrinute to the size of the block container. Therefore, I'm changing
the breaker logic in other to have newline characters in their own
segment.

Then glyph_run_is_whitespace_ending_with_preserved_newline can just be
renamed to glyph_run_is_preserved_newline.

This patch is still not perfect because it doesn't check allow_wrap(),
so `nowrap` is treated like `normal`, and `pre-wrap` like `pre`.
2024-03-15 12:45:23 +00:00
Manuel Rego Casasnovas
74b5f798cd Add issue templates (#31693)
* Add issue templates

This will allow to label new issues when filled depending on their type.

* Update .github/ISSUE_TEMPLATE/bug_report.md

Co-authored-by: Martin Robinson <mrobinson@igalia.com>

* Update .github/ISSUE_TEMPLATE/bug_report.md

Co-authored-by: Martin Robinson <mrobinson@igalia.com>

* Update .github/ISSUE_TEMPLATE/bug_report.md

Co-authored-by: Martin Robinson <mrobinson@igalia.com>

* Update .github/ISSUE_TEMPLATE/feature_request.md

Co-authored-by: Martin Robinson <mrobinson@igalia.com>

* Update .github/ISSUE_TEMPLATE/feature_request.md

Co-authored-by: Martin Robinson <mrobinson@igalia.com>

* Update .github/ISSUE_TEMPLATE/feature_request.md

Co-authored-by: Martin Robinson <mrobinson@igalia.com>

* Update .github/ISSUE_TEMPLATE/security-report.md

Co-authored-by: Martin Robinson <mrobinson@igalia.com>

* Update .github/ISSUE_TEMPLATE/security-report.md

Co-authored-by: Martin Robinson <mrobinson@igalia.com>

* Update .github/ISSUE_TEMPLATE/security-report.md

Co-authored-by: Martin Robinson <mrobinson@igalia.com>

* Fix typo

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-03-15 12:18:47 +00:00
Martin Robinson
a8791ddcbc clippy: Fix remaining warnings in gfx for MacOS (#31669) 2024-03-15 12:14:36 +00:00
eri
cb3ae70340 Add RUSTC env to clippy command (#31694)
* python: add RUSTC env to clippy command

* fix: pass env explicitly
2024-03-15 11:32:43 +00:00
Samson
3fdbde94cf Escaped reporting (#31691) 2024-03-15 10:58:42 +00:00
Munish Mummadi
55250dd8a6 Fix typo: changed seperator to separator (#31685) 2024-03-15 09:42:32 +00:00
Delan Azabani
884d024957 Add gstreamer plugins good/ugly for better codec support (#31687)
* NixOS: add gst-plugins-{good,ugly} for better codec support

* Add gstreamer plugins good/ugly to all other package lists
2024-03-15 09:05:26 +00:00
Richard Dushime
68b82e6d61 fonts: Add Noto Sans CJK fonts to the Linux fallback list (#31668)
* Add Noto Sans CJK fonts to the fallback list

* Fix test-tidy errors
2024-03-15 05:03:22 +00:00
Oriol Brufau
bc4f1c217d Implement HTMLStyleElement.disabled attribute (#31682)
https://html.spec.whatwg.org/multipage/#dom-style-disabled
2024-03-14 23:48:29 +00:00
Martin Robinson
ad37a54f59 dependencies: Upgrade to WebRender 0.64 (#31486)
This brings the version of WebRender used in Servo up-to-date with Gecko
upstream. The big change here is that HiDPI is no longer handled via
WebRender. Instead this happens via a scale applied to the root layer in
the compositor. In addition to this change, various changes are made to
Servo to adapt to the new WebRender API.

Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-03-14 17:40:54 +00:00
dependabot[bot]
4597aeae5f build(deps): bump smallbitvec from 2.5.1 to 2.5.2 (#31674)
Bumps [smallbitvec](https://github.com/servo/smallbitvec) from 2.5.1 to 2.5.2.
- [Release notes](https://github.com/servo/smallbitvec/releases)
- [Commits](https://github.com/servo/smallbitvec/compare/v2.5.1...v2.5.2)

---
updated-dependencies:
- dependency-name: smallbitvec
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-14 16:56:57 +00:00
dependabot[bot]
2afc117c44 build(deps): bump system-deps from 6.2.0 to 6.2.1 (#31672)
Bumps [system-deps](https://github.com/gdesmott/system-deps) from 6.2.0 to 6.2.1.
- [Release notes](https://github.com/gdesmott/system-deps/releases)
- [Changelog](https://github.com/gdesmott/system-deps/blob/main/CHANGELOG.md)
- [Commits](https://github.com/gdesmott/system-deps/compare/system-deps@6.2.0...v6.2.1)

---
updated-dependencies:
- dependency-name: system-deps
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-14 16:53:00 +00:00
Delan Azabani
ed99128132 constellation: allow event tracing to be configured with RUST_LOG (#31659) 2024-03-14 12:28:36 +00:00
Oriol Brufau
b30b79a93a Cleanup UA styles for anonymous table rows and cells (#31661)
These properties were being set to their initial value, this wasn't
needed because they are non-inherited properties and there isn't
anything else setting them.
2024-03-14 11:53:27 +00:00
Martin Robinson
e5fbb3d487 fonts: Add FontIdentifier and LocalFontIdentifier (#31658)
Instead of using a simple `Atom` to identify a local font, use a data
structure. This allows us to carry more information necessary to
identify a local font (such as a path on MacOS). We need this for the
new version of WebRender, as fonts on MacOS now require a path.

This has a lot of benefits:
 1. We can avoid loading fonts without paths on MacOS, which should
    avoid a lot of problems with flakiness and ensure we always load the
    same font for a given identifier.
 2. This clarifies the difference between web fonts and local fonts,
    though there is more work to do here.
 3. This avoid a *lot* of font shenanigans, such as trying to work
    backwards from the name of the font to the path of the font we
    actually matched. In general, we can remove a lot of code trying to
    accomplish these shenanigans.
 4. Getting the font bytes always returns an `Arc` now avoiding an extra
    full font copy in the case of Canvas.
2024-03-14 11:31:00 +00:00
Ngo Iok Ui (Wu Yu Wei)
b1debf2068 fix: missing thread name when spawning (#31656)
* Add missing thread name when spawning

* Update namings
2024-03-14 10:40:58 +00:00
Martin Robinson
78fe461ff2 layout: Properly parent table-row and table-row-group (#31619)
Put table cell content fragments into a hieararchy of fragments that
include their table row and table row group fragments. This ensures that
things like relative positioning and transforms set on rows and row
groups properly affect cells and cell content.

Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2024-03-14 10:33:42 +00:00
Oriol Brufau
0e78c8114b Allow finishing anonymous inline-table at the end of inline elements (#31650)
This avoids inserting it outside of its parent.
2024-03-14 09:58:00 +00:00
Martin Robinson
871a9bf677 layout: IFCs should not always be marked as containing floats (#31641)
Marking all IFCs as containing floats shouldn't change layout results,
but does prevent parallel layout in some cases. This change fixes an
issue where we were marking all IFCs as containing floats.

Fixes #31540.
2024-03-14 09:55:01 +00:00
Delan Azabani
eaa800c8dd servoshell: allow event tracing to be configured with RUST_LOG (#31657)
* servoshell: allow event tracing to be configured with RUST_LOG

* Move docs to same file as target prefixes

* Avoid requiring macro callers to use LogTarget trait

* Clean up macro call in app.rs

* Rename macros to reflect value types
2024-03-14 09:27:18 +00:00
Oriol Brufau
f3a73dbed3 End ongoing IFC when inserting anonymous block-level table (#31606)
So that the table appears after preceding inline-level contents.
Fixes #31603.
2024-03-13 21:03:06 +00:00
Aarya Khandelwal
525fc58ed9 rustdoc: Fix warnings in components/layout_2020 (#31647)
* Added a : to make it a clickable link

* changed block_offset_of_parent to parent_offset , to make it a clickable link.
2024-03-13 18:16:31 +00:00
Oluwatobi Sofela
8cbad332c3 rusdoc: Fix idl warning in components/script/dom/bindings (#31643)
* rusdoc: Add valid domstring link

* rustdoc: Replace unused idl link ref
2024-03-13 17:59:27 +00:00
dependabot[bot]
0779af71a0 build(deps): bump bytemuck from 1.14.3 to 1.15.0 (#31645)
Bumps [bytemuck](https://github.com/Lokathor/bytemuck) from 1.14.3 to 1.15.0.
- [Changelog](https://github.com/Lokathor/bytemuck/blob/main/changelog.md)
- [Commits](https://github.com/Lokathor/bytemuck/compare/v1.14.3...v1.15.0)

---
updated-dependencies:
- dependency-name: bytemuck
  dependency-type: indirect
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-13 17:14:15 +00:00
Aarya Khandelwal
f5a1879bac rustdoc: Fix warnings in components/layout_2020 (#31640)
* Changed LineItems to LineItem to make it a clickable link

* No variant named Anonymous is present in Fragment.
2024-03-13 13:50:26 +00:00
Martin Robinson
38db1a5ce9 rustdoc: Add some basic Safety sections to unsafe functions (#31639) 2024-03-13 10:44:59 +00:00
Oriol Brufau
0860deba05 Fix vertical alignment at the root of an IFC (#31636)
At the root of an inline formatting context, we used its vertical-align
in order to compute the strut. That was wrong, since vertical-align
on a block container shouldn't affect the contents, it should only
affect the alignment of the block container (if it's inline-level)
within the parent IFC.

This was only working well if the block container was block-level, since
effective_vertical_align_for_inline_layout returned `baseline` for
block-level boxes.

Instead of the outer display type, this patch changes the logic to check
whether we are at the root of the IFC.
2024-03-13 10:39:01 +00:00
eri
63527f56ca clippy: Fix warnings in components/net (#31626)
* clippy: fix warnings in `components/net`

* fix: review comments
2024-03-13 09:40:04 +00:00
Azhar Ismagulova
5ea0531775 rustdoc: Fix warnings in components/script/dom (#31632)
* fix: fixed warnings in components/script/dom

* fix: resolved comment by setting explicit link to HTMLConstructor

* fix: changed the format of WHATWG link

* Fix line breaking

* Remove trailing white space

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-03-13 09:34:42 +00:00
Martin Robinson
716f4a006d layout: Propagate overflow values from <body> to root element (#31618)
The specification gives instructions for how these values should be
propagated. The other big changs here is that they aren't applied to the
`<body>`.

 Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2024-03-13 09:17:09 +00:00
eri
03d64d0675 clippy: Fix assorted warnings in components/ (#31628)
* clippy: fix assorted warnings in `components/`

* fix: new and default

* fix: review comments
2024-03-13 08:31:58 +00:00
atbrakhi
0fda14263a layout: make margin in pbm use app unit (#31621)
* make margin in pbm use app unit

* Simplification

* Consistently resolve inline margins as Au, like block margins

---------

Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2024-03-13 03:15:20 +00:00
Manuel Rego Casasnovas
0b4b544910 Update FUNDING.yml (#31633)
Add GitHub sponsors
2024-03-13 02:40:54 +00:00
dependabot[bot]
5febb30313 build(deps): bump proc-macro2 from 1.0.78 to 1.0.79 (#31631)
Bumps [proc-macro2](https://github.com/dtolnay/proc-macro2) from 1.0.78 to 1.0.79.
- [Release notes](https://github.com/dtolnay/proc-macro2/releases)
- [Commits](https://github.com/dtolnay/proc-macro2/compare/1.0.78...1.0.79)

---
updated-dependencies:
- dependency-name: proc-macro2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-12 17:51:23 +00:00
dependabot[bot]
ed20f4f11a build(deps): bump anyhow from 1.0.80 to 1.0.81 (#31630)
Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.80 to 1.0.81.
- [Release notes](https://github.com/dtolnay/anyhow/releases)
- [Commits](https://github.com/dtolnay/anyhow/compare/1.0.80...1.0.81)

---
updated-dependencies:
- dependency-name: anyhow
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-12 17:41:11 +00:00
dependabot[bot]
67bf316093 build(deps): bump thiserror from 1.0.57 to 1.0.58 (#31629)
Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.57 to 1.0.58.
- [Release notes](https://github.com/dtolnay/thiserror/releases)
- [Commits](https://github.com/dtolnay/thiserror/compare/1.0.57...1.0.58)

---
updated-dependencies:
- dependency-name: thiserror
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-12 17:29:12 +00:00
eri
21939c2ba8 clippy: Fix warnings in components/shared (#31627)
* clippy: fix warnings in `components/shared`

* fix: formatting derive

* fix: rename new to default
2024-03-12 17:22:05 +00:00
Mucha Naibei
4efebf1e62 Fix clippy warnings in components/third_party (#31623) 2024-03-12 17:17:23 +00:00
Oluwatobi Sofela
59d89c8267 rustdoc: Fix StackingContextFragment error (#31625) 2024-03-12 16:25:26 +00:00
Samson
da609076c3 Add wpt-report output & continue if filtering failed (#31616)
* Add wpt-report artifact

* Merge logs (filtered) are last so we still get other logs merged

* fixup

* it's wptreport.json

* wptreport in full artifact

* Apply suggestions from code review

Co-authored-by: Martin Robinson <mrobinson@igalia.com>

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-03-12 13:45:36 +00:00
Daniel Adams
48fa77df67 Gamepad: Align closer to spec and implement missing slots (#31385)
* Implement missing gamepad slots, align to spec more

- Fixes TODO's from initial gamepad implementation
- Adds some missing spec steps

* Only handle gamepad events when pref is enabled

* Return empty list in getGamepads if document not active

* ./mach fmt

* Update getGamepads to return an array instead of GamepadList

* Add spec link for [[exposed]] slot

* Remove failing test expectations for not-fully-active

* A few fixes

- Change should_notify to has_gesture
- Add spec links and TODO to navigator
- Remove unneeded clone from GamepadList::list
- Move gamepadconnected event firing into has_gesture block

* Use queue_with_canceller for tasks and add expects

* Explicitly check for gamepad user gesture

* Move user gesture check into separate function

* Change contains_user_gesture to be a gamepad function

* mach fmt

* Change axis/button threshold constants to be private to module
2024-03-12 12:32:30 +00:00
Manuel Rego Casasnovas
31a50feb4a Add CoC and Security Policy (#31622)
CoC is the same than we have at <https://servo.org/coc/>.

Security Policy is based on the agreement on the last TSC meeting:
https://github.com/servo/project/blob/main/governance/tsc/tsc-2024-02-26.md#security-policy
2024-03-12 11:24:01 +00:00
dependabot[bot]
0ef07866a2 build(deps): bump bytemuck_derive from 1.5.0 to 1.6.0 (#31620)
Bumps [bytemuck_derive](https://github.com/Lokathor/bytemuck) from 1.5.0 to 1.6.0.
- [Changelog](https://github.com/Lokathor/bytemuck/blob/main/changelog.md)
- [Commits](https://github.com/Lokathor/bytemuck/compare/bytemuck_derive-v1.5.0...bytemuck_derive-v1.6.0)

---
updated-dependencies:
- dependency-name: bytemuck_derive
  dependency-type: indirect
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-12 06:49:39 +00:00
Mucha Naibei
d1fd8d55ab Fix rustdoc errors in components/script/dom (#31617)
* Fix rustdoc errors in components/script/dom

* Revert if to iff in audiobuffer.rs
2024-03-11 22:04:05 +00:00
Martin Robinson
45344dca2b font_cache: Handle filtering @font-face rules in Servo (#31601)
Instead of letting Stylo filter `@font-face` rules, handle this
filtering in Servo. It doesn't make sense that Stylo knows about what
fonts Servo supports. This also cleans up a bit the way that this is
handled, giving an entire stylesheet of rules to the font cache to
process instead of letting each layout thread walk the rules. This
brings more of the font-related code into the FontCacheThread itself.

This is the first step toward adding WOFF2 support and fixing various
web font related bugs.
2024-03-11 14:47:52 +00:00
eri
b03411f567 clippy: Fix warnings in components/layout_2020 (#31611)
* clippy: fix warnings in components/layout_2020

* fix: review comments
2024-03-11 14:24:33 +00:00
Martin Robinson
1d1f239ecc layout: Enable rendering of conical-gradient and repeating-conical-gradient (#31597)
This also ignores a clippy warning for a new function (and a similar
existing one), until this code can be refactored to use temporary Rust
strutures to carry display list building state.

There are a few new test failures here:

 - FAIL [expected PASS] /css/css-images/image-set/image-set-conic-gradient-rendering.html
 - FAIL [expected PASS] /css/css-images/image-set/image-set-repeating-conic-gradient-rendering.html

 These fail because Servo does not yet support `image-set()`.

 - FAIL [expected PASS] /css/filter-effects/filter-function/filter-function-conic-gradient.html
 - FAIL [expected PASS] /css/filter-effects/filter-function/filter-function-repeating-conic-gradient.html

 These fail because Servo does not support the very early filter effects
 specification.

 - FAIL [expected PASS] /html/canvas/element/manual/fill-and-stroke-styles/conic-gradient-rotation.html
 - FAIL [expected PASS] /html/canvas/element/manual/fill-and-stroke-styles/conic-gradient.html

 These fail because this change only adds support for CSS conical
 gradients. Another set of changes will be necessary to support this for
 Canvas.
2024-03-11 12:58:44 +00:00
Oriol Brufau
de7b9bed85 Take spaces into account in the max-content size of an IFC (#31613)
They were only considered in min-content sizes.
Also avoid some pointless conversions from Au to Length.

Fixes #31605.
2024-03-11 12:01:53 +00:00
eri
a6e25d555b clippy: Fix warnings in components/layout (#31612)
* clippy: fix warnings in components/layout

* fix: formatting
2024-03-11 10:24:36 +00:00
eri
7f1ef4c7fe clippy: Fix warnings in components/constellation (#31610)
* clippy: fix warnings in components/constellation

* fix: review comments
2024-03-11 10:22:28 +00:00
Samson
11c16adcd1 Use libc::malloc_size on apple (#31602)
* Use libc::malloc_size on apple

* Unify malloc_usable_size under *mut _
2024-03-11 07:58:32 +00:00
eri
af3583ade8 fix: unused mem import (#31608) 2024-03-10 20:20:42 +00:00
Mucha Naibei
0bc685ed97 Fix more clippy warnings in components/shared/net (#31548)
* Fix clippy warnings in components/shared

* Fix build error

* Fixes in order to solve some merge issues

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-03-10 17:47:38 +00:00
eri
67b277c992 clippy: fix warnings in components/net (#31564)
* clippy: fix some warnings in components/net

* fix: review comments

* fix: tidy
2024-03-10 15:34:16 +00:00
Samson
099bb0fa19 Use get_desired_proto in htmlconstructor (#31600)
* Use get_desired_proto in htmlconstructor

* Update expectations
2024-03-10 14:44:25 +00:00
Samson
f44cefa816 Add rust-lldb to mozdebug (#31580)
* Add rust-lldb to mozdebug

* Export as patch

* patches
2024-03-10 07:12:20 +00:00
Servo WPT Sync
60e4c1adb4 Update web-platform-tests to revision b'd9a5cc25fc5f520bde022cee67e9e6a6f0b588f9' (#31599) 2024-03-10 05:11:24 +00:00
Martin Robinson
9dff1fecfc wpt: Start running the WOFF2 tests (#31595)
This is the first step implementing WOFF2 font support in Servo.
2024-03-09 13:29:00 +00:00
Oriol Brufau
fddc7a1390 Align table cell measures in the block axis to Gecko/Blink/WebKit (#31596) 2024-03-09 12:59:57 +00:00
Martin Robinson
1f23ec2b27 layout: Do not inherit node and fragment flags in anonymous boxes (#31586)
This doesn't really have observable behavior right now, as much as I
tried to trigger some kind of bug. On the other hand, it's just wrong
and is very obvious when you dump the Fragment tree. If you create a
`display: table-cell` that is a child of the `<body>` all parts of the
anonymous table are flagged as if they are the `<body>` element.
2024-03-09 09:13:19 +00:00
Martin Robinson
55f908653f compositor: Remove the is_running_problem_test setting (#31589)
These tests don't seem to time out any longer and this mechanism is
probably better served by some sort of adjustment to `RUST_LOG` in the
WPT harness.
2024-03-09 02:29:43 +00:00
Azhar Ismagulova
48f5ee828c fix: resolved warning related to deprecated method chrono::NaiveDateTime::from_timestamp_opt (#31593) 2024-03-08 23:35:46 +00:00
Wepngong Maureen
0f4522c360 Fixed unresolved links by appropriately linking to parent (#31588)
Signed-off-by: Wepngong Maureen <maureenwepngong@gmail.com>
2024-03-08 19:53:44 +00:00
Wepngong Maureen
f64409dbfb Fix rustdoc warnings in components/layout 2020/positioned.rs (#31592)
* fixed typo in PositioningContext

Signed-off-by: Wepngong Maureen <maureenwepngong@gmail.com>

* fixed unresolved link to unresolved link to adjust_static_position_of_hoisted_fragments function

Signed-off-by: Wepngong Maureen <maureenwepngong@gmail.com>

* fixed unresolved link to unresolved link to len() function of PositioningContext

Signed-off-by: Wepngong Maureen <maureenwepngong@gmail.com>

---------

Signed-off-by: Wepngong Maureen <maureenwepngong@gmail.com>
2024-03-08 18:00:45 +00:00
Azhar Ismagulova
0768bba5b9 fix: resolved warnings related to deprecated method chrono::NaiveDateTime::timestamp_millis (#31584) 2024-03-08 16:47:09 +00:00
sandeep
81e6bd962b Fix rustdoc warnings in components/layout_2020 (#31587)
* fix rustdoc warnings in components/layout_2020

Signed-off-by: Sandeep Pillai <sandeeppillai@Sandeeps-MacBook-Air.local>

* made suggested changes

Signed-off-by: Sandeep Pillai <sandeeppillai@Sandeeps-MacBook-Air.local>

---------

Signed-off-by: Sandeep Pillai <sandeeppillai@Sandeeps-MacBook-Air.local>
Co-authored-by: Sandeep Pillai <sandeeppillai@Sandeeps-MacBook-Air.local>
2024-03-08 15:51:18 +00:00
eri
48f9db9bc5 Make image decoding thread pool the size of the system's CPUs (#31585) 2024-03-08 15:31:17 +00:00
eri
43f44965cd clippy: fix warnings in components/shared (#31565)
* clippy: fix some warnings in components/shared

* fix: unit tests

* fix: review comments
2024-03-08 15:28:19 +00:00
eri
3a5ca785d3 clippy: fix warnings in various modules in components (#31568)
* clippy: fix warnings in various modules in components

* fix: unit tests

* fix: build on android

* fix: all samplers use new_boxed
2024-03-08 14:28:04 +00:00
Josh Matthews
19f1f2a8f4 Extract generated finalizers into generic helper functions. (#31569) 2024-03-08 14:15:26 +00:00
Okhuomon Ajayi
0327d4638b Adjust the language used in some of the documentation (#31583)
* fixed a typo in the Android setup command

* Fix typo in documentation for command-line arguments

* Fix style and formatting issues in the Shell Scripts section of the documentation

* Update style.md

* Fixed various  inconsistencies

* Fixed various inconsistencies

* Update webxr.md

* Update style.md

* Update COMMAND_LINE_ARGS.md

* Update README.md

Co-authored-by: Martin Robinson <mrobinson@igalia.com>

* Update docs/COMMAND_LINE_ARGS.md

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-03-08 14:11:28 +00:00
Martin Robinson
7e8a1503ba layout: Add documentation about table layout (#31535)
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2024-03-08 12:57:23 +00:00
Aarya Khandelwal
dd6c929cc6 Fix rustdoc errors in components/shared (#31582)
* Fixed error in documentation in components>shared>embedder>lib.rs

* fixed documentation warning in compoenents>shared>net>request.rs

* Fixed the documentation (URL issue) in components>shared>script>lib.rs
2024-03-08 12:28:06 +00:00
Oriol Brufau
6b5a5147f8 Obey table cell's box-sizing (#31536)
Instead of assuming `box-sizing: content-box`.
2024-03-08 12:07:42 +00:00
Martin Robinson
49ae9bb442 layout: Fix the pseudo for anonymous tables (#31578)
Anonymous tables should not use legacy pseudos, as the legacy layout
engine had them inherit lots of random properites that lead to bad
layout in the new layout engine.

Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2024-03-08 10:32:51 +00:00
Azhar Ismagulova
a5a0e1cb3c Fix inheritance.sub.html WPT to work on Servo (#31534) 2024-03-08 10:13:39 +00:00
zawz
0748579803 Fix clippy warnings in components/shared/net/request.rs (#31551)
* Fix clippy warnings in components/shared/net/request.rs

Signed-off-by: mateoferon <mateo.feron@elipce.com>

* fixup! Fix clippy warnings in components/shared/net/request.rs

---------

Signed-off-by: mateoferon <mateo.feron@elipce.com>
2024-03-08 09:37:18 +00:00
Munish Mummadi
52c4f57085 Update phf_codegen and phf_shared to 0.11 (#31537)
* Update phf_codegen and phf_shared to 0.11

* Updated the Cargo.lock With ./mach build
2024-03-08 07:25:12 +00:00
eri
5c4f8cf0df clippy: fix some warnings in components/canvas (#31563) 2024-03-08 07:24:01 +00:00
eri
ef3dad3a61 clippy: fix warnings in components/config* (#31562) 2024-03-08 07:15:56 +00:00
eri
88033bd654 clippy: fix warnings in components/gfx (#31560)
* clippy: fix warnings in components/gfx

* refactor: switched the order of impl so that its intent is clearer

* fix: add font context default in other platforms
2024-03-08 07:10:15 +00:00
Daniel Adams
1771f9a9a1 Fix broken wiki link in README for Android instructions (#31574) 2024-03-08 05:35:27 +00:00
eri
6c7fe31db1 clippy: fix warnings on modules outside components (#31567) 2024-03-07 23:42:39 +00:00
eri
3b19189896 clippy: fix warnings in components/bluetooth (#31566) 2024-03-07 23:32:35 +00:00
sandeep
64d013d473 Fix clippy warnings in components/rand (#31549)
* resolved clippy warnings in components/rand

Signed-off-by: Sandeep Pillai <sandeeppillai@Sandeeps-MacBook-Air.local>

* replaced new() with default()

Signed-off-by: Sandeep Pillai <sandeeppillai@Sandeeps-MacBook-Air.local>

* replaced ServoRng::new() with ServoRng::default()

Signed-off-by: Sandeep Pillai <sandeeppillai@Sandeeps-MacBook-Air.local>

* moved the contents of the new() method into the default() method

Signed-off-by: Sandeep Pillai <sandeeppillai@Sandeeps-MacBook-Air.local>

---------

Signed-off-by: Sandeep Pillai <sandeeppillai@Sandeeps-MacBook-Air.local>
Co-authored-by: Sandeep Pillai <sandeeppillai@Sandeeps-MacBook-Air.local>
2024-03-07 23:16:42 +00:00
Martin Robinson
e4ac047a9c compositor: Limit animation tick interval when in WPT mode (#31561)
When exiting after load or dumping a screenshot, limit the speed that
the compositor sends tick events to the constellation (and on to the
script thread). Previously, these tick messages were sent as fast as the
winit event loop (that's really fast!), until the document was ready to
for its screenshot. rAf is meant to run at more or less the same
frequency as the refresh rate of the screen.

On my system, the massive amount of ticks was overwhelming the router
thread, preventing fonts from loading properly. This change is an attempt
to make tests with requestAnimationFrame less flaky.
2024-03-07 21:45:39 +00:00
Delan Azabani
dfefd7a30d Add multiview feature flag in libservo and servoshell (#31541) 2024-03-07 18:09:21 +00:00
dependabot[bot]
9f86979dc7 build(deps): bump chrono from 0.4.34 to 0.4.35 (#31555)
Bumps [chrono](https://github.com/chronotope/chrono) from 0.4.34 to 0.4.35.
- [Release notes](https://github.com/chronotope/chrono/releases)
- [Changelog](https://github.com/chronotope/chrono/blob/main/CHANGELOG.md)
- [Commits](https://github.com/chronotope/chrono/compare/v0.4.34...v0.4.35)

---
updated-dependencies:
- dependency-name: chrono
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-07 17:28:11 +00:00
dependabot[bot]
5ecfba9da5 build(deps): bump gilrs-core from 0.5.10 to 0.5.11 (#31554)
Bumps [gilrs-core](https://gitlab.com/gilrs-project/gilrs) from 0.5.10 to 0.5.11.
- [Commits](https://gitlab.com/gilrs-project/gilrs/compare/gilrs-core-v0.5.10...gilrs-core-v0.5.11)

---
updated-dependencies:
- dependency-name: gilrs-core
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-07 17:25:33 +00:00
dependabot[bot]
bbf2840b3f build(deps): bump libloading from 0.8.2 to 0.8.3 (#31553)
Bumps [libloading](https://github.com/nagisa/rust_libloading) from 0.8.2 to 0.8.3.
- [Commits](https://github.com/nagisa/rust_libloading/compare/0.8.2...0.8.3)

---
updated-dependencies:
- dependency-name: libloading
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-07 17:20:07 +00:00
dependabot[bot]
33906e4747 build(deps): bump svg_fmt from 0.4.1 to 0.4.2 (#31525)
Bumps [svg_fmt](https://github.com/nical/rust_debug) from 0.4.1 to 0.4.2.
- [Commits](https://github.com/nical/rust_debug/commits)

---
updated-dependencies:
- dependency-name: svg_fmt
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-07 17:17:27 +00:00
dependabot[bot]
35914422ec build(deps): bump bumpalo from 3.15.3 to 3.15.4 (#31552)
Bumps [bumpalo](https://github.com/fitzgen/bumpalo) from 3.15.3 to 3.15.4.
- [Changelog](https://github.com/fitzgen/bumpalo/blob/main/CHANGELOG.md)
- [Commits](https://github.com/fitzgen/bumpalo/compare/3.15.3...3.15.4)

---
updated-dependencies:
- dependency-name: bumpalo
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-07 17:14:38 +00:00
eri
3837fe00ad Use thread pool to decode image (#31517)
* feat: do not spawn dedicated thread to decode image

* fix: change comment to docstring

Co-authored-by: Taym Haddadi <haddadi.taym@gmail.com>

---------

Co-authored-by: Taym Haddadi <haddadi.taym@gmail.com>
2024-03-07 16:12:45 +00:00
Martin Robinson
6005049d88 compositor: Improve the way we wait for frames (#31523)
* compositor: Improve the way we wait for frames

In the newest version of WebRender it will be harder to make the
distinction between frame queued for scrolling and other kinds of
pending frames. This change makes it so that we queue frames for both
kinds of changes the same way and keeps a counting of pending frames.
This is conceptually a lot simpler.

In addition, do queue a composite even when recomposite isn't necessary
for a WebRender frame when there are active requestAnimationFrame
callbacks. Doing a composite is what triggers the callbacks to actually
run in the script thread! I believe this was a bug, but the WebRender
upgrade made it much more obvious.

These changes are in preparation for the WebRender upgrade.

* Remove spurious println
2024-03-07 11:59:02 +00:00
atbrakhi
3098c3d121 update readme (#31522) 2024-03-07 11:14:15 +00:00
Martin Robinson
602a5092c0 layout: Add support for box-shadow to Layout 2020 (#31453) 2024-03-07 11:13:57 +00:00
Oriol Brufau
007a31c1b5 Enable CSS Tables by default (#31470)
And remove the pref `layout.tables.enabled`.
2024-03-07 10:09:10 +00:00
Martin Robinson
d076b118c4 ci: Fix packaging step on Windows
WiX doesn't seem to be on the path any longer, so it must be added
manually as a temoprary workaround.
2024-03-07 11:07:54 +01:00
Oriol Brufau
ea38d8ad6f Add basic support for enumerating computed styles (#31499)
* Add basic support for enumerating computed styles

The old code was so broken, it was enumerating the style attribute
instead of the computed styles.

So this patch implements a basic enumeration, but not including custom
properties whose computed value is not the guaranteed-invalid value.

* Feedback
2024-03-06 21:43:06 +00:00
dependabot[bot]
6283146829 build(deps): bump web-sys from 0.3.68 to 0.3.69 (#31532)
Bumps [web-sys](https://github.com/rustwasm/wasm-bindgen) from 0.3.68 to 0.3.69.
- [Release notes](https://github.com/rustwasm/wasm-bindgen/releases)
- [Changelog](https://github.com/rustwasm/wasm-bindgen/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rustwasm/wasm-bindgen/commits)

---
updated-dependencies:
- dependency-name: web-sys
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-06 18:07:36 +00:00
eri
a8170966ec Move convert_* functions into gpuconvert.rs (#31521)
* feat: unify convert_* functions across gpu*.rs files #31104

* chore: reorder and format
2024-03-06 16:48:34 +00:00
Mucha Naibei
7ce19f2885 Fix several clippy warnings in components/bluetooth (#31512)
* Fix several clippy warnings in components/bluetooth/lib

* Fix requested change while maintaining clippy rules
2024-03-06 15:32:04 +00:00
Martin Robinson
096bd2977a layout: Add start of documentation for inline layout (#31519)
Co-authored-by: Rakhi Sharma <atbrakhi@igalia.com>
2024-03-06 12:55:35 +00:00
Oriol Brufau
dea416eec9 Fix the measures of a table cell (#31513)
The spec doesn't make much sense, this seems to match Gecko and Blink.
2024-03-06 12:42:06 +00:00
Mucha Naibei
3a3e76a935 Fix several clippy warnings in components/hyper_serde (#31508) 2024-03-06 08:14:23 +00:00
Smitty
24a088d94c shell.nix: update filterlock hash (#31515)
Signed-off-by: syvb <me@iter.ca>
2024-03-06 04:54:16 +00:00
Oriol Brufau
a483e2806c Enable accidentally skipped tests (#31507)
In #31469 I misunderstood how include.ini works (see #31502).
2024-03-05 23:07:42 +00:00
Oriol Brufau
abda22ed63 Fix intrinsic sizing of tables (#31506)
* Fix intrinsic sizing of tables

* Feedback
2024-03-05 20:38:30 +00:00
dependabot[bot]
f32937aaeb build(deps): bump pin-project from 1.1.4 to 1.1.5 (#31510)
Bumps [pin-project](https://github.com/taiki-e/pin-project) from 1.1.4 to 1.1.5.
- [Release notes](https://github.com/taiki-e/pin-project/releases)
- [Changelog](https://github.com/taiki-e/pin-project/blob/main/CHANGELOG.md)
- [Commits](https://github.com/taiki-e/pin-project/compare/v1.1.4...v1.1.5)

---
updated-dependencies:
- dependency-name: pin-project
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-05 19:15:38 +00:00
eri
3552bb2464 clippy: Fix several warnings in components/devtools (#31501) 2024-03-05 18:19:04 +00:00
dependabot[bot]
da873779b4 build(deps): bump js-sys from 0.3.68 to 0.3.69 (#31511)
Bumps [js-sys](https://github.com/rustwasm/wasm-bindgen) from 0.3.68 to 0.3.69.
- [Release notes](https://github.com/rustwasm/wasm-bindgen/releases)
- [Changelog](https://github.com/rustwasm/wasm-bindgen/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rustwasm/wasm-bindgen/commits)

---
updated-dependencies:
- dependency-name: js-sys
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-05 17:51:43 +00:00
dependabot[bot]
40aad8cfde build(deps): bump wasm-bindgen from 0.2.91 to 0.2.92 (#31509)
Bumps [wasm-bindgen](https://github.com/rustwasm/wasm-bindgen) from 0.2.91 to 0.2.92.
- [Release notes](https://github.com/rustwasm/wasm-bindgen/releases)
- [Changelog](https://github.com/rustwasm/wasm-bindgen/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rustwasm/wasm-bindgen/compare/0.2.91...0.2.92)

---
updated-dependencies:
- dependency-name: wasm-bindgen
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-05 17:31:43 +00:00
Mukilan Thiyagarajan
8f3e1bcabe Enable css-text explicitly in include.ini (#31502)
* Enable `css-text` explicitly in include.ini

The WPT test runner has some strange logic for determining
the key's value for a node like `[css]` or `[css-text]`.
In this logic, if the node doesn't have an explicit value for
a key (here `skip`), then the implicit root node's setting
(i.e key/value pair at the top of the file that is not nested
under a heading) is used as the default fallback value [1]. Only
when the implicit root node doesn't have an explicit value set
does the logic starts looking at the current node's parent [2].

In our case, in `include.ini` the default value for `skip`
is `true` as that is the first line in the file.
Since `[css-text]` doesn't have `skip` set explicitly, the
default value of `true` is used even though the parent's
value is `false`.

[1]: 2bafcf9f18/tests/wpt/tests/tools/wptrunner/wptrunner/wptmanifest/backends/conditional.py (L265)
[2]: 2bafcf9f18/tests/wpt/tests/tools/wptrunner/wptrunner/manifestinclude.py (L59)

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

* Update text expectations

---------

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2024-03-05 10:56:18 +00:00
dependabot[bot]
57dbb7a6f6 build(deps): bump mio from 0.8.10 to 0.8.11 (#31489)
Bumps [mio](https://github.com/tokio-rs/mio) from 0.8.10 to 0.8.11.
- [Release notes](https://github.com/tokio-rs/mio/releases)
- [Changelog](https://github.com/tokio-rs/mio/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tokio-rs/mio/compare/v0.8.10...v0.8.11)

---
updated-dependencies:
- dependency-name: mio
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-05 07:58:02 +00:00
dependabot[bot]
2da7ac5578 build(deps): bump walkdir from 2.4.0 to 2.5.0 (#31488)
Bumps [walkdir](https://github.com/BurntSushi/walkdir) from 2.4.0 to 2.5.0.
- [Commits](https://github.com/BurntSushi/walkdir/compare/2.4.0...2.5.0)

---
updated-dependencies:
- dependency-name: walkdir
  dependency-type: indirect
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-05 07:57:35 +00:00
Oriol Brufau
2bafcf9f18 Update manifest (#31497)
In #31481 I forgot to run ./mach update-manifest
2024-03-04 22:44:10 +00:00
dependabot[bot]
15b4545db9 build(deps): bump libloading from 0.8.1 to 0.8.2 (#31492)
Bumps [libloading](https://github.com/nagisa/rust_libloading) from 0.8.1 to 0.8.2.
- [Commits](https://github.com/nagisa/rust_libloading/compare/0.8.1...0.8.2)

---
updated-dependencies:
- dependency-name: libloading
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-04 21:30:04 +00:00
dependabot[bot]
450601d294 build(deps): bump ahash from 0.8.10 to 0.8.11 (#31495)
Bumps [ahash](https://github.com/tkaitchuck/ahash) from 0.8.10 to 0.8.11.
- [Release notes](https://github.com/tkaitchuck/ahash/releases)
- [Commits](https://github.com/tkaitchuck/ahash/compare/v0.8.10...v0.8.11)

---
updated-dependencies:
- dependency-name: ahash
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-04 17:31:04 +00:00
dependabot[bot]
8d1d7c6882 build(deps): bump regex-automata from 0.4.5 to 0.4.6 (#31494)
Bumps [regex-automata](https://github.com/rust-lang/regex) from 0.4.5 to 0.4.6.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/regex-automata-0.4.5...regex-automata-0.4.6)

---
updated-dependencies:
- dependency-name: regex-automata
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-04 17:27:17 +00:00
dependabot[bot]
53f9a3fe12 build(deps): bump cc from 1.0.83 to 1.0.89 (#31493)
Bumps [cc](https://github.com/rust-lang/cc-rs) from 1.0.83 to 1.0.89.
- [Release notes](https://github.com/rust-lang/cc-rs/releases)
- [Commits](https://github.com/rust-lang/cc-rs/compare/1.0.83...1.0.89)

---
updated-dependencies:
- dependency-name: cc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-04 17:24:18 +00:00
dependabot[bot]
7126b97493 build(deps): bump http from 0.2.11 to 0.2.12 (#31490)
Bumps [http](https://github.com/hyperium/http) from 0.2.11 to 0.2.12.
- [Release notes](https://github.com/hyperium/http/releases)
- [Changelog](https://github.com/hyperium/http/blob/v0.2.12/CHANGELOG.md)
- [Commits](https://github.com/hyperium/http/compare/v0.2.11...v0.2.12)

---
updated-dependencies:
- dependency-name: http
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-04 17:15:44 +00:00
Martin Robinson
f7f8c24072 layout: Properly propagate text decoration values in tables (#31487)
Instead of just taking the value from the ancestor outside the table,
combine the values when constructing the table.
2024-03-04 15:10:36 +00:00
Oriol Brufau
e76770202c Fix column and row measures (#31480)
The min-content size of a table track was >= the max-content size. So
- For the min-content size of a column, now we just use min-inline-size,
  ignoring inline-size and max-inline-size. This matches Gecko, Blink
  and WebKit.
- For the max-content size of a column, we keep matching Gecko.
  Note that Blink and WebKit are different, they ignore max-inline-size.
- For both the min-content and max-content sizes of a row, now we just
  use block-size. This matches Gecko, Blink and WebKit.

Also, if the computed value contains percentages, now we treat it as
the initial value, instead of resolving percentages against zero.
This matches Gecko and Blink, but not WebKit for rows.
2024-03-04 08:10:14 +00:00
Oriol Brufau
a977729a9e Treat indefinite percentages as auto offsets in relative positioning (#31484)
* Treat indefinite percentages as auto offsets in relative positioning

Instead of just resolving the percentages against zero.
The spec is not clear (https://github.com/w3c/csswg-drafts/issues/9353),
but this way we match Gecko, Blink and WebKit.

* Update test expectations
2024-03-04 08:09:33 +00:00
Oriol Brufau
3e6b92df13 Fix "unused import" warning (#31485) 2024-03-04 07:33:37 +00:00
dependabot[bot]
e1172d8920 build(deps): bump ahash from 0.8.9 to 0.8.10 (#31464)
Bumps [ahash](https://github.com/tkaitchuck/ahash) from 0.8.9 to 0.8.10.
- [Release notes](https://github.com/tkaitchuck/ahash/releases)
- [Commits](https://github.com/tkaitchuck/ahash/compare/v0.8.9...v0.8.10)

---
updated-dependencies:
- dependency-name: ahash
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-03 15:34:21 +00:00
Oriol Brufau
06aeeeb1f3 Add CSSOM support for CSS layers (#31481)
Instead of just crashing.
2024-03-03 12:47:39 +00:00
Servo WPT Sync
845f503c34 Sync WPT with upstream (03-03-2024) (#31482)
* Update web-platform-tests to revision b'1b88c8bd56a924f9865daa15834d444c55dd7327'

* Update expectations

---------

Co-authored-by: sagudev <16504129+sagudev@users.noreply.github.com>
2024-03-03 09:03:40 +00:00
Oriol Brufau
50fdb82246 Fix size of tables in flow layout (#31455)
* Fix size of tables in flow layout

The contents of a table can make it bigger than what we would expect
from its 'width', 'min-width', 'height' and ' min-height' properties.
Also, 'width: auto' doesn't stretch it to fill the containing block.

We had to refactor the resolution of margins to happen after layout,
otherwise 'auto' margins wouldn't align correctly.

Co-authored-by: Martin Robinson <mrobinson@igalia.com>

* Feedback

* Consistently use `containing_block_for_table` in table layout

* Update test result

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-03-02 01:39:41 +00:00
dependabot[bot]
c23999941a build(deps): bump indexmap from 2.2.3 to 2.2.5 (#31477)
Bumps [indexmap](https://github.com/indexmap-rs/indexmap) from 2.2.3 to 2.2.5.
- [Changelog](https://github.com/indexmap-rs/indexmap/blob/master/RELEASES.md)
- [Commits](https://github.com/indexmap-rs/indexmap/compare/2.2.3...2.2.5)

---
updated-dependencies:
- dependency-name: indexmap
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-01 22:52:21 +00:00
dependabot[bot]
fbf023486a build(deps): bump bumpalo from 3.15.2 to 3.15.3 (#31474)
Bumps [bumpalo](https://github.com/fitzgen/bumpalo) from 3.15.2 to 3.15.3.
- [Changelog](https://github.com/fitzgen/bumpalo/blob/main/CHANGELOG.md)
- [Commits](https://github.com/fitzgen/bumpalo/compare/3.15.2...3.15.3)

---
updated-dependencies:
- dependency-name: bumpalo
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-01 19:35:51 +00:00
dependabot[bot]
cbdeb62306 build(deps): bump hermit-abi from 0.3.6 to 0.3.9 (#31472)
Bumps [hermit-abi](https://github.com/hermit-os/hermit-rs) from 0.3.6 to 0.3.9.
- [Release notes](https://github.com/hermit-os/hermit-rs/releases)
- [Commits](https://github.com/hermit-os/hermit-rs/commits)

---
updated-dependencies:
- dependency-name: hermit-abi
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-01 18:01:53 +00:00
dependabot[bot]
f4ed89277a build(deps): bump half from 2.3.1 to 2.4.0 (#31473)
Bumps [half](https://github.com/starkat99/half-rs) from 2.3.1 to 2.4.0.
- [Release notes](https://github.com/starkat99/half-rs/releases)
- [Changelog](https://github.com/starkat99/half-rs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/starkat99/half-rs/compare/v2.3.1...v2.4.0)

---
updated-dependencies:
- dependency-name: half
  dependency-type: indirect
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-01 17:45:20 +00:00
dependabot[bot]
3597870298 build(deps): bump crossbeam-channel from 0.5.11 to 0.5.12 (#31478)
Bumps [crossbeam-channel](https://github.com/crossbeam-rs/crossbeam) from 0.5.11 to 0.5.12.
- [Release notes](https://github.com/crossbeam-rs/crossbeam/releases)
- [Changelog](https://github.com/crossbeam-rs/crossbeam/blob/master/CHANGELOG.md)
- [Commits](https://github.com/crossbeam-rs/crossbeam/compare/crossbeam-channel-0.5.11...crossbeam-channel-0.5.12)

---
updated-dependencies:
- dependency-name: crossbeam-channel
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-01 17:15:54 +00:00
dependabot[bot]
2f6edda90b build(deps): bump image from 0.24.8 to 0.24.9 (#31475)
Bumps [image](https://github.com/image-rs/image) from 0.24.8 to 0.24.9.
- [Changelog](https://github.com/image-rs/image/blob/master/CHANGES.md)
- [Commits](https://github.com/image-rs/image/compare/v0.24.8...v0.24.9)

---
updated-dependencies:
- dependency-name: image
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-01 16:55:01 +00:00
dependabot[bot]
691a0f17cb build(deps): bump socket2 from 0.5.5 to 0.5.6 (#31471)
Bumps [socket2](https://github.com/rust-lang/socket2) from 0.5.5 to 0.5.6.
- [Release notes](https://github.com/rust-lang/socket2/releases)
- [Changelog](https://github.com/rust-lang/socket2/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/socket2/compare/v0.5.5...v0.5.6)

---
updated-dependencies:
- dependency-name: socket2
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-01 16:42:19 +00:00
Samson
b785aea2cf Update gstreamer crates to 0.22 (#31465) 2024-03-01 11:45:43 +00:00
Oriol Brufau
2b1d342102 Enable more css tests (#31469)
* Enable more css tests

In particular, these directories are no longer skipped:
 - CSS1 (has no tests)
 - css-box (except margin-trim)
 - css-cascade
 - css-display (except run-in)
 - css-easing
 - css-env
 - css-lists
 - css-namespaces
 - css-overflow
 - css-pseudo
 - css-sizing (except aspect-ratio and contain-intrinsic-size)
 - css-syntax
 - reference
 - support (has no tests)

* Sort list properly

* Explicitly list skipped directories

* Do not skip css tests by default

* Add expectations
2024-03-01 07:49:39 +00:00
Smitty
0beec63c86 script: Implement <meta http-equiv="refresh"> (#31468)
* script: Implement <meta http-equiv="refresh">

* Address review comments
2024-03-01 07:42:18 +00:00
dependabot[bot]
ee122acdf4 build(deps): bump syn from 2.0.50 to 2.0.52 (#31459)
Bumps [syn](https://github.com/dtolnay/syn) from 2.0.50 to 2.0.52.
- [Release notes](https://github.com/dtolnay/syn/releases)
- [Commits](https://github.com/dtolnay/syn/compare/2.0.50...2.0.52)

---
updated-dependencies:
- dependency-name: syn
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-29 22:16:08 +00:00
dependabot[bot]
160a4b7482 build(deps): bump log from 0.4.20 to 0.4.21 (#31461)
Bumps [log](https://github.com/rust-lang/log) from 0.4.20 to 0.4.21.
- [Release notes](https://github.com/rust-lang/log/releases)
- [Changelog](https://github.com/rust-lang/log/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/log/compare/0.4.20...0.4.21)

---
updated-dependencies:
- dependency-name: log
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-29 22:11:18 +00:00
dependabot[bot]
62dcb4a288 build(deps): bump rayon from 1.8.1 to 1.9.0 (#31460)
Bumps [rayon](https://github.com/rayon-rs/rayon) from 1.8.1 to 1.9.0.
- [Changelog](https://github.com/rayon-rs/rayon/blob/main/RELEASES.md)
- [Commits](https://github.com/rayon-rs/rayon/compare/rayon-core-v1.8.1...rayon-core-v1.9.0)

---
updated-dependencies:
- dependency-name: rayon
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-29 18:37:57 +00:00
dependabot[bot]
b66a319b89 build(deps): bump tempfile from 3.10.0 to 3.10.1 (#31463)
Bumps [tempfile](https://github.com/Stebalien/tempfile) from 3.10.0 to 3.10.1.
- [Changelog](https://github.com/Stebalien/tempfile/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Stebalien/tempfile/compare/v3.10.0...v3.10.1)

---
updated-dependencies:
- dependency-name: tempfile
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-29 17:31:56 +00:00
dependabot[bot]
e55c2c05f2 build(deps): bump darling from 0.20.6 to 0.20.8 (#31458)
Bumps [darling](https://github.com/TedDriggs/darling) from 0.20.6 to 0.20.8.
- [Release notes](https://github.com/TedDriggs/darling/releases)
- [Changelog](https://github.com/TedDriggs/darling/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TedDriggs/darling/compare/v0.20.6...v0.20.8)

---
updated-dependencies:
- dependency-name: darling
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-29 16:56:36 +00:00
Oriol Brufau
5f399139ae Fix percentages in CSS tables (#31454)
100% is stored as Percent(1.), not as percent(100.)

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-02-29 15:21:14 +00:00
Martin Robinson
127aa657c2 layout: Add initial support for row height distribution (#31421)
This change adds a version of row height distribution that follows the
distribtuion algorithm used for tables in Blink's LayoutNG. This is just
an intermediate step toward implementing a distribution algorithm for
both rows and columns more similar to Layout NG.

The CSS Table 3 specification is often wrong with regard to web
compatability, which is why we have abandoned it in favor of the Layout
NG algorithm for row height distribution.  this work.

Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2024-02-29 12:12:54 +00:00
Oriol Brufau
31cfaf290d Update Stylo to 2023-07-23 (#31437)
* Update Stylo to 2023-07-23

* to_shmem should be local when working with Stylo

* Fixup for https://phabricator.services.mozilla.com/D180769

* Fixup for https://phabricator.services.mozilla.com/D181125

* Fixup for https://phabricator.services.mozilla.com/D181162

* Fixup for https://phabricator.services.mozilla.com/D181798

* Fixup for https://phabricator.services.mozilla.com/D182514

* Fixup for https://phabricator.services.mozilla.com/D182539

* Update test expectations
2024-02-29 10:23:53 +00:00
Martin Robinson
6eb96290fa mach: Speed up taplo runs on MacOS (#31452)
`taplo` is the TOML formatter that we use. It seems to be using a very
slow directory walking mechanism on MacOS. This change works around that
issue by explicitly listing globs of TOML files to format and check.

Before:
```text
real	0m17.632s
user	0m2.164s
sys	0m6.916s
```

After:
```text
real	0m1.519s
user	0m1.391s
sys	0m0.112s
```
2024-02-29 10:03:19 +00:00
Samson
9a9abe9152 Add use-system-allocator to not use jemalloc (#31443)
* Add `use-system-allocator` feature

* Allow `servo_allocator/use-system-allocator` on servoshell
2024-02-29 08:43:03 +00:00
Samson
cd92a17c5e ci: Update remaining GitHub actions to versions using Node.js 20 (#31450)
* Update sccache action

* Update baptiste0928/cargo-install

* Update github-script

* Update actions/setup-java

* Update nick-fields/retry
2024-02-29 08:24:38 +00:00
Smitty
ffc9730a48 tidy: Fix WHATWG replacement links (#31449) 2024-02-29 06:02:41 +00:00
Sebastian C
51b3313854 fix invalid video poster image loading from panicking (#31447)
This fixed #31438. When an image is loaded from cache, it will
load a placeholder if the url is not a valid image url. This
may be unexpected when using the image cache and specifying
UsePlaceholder::No but that has no effect on loading an image
not in the cache.

Signed-off-by: Sebastian C <sebsebmc@gmail.com>
2024-02-28 23:04:20 +00:00
Alex Touchet
e2e30bcbb1 Remove leftover layout_traits references (#31448) 2024-02-28 23:01:03 +00:00
Shamir Khodzha
201cdbab17 webaudio: Throw when setting invalid automationRate on AudioBufferSourceNode (#26469) 2024-02-28 21:24:08 +00:00
Smitty
5c87fe940e layout: Add an implementation of process_resolved_font_style_query for Layout 2020 (#31436)
* layout: support setting canvas font

Signed-off-by: syvb <me@iter.ca>

* Update 2d.reset.state.font.html test

Signed-off-by: syvb <me@iter.ca>

---------

Signed-off-by: syvb <me@iter.ca>
2024-02-28 21:00:17 +00:00
cybai (Haku)
a89bacb7c5 Update overrideMimeType and final-charset to match xhr spec (#29812)
* Update overrideMimeType to match xhr spec

* Update final-encoding to match xhr spec

* Fix an issue and add more comments

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2024-02-28 20:26:43 +00:00
Martin Robinson
5ba29c20ac layout: Turn on synthetic small-caps for layout 2020 (#31435)
Synthetic small caps is supported by the font subsystem, but this is
disabled in Layout 2020. We can turn this on to bring support to parity
with the old layout system.

In addition to turning on synthetic small-caps this change also improves
the way that they work. Before, synthetic small caps meant that every
character was a small version of capitalized character. After this
change, capital letters are larger than small caps versions of small
letters -- matching other browsers and the common expectation of how
small caps works.
2024-02-28 15:09:26 +00:00
Martin Robinson
98bd306816 mach: Do not use unstable rust for rustfmt (#31441)
We can use stable rust if we pass the unstable configuration as
command-line arguments to rustfmt itself. This prevents needing to
install an unstable rust toolchain.

The one downside here is that it doesn't seem that "ignore" is
supported so we have to start formatting the files in "third_party."
This shouldn't be a huge issue because we don't plan to check much more
rust code into those directories.
2024-02-28 13:53:04 +00:00
dependabot[bot]
2afd5431b1 build(deps): bump mako from 1.1.2 to 1.2.2 in /python (#31434)
Bumps [mako](https://github.com/sqlalchemy/mako) from 1.1.2 to 1.2.2.
- [Release notes](https://github.com/sqlalchemy/mako/releases)
- [Changelog](https://github.com/sqlalchemy/mako/blob/main/CHANGES)
- [Commits](https://github.com/sqlalchemy/mako/commits)

---
updated-dependencies:
- dependency-name: mako
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-28 12:43:04 +00:00
Delan Azabani
6a3cd65bf2 Move servoshell code into an internal lib crate (#31439)
* Move servoshell code into an internal lib crate

* Fix name of Android port
2024-02-28 11:46:12 +00:00
Delan Azabani
faf754dfa6 Move Stylo to its own repo (#31350)
* Remove packages that were moved to external repo

* Add workspace dependencies pointing to 2023-06-14 branch

* Fix servo-tidy.toml errors

* Update commit to include #31346

* Update commit to include servo/stylo#2

* Move css-properties.json lookup to target/doc/stylo

* Remove dependency on vendored mako in favour of pypi dependency

This also removes etc/ci/generate_workflow.py, which has been unused
since at least 9e71bd6a70.

* Add temporary code to debug Windows test failures

* Fix failures on Windows due to custom target dir

* Update commit to include servo/stylo#3

* Fix license in tests/unit/style/build.rs

* Document how to build with local Stylo in Cargo.toml
2024-02-27 15:39:06 +00:00
Oriol Brufau
b07505417e Fix percentages in the padding of a table-cell (#31430) 2024-02-27 13:28:23 +00:00
Mukilan Thiyagarajan
b9e217c480 Upgrade surfman to 0.9.1 (#31431)
* upgrade surfman to 0.9.1

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

* remove 'libegl1-mesa-dev' from runtime dependencies

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

---------

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-02-27 11:53:49 +00:00
atbrakhi
304ab9b09c layout: make AxisResult, Anchor & AbsoluteAxisSolver use Au (#31395)
* make AxisResult and Anchor use Au

* Avoid some .into()

* review fix

* review update

---------

Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2024-02-26 18:11:33 +00:00
Oriol Brufau
a97a04d84c Support <div align="..."> and <center> in block layout (#31423)
As per HTML [1], <div align="..."> and <center> should align descendants
to the left/center/right. This is similar to having 'auto' margins [2],
but without changing their used values [3].

[1]: https://html.spec.whatwg.org/multipage/rendering.html#flow-content-3
[2]: https://html.spec.whatwg.org/multipage/rendering.html#align-descendants
[3]: https://github.com/whatwg/html/issues/10149
2024-02-26 18:00:01 +00:00
Martin Robinson
e5598590ba layout: Add line height from preserved segment breaks in quirks mode (#31419)
In quirks mode, preserved segment breaks should add line height to
lines. This matches the behavior of WebKit and Blink, but not Gecko.

This also handles the special-case of `<br>` elements, which are
implemented with preserved segment breaks via `white-space: pre-line`.
This is an implementation detail though because `<br>` has a special
behavior if the line isn't empty -- it doesn't add any line height in
this case.
2024-02-26 17:26:41 +00:00
Taym Haddadi
a9a7e8a5cf Rename buffer_source_type to buffer_source (#31426)
* Rename buffer_source_type to buffer_source

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Code format

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

---------

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
2024-02-26 14:21:46 +00:00
Alex Touchet
ef8a0b7f7b Update time (#31424) 2024-02-25 17:18:35 +00:00
Taym Haddadi
d0b663800f WedIDL: bring dom/bindings/typedarray further in line with spec (#31375)
* WedIDL: bring dom/bindings/typedarray further in line with spec

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* Rename HeapBufferSourceTypes to HeapBufferSource

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

* fmt code

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>

---------

Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
2024-02-25 12:13:17 +00:00
Servo WPT Sync
32f1d07323 Update web-platform-tests to revision b'a39b23cb150d1ca3eddf7f2097ffe792a5f911e5' (#31425) 2024-02-25 06:16:30 +00:00
Martin Robinson
0d4e4748c4 layout: Place absolutes in IFCs at their hypothetical static position (#31418)
Absolutes need to be placed at their hypothetical position as if the
position value was static. This position differs based on the value they
had before blockification. The code for placing absolutes was taking
into account the original display for the inline value, but not for the
block value. A static `display: block` box would placed at a new block
position past the end of the linebox.
2024-02-23 17:55:18 +00:00
Josh Matthews
41a41b3d8f Treat video elements as replaced content and render the current frame. (#31412)
* Treat video elements as replaced content and render the current frame.

* Update test results.
2024-02-23 17:34:08 +00:00
Oriol Brufau
38d2ad9592 Support <div align="..."> and <center> on inline layout (#31388)
As per HTML [1], <div align="..."> and <center> should behave as if they
had the text-align property set to the corresponding value.

Servo implements that as internal text-align values because there should
the extra effect of aligning block descendants, but that part has not
been implemented yet. This patch only adds support for inline layout.

[1]: https://html.spec.whatwg.org/multipage/rendering.html#flow-content-3
2024-02-23 15:36:36 +00:00
Mukilan Thiyagarajan
0a8b69879a ci: Fix nightly release action (#31420)
* ci: check result of dependent jobs explicitly

Signed-off-by: Mukilan Thiyagarajan <me@mukilan.in>

* ci: use ubuntu latest image in more jobs

Signed-off-by: Mukilan Thiyagarajan <me@mukilan.in>

---------

Signed-off-by: Mukilan Thiyagarajan <me@mukilan.in>
2024-02-23 14:55:00 +00:00
Josh Matthews
b182bdfa52 Fix crash when closing window containing video element (#31413)
* Forbid casting DOM objects when JS runtime is shutting down.

* Remove media controls from document when element is removed from the tree.
2024-02-23 12:18:49 +00:00
Delan Azabani
e078a99817 style: Remove dependency on servo_config (was #31409) (#31411)
* Initial style_config crate

* Remove servo_config from style

* Remove servo_config from tests/unit/style

* Plumb servo prefs into stylo

* Clean up dependencies

* Fix formatting

* Add unit tests

* Add comment about avoiding clone

* Fix bug where getters acquire unnecessary write lock

* Remove stray dbg!()

* Plumb default prefs into Stylo as well

* Add comments about logging and mapping new pref types
2024-02-23 08:40:54 +00:00
Martin Robinson
9c0561536d script: Do not run layout in a thread (#31346)
* script: Do not run layout in a thread

Instead of spawning a thread for layout that almost always runs
synchronously with script, simply run layout in the script thread.

This is a resurrection of #28708, taking just the bits that remove the
layout thread. It's a complex change and thus is just a first step
toward cleaning up the interface between script and layout. Messages are
still passed from script to layout via a `process()` method and script
proxies some messages to layout from other threads as well.

Big changes:

1. Layout is created in the script thread on Document load, thus every
   live document is guaranteed to have a layout. This isn't completely
   hidden in the interface, but we can safely `unwrap()` on a Document's
   layout.
2. Layout configuration is abstracted away into a LayoutConfig struct
   and the LayoutFactory is a struct passed around by the Constellation.
   This is to avoid having to monomorphize the entire script thread
   for each layout.
3. Instead of having the Constellation block on the layout thread to
   figure out the current epoch and whether there are pending web fonts
   loading, updates are sent synchronously to the Constellation when
   rendering to a screenshot. This practically only used by the WPT.

A couple tests start to fail, which is probably inevitable since removing
the layout thread has introduced timing changes in "exit after load" and
screenshot behavior.

Co-authored-by: Josh Matthews <josh@joshmatthews.net>

* Update test expectations

* Fix some issues found during review

* Clarify some comments

* Address review comments

---------

Co-authored-by: Josh Matthews <josh@joshmatthews.net>
2024-02-23 08:14:10 +00:00
dependabot[bot]
4849ba901e build(deps): bump target-lexicon from 0.12.13 to 0.12.14 (#31410)
Bumps [target-lexicon](https://github.com/bytecodealliance/target-lexicon) from 0.12.13 to 0.12.14.
- [Commits](https://github.com/bytecodealliance/target-lexicon/compare/v0.12.13...v0.12.14)

---
updated-dependencies:
- dependency-name: target-lexicon
  dependency-type: indirect
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-22 16:50:14 +00:00
Martin Robinson
d8b326528b layout: Add initial support for text-transform (#31396)
This adds basic support for `text-transform` in a way that is more
complete than legacy layout. There are still many missing elements of
proper `text-transform` support such as:

1. Support for `full-width` and `full-size-kana`
2. Support for grapheme based uppercasing, lowercasing, and
   capitalization. These are all done per-code point right now.
3. Support for the language-specific `SpecialCasing.txt` cases for case
   mapping such as the ones for Irish and Turkish.

Co-authored-by: Rakhi Sharma <atbrakhi@igalia.com>
2024-02-22 14:15:59 +00:00
Delan Azabani
f60e5e767b Revert remaining Stylo changes (#31408)
* Revert remaining changes from Stylo split-into-commits branch

* Do the minimum amount of formatting to appease mach test-tidy
2024-02-22 09:56:26 +00:00
23425 changed files with 947386 additions and 567769 deletions

View File

@@ -34,4 +34,3 @@ RUSTC_BOOTSTRAP = "crown,script,style_tests"
[build]
rustdocflags = ["--document-private-items"]
rustc = "crown"

2
.gitattributes vendored
View File

@@ -1,5 +1,5 @@
* text=auto eol=lf
tests/* linguist-vendored
tests/wpt/** linguist-vendored
# Denote all files that are truly binary and should not be modified.
*.png binary

4
.github/CODEOWNERS vendored Normal file
View File

@@ -0,0 +1,4 @@
# Reviewers for the Servo project
/components/script/ @gterzian

1
.github/FUNDING.yml vendored
View File

@@ -1 +1,2 @@
github: servo
open_collective: servo

17
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@@ -0,0 +1,17 @@
---
name: Bug Report
about: Create a bug report to help us improve
title: ''
labels: C-untriaged
assignees: ''
---
**Describe the bug:**
A clear and concise description of the bug.
**To Reproduce:**
Steps to reproduce the behavior.
**Platform:**
Specify OS, distribution, and hardware platform.

View File

@@ -0,0 +1,11 @@
---
name: Feature Request
about: Suggest the implementation of a new feature
title: ''
labels: B-feature-tracking, C-untriaged
assignees: ''
---
**Describe the new feature:**
A clear and concise description of the new feature with links to any relevant specifications.

View File

@@ -8,3 +8,34 @@ updates:
allow:
- dependency-type: direct
- dependency-type: indirect
groups:
gstreamer-related:
patterns:
- "gio*"
- "glib*"
- "gobject*"
- "gstreamer*"
groups:
egui-related:
patterns:
- "ecolor"
- "egui"
- "egui-winit"
- "egui_glow"
- "emath"
- "epaint"
ignore:
# Ignore all stylo crates as their upgrades are coordinated via companion PRs.
- dependency-name: servo_atoms
- dependency-name: derive_common
- dependency-name: malloc_size_of
- dependency-name: selectors
- dependency-name: servo_arc
- dependency-name: size_of_test
- dependency-name: style
- dependency-name: style_config
- dependency-name: style_derive
- dependency-name: style_static_prefs
- dependency-name: style_traits
- dependency-name: to_shmem
- dependency-name: to_shmem_derive

View File

@@ -18,6 +18,7 @@ env:
RUST_BACKTRACE: 1
SHELL: /bin/bash
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
CCACHE: "sccache"
CARGO_INCREMENTAL: 0
@@ -27,32 +28,36 @@ jobs:
runs-on: ubuntu-22.04
strategy:
matrix:
arch: ['armv7-linux-androideabi', 'i686-linux-android']
arch: ['aarch64-linux-android', 'armv7-linux-androideabi', 'i686-linux-android', 'x86_64-linux-android']
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
android: false
large-packages: false
swap-storage: false
- uses: actions/checkout@v4
if: github.event_name != 'issue_comment' && github.event_name != 'pull_request_target'
if: github.event_name != 'pull_request_target'
with:
fetch-depth: 2
# This is necessary to checkout the pull request if this run was triggered
# via an `issue_comment` action on a pull request.
# This is necessary to checkout the pull request if this run was triggered via a
# `pull_request_target` event.
- uses: actions/checkout@v4
if: github.event_name == 'issue_comment' || github.event_name == 'pull_request_target'
if: github.event_name == 'pull_request_target'
with:
ref: refs/pull/${{ github.event.issue.number || github.event.number }}/head
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 2
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.3
- name: Install taplo
uses: baptiste0928/cargo-install@v2
with:
crate: taplo-cli
locked: true
uses: mozilla-actions/sccache-action@v0.0.4
- name: Install crown
run: cargo install --path support/crown
- name: Bootstrap Python
run: python3 -m pip install --upgrade pip virtualenv
- name: Bootstrap dependencies
run: sudo apt update && python3 ./mach bootstrap
run: sudo apt update && python3 ./mach bootstrap --skip-lints
- name: Set up JDK 17
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
@@ -64,12 +69,23 @@ jobs:
uses: nttld/setup-ndk@v1
id: setup-ndk
with:
ndk-version: r25c
ndk-version: r26c
- name: Setup Key Store for APK Signing
env:
KEYSTORE_BASE64: ${{ secrets.APK_KEYSTORE_BASE64 }}
if: ${{ env.KEYSTORE_BASE64 != '' }}
run: |
APK_SIGNING_KEY_STORE_PATH="${PWD}/servo_keystore.jks"
echo "${KEYSTORE_BASE64}" | base64 -d > "${APK_SIGNING_KEY_STORE_PATH}"
echo "APK_SIGNING_KEY_STORE_PATH=${APK_SIGNING_KEY_STORE_PATH}" >> ${GITHUB_ENV}
- name: Build (arch ${{ matrix.arch }} profile ${{ inputs.profile }})
env:
ANDROID_NDK_ROOT: ${{ steps.setup-ndk.outputs.ndk-path }}
APK_SIGNING_KEY_STORE_PASS: ${{ secrets.APK_SIGNING_KEY_STORE_PASS }}
APK_SIGNING_KEY_ALIAS: ${{ secrets.APK_SIGNING_KEY_ALIAS }}
APK_SIGNING_KEY_PASS: ${{ secrets.APK_SIGNING_KEY_PASS }}
run: |
python3 ./mach build --android --target ${{ matrix.arch }} --${{ inputs.profile }}
python3 ./mach build --use-crown --locked --target ${{ matrix.arch }} --${{ inputs.profile }}
cp -r target/cargo-timings target/cargo-timings-android-${{ matrix.arch }}
# TODO: This is disabled since APK crashes during startup.
# See https://github.com/servo/servo/issues/31134

View File

@@ -0,0 +1,18 @@
name: Automerge Dependabot & WPT Updates
on: pull_request
permissions:
pull-requests: read
jobs:
auto-merge:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' || github.actor == 'servo-wpt-sync' }}
steps:
- name: Approve the PR & enable auto-merge
run: |
gh pr review --approve "$PR_URL"
gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GH_TOKEN: ${{ secrets.SERVO_DEPENDABOT_TOKEN }}

12
.github/workflows/dco-merge-group.yml vendored Normal file
View File

@@ -0,0 +1,12 @@
# Mostly copied from https://github.com/onnx/onnx/blob/main/.github/workflows/dco_merge_group.yml
# Because of https://github.com/dcoapp/app/issues/199
name: DCO
on:
merge_group:
jobs:
DCO:
runs-on: ubuntu-latest
steps:
- run: echo "dummy DCO workflow (it won't run any check actually) to trigger by merge_group in order to enable merge queue"

View File

@@ -1,22 +0,0 @@
name: Approve & merge successful dependabot patch upgrade PRs
on: pull_request
permissions:
pull-requests: read
jobs:
dependabot:
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Dependabot metadata
id: metadata
uses: dependabot/fetch-metadata@v1
- name: Approve the PR & enable auto-merge
if: ${{ steps.metadata.outputs.update-type == 'version-update:semver-patch' }}
run: |
gh pr review --approve "$PR_URL"
gh pr merge --auto --merge "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GH_TOKEN: ${{secrets.SERVO_DEPENDABOT_TOKEN}}

View File

@@ -8,7 +8,7 @@ on:
profile:
required: true
type: string
wpt-tests-to-run:
wpt-args:
required: true
type: string
wpt-layout:
@@ -37,7 +37,7 @@ jobs:
profile: ${{ inputs.profile }}
wpt-layout: ${{ inputs.wpt-layout }}
unit-tests: ${{ inputs.unit-tests }}
wpt-tests-to-run: ${{ inputs.wpt-tests-to-run }}
wpt-args: ${{ inputs.wpt-args }}
linux:
if: ${{ inputs.workflow == 'linux' }}
@@ -48,7 +48,13 @@ jobs:
profile: ${{ inputs.profile }}
wpt-layout: ${{ inputs.wpt-layout }}
unit-tests: ${{ inputs.unit-tests }}
wpt-tests-to-run: ${{ inputs.wpt-tests-to-run }}
wpt-args: ${{ inputs.wpt-args }}
lint:
if: ${{ inputs.workflow == 'lint' }}
name: Lint
uses: ./.github/workflows/lint.yml
secrets: inherit
android:
if: ${{ inputs.workflow == 'android' }}
@@ -57,3 +63,10 @@ jobs:
secrets: inherit
with:
profile: ${{ inputs.profile }}
ohos:
if: ${{ inputs.workflow == 'ohos' }}
name: OpenHarmony
uses: ./.github/workflows/ohos.yml
with:
profile: ${{ inputs.profile }}

View File

@@ -17,7 +17,7 @@ jobs:
run: |
python3 -m pip install --upgrade pip
sudo apt update
python3 ./mach bootstrap
python3 ./mach bootstrap --skip-lints
- name: Set LIBCLANG_PATH # This is needed for bindgen in mozangle.
run: echo "LIBCLANG_PATH=/usr/lib/llvm-14/lib" >> $GITHUB_ENV
- name: Compile docs

59
.github/workflows/lint.yml vendored Normal file
View File

@@ -0,0 +1,59 @@
name: Lint
on:
workflow_call:
workflow_dispatch:
env:
RUST_BACKTRACE: 1
SHELL: /bin/bash
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
CCACHE: "sccache"
CARGO_INCREMENTAL: 0
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
if: github.event_name != 'pull_request_target'
with:
fetch-depth: 2 # This is necessary for `test-tidy`.
# This is necessary to checkout the pull request if this run was triggered via a
# `pull_request_target` event.
- uses: actions/checkout@v4
if: github.event_name == 'pull_request_target'
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 2 # This is necessary for `test-tidy`.
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.4
- name: Set LIBCLANG_PATH env # needed for bindgen in mozangle
run: echo "LIBCLANG_PATH=/usr/lib/llvm-14/lib" >> $GITHUB_ENV
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install taplo
uses: baptiste0928/cargo-install@v3
with:
crate: taplo-cli
locked: true
- name: Install cargo-deny
uses: baptiste0928/cargo-install@v3
with:
crate: cargo-deny
locked: true
- name: Bootstrap Python
run: python3 -m pip install --upgrade pip
- name: Bootstrap dependencies
run: |
sudo apt update
python3 ./mach bootstrap
# TODO: Do GitHub anotaions
# TODO: Fail on warnings
- name: Clippy
run: |
python3 ./mach cargo-clippy --use-crown --locked
- name: Tidy
run: python3 ./mach test-tidy --no-progress --all

View File

@@ -5,7 +5,7 @@ on:
profile:
required: true
type: string
wpt-tests-to-run:
wpt-args:
default: ""
required: false
type: string
@@ -55,7 +55,7 @@ jobs:
python3 -m pip install --upgrade pip
sudo apt update
sudo apt install -qy --no-install-recommends mesa-vulkan-drivers
python3 ./mach bootstrap
python3 ./mach bootstrap --skip-lints
- name: Sync from upstream WPT
if: ${{ inputs.wpt-sync-from-upstream }}
run: |
@@ -67,12 +67,13 @@ jobs:
python3 ./mach test-wpt \
$WPT_LAYOUT_ARG \
$WPT_ALWAYS_SUCCEED_ARG \
${{ inputs.wpt-tests-to-run }} \
--${{ inputs.profile }} --processes $(nproc) --timeout-multiplier 2 \
--total-chunks ${{ env.max_chunk_id }} --this-chunk ${{ matrix.chunk_id }} \
--log-raw wpt-full-logs/linux-${{ inputs.wpt-layout }}/${{ matrix.chunk_id }}.log \
--log-raw wpt-full-logs/linux-${{ inputs.wpt-layout }}/raw/${{ matrix.chunk_id }}.log \
--log-wptreport wpt-full-logs/linux-${{ inputs.wpt-layout }}/wptreport/${{ matrix.chunk_id }}.json \
--log-raw-unexpected wpt-filtered-logs/linux-${{ inputs.wpt-layout }}/${{ matrix.chunk_id }}.log \
--filter-intermittents wpt-filtered-logs/linux-${{ inputs.wpt-layout }}/${{ matrix.chunk_id }}.json
--filter-intermittents wpt-filtered-logs/linux-${{ inputs.wpt-layout }}/${{ matrix.chunk_id }}.json \
${{ inputs.wpt-args }}
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
- name: Archive results (filtered)
@@ -94,18 +95,19 @@ jobs:
if: ${{ always() }}
needs: linux-wpt
steps:
- name: Merge logs (filtered)
uses: actions/upload-artifact/merge@v4
with:
name: wpt-filtered-logs-linux-${{ inputs.wpt-layout }}
pattern: wpt-filtered-logs-linux-${{ inputs.wpt-layout }}-*
delete-merged: true
- name: Merge logs (full)
uses: actions/upload-artifact/merge@v4
with:
name: wpt-full-logs-linux-${{ inputs.wpt-layout }}
pattern: wpt-full-logs-linux-${{ inputs.wpt-layout }}-*
delete-merged: true
# This job needs to be last. If no filtered results were uploaded, it will fail, but we want to merge other archives in that case.
- name: Merge logs (filtered)
uses: actions/upload-artifact/merge@v4
with:
name: wpt-filtered-logs-linux-${{ inputs.wpt-layout }}
pattern: wpt-filtered-logs-linux-${{ inputs.wpt-layout }}-*
delete-merged: true
- uses: actions/checkout@v4
if: ${{ !cancelled() && !inputs.wpt-sync-from-upstream }}
- uses: actions/download-artifact@v4

View File

@@ -6,7 +6,7 @@ on:
required: false
default: "release"
type: string
wpt-tests-to-run:
wpt-args:
default: ""
required: false
type: string
@@ -35,7 +35,7 @@ on:
default: "release"
type: choice
options: ["release", "debug", "production"]
wpt-tests-to-run:
wpt-args:
default: ""
required: false
type: string
@@ -59,54 +59,92 @@ on:
env:
RUST_BACKTRACE: 1
SHELL: /bin/bash
SCCACHE_GHA_ENABLED: "true"
CCACHE: "sccache"
CARGO_INCREMENTAL: 0
jobs:
# Runs the underlying job (“workload”) on a self-hosted runner if available,
# with the help of a `runner-select` job and a `runner-timeout` job.
runner-select:
uses: ./.github/workflows/self-hosted-runner-select.yml
secrets: inherit
with:
# Ubuntu 22.04 has glibc 2.34 so the binaries produced
# won't run on systems with older glibc e.g wpt.fyi
# runners which still use 20.04.
github-hosted-runner-label: ubuntu-${{ inputs.upload && '20.04' || '22.04' }}
self-hosted-image-name: servo-ubuntu2204
force-github-hosted-runner: ${{ inputs.upload }}
runner-timeout:
needs:
- runner-select
uses: ./.github/workflows/self-hosted-runner-timeout.yml
secrets: inherit
with:
selected-runner-label: ${{ needs.runner-select.outputs.selected-runner-label }}
is-self-hosted: ${{ fromJSON(needs.runner-select.outputs.is-self-hosted) }}
build:
name: Linux Build
# Ubuntu 22.04 has glibc 2.34 so the binaries produced
# won't run on systems with older glibc e.g wpt.fyi
# runners which still use 20.04.
runs-on: ubuntu-${{ inputs.upload && '20.04' || '22.04' }}
needs:
- runner-select
name: Linux Build [${{ needs.runner-select.outputs.unique-id }}]
runs-on: ${{ needs.runner-select.outputs.selected-runner-label }}
steps:
- if: ${{ ! fromJSON(needs.runner-select.outputs.is-self-hosted) }}
run: |
echo SCCACHE_GHA_ENABLED=true >> $GITHUB_ENV
echo RUSTC_WRAPPER=sccache >> $GITHUB_ENV
echo CCACHE=sccache >> $GITHUB_ENV
echo CARGO_INCREMENTAL=0 >> $GITHUB_ENV
- uses: actions/checkout@v4
if: github.event_name != 'pull_request_target'
with:
fetch-depth: 2 # This is necessary for `test-tidy`.
if: ${{ ! fromJSON(needs.runner-select.outputs.is-self-hosted) && github.event_name != 'pull_request_target' }}
# This is necessary to checkout the pull request if this run was triggered via a
# `pull_request_target` event.
- uses: actions/checkout@v4
if: github.event_name == 'pull_request_target'
if: ${{ ! fromJSON(needs.runner-select.outputs.is-self-hosted) && github.event_name == 'pull_request_target' }}
with:
ref: refs/pull/${{ github.event.number }}/head
fetch-depth: 2 # This is necessary for `test-tidy`.
ref: ${{ github.event.pull_request.head.sha }}
# Faster checkout for self-hosted runner that uses prebaked repo.
- if: ${{ fromJSON(needs.runner-select.outputs.is-self-hosted) && github.event_name != 'pull_request_target' }}
run: git fetch --depth=1 origin $GITHUB_SHA
- if: ${{ fromJSON(needs.runner-select.outputs.is-self-hosted) && github.event_name == 'pull_request_target' }}
run: git fetch --depth=1 origin ${{ github.event.pull_request.head.sha }}
- if: ${{ fromJSON(needs.runner-select.outputs.is-self-hosted) }}
# Same as `git switch --detach FETCH_HEAD`, but fixes up dirty working
# trees, in case the runner image was baked with a dirty working tree.
run: |
git switch --detach
git reset --hard FETCH_HEAD
# Install missing tools in a GitHub-hosted runner.
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.3
if: ${{ ! fromJSON(needs.runner-select.outputs.is-self-hosted) }}
uses: mozilla-actions/sccache-action@v0.0.4
- name: Set LIBCLANG_PATH env # needed for bindgen in mozangle
if: ${{ !inputs.upload }} # not needed on ubuntu 20.04 used for nightly
if: ${{ ! fromJSON(needs.runner-select.outputs.is-self-hosted) && !inputs.upload }} # not needed on ubuntu 20.04 used for nightly
run: echo "LIBCLANG_PATH=/usr/lib/llvm-14/lib" >> $GITHUB_ENV
- uses: actions/setup-python@v5
if: ${{ ! fromJSON(needs.runner-select.outputs.is-self-hosted) }}
with:
python-version: '3.10'
- name: Install taplo
uses: baptiste0928/cargo-install@v2
with:
crate: taplo-cli
locked: true
cache-key: ${{ inputs.upload && '20.04' || '22.04' }}
- name: Bootstrap Python
if: ${{ ! fromJSON(needs.runner-select.outputs.is-self-hosted) }}
run: python3 -m pip install --upgrade pip
- name: Bootstrap dependencies
if: ${{ ! fromJSON(needs.runner-select.outputs.is-self-hosted) }}
run: |
sudo apt update
python3 ./mach bootstrap
- name: Tidy
run: python3 ./mach test-tidy --no-progress --all
python3 ./mach bootstrap --skip-lints
# Always install crown, even on self-hosted runners, because it is tightly
# coupled to the rustc version, and we may have the wrong version if the
# commit we are building uses a different rustc version.
- name: Install crown
run: cargo install --path support/crown
- name: Build (${{ inputs.profile }})
run: |
python3 ./mach build --${{ inputs.profile }}
python3 ./mach build --use-crown --locked --${{ inputs.profile }}
cp -r target/cargo-timings target/cargo-timings-linux
- name: Smoketest
run: xvfb-run python3 ./mach smoketest --${{ inputs.profile }}
@@ -114,7 +152,7 @@ jobs:
run: ./mach test-scripts
- name: Unit tests
if: ${{ inputs.unit-tests }}
uses: nick-fields/retry@v2
uses: nick-fields/retry@v3
with:
timeout_minutes: 20
max_attempts: 2 # https://github.com/servo/servo/issues/30683
@@ -125,8 +163,6 @@ jobs:
name: cargo-timings-linux
# Using a wildcard here ensures that the archive includes the path.
path: target/cargo-timings-*
- name: Lockfile check
run: ./etc/ci/lockfile_changed.sh
- name: Build mach package
run: python3 ./mach package --${{ inputs.profile }}
- name: Upload artifact for mach package
@@ -158,7 +194,7 @@ jobs:
needs: ["build"]
uses: ./.github/workflows/linux-wpt.yml
with:
wpt-tests-to-run: ${{ inputs.wpt-tests-to-run }}
wpt-args: ${{ inputs.wpt-args }}
profile: ${{ inputs.profile }}
wpt-sync-from-upstream: ${{ inputs.wpt-sync-from-upstream }}
wpt-layout: "layout-2020"
@@ -170,7 +206,7 @@ jobs:
needs: ["build"]
uses: ./.github/workflows/linux-wpt.yml
with:
wpt-tests-to-run: ${{ inputs.wpt-tests-to-run }}
wpt-args: ${{ inputs.wpt-args }}
profile: ${{ inputs.profile }}
wpt-sync-from-upstream: ${{ inputs.wpt-sync-from-upstream }}
wpt-layout: "layout-2013"

View File

@@ -3,7 +3,7 @@ name: Mac WPT Tests
on:
workflow_call:
inputs:
wpt-tests-to-run:
wpt-args:
default: ""
required: false
type: string
@@ -45,19 +45,20 @@ jobs:
run: |
gtar -xzf target.tar.gz
python3 -m pip install --upgrade pip
python3 ./mach bootstrap
python3 ./mach bootstrap --skip-lints
- name: Smoketest
run: python3 ./mach smoketest --${{ inputs.profile }}
- name: Run tests
run: |
mkdir -p wpt-filtered-logs/macos-${{ inputs.wpt-layout }}
mkdir -p wpt-full-logs/macos-${{ inputs.wpt-layout }}
python3 ./mach test-wpt $WPT_COMMAND_LINE_ARG ${{ inputs.wpt-tests-to-run }} \
python3 ./mach test-wpt $WPT_COMMAND_LINE_ARG \
--${{ inputs.profile }} --processes $(sysctl -n hw.logicalcpu) --timeout-multiplier 8 \
--total-chunks ${{ env.max_chunk_id }} --this-chunk ${{ matrix.chunk_id }} \
--log-raw wpt-full-logs/macos-${{ inputs.wpt-layout }}/${{ matrix.chunk_id }}.log \
--log-raw-unexpected wpt-filtered-logs/macos-${{ inputs.wpt-layout }}/${{ matrix.chunk_id }}.log \
--filter-intermittents wpt-filtered-logs/macos-${{ inputs.wpt-layout }}/${{ matrix.chunk_id }}.json
${{ inputs.wpt-args }}
- name: Archive results (filtered)
uses: actions/upload-artifact@v4
if: ${{ always() }}

View File

@@ -7,7 +7,7 @@ on:
required: false
default: "release"
type: string
wpt-tests-to-run:
wpt-args:
default: ""
required: false
type: string
@@ -32,7 +32,7 @@ on:
default: "release"
type: choice
options: ["release", "debug", "production"]
wpt-tests-to-run:
wpt-args:
default: ""
required: false
type: string
@@ -53,6 +53,7 @@ env:
RUST_BACKTRACE: 1
SHELL: /bin/bash
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
CCACHE: "sccache"
CARGO_INCREMENTAL: 0
@@ -75,25 +76,22 @@ jobs:
- uses: actions/checkout@v4
if: github.event_name == 'pull_request_target'
with:
ref: refs/pull/${{ github.event.number }}/head
ref: ${{ github.event.pull_request.head.sha }}
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.3
- name: Install taplo
uses: baptiste0928/cargo-install@v2
with:
crate: taplo-cli
locked: true
uses: mozilla-actions/sccache-action@v0.0.4
- name: Install crown
run: cargo install --path support/crown
- name: Bootstrap
run: |
python3 -m pip install --upgrade pip
python3 ./mach bootstrap
python3 ./mach bootstrap --skip-lints
brew install gnu-tar
- name: Build (${{ inputs.profile }})
run: |
python3 ./mach build --${{ inputs.profile }}
python3 ./mach build --use-crown --locked --${{ inputs.profile }}
cp -r target/cargo-timings target/cargo-timings-macos
- name: Smoketest
uses: nick-fields/retry@v2
uses: nick-fields/retry@v3
with: # See https://github.com/servo/servo/issues/30757
timeout_minutes: 5
max_attempts: 2
@@ -102,7 +100,7 @@ jobs:
run: ./mach test-scripts
- name: Unit tests
if: ${{ inputs.unit-tests }}
uses: nick-fields/retry@v2
uses: nick-fields/retry@v3
with:
timeout_minutes: 20 # https://github.com/servo/servo/issues/30275
max_attempts: 3 # https://github.com/servo/servo/issues/30683
@@ -110,7 +108,7 @@ jobs:
- name: Build mach package
run: python3 ./mach package --${{ inputs.profile }}
- name: Run DMG smoketest
uses: nick-fields/retry@v2
uses: nick-fields/retry@v3
with: # See https://github.com/servo/servo/issues/30757
timeout_minutes: 5
max_attempts: 2
@@ -152,7 +150,7 @@ jobs:
with:
profile: ${{ inputs.profile }}
wpt-layout: "layout-2020"
wpt-tests-to-run: ${{ inputs.wpt-tests-to-run }}
wpt-args: ${{ inputs.wpt-args }}
secrets: inherit
wpt-2013:
@@ -163,5 +161,5 @@ jobs:
with:
profile: ${{ inputs.profile }}
wpt-layout: "layout-2013"
wpt-tests-to-run: ${{ inputs.wpt-tests-to-run }}
wpt-args: ${{ inputs.wpt-args }}
secrets: inherit

View File

@@ -35,7 +35,12 @@ jobs:
uses: ./.github/workflows/linux.yml
with:
unit-tests: true
wpt-layout: ${{ github.event_name == 'pull_request' && 'none' || 'all' }}
wpt-layout: ${{ github.event_name == 'pull_request' && 'none' || '2020' }}
secrets: inherit
lint:
name: Lint
uses: ./.github/workflows/lint.yml
secrets: inherit
build-android:
@@ -46,6 +51,13 @@ jobs:
profile: "release"
secrets: inherit
build-ohos:
name: OpenHarmony
if: ${{ github.event_name != 'pull_request' }}
uses: ./.github/workflows/ohos.yml
with:
profile: "release"
build-result:
name: Result
runs-on: ubuntu-latest
@@ -56,6 +68,8 @@ jobs:
- "build-mac"
- "build-linux"
- "build-android"
- "build-ohos"
- "lint"
steps:
- name: Merge build timings
uses: actions/upload-artifact/merge@v4

View File

@@ -15,7 +15,7 @@ jobs:
# This job is only useful when run on upstream servo.
if: github.repository == 'servo/servo' || github.event_name == 'workflow_dispatch'
name: Create Draft GH Release
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- id: create-release
run: |
@@ -43,10 +43,10 @@ jobs:
# This job is only useful when run on upstream servo.
if: always() && (github.repository == 'servo/servo' || github.event_name == 'workflow_dispatch')
name: Publish GH Release for nightly
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- name: Publish as latest (success)
if: success()
if: ${{ !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') }}
run: |
gh api \
--method PATCH \
@@ -55,7 +55,7 @@ jobs:
/repos/${NIGHTLY_REPO}/releases/${RELEASE_ID} \
-F draft=false
- name: Publish as latest (failure)
if: failure()
if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}
run: |
gh api \
--method PATCH \

69
.github/workflows/ohos.yml vendored Normal file
View File

@@ -0,0 +1,69 @@
name: OpenHarmony
on:
workflow_call:
inputs:
profile:
required: false
default: "release"
type: string
workflow_dispatch:
inputs:
profile:
required: false
default: "release"
type: choice
description: "Cargo build profile"
options: [ "release", "debug", "production"]
env:
RUST_BACKTRACE: 1
SHELL: /bin/bash
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
CCACHE: "sccache"
CARGO_INCREMENTAL: 0
jobs:
build:
name: OpenHarmony Build
runs-on: ubuntu-22.04
strategy:
matrix:
arch: ['aarch64-unknown-linux-ohos', 'x86_64-unknown-linux-ohos']
steps:
- uses: actions/checkout@v4
if: github.event_name != 'pull_request_target'
with:
fetch-depth: 2
# This is necessary to checkout the pull request if this run was triggered via a
# `pull_request_target` event.
- uses: actions/checkout@v4
if: github.event_name == 'pull_request_target'
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 2
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@v0.0.4
- name: Install crown
run: cargo install --path support/crown
- name: Bootstrap Python
run: python3 -m pip install --upgrade pip virtualenv
- name: Bootstrap dependencies
run: sudo apt update && python3 ./mach bootstrap --skip-lints
- name: Setup OpenHarmony SDK
id: setup_sdk
uses: openharmony-rs/setup-ohos-sdk@v0.1
with:
version: "4.1"
- name: Build (arch ${{ matrix.arch }} profile ${{ inputs.profile }})
env:
OHOS_SDK_NATIVE: ${{ steps.setup_sdk.outputs.ohos_sdk_native }}
run: |
python3 ./mach build --locked --target ${{ matrix.arch }} --${{ inputs.profile }}
cp -r target/cargo-timings target/cargo-timings-ohos-${{ matrix.arch }}
- name: Archive build timing
uses: actions/upload-artifact@v4
with:
name: cargo-timings-ohos-${{ matrix.arch }}
# Using a wildcard here ensures that the archive includes the path.
path: target/cargo-timings-*

View File

@@ -2,6 +2,7 @@ name: WPT Export
on:
pull_request_target:
types: ['opened', 'synchronize', 'reopened', 'edited', 'closed']
branches: ['main']
jobs:
upstream:

View File

@@ -1,16 +0,0 @@
# This action is meant as a quick check to be run when pushing to
# branches on forks. This allows forks to test the build and unit
# tests automatically without opening a pull request.
name: Quick check
on:
push:
branches-ignore:
["main", "auto", "try", "try-*", "dependabot/**"]
jobs:
build-linux:
name: Linux
if: github.repository != 'servo/servo' || github.event_name == 'workflow_dispatch'
uses: ./.github/workflows/linux.yml
with:
unit-tests: true

View File

@@ -42,7 +42,7 @@ jobs:
python3 ./mach bootstrap
- name: Add upstream remote
run: |
git config --local user.email "josh+wptsync@joshmatthews.net"
git config --local user.email "ghbot+wpt-sync@servo.org"
git config --local user.name "WPT Sync Bot"
git remote add upstream https://github.com/servo/servo.git
git fetch --unshallow upstream
@@ -54,10 +54,10 @@ jobs:
export CURRENT_DATE=$(date +"%d-%m-%Y")
echo $CURRENT_DATE
echo "CURRENT_DATE=$CURRENT_DATE" >> $GITHUB_ENV
./mach update-wpt linux-layout-2013/*.log --legacy-layout
./mach update-wpt linux-layout-2020/*.log
./mach update-wpt linux-layout-2013/raw/*.log --legacy-layout
./mach update-wpt linux-layout-2020/raw/*.log
git add tests/wpt/meta tests/wpt/meta-legacy-layout
git commit -a --amend --no-edit
git commit -a --amend -s --no-edit
- name: Push changes
uses: ad-m/github-push-action@master
with:

View File

@@ -0,0 +1,98 @@
name: Select Self-hosted Runner
on:
workflow_call:
inputs:
github-hosted-runner-label:
required: true
type: string
self-hosted-image-name:
required: true
type: string
self-hosted-runner-scope:
required: false
type: string
default: /orgs/${{ github.repository_owner }}/actions/runners
monitor-api-base-url:
required: false
type: string
default: https://ci0.servo.org
force-github-hosted-runner:
required: false
type: boolean
default: false
outputs:
unique-id:
value: ${{ jobs.runner-select.outputs.unique-id }}
selected-runner-label:
value: ${{ jobs.runner-select.outputs.selected-runner-label }}
is-self-hosted:
value: ${{ jobs.runner-select.outputs.is-self-hosted }}
jobs:
# Selects a self-hosted runner if available, or else a GitHub-hosted runner.
# We generate a unique id for the workload, then ask our monitor API to
# reserve a self-hosted runner for us.
runner-select:
name: Select Runner
runs-on: ubuntu-latest
outputs:
unique-id: ${{ steps.select.outputs.unique_id }}
selected-runner-label: ${{ steps.select.outputs.selected_runner_label }}
is-self-hosted: ${{ steps.select.outputs.is_self_hosted }}
steps:
- name: Select and reserve best available runner
id: select
run: |
github_hosted_runner_label='${{ inputs.github-hosted-runner-label }}'
self_hosted_image_name='${{ inputs.self-hosted-image-name }}'
self_hosted_runner_scope='${{ inputs.self-hosted-runner-scope }}'
monitor_api_base_url='${{ inputs.monitor-api-base-url }}'
set -euo pipefail
fall_back_to_github_hosted() {
echo 'Falling back to GitHub-hosted runner'
echo "selected_runner_label=$github_hosted_runner_label" | tee -a $GITHUB_OUTPUT
echo 'is_self_hosted=false' | tee -a $GITHUB_OUTPUT
exit 0
}
# Generate a unique id that allows the workload job to find the runner
# we are reserving for it (via runner labels), and allows the timeout
# job to find the workload job run (via the jobs friendly name), even
# if there are multiple instances in the workflow call tree.
unique_id=$(uuidgen)
echo "unique_id=$unique_id" | tee -a $GITHUB_OUTPUT
# Disable self-hosted runners by creating a repository variable named
# NO_SELF_HOSTED_RUNNERS with any non-empty value.
# <https://github.com/servo/servo/settings/variables/actions>
if [ -n '${{ vars.NO_SELF_HOSTED_RUNNERS }}' ]; then
echo 'NO_SELF_HOSTED_RUNNERS is set!'
# fall_back_to_github_hosted
fi
if [ '${{ inputs.force-github-hosted-runner }}' = true ]; then
echo 'inputs.force-github-hosted-runner is set!'
fall_back_to_github_hosted
fi
# Use the monitor API to reserve a runner. If we get an object with
# runner details, we succeeded. If we get null, we failed.
take_runner_url=$monitor_api_base_url/$self_hosted_image_name/$unique_id/${{ github.repository }}/${{ github.run_id }}
result=$(mktemp)
echo
echo POST "$take_runner_url"
if ! curl -sS --fail-with-body --connect-timeout 5 --max-time 30 -X POST "$take_runner_url" \
-H 'Authorization: Bearer ${{ secrets.SERVO_CI_MONITOR_API_TOKEN }}' > $result \
|| ! jq -e . $result > /dev/null; then
cat $result
echo
echo
echo 'No self-hosted runners available!'
fall_back_to_github_hosted
fi
echo
echo "selected_runner_label=reserved-for:$unique_id" | tee -a $GITHUB_OUTPUT
echo 'is_self_hosted=true' | tee -a $GITHUB_OUTPUT

View File

@@ -0,0 +1,39 @@
name: Detect Self-hosted Runner Timeout
on:
workflow_call:
inputs:
selected-runner-label:
required: true
type: string
is-self-hosted:
required: true
type: boolean
jobs:
# In the unlikely event a self-hosted runner was selected and reserved but it
# goes down before the workload starts, cancel the workflow run.
runner-timeout:
if: ${{ inputs.is-self-hosted }}
name: Detect Runner Timeout
runs-on: ubuntu-latest
steps:
- name: Wait a bit
run: sleep 30
- name: Cancel if workload job is still queued
run: |
run_url=/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}
export GH_TOKEN=${{ secrets.GITHUB_TOKEN }}
if [ "$(gh api "$run_url/jobs" \
| jq -er --arg id '${{ inputs.unique-id }}' \
'.jobs[] | select(.name | contains("[" + $id + "]")) | .status'
)" = queued ]; then
echo 'Timeout waiting for runner assignment!'
echo 'Hint: does this repo have permission to access the runner group?'
echo 'Hint: https://github.com/organizations/servo/settings/actions/runner-groups'
echo
echo 'Cancelling workflow run'
gh api "$run_url/cancel" --method POST
exit 1
fi

180
.github/workflows/try-label.yml vendored Normal file
View File

@@ -0,0 +1,180 @@
name: Try (Label)
on:
pull_request_target:
types: [labeled]
jobs:
parse-comment:
name: Trigger Try
runs-on: ubuntu-latest
concurrency:
group: try-${{ github.event.number }}
outputs:
configuration: ${{ steps.configuration.outputs.config }}
try_string: ${{ steps.try_string.outputs.result }}
steps:
- name: Collect Labels
uses: actions/github-script@v7
id: try_string
with:
result-encoding: string
script: |
function makeComment(body) {
console.log(body);
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body
})
}
let try_string = "";
for (let label of context.payload.pull_request.labels) {
if (!label.name.startsWith("T-")) {
continue;
}
// Try to remove the label. If that fails, it's likely that another
// workflow has already processed it or a user has removed it.
try {
await github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
name: label.name,
});
} catch (exception) {
console.log("Assuming '" + label.name + "' is already removed: " + exception);
continue;
}
console.log("Found label: " + label.name);
// Remove the "T-" prefix.
label = label.name.slice(2);
try_string += " " + label;
}
console.log(try_string);
// Exit early if the try string is empty (no try triggered).
if (!try_string.trim()) {
return "";
}
let username = context.payload.sender.login;
let result = await github.rest.repos.getCollaboratorPermissionLevel({
owner: context.repo.owner,
repo: context.repo.repo,
username
});
if (!result.data.user.permissions.push) {
makeComment('🔒 User @' + username + ' does not have permission to trigger try jobs.');
return "";
}
return try_string;
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- uses: actions/checkout@v4
with:
sparse-checkout: |
python/servo/try_parser.py
sparse-checkout-cone-mode: false
- name: Parse Labels
if: ${{ steps.try_string.outputs.result }}
id: configuration
run: |
{
echo 'config<<EOF'
python ./python/servo/try_parser.py ${{ steps.try_string.outputs.result }}
echo EOF
} >> $GITHUB_OUTPUT
- name: Comment Run Start
if: ${{ steps.try_string.outputs.result }}
uses: actions/github-script@v7
with:
result-encoding: string
script: |
let config = ${{ steps.configuration.outputs.config }};
function makeComment(body) {
console.log(body);
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body
})
}
const url = context.serverUrl +
"/" + context.repo.owner +
"/" + context.repo.repo +
"/actions/runs/" + context.runId;
const formattedURL = "[#" + context.runId + "](" + url + ")";
makeComment("🔨 Triggering try run (" + formattedURL + ") for "
+ config.matrix.map(m => m.name).join(", "));
run-try:
if: ${{ needs.parse-comment.outputs.try_string }}
needs: ["parse-comment"]
name: ${{ matrix.name }}
strategy:
fail-fast: ${{ fromJson(needs.parse-comment.outputs.configuration).fail_fast }}
matrix:
include: ${{ fromJson(needs.parse-comment.outputs.configuration).matrix }}
# We need to use `dipatch-workflow.yml` because workflows do not support using: ${}.
uses: ./.github/workflows/dispatch-workflow.yml
secrets: inherit
with:
workflow: ${{ matrix.workflow }}
wpt-layout: ${{ matrix.wpt_layout }}
profile: ${{ matrix.profile }}
unit-tests: ${{ matrix.unit_tests }}
wpt-args: ${{ matrix.wpt_args }}
results:
name: Results
needs: ["parse-comment", "run-try"]
runs-on: ubuntu-latest
if: ${{ always() && needs.parse-comment.outputs.try_string }}
steps:
- name: Success
if: ${{ !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') }}
uses: actions/github-script@v7
with:
script: |
const url = context.serverUrl +
"/" + context.repo.owner +
"/" + context.repo.repo +
"/actions/runs/" + context.runId;
const formattedURL = "[#" + context.runId + "](" + url + ")";
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: "✨ Try run (" + formattedURL + ") " + "succeeded.",
});
- name: Failure
if: ${{ contains(needs.*.result, 'failure') }}
uses: actions/github-script@v7
with:
script: |
const url = context.serverUrl +
"/" + context.repo.owner +
"/" + context.repo.repo +
"/actions/runs/" + context.runId;
const formattedURL = "[#" + context.runId + "](" + url + ")";
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: "⚠️ Try run (" + formattedURL + ") " + "failed.",
});

View File

@@ -10,7 +10,7 @@ on:
default: "release"
type: choice
options: ["release", "debug", "production"]
wpt-tests-to-run:
wpt-args:
default: ""
required: false
type: string
@@ -48,7 +48,7 @@ jobs:
} >> $GITHUB_OUTPUT
- name: Configuration
id: configuration
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
script: |
// When triggered via a push try the `try` branch, search the last commit for a configuration object.
@@ -75,7 +75,7 @@ jobs:
if (context.eventName == "workflow_dispatch") {
// WPT-related overrides only affect Linux currently, as tests don't run by default on other platforms.
configuration.matrix[0].wpt_layout = "${{ inputs.wpt-layout }}" || "none";
configuration.matrix[0].wpt_tests_to_run = "${{ inputs.wpt-tests-to-run }}" || "";
configuration.matrix[0].wpt_args = "${{ inputs.wpt-args }}" || "";
let unit_tests = Boolean(${{ inputs.unit-tests }});
let profile = '${{ inputs.profile }}';
@@ -103,7 +103,7 @@ jobs:
wpt-layout: ${{ matrix.wpt_layout }}
profile: ${{ matrix.profile }}
unit-tests: ${{ matrix.unit_tests }}
wpt-tests-to-run: ${{ matrix.wpt_tests_to_run }}
wpt-args: ${{ matrix.wpt_args }}
build-result:
name: Result
@@ -113,6 +113,7 @@ jobs:
needs: [ "decision", "build" ]
steps:
- name: Merge build timings
continue-on-error: true
uses: actions/upload-artifact/merge@v4
with:
name: cargo-timings

View File

@@ -1,183 +0,0 @@
name: Try (Label)
on:
pull_request_target:
types: [labeled]
jobs:
parse-comment:
name: Trigger Try
runs-on: ubuntu-latest
concurrency:
group: try-${{ github.event.number }}
outputs:
configuration: ${{ steps.configuration.outputs.config }}
try_string: ${{ steps.try_string.outputs.result }}
steps:
- name: Collect Labels
uses: actions/github-script@v6
id: try_string
with:
result-encoding: string
script: |
function makeComment(body) {
console.log(body);
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body
})
}
let try_string = "";
for (let label of context.payload.pull_request.labels) {
if (!label.name.startsWith("T-")) {
continue;
}
// Try to remove the label. If that fails, it's likely that another
// workflow has already processed it or a user has removed it.
try {
await github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
name: label.name,
});
} catch (exception) {
console.log("Assuming '" + label.name + "' is already removed: " + exception);
continue;
}
console.log("Found label: " + label.name);
// Remove the "T-" prefix.
label = label.name.slice(2);
try_string += " " + label;
}
console.log(try_string);
// Exit early if the try string is empty (no try triggered).
if (!try_string.trim()) {
return "";
}
let username = context.payload.sender.login;
let result = await github.rest.repos.getCollaboratorPermissionLevel({
owner: context.repo.owner,
repo: context.repo.repo,
username
});
if (!result.data.user.permissions.push) {
makeComment('🔒 User @' + username + ' does not have permission to trigger try jobs.');
return "";
}
return try_string;
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- uses: actions/checkout@v4
with:
# This is necessary to checkout the pull request if this run was triggered
# via an `label` action on a pull request.
ref: refs/pull/${{ github.event.number }}/head
sparse-checkout: |
python/servo/try_parser.py
sparse-checkout-cone-mode: false
- name: Parse Labels
if: ${{ steps.try_string.outputs.result }}
id: configuration
run: |
{
echo 'config<<EOF'
python ./python/servo/try_parser.py ${{ steps.try_string.outputs.result }}
echo EOF
} >> $GITHUB_OUTPUT
- name: Comment Run Start
if: ${{ steps.try_string.outputs.result }}
uses: actions/github-script@v6
with:
result-encoding: string
script: |
let config = ${{ steps.configuration.outputs.config }};
function makeComment(body) {
console.log(body);
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body
})
}
const url = context.serverUrl +
"/" + context.repo.owner +
"/" + context.repo.repo +
"/actions/runs/" + context.runId;
const formattedURL = "[#" + context.runId + "](" + url + ")";
makeComment("🔨 Triggering try run (" + formattedURL + ") for "
+ config.matrix.map(m => m.name).join(", "));
run-try:
if: ${{ needs.parse-comment.outputs.try_string }}
needs: ["parse-comment"]
name: ${{ matrix.name }}
strategy:
fail-fast: ${{ fromJson(needs.parse-comment.outputs.configuration).fail_fast }}
matrix:
include: ${{ fromJson(needs.parse-comment.outputs.configuration).matrix }}
# We need to use `dipatch-workflow.yml` because workflows do not support using: ${}.
uses: ./.github/workflows/dispatch-workflow.yml
secrets: inherit
with:
workflow: ${{ matrix.workflow }}
wpt-layout: ${{ matrix.wpt_layout }}
profile: ${{ matrix.profile }}
unit-tests: ${{ matrix.unit_tests }}
wpt-tests-to-run: ${{ matrix.wpt_tests_to_run }}
results:
name: Results
needs: ["parse-comment", "run-try"]
runs-on: ubuntu-latest
if: ${{ always() && needs.parse-comment.outputs.try_string }}
steps:
- name: Success
if: ${{ !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') }}
uses: actions/github-script@v6
with:
script: |
const url = context.serverUrl +
"/" + context.repo.owner +
"/" + context.repo.repo +
"/actions/runs/" + context.runId;
const formattedURL = "[#" + context.runId + "](" + url + ")";
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: "✨ Try run (" + formattedURL + ") " + "succeeded.",
});
- name: Failure
if: ${{ contains(needs.*.result, 'failure') }}
uses: actions/github-script@v6
with:
script: |
const url = context.serverUrl +
"/" + context.repo.owner +
"/" + context.repo.repo +
"/actions/runs/" + context.runId;
const formattedURL = "[#" + context.runId + "](" + url + ")";
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: "⚠️ Try run (" + formattedURL + ") " + "failed.",
});

View File

@@ -42,53 +42,111 @@ env:
# clang_sys will search msys path before Program Files\LLVM
# so we need to override this behaviour until we update clang-sys
# https://github.com/KyleMayes/clang-sys/issues/150
LIBCLANG_PATH: C:\\Program Files\\LLVM\\bin
LIBCLANG_PATH: C:\Program Files\LLVM\bin
RUSTUP_WINDOWS_PATH_ADD_BIN: 1
jobs:
# Runs the underlying job (“workload”) on a self-hosted runner if available,
# with the help of a `runner-select` job and a `runner-timeout` job.
runner-select:
uses: ./.github/workflows/self-hosted-runner-select.yml
secrets: inherit
with:
github-hosted-runner-label: windows-2022
self-hosted-image-name: servo-windows10
runner-timeout:
needs:
- runner-select
uses: ./.github/workflows/self-hosted-runner-timeout.yml
secrets: inherit
with:
selected-runner-label: ${{ needs.runner-select.outputs.selected-runner-label }}
is-self-hosted: ${{ fromJSON(needs.runner-select.outputs.is-self-hosted) }}
build:
name: Windows Build
runs-on: windows-2022
needs:
- runner-select
name: Windows Build [${{ needs.runner-select.outputs.unique-id }}]
runs-on: ${{ needs.runner-select.outputs.selected-runner-label }}
steps:
- uses: actions/checkout@v4
if: github.event_name != 'pull_request_target'
# This is necessary to checkout the pull request if this run was triggered via a
# `pull_request_target` event.
- uses: actions/checkout@v4
if: github.event_name == 'pull_request_target'
- if: ${{ ! fromJSON(needs.runner-select.outputs.is-self-hosted) && github.event_name != 'pull_request_target' }}
uses: actions/checkout@v4
- if: ${{ ! fromJSON(needs.runner-select.outputs.is-self-hosted) && github.event_name == 'pull_request_target' }}
uses: actions/checkout@v4
with:
ref: refs/pull/${{ github.event.number }}/head
fetch-depth: 2
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 1
# Faster checkout for self-hosted runner that uses prebaked repo.
- if: ${{ fromJSON(needs.runner-select.outputs.is-self-hosted) && github.event_name != 'pull_request_target' }}
run: git fetch --depth=1 origin $env:GITHUB_SHA
- if: ${{ fromJSON(needs.runner-select.outputs.is-self-hosted) && github.event_name == 'pull_request_target' }}
run: git fetch --depth=1 origin ${{ github.event.pull_request.head.sha }}
- if: ${{ fromJSON(needs.runner-select.outputs.is-self-hosted) }}
# Same as `git switch --detach FETCH_HEAD`, but fixes up dirty working
# trees, in case the runner image was baked with a dirty working tree.
run: |
git switch --detach
git reset --hard FETCH_HEAD
- name: ccache
# FIXME: “Error: Restoring cache failed: Error: Unable to locate executable file: sh.”
if: ${{ ! fromJSON(needs.runner-select.outputs.is-self-hosted) }}
uses: hendrikmuhs/ccache-action@v1.2
- name: Install taplo
uses: baptiste0928/cargo-install@v2
with:
crate: taplo-cli
locked: true
# Install missing tools in a GitHub-hosted runner.
# Workaround for https://github.com/actions/runner-images/issues/10001:
- name: Upgrade llvm
if: ${{ ! fromJSON(needs.runner-select.outputs.is-self-hosted) }}
run: choco upgrade llvm
- name: Install wixtoolset
if: ${{ ! fromJSON(needs.runner-select.outputs.is-self-hosted) }}
run: |
choco install wixtoolset
echo "C:\\Program Files (x86)\\WiX Toolset v3.11\\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- uses: actions/setup-python@v5
if: ${{ ! fromJSON(needs.runner-select.outputs.is-self-hosted) }}
with:
python-version: '3.10'
python-version: "3.10"
- name: Bootstrap
if: ${{ ! fromJSON(needs.runner-select.outputs.is-self-hosted) }}
run: |
python -m pip install --upgrade pip
python mach fetch
python mach bootstrap-gstreamer
cargo install --path support/crown
# For some reason WiX isn't currently on the GitHub runner path. This is a
# temporary workaround until that is fixed.
- name: Add WiX to Path
if: ${{ ! fromJSON(needs.runner-select.outputs.is-self-hosted) }}
run: |
"$env:WIX\bin" >> $env:GITHUB_PATH
# Always install crown, even on self-hosted runners, because it is tightly
# coupled to the rustc version, and we may have the wrong version if the
# commit we are building uses a different rustc version.
- name: Install crown
run: cargo install --path support/crown --force
- name: Debug logging for incremental builds
if: ${{ fromJSON(needs.runner-select.outputs.is-self-hosted) }}
run: |
cat C:\init\incremental_build_debug.txt
echo "`$env:LIBCLANG_PATH now = $env:LIBCLANG_PATH"
echo "`$env:PATH now = $env:PATH"
- name: Build (${{ inputs.profile }})
run: |
python mach build --${{ inputs.profile }}
python mach build --use-crown --locked --${{ inputs.profile }}
cp C:\a\servo\servo\target\cargo-timings C:\a\servo\servo\target\cargo-timings-windows -Recurse
- name: Copy resources
if: ${{ ! fromJSON(needs.runner-select.outputs.is-self-hosted) }}
# GitHub-hosted runners check out the repo on D: drive.
run: cp D:\a\servo\servo\resources C:\a\servo\servo -Recurse
- name: Smoketest
run: python mach smoketest --angle --${{ inputs.profile }}
run: python mach smoketest --${{ inputs.profile }}
- name: Unit tests
if: ${{ inputs.unit-tests }}
uses: nick-fields/retry@v2
uses: nick-fields/retry@v3
with:
timeout_minutes: 30
max_attempts: 3 # https://github.com/servo/servo/issues/30683

8
.gitignore vendored
View File

@@ -8,14 +8,11 @@
/android-toolchains
/target
/tests/wpt/reftests-report/report.html
/ports/android/bin
/ports/android/libs
/ports/android/local.properties
/ports/android/obj
/python/_virtualenv*
/python/_venv*
/python/tidy/servo_tidy.egg-info
/tests/wpt/sync
/tests/dromaeo/dromaeo
*.pkl
*.pyc
*.swp
@@ -26,9 +23,10 @@
.coverage
.DS_Store
Servo.app
servo.pftrace
.config.mk.last
/glfw
capture_webrender/
webrender-captures/
/screenshots
# Allow CSV files to be used as resources in tests

13
CODE_OF_CONDUCT.md Normal file
View File

@@ -0,0 +1,13 @@
# Code of Conduct
The Servo Project follows the [**Rust Code of Conduct**](https://www.rust-lang.org/policies/code-of-conduct), with the differences below.
Our code of conduct applies to the [Servo Zulip channels](https://servo.zulipchat.com/), [GitHub repositories](https://github.com/servo), and all official Servo venues, rather than the Rust project.
If you are subject to or witness unacceptable behavior, or have any other concerns, please notify one of our designated contacts:
* Delan Azabani (she/her) <dazabani@igalia.com>
* Martin Robinson (he/him) <mrobinson@igalia.com>
* Manuel Rego Casasnovas (he/him) <rego@igalia.com>
*Note: If you modify this file, please keep this file in sync with <https://servo.org/coc/>.*

View File

@@ -1,78 +1,5 @@
# Contributing to Servo
Servo welcomes contribution from everyone. Here are the guidelines if you are
thinking of helping us:
## Contributions
Contributions to Servo or its dependencies should be made in the form of GitHub
pull requests. Each pull request will be reviewed by a core contributor
(someone with permission to land patches) and either landed in the main tree or
given feedback for changes that would be required. All contributions should
follow this format, even those from core contributors.
Should you wish to work on an issue, please claim it first by commenting on
the GitHub issue that you want to work on it. This is to prevent duplicated
efforts from contributors on the same issue.
Head over to [Servo Starters](https://starters.servo.org/) to find
good tasks to start with. If you come across words or jargon that do not make
sense, please check [the glossary](docs/glossary.md) first. If there's no
matching entry, please make a pull request to add one with the content `TODO`
so we can correct that!
See [`HACKING_QUICKSTART.md`](docs/HACKING_QUICKSTART.md) for more information
on how to start working on Servo.
## Pull request checklist
- Branch from the main branch and, if needed, rebase to the current main branch
before submitting your pull request. If it doesn't merge cleanly with main
you may be asked to rebase your changes.
- Commits should be as small as possible, while ensuring that each commit is
correct independently (i.e., each commit should compile and pass tests).
- Commits should be accompanied by a Developer Certificate of Origin
(http://developercertificate.org) sign-off, which indicates that you (and
your employer if applicable) agree to be bound by the terms of the
[project license](LICENSE). In git, this is the `-s` option to `git commit`.
- If your patch is not getting reviewed or you need a specific person to review
it, you can @-reply a reviewer asking for a review in the pull request or a
comment, or you can ask for a review in [the Servo chat](https://servo.zulipchat.com/).
- Add tests relevant to the fixed bug or new feature. For a DOM change this
will usually be a web platform test; for layout, a reftest. See our [testing
guide](https://github.com/servo/servo/wiki/Testing) for more information.
For specific git instructions, see [GitHub workflow 101](https://github.com/servo/servo/wiki/Github-workflow).
## Running tests in pull requests
When you push to a pull request, GitHub automatically checks that your changes have no compilation, lint, or tidy errors.
To run unit tests or Web Platform Tests against a pull request, add one or more of the labels below to your pull request. If you do not have permission to add labels to your pull request, add a comment on your bug requesting that they be added.
| Label | Effect |
|---|---|
| `T-full` | Unit tests: Linux, macOS, Windows<br>Layout tests: Linux, macOS<br>Legacy layout tests: Linux, macOS |
| `T-linux-wpt-2013` | Unit tests: Linux<br>Legacy layout tests: Linux |
| `T-linux-wpt-2020` | Unit tests: Linux<br>Layout tests: Linux |
| `T-macos` | Unit tests: macOS |
| `T-windows` | Unit tests: Windows |
## Conduct
Servo Code of Conduct is published at <https://servo.org/coc/>.
## Communication
Servo contributors frequent the [Servo Zulip chat](https://servo.zulipchat.com/).
## Technical Steering Committee
Technical oversight of the Servo Project is provided by the
[Technical Steering Committee](https://github.com/servo/project/blob/main/governance/tsc/README.md).
Moved to the Servo book:
- [Contributing to Servo](https://book.servo.org/contributing.html)

4010
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -2,77 +2,88 @@
resolver = "2"
members = [
"ports/servoshell",
"ports/jniapi/",
"tests/unit/*",
"support/crown",
]
default-members = ["ports/servoshell"]
exclude = [".cargo"]
[workspace.package]
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2021"
publish = false
[workspace.dependencies]
accountable-refcell = "0.2.0"
app_units = "0.7"
arrayvec = "0.7"
async-tungstenite = { version = "0.23", features = ["tokio-rustls-webpki-roots"] }
atomic_refcell = "0.1.13"
background_hang_monitor_api = { path = "components/shared/background_hang_monitor" }
backtrace = "0.3"
base = { path = "components/shared/base" }
base64 = "0.21.7"
bitflags = "2.4"
bincode = "1"
bitflags = "2.6"
bluetooth_traits = { path = "components/shared/bluetooth" }
byteorder = "1.5"
canvas_traits = { path = "components/shared/canvas" }
cfg-if = "1.0.0"
chrono = { version = "0.4", features = ["serde"] }
compositing_traits = { path = "components/shared/compositing" }
content-security-policy = { version = "0.5", features = ["serde"] }
cookie = "0.12"
cookie = { package = "cookie", version = "0.18" }
crossbeam-channel = "0.5"
cssparser = "0.31.2"
cssparser = { version = "0.34", features = ["serde"] }
darling = { version = "0.20", default-features = false }
data-url = "0.1.0"
data-url = "0.3"
devtools_traits = { path = "components/shared/devtools" }
embedder_traits = { path = "components/shared/embedder" }
encoding_rs = "0.8"
env_logger = "0.10"
euclid = "0.22"
fnv = "1.0"
freetype-sys = "0.20"
fxhash = "0.2"
getopts = "0.2.11"
gfx_traits = { path = "components/shared/gfx" }
fonts_traits = { path = "components/shared/fonts" }
gleam = "0.15"
glib = "0.18"
gstreamer = { version = "0.21", features = ["v1_18"] }
gstreamer-base = "0.21"
gstreamer-gl = "0.21"
gstreamer-gl-sys = { version = "0.21" }
gstreamer-gl-wayland = { version = "0.21" }
gstreamer-sys = "0.21"
gstreamer-video = "0.21"
glib = "0.19"
gstreamer = { version = "0.22", features = ["v1_18"] }
gstreamer-base = "0.22"
gstreamer-gl = "0.22"
gstreamer-gl-sys = "0.22"
gstreamer-sys = "0.22"
gstreamer-video = "0.22"
headers = "0.3"
html5ever = "0.26"
html5ever = "0.28"
http = "0.2"
hyper = "0.14"
hyper-rustls = { version = "0.24", default-features = false, features = ["acceptor", "http1", "http2", "logging", "tls12", "webpki-tokio"] }
hyper_serde = { path = "components/hyper_serde" }
icu_segmenter = "1.5.0"
image = "0.24"
imsz = "0.2"
indexmap = { version = "2.2.3", features = ["std"] }
indexmap = { version = "2.5.0", features = ["std"] }
ipc-channel = "0.18"
itertools = "0.12"
jemallocator = "0.5.4"
jemalloc-sys = "0.5.4"
keyboard-types = "0.6"
layout_traits = { path = "components/shared/layout" }
lazy_static = "1.4"
itertools = "0.13"
tikv-jemalloc-sys = "0.6.0"
tikv-jemallocator = "0.6.0"
keyboard-types = "0.7"
libc = "0.2"
log = "0.4"
mach2 = "0.4"
malloc_size_of = { git = "https://github.com/servo/stylo", branch = "2024-07-16", features = ["servo"] }
malloc_size_of_derive = "0.1"
mime = "0.3.13"
mime_guess = "2.0.3"
mime_guess = "2.0.5"
mozangle = "0.5.1"
msg = { path = "components/shared/msg" }
net_traits = { path = "components/shared/net" }
num_cpus = "1.1.0"
nix = "0.29"
num-traits = "0.2"
num_cpus = "1.1.0"
parking_lot = "0.12"
percent-encoding = "2.3"
proc-macro2 = "1"
@@ -83,43 +94,59 @@ rand_core = "0.6"
rand_isaac = "0.3"
rayon = "1"
regex = "1.10"
rustls = { version = "0.21.10", features = ["dangerous_configuration"] }
rustls = { version = "0.21.12", features = ["dangerous_configuration"] }
rustls-pemfile = "1.0.4"
script_layout_interface = { path = "components/shared/script_layout" }
script_traits = { path = "components/shared/script" }
serde = "1.0.197"
selectors = { git = "https://github.com/servo/stylo", branch = "2024-07-16" }
serde = "1.0.209"
serde_bytes = "0.11"
serde_json = "1.0"
smallbitvec = "2.3.0"
servo-media = { git = "https://github.com/servo/media" }
servo-media-dummy = { git = "https://github.com/servo/media" }
servo-media-gstreamer = { git = "https://github.com/servo/media" }
servo_arc = { git = "https://github.com/servo/stylo", branch = "2024-07-16", features = ["servo"] }
servo_atoms = { git = "https://github.com/servo/stylo", branch = "2024-07-16" }
size_of_test = { git = "https://github.com/servo/stylo", branch = "2024-07-16" }
smallbitvec = "2.5.3"
smallvec = "1.13"
sparkle = "0.1.26"
string_cache = "0.8"
string_cache_codegen = "0.5"
style_traits = { path = "components/style_traits", features = ["servo"] }
# NOTE: the sm-angle feature only enables ANGLE on Windows, not other platforms!
surfman = { version = "0.9", features = ["chains", "sm-angle", "sm-angle-default"] }
style = { git = "https://github.com/servo/stylo", branch = "2024-07-16", features = ["servo"] }
style_config = { git = "https://github.com/servo/stylo", branch = "2024-07-16" }
style_dom = { git = "https://github.com/servo/stylo", package = "dom", branch = "2024-07-16" }
style_traits = { git = "https://github.com/servo/stylo", branch = "2024-07-16", features = ["servo"] }
surfman = { version = "0.9.8", features = ["chains"] }
syn = { version = "2", default-features = false, features = ["clone-impls", "derive", "parsing"] }
synstructure = "0.13"
thin-vec = "0.2.13"
time = "0.1.41"
time_03 = { package = "time", version = "0.3", features = ["large-dates", "serde"] }
to_shmem = { git = "https://github.com/servo/stylo", branch = "2024-07-16" }
tokio = "1"
tokio-rustls = "0.24"
tungstenite = "0.20"
tracing = "0.1.40"
tracing-subscriber = "0.3.18"
tracing-perfetto = "0.1.1"
uluru = "3.0"
unicode-bidi = "0.3.15"
unicode-properties = { version = "0.1.2", features = ["emoji"] }
unicode-script = "0.5"
unicode-segmentation = "1.1.0"
url = "2.5"
uuid = { version = "1.7.0", features = ["v4"] }
uuid = { version = "1.10.0", features = ["v4"] }
webdriver = "0.49.0"
webpki = "0.22"
webpki-roots = "0.25"
webrender = { git = "https://github.com/servo/webrender", rev = "f91b68a61", features = ["capture"] }
webrender_api = { git = "https://github.com/servo/webrender", rev = "f91b68a61" }
webrender = { git = "https://github.com/servo/webrender", branch = "0.65", features = ["capture"] }
webrender_api = { git = "https://github.com/servo/webrender", branch = "0.65" }
webrender_traits = { path = "components/shared/webrender" }
wgpu-core = "0.18"
wgpu-types = "0.18"
winapi = "0.3"
xi-unicode = "0.1.0"
xml5ever = "0.17"
wgpu-core = { git = "https://github.com/gfx-rs/wgpu", rev = "0e352f5b3448236b6cbebcd146d0606b00cb3806" }
wgpu-types = { git = "https://github.com/gfx-rs/wgpu", rev = "0e352f5b3448236b6cbebcd146d0606b00cb3806" }
windows-sys = "0.59"
xi-unicode = "0.3.0"
xml5ever = "0.19"
[profile.release]
opt-level = 3
@@ -131,6 +158,12 @@ debug-assertions = true
[profile.production]
inherits = "release"
debug-assertions = false
lto = "thin"
codegen-units = 1
[profile.production-stripped]
inherits = "production"
strip = true
[patch.crates-io]
# If you need to temporarily test Servo with a local fork of some upstream
@@ -138,7 +171,30 @@ debug-assertions = false
#
# <crate> = { path = "/path/to/local/checkout" }
#
# Or for a git dependency:
# Or for Stylo:
#
# [patch."https://github.com/servo/<repository>"]
# <crate> = { path = "/path/to/local/checkout" }
# [patch."https://github.com/servo/stylo"]
# derive_common = { path = "../stylo/derive_common" }
# dom = { path = "../stylo/dom" }
# malloc_size_of = { path = "../stylo/malloc_size_of" }
# selectors = { path = "../stylo/selectors" }
# servo_arc = { path = "../stylo/servo_arc" }
# servo_atoms = { path = "../stylo/atoms" }
# size_of_test = { path = "../stylo/size_of_test" }
# static_prefs = { path = "../stylo/style_static_prefs" }
# style = { path = "../stylo/style" }
# style_config = { path = "../stylo/style_config" }
# style_derive = { path = "../stylo/style_derive" }
# style_traits = { path = "../stylo/style_traits" }
# to_shmem = { path = "../stylo/to_shmem" }
#
# Or for WebRender:
#
# [patch."https://github.com/servo/webrender"]
# webrender = { path = "../webrender/webrender" }
# webrender_api = { path = "../webrender/webrender_api" }
#
# Or for another Git dependency:
#
# [patch."https://github.com/servo/<repository>"]
# <crate> = { path = "/path/to/local/checkout" }

204
README.md
View File

@@ -4,205 +4,63 @@ Servo is a prototype web browser engine written in the
[Rust](https://github.com/rust-lang/rust) language. It is currently developed on
64-bit macOS, 64-bit Linux, 64-bit Windows, and Android.
Servo welcomes contribution from everyone. See
[`CONTRIBUTING.md`](CONTRIBUTING.md) and [`HACKING_QUICKSTART.md`](docs/HACKING_QUICKSTART.md)
for help getting started.
Servo welcomes contribution from everyone. Check out [The Servo Book](https://book.servo.org) to get started, or go to [servo.org](https://servo.org/) for news and guides.
Visit the [Servo Project page](https://servo.org/) for news and guides.
## Getting started
## Build Setup
* [macOS](#macos)
* [Linux](#Linux)
* [Windows](#windows)
* [Android](https://github.com/servo/servo/wiki/Building-for-Android)
If these instructions fail or you would like to install dependencies
manually, try the [manual build setup][manual-build].
For more detailed build instructions, see the Servo book under [Setting up your environment](https://book.servo.org/hacking/setting-up-your-environment.html), [Building Servo](https://book.servo.org/hacking/building-servo.html), and [Building for Android](https://book.servo.org/hacking/building-for-android.html).
### macOS
- Ensure that the version showed by `python --version` is >= 3.10:
- Install [Xcode](https://developer.apple.com/xcode/)
- Install [Homebrew](https://brew.sh/)
- Run `curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh`
- Run `./mach bootstrap`<br/>
*Note: This will install the recommended version of GStreamer globally on your system.*
- Download and install [`python`](https://www.python.org/downloads/macos/), [Xcode](https://developer.apple.com/xcode/), and [`brew`](https://brew.sh/)
- Install `rustup`: `curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh`
- Restart your shell to make sure `cargo` is available
- Install the other dependencies: `./mach bootstrap`
- Build servoshell: `./mach build`
### Linux
- Run `curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh`
- Install Python (version >= 3.10):
- **Debian-like:** Run `sudo apt install python3-pip python3-venv`
- **Fedora:** Run `sudo dnf install python3 python3-pip python3-devel`
- **Arch:** Run `sudo pacman -S --needed python python-pip`
- **Gentoo:** Run `sudo emerge dev-python/pip`
- Run `./mach bootstrap`
- Install `curl` and `python`:
- Arch: `sudo pacman -S --needed curl python python-pip`
- Debian, Ubuntu: `sudo apt install curl python3-pip python3-venv`
- Fedora: `sudo dnf install curl python3 python3-pip python3-devel`
- Gentoo: `sudo emerge net-misc/curl dev-python/pip`
- Install `rustup`: `curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh`
- Restart your shell to make sure `cargo` is available
- Install the other dependencies: `./mach bootstrap`
- Build servoshell: `./mach build`
### Windows
- Download and run [`rustup-init.exe`](https://win.rustup.rs/)
- Make sure to select *Quick install via the Visual Studio Community
installer* or otherwise install Visual Studio 2022.
- In the *Visual Studio Installer* ensure the following components are installed for Visual Studio 2022:
- **Windows 10 SDK (10.0.19041.0)** (`Microsoft.VisualStudio.Component.Windows10SDK.19041`)
- **MSVC v143 - VS 2022 C++ x64/x86 build tools (Latest)** (`Microsoft.VisualStudio.Component.VC.Tools.x86.x64`)
- **C++ ATL for latest v143 build tools (x86 & x64)** (`Microsoft.VisualStudio.Component.VC.ATL`)
- **C++ MFC for latest v143 build tools (x86 & x64)** (`Microsoft.VisualStudio.Component.VC.ATLMFC`)
- Install [chocolatey](https://chocolatey.org/)
- Install [Python 3.11](https://www.python.org/downloads/windows/)
- Run `mach bootstrap`
+ *This will install CMake, Git, and Ninja via choco in an
Administrator console. Allow the scripts to run and once
the operation finishes, close the new console.*
- Run `refreshenv`
See also [Windows Troubleshooting Tips][windows-tips].
- Download and install [`python`](https://www.python.org/downloads/windows/), [`choco`](https://chocolatey.org/install#individual), and [`rustup`](https://win.rustup.rs/)
- Be sure to select *Quick install via the Visual Studio Community installer*
- In the Visual Studio Installer, ensure the following components are installed:
- **Windows 10 SDK (10.0.19041.0)** (`Microsoft.VisualStudio.Component.Windows10SDK.19041`)
- **MSVC v143 - VS 2022 C++ x64/x86 build tools (Latest)** (`Microsoft.VisualStudio.Component.VC.Tools.x86.x64`)
- **C++ ATL for latest v143 build tools (x86 & x64)** (`Microsoft.VisualStudio.Component.VC.ATL`)
- **C++ MFC for latest v143 build tools (x86 & x64)** (`Microsoft.VisualStudio.Component.VC.ATLMFC`)
- Restart your shell to make sure `cargo` is available
- Install the other dependencies: `.\mach bootstrap`
- Build servoshell: `.\mach build`
### Android
- Ensure that the following environment variables are set:
- `ANDROID_SDK_ROOT`
- `ANDROID_NDK_ROOT`: `$ANDROID_SDK_ROOT/ndk/25.2.9519653/`
- `ANDROID_NDK_ROOT`: `$ANDROID_SDK_ROOT/ndk/26.2.11394342/`
`ANDROID_SDK_ROOT` can be any directory (such as `~/android-sdk`).
All of the Android build dependencies will be installed there.
- Install the latest version of the [Android command-line
tools](https://developer.android.com/studio#command-tools) to
`$ANDROID_SDK_ROOT/cmdline-tools/latest`.
- Run the following command to install the necessary components and the path t
- Run the following command to install the necessary components:
```shell
sudo $ANDROID_SDK_ROOT/cmdline-tools/latest/bin/sdkmanager --install
"build-tools;33.0.2" \
"emulator" \
"ndk;25.2.9519653" \
"ndk;26.2.11394342" \
"platform-tools" \
"platforms;android-33" \
"system-images;android-33;google_apis;x86_64"
```
For information about building and running the Android build, see
the [Android documentation][android-docs].
### Cloning the Repo
Your CARGO_HOME needs to point to (or be in) the same drive as your Servo repository (See [#28530](https://github.com/servo/servo/issues/28530)).
``` sh
git clone https://github.com/servo/servo
cd servo
```
## Building
Servo is built with [Cargo](https://crates.io/), the Rust package manager.
We also use Mozilla's Mach tools to orchestrate the build and other tasks.
You can call Mach like this:
On Unix systems:
```
./mach [command] [arguments]
```
On Windows Commandline:
```
mach.bat [command] [arguments]
```
The examples below will use Unix, but the same applies to Windows.
### The Rust compiler
Servo's build system uses rustup.rs to automatically download a Rust compiler.
This is a specific version of Rust Nightly determined by the
[`rust-toolchain.toml`](https://github.com/servo/servo/blob/main/rust-toolchain.toml) file.
### Normal build
To build Servo in development mode.
This is useful for development, but the resulting binary is very slow:
``` sh
./mach build --dev
./mach run tests/html/about-mozilla.html
```
### Release build
For benchmarking, performance testing, or real-world use.
Add the `--release` flag to create an optimized build:
``` sh
./mach build --release
./mach run --release tests/html/about-mozilla.html
```
### Android build
For an armv7 Android build run the following command.
```shell
./mach build --android
```
### Checking for build errors, without building
If youre making changes to one crate that cause build errors in another crate,
consider this instead of a full build:
```sh
./mach check
```
It will run `cargo check`, which runs the analysis phase of the compiler
(and so shows build errors if any) but skips the code generation phase.
This can be a lot faster than a full build,
though of course it doesnt produce a binary you can run.
## Running
Run Servo with the command:
```sh
./servo [url] [arguments] # if you run with nightly build
./mach run [url] [arguments] # if you run with mach
# For example
./mach run https://www.google.com
```
### Commandline Arguments
- `-p INTERVAL` turns on the profiler and dumps info to the console every
`INTERVAL` seconds
- `-s SIZE` sets the tile size for painting; defaults to 512
- `-z` disables all graphical output; useful for running JS / layout tests
- `-Z help` displays useful output to debug servo
### Keyboard Shortcuts
- `Ctrl`+`L` opens URL prompt (`Cmd`+`L` on Mac)
- `Ctrl`+`R` reloads current page (`Cmd`+`R` on Mac)
- `Ctrl`+`-` zooms out (`Cmd`+`-` on Mac)
- `Ctrl`+`=` zooms in (`Cmd`+`=` on Mac)
- `Alt`+`left arrow` goes backwards in the history (`Cmd`+`left arrow` on Mac)
- `Alt`+`right arrow` goes forwards in the history (`Cmd`+`right arrow` on Mac)
- `Esc` or `Ctrl`+`Q` exits Servo (`Cmd`+`Q` on Mac)
### Runtime dependencies
#### Linux
* `GStreamer` >=1.18
* `gst-plugins-bad` >=1.18
* `libXcursor`
* `libXrandr`
* `libXi`
* `libxkbcommon`
* `vulkan-loader`
* `libegl1-mesa-dev`
## Developing
There are lots of mach commands you can use. You can list them with `./mach
--help`.
The generated documentation can be found on https://doc.servo.org/servo/index.html
[manual-build]: https://github.com/servo/servo/wiki/Building#manual-build-setup
[windows-tips]: https://github.com/servo/servo/wiki/Building#troubleshooting-the-windows-build
[android-docs]: https://github.com/servo/servo/wiki/Android
- Follow the instructions above for the platform you are building on

4
SECURITY.md Normal file
View File

@@ -0,0 +1,4 @@
# Security Policy
Given that Servo does not yet have customers or products, we are comfortable accepting the security related vulnerabilities as a [new GitHub issue](https://github.com/servo/servo/security/advisories/new) for now.

View File

@@ -1,20 +1,24 @@
[package]
name = "servo_allocator"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2018"
publish = false
version.workspace = true
authors.workspace = true
license.workspace = true
edition.workspace = true
publish.workspace = true
[lib]
path = "lib.rs"
[target.'cfg(not(any(windows, target_os = "android")))'.dependencies]
jemallocator = { workspace = true }
jemalloc-sys = { workspace = true }
[features]
use-system-allocator = ["libc"]
[target.'cfg(not(any(windows, target_env = "ohos")))'.dependencies]
tikv-jemallocator = { workspace = true }
tikv-jemalloc-sys = { workspace = true }
libc = { workspace = true, optional = true }
[target.'cfg(windows)'.dependencies]
winapi = { workspace = true, features = ["heapapi"] }
windows-sys = { workspace = true, features = ["Win32_System_Memory"] }
[target.'cfg(target_os = "android")'.dependencies]
[target.'cfg(target_env = "ohos")'.dependencies]
libc = { workspace = true }

View File

@@ -9,33 +9,46 @@ static ALLOC: Allocator = Allocator;
pub use crate::platform::*;
#[cfg(not(any(windows, target_os = "android")))]
#[cfg(not(any(windows, feature = "use-system-allocator", target_env = "ohos")))]
mod platform {
use std::os::raw::c_void;
use jemallocator;
pub use self::jemallocator::Jemalloc as Allocator;
pub use tikv_jemallocator::Jemalloc as Allocator;
/// Get the size of a heap block.
///
/// # Safety
///
/// Passing a non-heap allocated pointer to this function results in undefined behavior.
pub unsafe extern "C" fn usable_size(ptr: *const c_void) -> usize {
jemallocator::usable_size(ptr)
tikv_jemallocator::usable_size(ptr)
}
/// Memory allocation APIs compatible with libc
pub mod libc_compat {
pub use jemalloc_sys::{free, malloc, realloc};
pub use tikv_jemalloc_sys::{free, malloc, realloc};
}
}
#[cfg(target_os = "android")]
#[cfg(all(
not(windows),
any(feature = "use-system-allocator", target_env = "ohos")
))]
mod platform {
pub use std::alloc::System as Allocator;
use std::os::raw::c_void;
/// Get the size of a heap block.
///
/// # Safety
///
/// Passing a non-heap allocated pointer to this function results in undefined behavior.
pub unsafe extern "C" fn usable_size(ptr: *const c_void) -> usize {
libc::malloc_usable_size(ptr)
#[cfg(target_vendor = "apple")]
return libc::malloc_size(ptr);
#[cfg(not(target_vendor = "apple"))]
return libc::malloc_usable_size(ptr as *mut _);
}
pub mod libc_compat {
@@ -48,14 +61,19 @@ mod platform {
pub use std::alloc::System as Allocator;
use std::os::raw::c_void;
use winapi::um::heapapi::{GetProcessHeap, HeapSize, HeapValidate};
use windows_sys::Win32::Foundation::FALSE;
use windows_sys::Win32::System::Memory::{GetProcessHeap, HeapSize, HeapValidate};
/// Get the size of a heap block.
///
/// # Safety
///
/// Passing a non-heap allocated pointer to this function results in undefined behavior.
pub unsafe extern "C" fn usable_size(mut ptr: *const c_void) -> usize {
let heap = GetProcessHeap();
if HeapValidate(heap, 0, ptr) == 0 {
ptr = *(ptr as *const *const c_void).offset(-1);
if HeapValidate(heap, 0, ptr) == FALSE {
ptr = *(ptr as *const *const c_void).offset(-1)
}
HeapSize(heap, 0, ptr) as usize

View File

@@ -1,17 +0,0 @@
[package]
name = "servo_atoms"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2018"
publish = false
build = "build.rs"
[lib]
path = "lib.rs"
[dependencies]
string_cache = { workspace = true }
[build-dependencies]
string_cache_codegen = { workspace = true }

View File

@@ -1,31 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use std::env;
use std::fs::File;
use std::io::{BufRead, BufReader};
use std::path::Path;
fn main() {
let static_atoms =
Path::new(&env::var_os("CARGO_MANIFEST_DIR").unwrap()).join("static_atoms.txt");
let static_atoms = BufReader::new(File::open(&static_atoms).unwrap());
let mut atom_type = string_cache_codegen::AtomType::new("Atom", "atom!");
macro_rules! predefined {
($($name: expr,)+) => {
{
$(
atom_type.atom($name);
)+
}
}
}
include!("../style/counter_style/predefined.rs");
atom_type
.atoms(static_atoms.lines().map(Result::unwrap))
.write_to_file(&Path::new(&env::var_os("OUT_DIR").unwrap()).join("atom.rs"))
.unwrap();
}

View File

@@ -1,5 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
include!(concat!(env!("OUT_DIR"), "/atom.rs"));

View File

@@ -1,174 +0,0 @@
-moz-content-preferred-color-scheme
-moz-device-pixel-ratio
-moz-gtk-csd-close-button-position
-moz-gtk-csd-maximize-button-position
-moz-gtk-csd-menu-radius
-moz-gtk-csd-minimize-button-position
-moz-gtk-csd-titlebar-radius
-moz-gtk-menu-radius
DOMContentLoaded
abort
activate
addtrack
animationcancel
animationend
animationiteration
animationstart
aspect-ratio
beforeunload
block-size
button
canplay
canplaythrough
center
change
characteristicvaluechanged
checkbox
click
close
closing
color
complete
compositionend
compositionstart
compositionupdate
controllerchange
cursive
dark
datachannel
date
datetime-local
dir
device-pixel-ratio
durationchange
email
emptied
end
ended
error
fantasy
fetch
file
fill
fill-opacity
formdata
fullscreenchange
fullscreenerror
gattserverdisconnected
hashchange
height
hidden
icecandidate
iceconnectionstatechange
icegatheringstatechange
image
inline-size
input
inputsourceschange
invalid
keydown
keypress
kind
left
light
ltr
load
loadeddata
loadedmetadata
loadend
loadstart
message
message
messageerror
monospace
month
mousedown
mousemove
mouseover
mouseup
negotiationneeded
none
normal
number
onchange
open
orientation
pagehide
pageshow
password
pause
play
playing
popstate
postershown
print
progress
radio
range
ratechange
readystatechange
referrer
reftest-wait
rejectionhandled
removetrack
reset
resize
resolution
resourcetimingbufferfull
right
rtl
sans-serif
safe-area-inset-top
safe-area-inset-bottom
safe-area-inset-left
safe-area-inset-right
scan
screen
scroll-position
scrollbar-inline-size
search
seeked
seeking
select
selectend
selectionchange
selectstart
serif
sessionavailable
signalingstatechange
squeeze
squeezeend
squeezestart
srclang
statechange
stroke
stroke-opacity
storage
submit
suspend
system-ui
tel
text
time
timeupdate
toggle
track
transitioncancel
transitionend
transitionrun
transitionstart
uncapturederror
unhandledrejection
unload
url
visibilitychange
volumechange
waiting
webglcontextcreationerror
webkitAnimationEnd
webkitAnimationIteration
webkitAnimationStart
webkitTransitionEnd
webkitTransitionRun
week
width

View File

@@ -1,10 +1,10 @@
[package]
name = "background_hang_monitor"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
publish = false
edition = "2018"
version.workspace = true
authors.workspace = true
license.workspace = true
edition.workspace = true
publish.workspace = true
[lib]
name = "background_hang_monitor"
@@ -13,20 +13,18 @@ test = false
doctest = false
[dependencies]
background_hang_monitor_api = { workspace = true }
backtrace = { workspace = true }
base = { workspace = true }
crossbeam-channel = { workspace = true }
ipc-channel = { workspace = true }
libc = { workspace = true }
log = { workspace = true }
msg = { workspace = true }
serde_json = { workspace = true }
[dev-dependencies]
lazy_static = { workspace = true }
[target.'cfg(target_os = "macos")'.dependencies]
mach2 = "0.4"
[target.'cfg(all(target_os = "linux", not(any(target_arch = "arm", target_arch = "aarch64"))))'.dependencies]
nix = "0.25"
[target.'cfg(all(target_os = "linux", not(any(target_arch = "arm", target_arch = "aarch64", target_env = "ohos", target_env = "musl"))))'.dependencies]
nix = { workspace = true, features = ["signal"] }
unwind-sys = "0.1.4"

View File

@@ -8,15 +8,15 @@ use std::sync::{Arc, Weak};
use std::thread;
use std::time::{Duration, Instant};
use crossbeam_channel::{after, never, select, unbounded, Receiver, Sender};
use ipc_channel::ipc::{IpcReceiver, IpcSender};
use ipc_channel::router::ROUTER;
use log::warn;
use msg::constellation_msg::{
use background_hang_monitor_api::{
BackgroundHangMonitor, BackgroundHangMonitorClone, BackgroundHangMonitorControlMsg,
BackgroundHangMonitorExitSignal, BackgroundHangMonitorRegister, HangAlert, HangAnnotation,
HangMonitorAlert, MonitoredComponentId,
};
use crossbeam_channel::{after, never, select, unbounded, Receiver, Sender};
use ipc_channel::ipc::{IpcReceiver, IpcSender};
use ipc_channel::router::ROUTER;
use log::warn;
use crate::sampler::{NativeStack, Sampler};
@@ -49,6 +49,7 @@ impl HangMonitorRegister {
let (tether, tether_port) = unbounded();
let _ = thread::Builder::new()
.name("BackgroundHangMonitor".to_owned())
.spawn(move || {
let mut monitor = BackgroundHangMonitorWorker::new(
constellation_chan,
@@ -92,19 +93,32 @@ impl BackgroundHangMonitorRegister for HangMonitorRegister {
target_os = "windows",
any(target_arch = "x86_64", target_arch = "x86")
))]
let sampler = crate::sampler_windows::WindowsSampler::new();
let sampler = crate::sampler_windows::WindowsSampler::new_boxed();
#[cfg(target_os = "macos")]
let sampler = crate::sampler_mac::MacOsSampler::new();
let sampler = crate::sampler_mac::MacOsSampler::new_boxed();
#[cfg(all(
target_os = "linux",
not(any(target_arch = "arm", target_arch = "aarch64"))
not(any(
target_arch = "arm",
target_arch = "aarch64",
target_env = "ohos",
target_env = "musl"
)),
))]
let sampler = crate::sampler_linux::LinuxSampler::new();
let sampler = crate::sampler_linux::LinuxSampler::new_boxed();
#[cfg(any(
target_os = "android",
all(target_os = "linux", any(target_arch = "arm", target_arch = "aarch64"))
all(
target_os = "linux",
any(
target_arch = "arm",
target_arch = "aarch64",
target_env = "ohos",
target_env = "musl"
)
)
))]
let sampler = crate::sampler::DummySampler::new();
let sampler = crate::sampler::DummySampler::new_boxed();
// When a component is registered, and there's an exit request that
// reached BHM, we want an exit signal to be delivered to the
@@ -208,7 +222,7 @@ impl BackgroundHangMonitorChan {
BackgroundHangMonitorChan {
sender,
_tether: tether,
component_id: component_id,
component_id,
disconnected: Default::default(),
monitoring_enabled,
}
@@ -312,14 +326,14 @@ struct BackgroundHangMonitorWorker {
monitoring_enabled: bool,
}
type MonitoredComponentSender = Sender<(MonitoredComponentId, MonitoredComponentMsg)>;
type MonitoredComponentReceiver = Receiver<(MonitoredComponentId, MonitoredComponentMsg)>;
impl BackgroundHangMonitorWorker {
fn new(
constellation_chan: IpcSender<HangMonitorAlert>,
control_port: IpcReceiver<BackgroundHangMonitorControlMsg>,
(port_sender, port): (
Arc<Sender<(MonitoredComponentId, MonitoredComponentMsg)>>,
Receiver<(MonitoredComponentId, MonitoredComponentMsg)>,
),
(port_sender, port): (Arc<MonitoredComponentSender>, MonitoredComponentReceiver),
tether_port: Receiver<Never>,
monitoring_enabled: bool,
) -> Self {
@@ -360,7 +374,7 @@ impl BackgroundHangMonitorWorker {
let profile = stack.to_hangprofile();
let name = match self.component_names.get(&id) {
Some(ref s) => format!("\"{}\"", s),
None => format!("null"),
None => "null".to_string(),
};
let json = format!(
"{}{{ \"name\": {}, \"namespace\": {}, \"index\": {}, \"type\": \"{:?}\", \
@@ -389,12 +403,10 @@ impl BackgroundHangMonitorWorker {
.checked_sub(Instant::now() - self.last_sample)
.unwrap_or_else(|| Duration::from_millis(0));
after(duration)
} else if self.monitoring_enabled {
after(Duration::from_millis(100))
} else {
if self.monitoring_enabled {
after(Duration::from_millis(100))
} else {
never()
}
never()
};
let received = select! {
@@ -403,13 +415,8 @@ impl BackgroundHangMonitorWorker {
// gets disconnected.
Some(event.unwrap())
},
recv(self.tether_port) -> event => {
recv(self.tether_port) -> _ => {
// This arm can only reached by a tether disconnection
match event {
Ok(x) => match x {}
Err(_) => {}
}
// All associated `HangMonitorRegister` and
// `BackgroundHangMonitorChan` have been dropped. Suppress
// `signal_to_exit` and exit the BHM.

View File

@@ -8,7 +8,12 @@ pub mod background_hang_monitor;
mod sampler;
#[cfg(all(
target_os = "linux",
not(any(target_arch = "arm", target_arch = "aarch64"))
not(any(
target_arch = "arm",
target_arch = "aarch64",
target_env = "ohos",
target_env = "musl"
))
))]
mod sampler_linux;
#[cfg(target_os = "macos")]

View File

@@ -4,8 +4,7 @@
use std::ptr;
use backtrace;
use msg::constellation_msg::{HangProfile, HangProfileSymbol};
use background_hang_monitor_api::{HangProfile, HangProfileSymbol};
const MAX_NATIVE_FRAMES: usize = 1024;
@@ -18,7 +17,7 @@ pub struct DummySampler;
impl DummySampler {
#[allow(dead_code)]
pub fn new() -> Box<dyn Sampler> {
pub fn new_boxed() -> Box<dyn Sampler> {
Box::new(DummySampler)
}
}
@@ -44,13 +43,17 @@ pub struct Registers {
pub frame_ptr: Address,
}
#[allow(dead_code)]
pub struct NativeStack {
instruction_ptrs: [*mut std::ffi::c_void; MAX_NATIVE_FRAMES],
#[allow(dead_code)]
stack_ptrs: [*mut std::ffi::c_void; MAX_NATIVE_FRAMES],
#[allow(dead_code)]
count: usize,
}
impl NativeStack {
#[allow(dead_code)]
pub fn new() -> Self {
NativeStack {
instruction_ptrs: [ptr::null_mut(); MAX_NATIVE_FRAMES],
@@ -59,17 +62,18 @@ impl NativeStack {
}
}
#[allow(dead_code)]
pub fn process_register(
&mut self,
instruction_ptr: *mut std::ffi::c_void,
stack_ptr: *mut std::ffi::c_void,
) -> Result<(), ()> {
if !(self.count < MAX_NATIVE_FRAMES) {
if self.count >= MAX_NATIVE_FRAMES {
return Err(());
}
self.instruction_ptrs[self.count] = instruction_ptr;
self.stack_ptrs[self.count] = stack_ptr;
self.count = self.count + 1;
self.count += 1;
Ok(())
}
@@ -85,7 +89,7 @@ impl NativeStack {
// TODO: use the demangled or C++ demangled symbols if available.
let name = symbol
.name()
.map(|n| String::from_utf8_lossy(&n.as_bytes()).to_string());
.map(|n| String::from_utf8_lossy(n.as_bytes()).to_string());
let filename = symbol.filename().map(|n| n.to_string_lossy().to_string());
let lineno = symbol.lineno();
profile.backtrace.push(HangProfileSymbol {

View File

@@ -6,9 +6,8 @@
use std::cell::UnsafeCell;
use std::sync::atomic::{AtomicPtr, Ordering};
use std::{io, mem, process, ptr, thread};
use std::{cmp, io, mem, process, ptr, thread};
use libc;
use nix::sys::signal::{sigaction, SaFlags, SigAction, SigHandler, SigSet, Signal};
use unwind_sys::{
unw_cursor_t, unw_get_reg, unw_init_local, unw_step, UNW_ESUCCESS, UNW_REG_IP, UNW_REG_SP,
@@ -138,7 +137,7 @@ pub struct LinuxSampler {
impl LinuxSampler {
#[allow(unsafe_code, dead_code)]
pub fn new() -> Box<dyn Sampler> {
pub fn new_boxed() -> Box<dyn Sampler> {
let thread_id = unsafe { libc::syscall(libc::SYS_gettid) as libc::pid_t };
let handler = SigHandler::SigAction(sigprof_handler);
let action = SigAction::new(
@@ -181,12 +180,10 @@ fn step(cursor: *mut unw_cursor_t) -> Result<bool, i32> {
}
let ret = unw_step(cursor);
if ret > 0 {
Ok(true)
} else if ret == 0 {
Ok(false)
} else {
Err(ret)
match ret.cmp(&0) {
cmp::Ordering::Less => Err(ret),
cmp::Ordering::Greater => Ok(true),
cmp::Ordering::Equal => Ok(false),
}
}
}
@@ -222,6 +219,7 @@ impl Sampler for LinuxSampler {
let ret = unsafe { unw_init_local(cursor.as_mut_ptr(), context) };
result = if ret == UNW_ESUCCESS {
let mut native_stack = NativeStack::new();
#[allow(clippy::while_let_loop)] // False positive
loop {
let ip = match get_register(cursor.as_mut_ptr(), RegNum::Ip) {
Ok(ip) => ip,

View File

@@ -4,8 +4,6 @@
use std::{panic, process};
use {libc, mach2};
use crate::sampler::{Address, NativeStack, Registers, Sampler};
type MonitoredThreadId = mach2::mach_types::thread_act_t;
@@ -16,7 +14,7 @@ pub struct MacOsSampler {
impl MacOsSampler {
#[allow(unsafe_code)]
pub fn new() -> Box<dyn Sampler> {
pub fn new_boxed() -> Box<dyn Sampler> {
let thread_id = unsafe { mach2::mach_init::mach_thread_self() };
Box::new(MacOsSampler { thread_id })
}

View File

@@ -4,7 +4,7 @@
use crate::sampler::{NativeStack, Sampler};
type MonitoredThreadId = usize; // TODO: use winapi
type MonitoredThreadId = usize; // TODO: use the `windows` crate to do this.
#[allow(dead_code)]
pub struct WindowsSampler {
@@ -13,8 +13,8 @@ pub struct WindowsSampler {
impl WindowsSampler {
#[allow(unsafe_code, dead_code)]
pub fn new() -> Box<dyn Sampler> {
let thread_id = 0; // TODO: use winapi::um::processthreadsapi::GetThreadId
pub fn new_boxed() -> Box<dyn Sampler> {
let thread_id = 0; // TODO: use windows::Win32::System::Threading::GetThreadId
Box::new(WindowsSampler { thread_id })
}
}
@@ -28,11 +28,11 @@ impl Sampler for WindowsSampler {
// or any other unshareable resource.
// TODO:
// 1: use winapi::um::processthreadsapi::SuspendThread
// 2: use winapi::um::processthreadsapi::GetThreadContext
// 1: use windows::Win32::Threading::SuspendThread
// 2: use windows::Win32::Threading::GetThreadContext
// 3: populate registers using the context, see
// https://dxr.mozilla.org/mozilla-central/source/tools/profiler/core/platform-win32.cpp#129
// 4: use winapi::um::processthreadsapi::ResumeThread
// 4: use windows::Win32::Threading::ResumeThread
// NOTE: End of "critical section".
Err(())

View File

@@ -10,16 +10,14 @@ use std::thread;
use std::time::Duration;
use background_hang_monitor::HangMonitorRegister;
use ipc_channel::ipc;
use msg::constellation_msg::{
use background_hang_monitor_api::{
BackgroundHangMonitorControlMsg, BackgroundHangMonitorExitSignal, HangAlert, HangAnnotation,
HangMonitorAlert, MonitoredComponentId, MonitoredComponentType, ScriptHangAnnotation,
TEST_PIPELINE_ID,
};
use base::id::TEST_PIPELINE_ID;
use ipc_channel::ipc;
lazy_static::lazy_static! {
static ref SERIAL: Mutex<()> = Mutex::new(());
}
static SERIAL: Mutex<()> = Mutex::new(());
#[test]
fn test_hang_monitoring() {

View File

@@ -1,10 +1,10 @@
[package]
name = "bluetooth"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2018"
publish = false
version.workspace = true
authors.workspace = true
license.workspace = true
edition.workspace = true
publish.workspace = true
[lib]
name = "bluetooth"

View File

@@ -197,6 +197,7 @@ impl BluetoothAdapter {
pub fn create_discovery_session(&self) -> Result<BluetoothDiscoverySession, Box<dyn Error>> {
let discovery_session = match self {
#[cfg(all(target_os = "linux", feature = "native-bluetooth"))]
#[allow(clippy::arc_with_non_send_sync)] // Problem with underlying library
BluetoothAdapter::Bluez(inner) => BluetoothDiscoverySession::Bluez(Arc::new(
BluetoothDiscoverySessionBluez::create_session(inner.get_id())?,
)),
@@ -292,7 +293,10 @@ impl BluetoothAdapter {
pub fn set_id(&self, id: String) -> Result<(), Box<dyn Error>> {
match self {
#[cfg(feature = "bluetooth-test")]
BluetoothAdapter::Mock(inner) => Ok(inner.set_id(id)),
BluetoothAdapter::Mock(inner) => {
inner.set_id(id);
Ok(())
},
_ => Err(Box::from(
"Error! Test functions are not supported on real devices!",
)),

View File

@@ -83,8 +83,7 @@ use super::macros::get_inner_and_call;
use super::macros::get_inner_and_call_test_func;
#[cfg(feature = "bluetooth-test")]
const NOT_SUPPORTED_ON_MOCK_ERROR: &'static str =
"Error! The first parameter must be a mock structure!";
const NOT_SUPPORTED_ON_MOCK_ERROR: &str = "Error! The first parameter must be a mock structure!";
#[derive(Debug)]
pub enum BluetoothDiscoverySession {
@@ -193,9 +192,8 @@ impl BluetoothDevice {
#[cfg(feature = "bluetooth-test")]
pub fn set_id(&self, id: String) {
match self {
&BluetoothDevice::Mock(ref fake_adapter) => fake_adapter.set_id(id),
_ => (),
if let BluetoothDevice::Mock(fake_adapter) = self {
fake_adapter.set_id(id)
}
}
@@ -473,9 +471,8 @@ impl BluetoothGATTService {
#[cfg(feature = "bluetooth-test")]
pub fn set_id(&self, id: String) {
match self {
&BluetoothGATTService::Mock(ref fake_service) => fake_service.set_id(id),
_ => (),
if let BluetoothGATTService::Mock(fake_service) = self {
fake_service.set_id(id)
}
}
@@ -578,11 +575,8 @@ impl BluetoothGATTCharacteristic {
#[cfg(feature = "bluetooth-test")]
pub fn set_id(&self, id: String) {
match self {
&BluetoothGATTCharacteristic::Mock(ref fake_characteristic) => {
fake_characteristic.set_id(id)
},
_ => (),
if let BluetoothGATTCharacteristic::Mock(fake_characteristic) = self {
fake_characteristic.set_id(id)
}
}
@@ -710,9 +704,8 @@ impl BluetoothGATTDescriptor {
#[cfg(feature = "bluetooth-test")]
pub fn set_id(&self, id: String) {
match self {
&BluetoothGATTDescriptor::Mock(ref fake_descriptor) => fake_descriptor.set_id(id),
_ => (),
if let BluetoothGATTDescriptor::Mock(fake_descriptor) = self {
fake_descriptor.set_id(id)
}
}

View File

@@ -6,7 +6,7 @@ use std::collections::HashMap;
use std::error::Error;
use std::sync::Arc;
const NOT_SUPPORTED_ERROR: &'static str = "Error! Not supported platform!";
const NOT_SUPPORTED_ERROR: &str = "Error! Not supported platform!";
#[derive(Clone, Debug)]
pub struct EmptyAdapter {}

View File

@@ -120,7 +120,7 @@ fn matches_filter(device: &BluetoothDevice, filter: &BluetoothScanfilter) -> boo
if !filter.get_services().is_empty() {
if let Ok(device_uuids) = device.get_uuids() {
for service in filter.get_services() {
if device_uuids.iter().find(|x| x == &service).is_none() {
if !device_uuids.iter().any(|x| x == service) {
return false;
}
}
@@ -128,12 +128,12 @@ fn matches_filter(device: &BluetoothDevice, filter: &BluetoothScanfilter) -> boo
}
// Step 4.
if let Some(ref manufacturer_data) = filter.get_manufacturer_data() {
if let Some(manufacturer_data) = filter.get_manufacturer_data() {
let advertised_manufacturer_data = match device.get_manufacturer_data() {
Ok(data) => data,
Err(_) => return false,
};
for (ref id, &(ref prefix, ref mask)) in manufacturer_data.iter() {
for (id, (prefix, mask)) in manufacturer_data.iter() {
if let Some(advertised_data) = advertised_manufacturer_data.get(id) {
if !data_filter_matches(advertised_data, prefix, mask) {
return false;
@@ -145,12 +145,12 @@ fn matches_filter(device: &BluetoothDevice, filter: &BluetoothScanfilter) -> boo
}
// Step 5.
if let Some(ref service_data) = filter.get_service_data() {
if let Some(service_data) = filter.get_service_data() {
let advertised_service_data = match device.get_service_data() {
Ok(data) => data,
Err(_) => return false,
};
for (uuid, &(ref prefix, ref mask)) in service_data.iter() {
for (uuid, (prefix, mask)) in service_data.iter() {
if let Some(advertised_data) = advertised_service_data.get(uuid.as_str()) {
if !data_filter_matches(advertised_data, prefix, mask) {
return false;
@@ -193,10 +193,7 @@ fn matches_filters(device: &BluetoothDevice, filters: &BluetoothScanfilterSequen
}
fn is_mock_adapter(adapter: &BluetoothAdapter) -> bool {
match adapter {
&BluetoothAdapter::Mock(_) => true,
_ => false,
}
matches!(adapter, &BluetoothAdapter::Mock(_))
}
pub struct BluetoothManager {
@@ -299,7 +296,7 @@ impl BluetoothManager {
self.allowed_services.clear();
self.adapter = BluetoothAdapter::new_mock().ok();
match test::test(self, data_set_name) {
Ok(_) => return Ok(()),
Ok(_) => Ok(()),
Err(error) => Err(BluetoothError::Type(error.to_string())),
}
}
@@ -352,18 +349,19 @@ impl BluetoothManager {
if !adapter.is_powered().unwrap_or(false) {
return Err(BluetoothError::NotFound);
}
return Ok(adapter);
Ok(adapter)
},
None => return Err(BluetoothError::NotFound),
None => Err(BluetoothError::NotFound),
}
}
// Device
fn get_and_cache_devices(&mut self, adapter: &mut BluetoothAdapter) -> Vec<BluetoothDevice> {
let devices = adapter.get_devices().unwrap_or(vec![]);
let devices = adapter.get_devices().unwrap_or_default();
for device in &devices {
if let Ok(address) = device.get_address() {
#[allow(clippy::map_entry)] // False positive, the fix creates a borrowing error
if !self.address_to_id.contains_key(&address) {
let generated_id = self.generate_device_id();
self.address_to_id.insert(address, generated_id.clone());
@@ -373,7 +371,7 @@ impl BluetoothManager {
}
}
}
self.cached_devices.iter().map(|(_, d)| d.clone()).collect()
self.cached_devices.values().cloned().collect()
}
fn get_device(
@@ -454,7 +452,7 @@ impl BluetoothManager {
) -> BluetoothResult<bool> {
let mut adapter = self.get_adapter()?;
match self.get_device(&mut adapter, device_id) {
Some(ref device) => Ok(matches_filters(device, filters)),
Some(device) => Ok(matches_filters(device, filters)),
None => Ok(false),
}
}
@@ -467,14 +465,14 @@ impl BluetoothManager {
device_id: &str,
) -> Vec<BluetoothGATTService> {
let mut services = match self.get_device(adapter, device_id) {
Some(d) => d.get_gatt_services().unwrap_or(vec![]),
Some(d) => d.get_gatt_services().unwrap_or_default(),
None => vec![],
};
services.retain(|s| {
!uuid_is_blocklisted(&s.get_uuid().unwrap_or(String::new()), Blocklist::All) &&
!uuid_is_blocklisted(&s.get_uuid().unwrap_or_default(), Blocklist::All) &&
self.allowed_services.get(device_id).map_or(false, |uuids| {
uuids.contains(&s.get_uuid().unwrap_or(String::new()))
uuids.contains(&s.get_uuid().unwrap_or_default())
})
});
for service in &services {
@@ -511,13 +509,12 @@ impl BluetoothManager {
service_id: &str,
) -> Vec<BluetoothGATTCharacteristic> {
let mut characteristics = match self.get_gatt_service(adapter, service_id) {
Some(s) => s.get_gatt_characteristics().unwrap_or(vec![]),
Some(s) => s.get_gatt_characteristics().unwrap_or_default(),
None => vec![],
};
characteristics.retain(|c| {
!uuid_is_blocklisted(&c.get_uuid().unwrap_or(String::new()), Blocklist::All)
});
characteristics
.retain(|c| !uuid_is_blocklisted(&c.get_uuid().unwrap_or_default(), Blocklist::All));
for characteristic in &characteristics {
self.cached_characteristics
.insert(characteristic.get_id(), characteristic.clone());
@@ -544,7 +541,7 @@ impl BluetoothManager {
fn get_characteristic_properties(&self, characteristic: &BluetoothGATTCharacteristic) -> Flags {
let mut props: Flags = Flags::empty();
let flags = characteristic.get_flags().unwrap_or(vec![]);
let flags = characteristic.get_flags().unwrap_or_default();
for flag in flags {
match flag.as_ref() {
"broadcast" => props.insert(Flags::BROADCAST),
@@ -576,13 +573,12 @@ impl BluetoothManager {
characteristic_id: &str,
) -> Vec<BluetoothGATTDescriptor> {
let mut descriptors = match self.get_gatt_characteristic(adapter, characteristic_id) {
Some(c) => c.get_gatt_descriptors().unwrap_or(vec![]),
Some(c) => c.get_gatt_descriptors().unwrap_or_default(),
None => vec![],
};
descriptors.retain(|d| {
!uuid_is_blocklisted(&d.get_uuid().unwrap_or(String::new()), Blocklist::All)
});
descriptors
.retain(|d| !uuid_is_blocklisted(&d.get_uuid().unwrap_or_default(), Blocklist::All));
for descriptor in &descriptors {
self.cached_descriptors
.insert(descriptor.get_id(), descriptor.clone());
@@ -617,11 +613,10 @@ impl BluetoothManager {
// Step 7.
// Note: There are no requiredServiceUUIDS, we scan for all devices.
if let Ok(ref session) = adapter.create_discovery_session() {
if session.start_discovery().is_ok() {
if !is_mock_adapter(&adapter) {
thread::sleep(Duration::from_millis(DISCOVERY_TIMEOUT_MS));
}
if session.start_discovery().is_ok() && !is_mock_adapter(&adapter) {
thread::sleep(Duration::from_millis(DISCOVERY_TIMEOUT_MS));
}
let _ = session.stop_discovery();
}
@@ -629,10 +624,7 @@ impl BluetoothManager {
// Step 8.
if !options.is_accepting_all_devices() {
matched_devices = matched_devices
.into_iter()
.filter(|d| matches_filters(d, options.get_filters()))
.collect();
matched_devices.retain(|d| matches_filters(d, options.get_filters()));
}
// Step 9.
@@ -655,7 +647,7 @@ impl BluetoothManager {
}
}
// Step 10.
return Err(BluetoothError::NotFound);
Err(BluetoothError::NotFound)
// Step 12: Missing, because it is optional.
}
@@ -686,9 +678,9 @@ impl BluetoothManager {
// TODO: Step 5.1.4: Use the exchange MTU procedure.
}
// Step 5.1.3.
return Err(BluetoothError::Network);
Err(BluetoothError::Network)
},
None => return Err(BluetoothError::NotFound),
None => Err(BluetoothError::NotFound),
}
}
@@ -709,9 +701,9 @@ impl BluetoothManager {
return Ok(());
}
}
return Err(BluetoothError::Network);
Err(BluetoothError::Network)
},
None => return Err(BluetoothError::NotFound),
None => Err(BluetoothError::NotFound),
}
}
@@ -742,14 +734,14 @@ impl BluetoothManager {
}
let mut services = self.get_and_cache_gatt_services(&mut adapter, &id);
if let Some(uuid) = uuid {
services.retain(|ref e| e.get_uuid().unwrap_or(String::new()) == uuid);
services.retain(|e| e.get_uuid().unwrap_or_default() == uuid);
}
let mut services_vec = vec![];
for service in services {
if service.is_primary().unwrap_or(false) {
if let Ok(uuid) = service.get_uuid() {
services_vec.push(BluetoothServiceMsg {
uuid: uuid,
uuid,
is_primary: true,
instance_id: service.get_id(),
});
@@ -761,7 +753,7 @@ impl BluetoothManager {
return Err(BluetoothError::NotFound);
}
return Ok(BluetoothResponse::GetPrimaryServices(services_vec, single));
Ok(BluetoothResponse::GetPrimaryServices(services_vec, single))
},
GATTType::Characteristic => {
// Step 5.
@@ -772,14 +764,14 @@ impl BluetoothManager {
let mut characteristics =
self.get_and_cache_gatt_characteristics(&mut adapter, &id);
if let Some(uuid) = uuid {
characteristics.retain(|ref e| e.get_uuid().unwrap_or(String::new()) == uuid);
characteristics.retain(|e| e.get_uuid().unwrap_or_default() == uuid);
}
let mut characteristics_vec = vec![];
for characteristic in characteristics {
if let Ok(uuid) = characteristic.get_uuid() {
let properties = self.get_characteristic_properties(&characteristic);
characteristics_vec.push(BluetoothCharacteristicMsg {
uuid: uuid,
uuid,
instance_id: characteristic.get_id(),
broadcast: properties.contains(Flags::BROADCAST),
read: properties.contains(Flags::READ),
@@ -801,10 +793,10 @@ impl BluetoothManager {
return Err(BluetoothError::NotFound);
}
return Ok(BluetoothResponse::GetCharacteristics(
Ok(BluetoothResponse::GetCharacteristics(
characteristics_vec,
single,
));
))
},
GATTType::IncludedService => {
// Step 5.
@@ -832,7 +824,7 @@ impl BluetoothManager {
}
}
if let Some(uuid) = uuid {
services_vec.retain(|ref s| s.uuid == uuid);
services_vec.retain(|s| s.uuid == uuid);
}
services_vec.retain(|s| !uuid_is_blocklisted(&s.uuid, Blocklist::All));
@@ -841,7 +833,7 @@ impl BluetoothManager {
return Err(BluetoothError::NotFound);
}
return Ok(BluetoothResponse::GetIncludedServices(services_vec, single));
Ok(BluetoothResponse::GetIncludedServices(services_vec, single))
},
GATTType::Descriptor => {
// Step 5.
@@ -851,13 +843,13 @@ impl BluetoothManager {
// Step 6.
let mut descriptors = self.get_and_cache_gatt_descriptors(&mut adapter, &id);
if let Some(uuid) = uuid {
descriptors.retain(|ref e| e.get_uuid().unwrap_or(String::new()) == uuid);
descriptors.retain(|e| e.get_uuid().unwrap_or_default() == uuid);
}
let mut descriptors_vec = vec![];
for descriptor in descriptors {
if let Ok(uuid) = descriptor.get_uuid() {
descriptors_vec.push(BluetoothDescriptorMsg {
uuid: uuid,
uuid,
instance_id: descriptor.get_id(),
});
}
@@ -867,7 +859,7 @@ impl BluetoothManager {
if descriptors_vec.is_empty() {
return Err(BluetoothError::NotFound);
}
return Ok(BluetoothResponse::GetDescriptors(descriptors_vec, single));
Ok(BluetoothResponse::GetDescriptors(descriptors_vec, single))
},
}
}
@@ -882,7 +874,7 @@ impl BluetoothManager {
// (Characteristic) Step 5.3.
let mut value = self
.get_gatt_characteristic(&mut adapter, &id)
.map(|c| c.read_value().unwrap_or(vec![]));
.map(|c| c.read_value().unwrap_or_default());
// (Characteristic) TODO: Step 5.4: Handle all the errors returned from the read_value call.
@@ -890,7 +882,7 @@ impl BluetoothManager {
if value.is_none() {
value = self
.get_gatt_descriptor(&mut adapter, &id)
.map(|d| d.read_value().unwrap_or(vec![]));
.map(|d| d.read_value().unwrap_or_default());
}
// (Descriptor) TODO: Step 5.3: Handle all the errors returned from the read_value call.
@@ -898,11 +890,11 @@ impl BluetoothManager {
match value {
// (Characteristic) Step 5.5.4.
// (Descriptor) Step 5.4.3.
Some(v) => return Ok(BluetoothResponse::ReadValue(v)),
Some(v) => Ok(BluetoothResponse::ReadValue(v)),
// (Characteristic) Step 4.
// (Descriptor) Step 4.
None => return Err(BluetoothError::InvalidState),
None => Err(BluetoothError::InvalidState),
}
}
@@ -933,15 +925,15 @@ impl BluetoothManager {
Some(v) => match v {
// (Characteristic) Step 7.5.3.
// (Descriptor) Step 7.4.3.
Ok(_) => return Ok(BluetoothResponse::WriteValue(value)),
Ok(_) => Ok(BluetoothResponse::WriteValue(value)),
// (Characteristic) Step 7.1.
Err(_) => return Err(BluetoothError::NotSupported),
Err(_) => Err(BluetoothError::NotSupported),
},
// (Characteristic) Step 6.
// (Descriptor) Step 6.
None => return Err(BluetoothError::InvalidState),
None => Err(BluetoothError::InvalidState),
}
}
@@ -969,14 +961,14 @@ impl BluetoothManager {
match result {
// (StartNotification) Step 11.
// (StopNotification) Step 5.
Ok(_) => return Ok(BluetoothResponse::EnableNotification(())),
Ok(_) => Ok(BluetoothResponse::EnableNotification(())),
// (StartNotification) Step 5.
Err(_) => return Err(BluetoothError::NotSupported),
Err(_) => Err(BluetoothError::NotSupported),
}
},
// (StartNotification) Step 4.
None => return Err(BluetoothError::InvalidState),
None => Err(BluetoothError::InvalidState),
}
}
@@ -984,7 +976,7 @@ impl BluetoothManager {
fn watch_advertisements(&mut self, _device_id: String) -> BluetoothResponseResult {
// Step 2.
// TODO: Implement this when supported in lower level
return Err(BluetoothError::NotSupported);
Err(BluetoothError::NotSupported)
}
// https://webbluetoothcg.github.io/web-bluetooth/#dom-bluetooth-getavailability

View File

@@ -18,110 +18,103 @@ use crate::BluetoothManager;
thread_local!(pub static CACHED_IDS: RefCell<HashSet<Uuid>> = RefCell::new(HashSet::new()));
const ADAPTER_ERROR: &'static str = "No adapter found";
const WRONG_DATA_SET_ERROR: &'static str = "Wrong data set name was provided";
const READ_FLAG: &'static str = "read";
const WRITE_FLAG: &'static str = "write";
const NOTIFY_FLAG: &'static str = "notify";
const ADAPTER_ERROR: &str = "No adapter found";
const WRONG_DATA_SET_ERROR: &str = "Wrong data set name was provided";
const READ_FLAG: &str = "read";
const WRITE_FLAG: &str = "write";
const NOTIFY_FLAG: &str = "notify";
// Adapter names
// https://cs.chromium.org/chromium/src/content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.h?l=65
const NOT_PRESENT_ADAPTER: &'static str = "NotPresentAdapter";
const NOT_PRESENT_ADAPTER: &str = "NotPresentAdapter";
// https://cs.chromium.org/chromium/src/content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.h?l=83
const NOT_POWERED_ADAPTER: &'static str = "NotPoweredAdapter";
const NOT_POWERED_ADAPTER: &str = "NotPoweredAdapter";
// https://cs.chromium.org/chromium/src/content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.h?l=118
const EMPTY_ADAPTER: &'static str = "EmptyAdapter";
const EMPTY_ADAPTER: &str = "EmptyAdapter";
// https://cs.chromium.org/chromium/src/content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.h?l=126
const GLUCOSE_HEART_RATE_ADAPTER: &'static str = "GlucoseHeartRateAdapter";
const GLUCOSE_HEART_RATE_ADAPTER: &str = "GlucoseHeartRateAdapter";
// https://cs.chromium.org/chromium/src/content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.h?l=135
const UNICODE_DEVICE_ADAPTER: &'static str = "UnicodeDeviceAdapter";
const UNICODE_DEVICE_ADAPTER: &str = "UnicodeDeviceAdapter";
// https://cs.chromium.org/chromium/src/content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.h?l=205
const MISSING_SERVICE_HEART_RATE_ADAPTER: &'static str = "MissingServiceHeartRateAdapter";
const MISSING_SERVICE_HEART_RATE_ADAPTER: &str = "MissingServiceHeartRateAdapter";
// https://cs.chromium.org/chromium/src/content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.h?l=219
const MISSING_CHARACTERISTIC_HEART_RATE_ADAPTER: &'static str =
"MissingCharacteristicHeartRateAdapter";
const MISSING_DESCRIPTOR_HEART_RATE_ADAPTER: &'static str = "MissingDescriptorHeartRateAdapter";
const MISSING_CHARACTERISTIC_HEART_RATE_ADAPTER: &str = "MissingCharacteristicHeartRateAdapter";
const MISSING_DESCRIPTOR_HEART_RATE_ADAPTER: &str = "MissingDescriptorHeartRateAdapter";
// https://cs.chromium.org/chromium/src/content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.h?l=234
const HEART_RATE_ADAPTER: &'static str = "HeartRateAdapter";
const HEART_RATE_ADAPTER: &str = "HeartRateAdapter";
// https://cs.chromium.org/chromium/src/content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.h?l=250
const EMPTY_NAME_HEART_RATE_ADAPTER: &'static str = "EmptyNameHeartRateAdapter";
const EMPTY_NAME_HEART_RATE_ADAPTER: &str = "EmptyNameHeartRateAdapter";
// https://cs.chromium.org/chromium/src/content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.h?l=267
const NO_NAME_HEART_RATE_ADAPTER: &'static str = "NoNameHeartRateAdapter";
const NO_NAME_HEART_RATE_ADAPTER: &str = "NoNameHeartRateAdapter";
// https://cs.chromium.org/chromium/src/content/shell/browser/layout_test/layout_test_bluetooth_adapter_provider.h?l=284
const TWO_HEART_RATE_SERVICES_ADAPTER: &'static str = "TwoHeartRateServicesAdapter";
const BLOCKLIST_TEST_ADAPTER: &'static str = "BlocklistTestAdapter";
const TWO_HEART_RATE_SERVICES_ADAPTER: &str = "TwoHeartRateServicesAdapter";
const BLOCKLIST_TEST_ADAPTER: &str = "BlocklistTestAdapter";
// Device names
const CONNECTABLE_DEVICE_NAME: &'static str = "Connectable Device";
const EMPTY_DEVICE_NAME: &'static str = "";
const CONNECTABLE_DEVICE_NAME: &str = "Connectable Device";
const EMPTY_DEVICE_NAME: &str = "";
// https://webbluetoothcg.github.io/web-bluetooth/tests.html#glucosedevice
const GLUCOSE_DEVICE_NAME: &'static str = "Glucose Device";
const GLUCOSE_DEVICE_NAME: &str = "Glucose Device";
// https://webbluetoothcg.github.io/web-bluetooth/tests.html#heartratedevice
const HEART_RATE_DEVICE_NAME: &'static str = "Heart Rate Device";
const UNICODE_DEVICE_NAME: &'static str = "❤❤❤❤❤❤❤❤❤";
const HEART_RATE_DEVICE_NAME: &str = "Heart Rate Device";
const UNICODE_DEVICE_NAME: &str = "❤❤❤❤❤❤❤❤❤";
// Device addresses
const CONNECTABLE_DEVICE_ADDRESS: &'static str = "00:00:00:00:00:04";
const CONNECTABLE_DEVICE_ADDRESS: &str = "00:00:00:00:00:04";
// https://webbluetoothcg.github.io/web-bluetooth/tests.html#glucosedevice
const GLUCOSE_DEVICE_ADDRESS: &'static str = "00:00:00:00:00:02";
const GLUCOSE_DEVICE_ADDRESS: &str = "00:00:00:00:00:02";
// https://webbluetoothcg.github.io/web-bluetooth/tests.html#heartratedevice
const HEART_RATE_DEVICE_ADDRESS: &'static str = "00:00:00:00:00:03";
const UNICODE_DEVICE_ADDRESS: &'static str = "00:00:00:00:00:01";
const HEART_RATE_DEVICE_ADDRESS: &str = "00:00:00:00:00:03";
const UNICODE_DEVICE_ADDRESS: &str = "00:00:00:00:00:01";
// Service UUIDs
const BLOCKLIST_TEST_SERVICE_UUID: &'static str = "611c954a-263b-4f4a-aab6-01ddb953f985";
const BLOCKLIST_TEST_SERVICE_UUID: &str = "611c954a-263b-4f4a-aab6-01ddb953f985";
// https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.service.device_information.xml
const DEVICE_INFORMATION_UUID: &'static str = "0000180a-0000-1000-8000-00805f9b34fb";
const DEVICE_INFORMATION_UUID: &str = "0000180a-0000-1000-8000-00805f9b34fb";
// https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.service.generic_access.xml
const GENERIC_ACCESS_SERVICE_UUID: &'static str = "00001800-0000-1000-8000-00805f9b34fb";
const GENERIC_ACCESS_SERVICE_UUID: &str = "00001800-0000-1000-8000-00805f9b34fb";
// https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.service.glucose.xml
const GLUCOSE_SERVICE_UUID: &'static str = "00001808-0000-1000-8000-00805f9b34fb";
const GLUCOSE_SERVICE_UUID: &str = "00001808-0000-1000-8000-00805f9b34fb";
// https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.service.heart_rate.xml
const HEART_RATE_SERVICE_UUID: &'static str = "0000180d-0000-1000-8000-00805f9b34fb";
const HEART_RATE_SERVICE_UUID: &str = "0000180d-0000-1000-8000-00805f9b34fb";
// https://www.bluetooth.com/specifications/gatt/
// viewer?attributeXmlFile=org.bluetooth.service.human_interface_device.xml
const HUMAN_INTERFACE_DEVICE_SERVICE_UUID: &'static str = "00001812-0000-1000-8000-00805f9b34fb";
const HUMAN_INTERFACE_DEVICE_SERVICE_UUID: &str = "00001812-0000-1000-8000-00805f9b34fb";
// https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.service.tx_power.xml
const TX_POWER_SERVICE_UUID: &'static str = "00001804-0000-1000-8000-00805f9b34fb";
const TX_POWER_SERVICE_UUID: &str = "00001804-0000-1000-8000-00805f9b34fb";
// Characteristic UUIDs
const BLOCKLIST_EXCLUDE_READS_CHARACTERISTIC_UUID: &'static str =
"bad1c9a2-9a5b-4015-8b60-1579bbbf2135";
const BLOCKLIST_EXCLUDE_READS_CHARACTERISTIC_UUID: &str = "bad1c9a2-9a5b-4015-8b60-1579bbbf2135";
// https://www.bluetooth.com/specifications/gatt/
// viewer?attributeXmlFile=org.bluetooth.characteristic.body_sensor_location.xml
const BODY_SENSOR_LOCATION_CHARACTERISTIC_UUID: &'static str =
"00002a38-0000-1000-8000-00805f9b34fb";
const BODY_SENSOR_LOCATION_CHARACTERISTIC_UUID: &str = "00002a38-0000-1000-8000-00805f9b34fb";
// https://www.bluetooth.com/specifications/gatt/
// viewer?attributeXmlFile=org.bluetooth.characteristic.gap.device_name.xml
const DEVICE_NAME_CHARACTERISTIC_UUID: &'static str = "00002a00-0000-1000-8000-00805f9b34fb";
const DEVICE_NAME_CHARACTERISTIC_UUID: &str = "00002a00-0000-1000-8000-00805f9b34fb";
// https://www.bluetooth.com/specifications/gatt/
// viewer?attributeXmlFile=org.bluetooth.characteristic.heart_rate_measurement.xml
const HEART_RATE_MEASUREMENT_CHARACTERISTIC_UUID: &'static str =
"00002a37-0000-1000-8000-00805f9b34fb";
const HEART_RATE_MEASUREMENT_CHARACTERISTIC_UUID: &str = "00002a37-0000-1000-8000-00805f9b34fb";
// https://www.bluetooth.com/specifications/gatt/
// viewer?attributeXmlFile=org.bluetooth.characteristic.gap.peripheral_privacy_flag.xml
const PERIPHERAL_PRIVACY_FLAG_CHARACTERISTIC_UUID: &'static str =
"00002a02-0000-1000-8000-00805f9b34fb";
const PERIPHERAL_PRIVACY_FLAG_CHARACTERISTIC_UUID: &str = "00002a02-0000-1000-8000-00805f9b34fb";
// https://www.bluetooth.com/specifications/gatt/
// viewer?attributeXmlFile=org.bluetooth.characteristic.serial_number_string.xml
const SERIAL_NUMBER_STRING_UUID: &'static str = "00002a25-0000-1000-8000-00805f9b34fb";
const SERIAL_NUMBER_STRING_UUID: &str = "00002a25-0000-1000-8000-00805f9b34fb";
// Descriptor UUIDs
const BLOCKLIST_EXCLUDE_READS_DESCRIPTOR_UUID: &'static str =
"aaaaaaaa-aaaa-1181-0510-810819516110";
const BLOCKLIST_DESCRIPTOR_UUID: &'static str = "07711111-6104-0970-7011-1107105110aa";
const BLOCKLIST_EXCLUDE_READS_DESCRIPTOR_UUID: &str = "aaaaaaaa-aaaa-1181-0510-810819516110";
const BLOCKLIST_DESCRIPTOR_UUID: &str = "07711111-6104-0970-7011-1107105110aa";
// https://www.bluetooth.com/specifications/gatt/
// viewer?attributeXmlFile=org.bluetooth.descriptor.gatt.characteristic_user_description.xml
const CHARACTERISTIC_USER_DESCRIPTION_UUID: &'static str = "00002901-0000-1000-8000-00805f9b34fb";
const CHARACTERISTIC_USER_DESCRIPTION_UUID: &str = "00002901-0000-1000-8000-00805f9b34fb";
// https://www.bluetooth.com/specifications/gatt/
// viewer?attributeXmlFile=org.bluetooth.descriptor.gatt.client_characteristic_configuration.xml
const CLIENT_CHARACTERISTIC_CONFIGURATION_UUID: &'static str =
"00002902-0000-1000-8000-00805f9b34fb";
const CLIENT_CHARACTERISTIC_CONFIGURATION_UUID: &str = "00002902-0000-1000-8000-00805f9b34fb";
// https://www.bluetooth.com/specifications/gatt/
// viewer?attributeXmlFile=org.bluetooth.descriptor.number_of_digitals.xml
const NUMBER_OF_DIGITALS_UUID: &'static str = "00002909-0000-1000-8000-00805f9b34fb";
const NUMBER_OF_DIGITALS_UUID: &str = "00002909-0000-1000-8000-00805f9b34fb";
const HEART_RATE_DEVICE_NAME_DESCRIPTION: &'static str = "The name of this device.";
const HEART_RATE_DEVICE_NAME_DESCRIPTION: &str = "The name of this device.";
fn generate_id() -> Uuid {
let mut id = Uuid::nil();
@@ -130,7 +123,7 @@ fn generate_id() -> Uuid {
id = Uuid::new_v4();
CACHED_IDS.with(|cache| {
if !cache.borrow().contains(&id) {
cache.borrow_mut().insert(id.clone());
cache.borrow_mut().insert(id);
generated = true;
}
});
@@ -539,7 +532,7 @@ pub fn test(manager: &mut BluetoothManager, data_set_name: String) -> Result<(),
},
GLUCOSE_HEART_RATE_ADAPTER => {
set_adapter(adapter, GLUCOSE_HEART_RATE_ADAPTER.to_owned())?;
let _ = create_glucose_heart_rate_devices(adapter)?;
create_glucose_heart_rate_devices(adapter)?;
},
UNICODE_DEVICE_ADAPTER => {
set_adapter(adapter, UNICODE_DEVICE_ADAPTER.to_owned())?;
@@ -561,12 +554,12 @@ pub fn test(manager: &mut BluetoothManager, data_set_name: String) -> Result<(),
MISSING_CHARACTERISTIC_HEART_RATE_ADAPTER.to_owned(),
)?;
let _ = create_missing_characterisitc_heart_rate_device(adapter)?;
create_missing_characterisitc_heart_rate_device(adapter)?;
},
MISSING_DESCRIPTOR_HEART_RATE_ADAPTER => {
set_adapter(adapter, MISSING_DESCRIPTOR_HEART_RATE_ADAPTER.to_owned())?;
let _ = create_missing_descriptor_heart_rate_device(adapter)?;
create_missing_descriptor_heart_rate_device(adapter)?;
},
HEART_RATE_ADAPTER => {
set_adapter(adapter, HEART_RATE_ADAPTER.to_owned())?;
@@ -588,14 +581,14 @@ pub fn test(manager: &mut BluetoothManager, data_set_name: String) -> Result<(),
TWO_HEART_RATE_SERVICES_ADAPTER => {
set_adapter(adapter, TWO_HEART_RATE_SERVICES_ADAPTER.to_owned())?;
let _ = create_two_heart_rate_services_device(adapter)?;
create_two_heart_rate_services_device(adapter)?;
},
BLOCKLIST_TEST_ADAPTER => {
set_adapter(adapter, BLOCKLIST_TEST_ADAPTER.to_owned())?;
let _ = create_blocklisted_device(adapter)?;
create_blocklisted_device(adapter)?;
},
_ => return Err(Box::from(WRONG_DATA_SET_ERROR.to_string())),
}
return Ok(());
Ok(())
}

View File

@@ -1,44 +1,46 @@
[package]
name = "canvas"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2018"
publish = false
version.workspace = true
authors.workspace = true
license.workspace = true
edition.workspace = true
publish.workspace = true
[lib]
name = "canvas"
path = "lib.rs"
[features]
no-wgl = ["surfman/sm-no-wgl"]
webgl_backtrace = ["canvas_traits/webgl_backtrace"]
xr-profile = ["webxr-api/profile", "time"]
[dependencies]
app_units = { workspace = true }
bitflags = { workspace = true }
byteorder = { workspace = true }
canvas_traits = { workspace = true }
crossbeam-channel = { workspace = true }
cssparser = { workspace = true }
euclid = { workspace = true }
font-kit = "0.11"
font-kit = { version = "0.14" }
fnv = { workspace = true }
gfx = { path = "../gfx" }
fonts = { path = "../fonts" }
half = "2"
ipc-channel = { workspace = true }
log = { workspace = true }
lyon_geom = "1.0.4"
net_traits = { workspace = true }
num-traits = { workspace = true }
parking_lot = { workspace = true }
pathfinder_geometry = "0.5"
pixels = { path = "../pixels" }
raqote = "0.8.2"
servo_arc = { path = "../servo_arc" }
range = { path = "../range" }
raqote = { git = "https://github.com/jrmuizel/raqote", rev = "64716c8" }
servo_arc = { workspace = true }
sparkle = { workspace = true }
style = { path = "../style" }
style = { workspace = true }
style_traits = { workspace = true }
surfman = { workspace = true }
time = { workspace = true, optional = true }
unicode-script = { workspace = true }
webrender = { workspace = true }
webrender_api = { workspace = true }
webrender_traits = { workspace = true }

View File

@@ -2,33 +2,30 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use std::cell::RefCell;
use std::mem;
use std::sync::{Arc, Mutex};
use std::sync::Arc;
use app_units::Au;
use canvas_traits::canvas::*;
use cssparser::RGBA;
use euclid::default::{Point2D, Rect, Size2D, Transform2D, Vector2D};
use euclid::{point2, vec2};
use font_kit::family_name::FamilyName;
use font_kit::font::Font;
use font_kit::metrics::Metrics;
use font_kit::properties::{Properties, Stretch, Style, Weight};
use font_kit::source::SystemSource;
use gfx::font::FontHandleMethods;
use gfx::font_cache_thread::FontCacheThread;
use gfx::font_context::FontContext;
use euclid::default::{Box2D, Point2D, Rect, Size2D, Transform2D, Vector2D};
use euclid::point2;
use fonts::{
ByteIndex, FontBaseline, FontCacheThread, FontContext, FontGroup, FontMetrics, FontRef,
GlyphInfo, GlyphStore, ShapingFlags, ShapingOptions, LAST_RESORT_GLYPH_ADVANCE,
};
use ipc_channel::ipc::{IpcSender, IpcSharedMemory};
use log::{debug, error, warn};
use log::{debug, warn};
use num_traits::ToPrimitive;
use range::Range;
use servo_arc::Arc as ServoArc;
use style::color::AbsoluteColor;
use style::properties::style_structs::Font as FontStyleStruct;
use style::values::computed::font;
use style_traits::values::ToCss;
use unicode_script::Script;
use webrender_api::units::{DeviceIntSize, RectExt as RectExt_};
use webrender_api::{ImageData, ImageDescriptor, ImageDescriptorFlags, ImageFormat, ImageKey};
use webrender_traits::ImageUpdate;
use crate::canvas_paint_thread::{AntialiasMode, ImageUpdate, WebrenderApi};
use crate::canvas_paint_thread::{AntialiasMode, WebrenderApi};
use crate::raqote_backend::Repetition;
/// The canvas data stores a state machine for the current status of
@@ -74,23 +71,23 @@ impl PathState {
pub trait Backend {
fn get_composition_op(&self, opts: &DrawOptions) -> CompositionOp;
fn need_to_draw_shadow(&self, color: &Color) -> bool;
fn set_shadow_color<'a>(&mut self, color: RGBA, state: &mut CanvasPaintState<'a>);
fn set_fill_style<'a>(
fn set_shadow_color(&mut self, color: AbsoluteColor, state: &mut CanvasPaintState<'_>);
fn set_fill_style(
&mut self,
style: FillOrStrokeStyle,
state: &mut CanvasPaintState<'a>,
state: &mut CanvasPaintState<'_>,
drawtarget: &dyn GenericDrawTarget,
);
fn set_stroke_style<'a>(
fn set_stroke_style(
&mut self,
style: FillOrStrokeStyle,
state: &mut CanvasPaintState<'a>,
state: &mut CanvasPaintState<'_>,
drawtarget: &dyn GenericDrawTarget,
);
fn set_global_composition<'a>(
fn set_global_composition(
&mut self,
op: CompositionOrBlending,
state: &mut CanvasPaintState<'a>,
state: &mut CanvasPaintState<'_>,
);
fn create_drawtarget(&self, size: Size2D<u64>) -> Box<dyn GenericDrawTarget>;
fn recreate_paint_state<'a>(&self, state: &CanvasPaintState<'a>) -> CanvasPaintState<'a>;
@@ -114,6 +111,7 @@ pub trait GenericPathBuilder {
control_point3: &Point2D<f32>,
);
fn close(&mut self);
#[allow(clippy::too_many_arguments)]
fn ellipse(
&mut self,
origin: Point2D<f32>,
@@ -195,6 +193,7 @@ impl<'a> PathBuilderRef<'a> {
.arc(center, radius, start_angle, end_angle, ccw);
}
#[allow(clippy::too_many_arguments)]
pub fn ellipse(
&mut self,
center: &Point2D<f32>,
@@ -222,10 +221,9 @@ impl<'a> PathBuilderRef<'a> {
Some(i) => i,
None => return None,
};
match self.builder.get_current_point() {
Some(point) => Some(inverse.transform_point(Point2D::new(point.x, point.y))),
None => None,
}
self.builder
.get_current_point()
.map(|point| inverse.transform_point(Point2D::new(point.x, point.y)))
}
fn close(&mut self) {
@@ -233,10 +231,78 @@ impl<'a> PathBuilderRef<'a> {
}
}
// TODO(pylbrecht)
// This defines required methods for DrawTarget of azure and raqote
// The prototypes are derived from azure's methods.
// TODO: De-abstract now that Azure is removed?
#[derive(Debug, Default)]
struct UnshapedTextRun<'a> {
font: Option<FontRef>,
script: Script,
string: &'a str,
}
impl<'a> UnshapedTextRun<'a> {
fn script_and_font_compatible(&self, script: Script, other_font: &Option<FontRef>) -> bool {
if self.script != script {
return false;
}
match (&self.font, other_font) {
(Some(font_a), Some(font_b)) => font_a.identifier() == font_b.identifier(),
(None, None) => true,
_ => false,
}
}
fn into_shaped_text_run(self) -> Option<TextRun> {
let font = self.font?;
if self.string.is_empty() {
return None;
}
let word_spacing = Au::from_f64_px(
font.glyph_index(' ')
.map(|glyph_id| font.glyph_h_advance(glyph_id))
.unwrap_or(LAST_RESORT_GLYPH_ADVANCE),
);
let options = ShapingOptions {
letter_spacing: None,
word_spacing,
script: self.script,
flags: ShapingFlags::empty(),
};
let glyphs = font.shape_text(self.string, &options);
Some(TextRun { font, glyphs })
}
}
pub struct TextRun {
pub font: FontRef,
pub glyphs: Arc<GlyphStore>,
}
impl TextRun {
fn bounding_box(&self) -> Rect<f32> {
let mut bounding_box = None;
let mut bounds_offset: f32 = 0.;
let glyph_ids = self
.glyphs
.iter_glyphs_for_byte_range(&Range::new(ByteIndex(0), self.glyphs.len()))
.map(GlyphInfo::id);
for glyph_id in glyph_ids {
let bounds = self.font.typographic_bounds(glyph_id);
let amount = Vector2D::new(bounds_offset, 0.);
let bounds = bounds.translate(amount);
let initiated_bbox = bounding_box.get_or_insert_with(|| {
let origin = Point2D::new(bounds.min_x(), 0.);
Box2D::new(origin, origin).to_rect()
});
bounding_box = Some(initiated_bbox.union(&bounds));
bounds_offset = bounds.max_x();
}
bounding_box.unwrap_or_default()
}
}
// This defines required methods for a DrawTarget (currently only implemented for raqote). The
// prototypes are derived from the now-removed Azure backend's methods.
pub trait GenericDrawTarget {
fn clear_rect(&mut self, rect: &Rect<f32>);
fn copy_surface(
@@ -269,9 +335,7 @@ pub trait GenericDrawTarget {
fn fill(&mut self, path: &Path, pattern: Pattern, draw_options: &DrawOptions);
fn fill_text(
&mut self,
font: &Font,
point_size: f32,
text: &str,
text_runs: Vec<TextRun>,
start: Point2D<f32>,
pattern: &Pattern,
draw_options: &DrawOptions,
@@ -358,21 +422,6 @@ pub enum Filter {
Nearest,
}
pub(crate) type CanvasFontContext = FontContext<FontCacheThread>;
thread_local!(static FONT_CONTEXT: RefCell<Option<CanvasFontContext>> = RefCell::new(None));
pub(crate) fn with_thread_local_font_context<F, R>(canvas_data: &CanvasData, f: F) -> R
where
F: FnOnce(&mut CanvasFontContext) -> R,
{
FONT_CONTEXT.with(|font_context| {
f(font_context.borrow_mut().get_or_insert_with(|| {
FontContext::new(canvas_data.font_cache_thread.lock().unwrap().clone())
}))
})
}
pub struct CanvasData<'a> {
backend: Box<dyn Backend>,
drawtarget: Box<dyn GenericDrawTarget>,
@@ -385,7 +434,7 @@ pub struct CanvasData<'a> {
old_image_key: Option<ImageKey>,
/// An old webrender image key that can be deleted when the current epoch ends.
very_old_image_key: Option<ImageKey>,
font_cache_thread: Mutex<FontCacheThread>,
font_context: Arc<FontContext<FontCacheThread>>,
}
fn create_backend() -> Box<dyn Backend> {
@@ -397,7 +446,7 @@ impl<'a> CanvasData<'a> {
size: Size2D<u64>,
webrender_api: Box<dyn WebrenderApi>,
antialias: AntialiasMode,
font_cache_thread: FontCacheThread,
font_context: Arc<FontContext<FontCacheThread>>,
) -> CanvasData<'a> {
let backend = create_backend();
let draw_target = backend.create_drawtarget(size);
@@ -411,7 +460,7 @@ impl<'a> CanvasData<'a> {
image_key: None,
old_image_key: None,
very_old_image_key: None,
font_cache_thread: Mutex::new(font_cache_thread),
font_context,
}
}
@@ -428,7 +477,7 @@ impl<'a> CanvasData<'a> {
let source_rect = source_rect.ceil();
// It discards the extra pixels (if any) that won't be painted
let image_data = if Rect::from_size(image_size).contains_rect(&source_rect) {
pixels::rgba8_get_rect(&image_data, image_size.to_u64(), source_rect.to_u64()).into()
pixels::rgba8_get_rect(image_data, image_size.to_u64(), source_rect.to_u64()).into()
} else {
image_data.into()
};
@@ -471,7 +520,85 @@ impl<'a> CanvasData<'a> {
}
}
// https://html.spec.whatwg.org/multipage/#text-preparation-algorithm
pub fn fill_text_with_size(
&mut self,
text: String,
x: f64,
y: f64,
max_width: Option<f64>,
is_rtl: bool,
size: f64,
) {
// > Step 2: Replace all ASCII whitespace in text with U+0020 SPACE characters.
let text = replace_ascii_whitespace(text);
// > Step 3: Let font be the current font of target, as given by that object's font
// > attribute.
let Some(ref font_style) = self.state.font_style else {
return;
};
let font_group = self
.font_context
.font_group_with_size(font_style.clone(), Au::from_f64_px(size));
let mut font_group = font_group.write();
let Some(first_font) = font_group.first(&self.font_context) else {
warn!("Could not render canvas text, because there was no first font.");
return;
};
let runs = self.build_unshaped_text_runs(&text, &mut font_group);
// TODO: This doesn't do any kind of line layout at all. In particular, there needs
// to be some alignment along a baseline and also support for bidi text.
let shaped_runs: Vec<_> = runs
.into_iter()
.filter_map(UnshapedTextRun::into_shaped_text_run)
.collect();
let total_advance = shaped_runs
.iter()
.map(|run| run.glyphs.total_advance())
.sum::<Au>()
.to_f64_px();
// > Step 6: If maxWidth was provided and the hypothetical width of the inline box in the
// > hypothetical line box is greater than maxWidth CSS pixels, then change font to have a
// > more condensed font (if one is available or if a reasonably readable one can be
// > synthesized by applying a horizontal scale factor to the font) or a smaller font, and
// > return to the previous step.
//
// TODO: We only try decreasing the font size here. Eventually it would make sense to use
// other methods to try to decrease the size, such as finding a narrower font or decreasing
// spacing.
if let Some(max_width) = max_width {
let new_size = (max_width / total_advance * size).floor().max(5.);
if total_advance > max_width && new_size != size {
self.fill_text_with_size(text, x, y, Some(max_width), is_rtl, new_size);
return;
}
}
// > Step 7: Find the anchor point for the line of text.
let start = self.find_anchor_point_for_line_of_text(
x as f32,
y as f32,
&first_font.metrics,
total_advance as f32,
is_rtl,
);
// > Step 8: Let result be an array constructed by iterating over each glyph in the inline box
// > from left to right (if any), adding to the array, for each glyph, the shape of the glyph
// > as it is in the inline box, positioned on a coordinate space using CSS pixels with its
// > origin is at the anchor point.
self.drawtarget.fill_text(
shaped_runs,
start,
&self.state.fill_style,
&self.state.draw_options,
);
}
/// <https://html.spec.whatwg.org/multipage/#text-preparation-algorithm>
pub fn fill_text(
&mut self,
text: String,
@@ -480,81 +607,138 @@ impl<'a> CanvasData<'a> {
max_width: Option<f64>,
is_rtl: bool,
) {
// Step 2.
let text = replace_ascii_whitespace(text);
// Step 3.
let point_size = self
.state
.font_style
.as_ref()
.map_or(10., |style| style.font_size.computed_size().px());
let font_style = self.state.font_style.as_ref();
let font = font_style.map_or_else(
|| load_system_font_from_style(None),
|style| {
with_thread_local_font_context(&self, |font_context| {
let font_group = font_context.font_group(ServoArc::new(style.clone()));
let font = font_group
.borrow_mut()
.first(font_context)
.expect("couldn't find font");
let font = font.borrow_mut();
let template = font.handle.template();
Font::from_bytes(Arc::new(template.bytes()), 0)
.ok()
.or_else(|| load_system_font_from_style(Some(style)))
})
},
);
let font = match font {
Some(f) => f,
None => {
error!("Couldn't load desired font or system fallback.");
return;
},
};
let font_width = font_width(&text, point_size, &font);
// Step 6.
let max_width = max_width.map(|width| width as f32);
let (width, scale_factor) = match max_width {
Some(max_width) if max_width > font_width => (max_width, 1.),
Some(max_width) => (font_width, max_width / font_width),
None => (font_width, 1.),
let Some(ref font_style) = self.state.font_style else {
return;
};
// Step 7.
let start = self.text_origin(x as f32, y as f32, &font.metrics(), width, is_rtl);
// TODO: Bidi text layout
let old_transform = self.get_transform();
self.set_transform(
&old_transform
.pre_translate(vec2(start.x, 0.))
.pre_scale(scale_factor, 1.)
.pre_translate(vec2(-start.x, 0.)),
);
// Step 8.
self.drawtarget.fill_text(
&font,
point_size,
&text,
start,
&self.state.fill_style,
&self.state.draw_options,
);
self.set_transform(&old_transform);
let size = font_style.font_size.computed_size();
self.fill_text_with_size(text, x, y, max_width, is_rtl, size.px() as f64);
}
fn text_origin(
/// <https://html.spec.whatwg.org/multipage/#text-preparation-algorithm>
/// <https://html.spec.whatwg.org/multipage/#dom-context-2d-measuretext>
pub fn measure_text(&mut self, text: String) -> TextMetrics {
// > Step 2: Replace all ASCII whitespace in text with U+0020 SPACE characters.
let text = replace_ascii_whitespace(text);
let Some(ref font_style) = self.state.font_style else {
return TextMetrics::default();
};
let font_group = self.font_context.font_group(font_style.clone());
let mut font_group = font_group.write();
let font = font_group
.first(&self.font_context)
.expect("couldn't find font");
let ascent = font.metrics.ascent.to_f32_px();
let descent = font.metrics.descent.to_f32_px();
let runs = self.build_unshaped_text_runs(&text, &mut font_group);
let shaped_runs: Vec<_> = runs
.into_iter()
.filter_map(UnshapedTextRun::into_shaped_text_run)
.collect();
let total_advance = shaped_runs
.iter()
.map(|run| run.glyphs.total_advance())
.sum::<Au>()
.to_f32_px();
let bounding_box = shaped_runs
.iter()
.map(TextRun::bounding_box)
.reduce(|a, b| {
let amount = Vector2D::new(a.max_x(), 0.);
let bounding_box = b.translate(amount);
a.union(&bounding_box)
})
.unwrap_or_default();
let FontBaseline {
ideographic_baseline,
alphabetic_baseline,
hanging_baseline,
} = match font.get_baseline() {
Some(baseline) => baseline,
None => FontBaseline {
hanging_baseline: ascent * HANGING_BASELINE_DEFAULT,
ideographic_baseline: -descent * IDEOGRAPHIC_BASELINE_DEFAULT,
alphabetic_baseline: 0.,
},
};
let anchor_x = match self.state.text_align {
TextAlign::End => total_advance,
TextAlign::Center => total_advance / 2.,
TextAlign::Right => total_advance,
_ => 0.,
};
let anchor_y = match self.state.text_baseline {
TextBaseline::Top => ascent,
TextBaseline::Hanging => hanging_baseline,
TextBaseline::Ideographic => ideographic_baseline,
TextBaseline::Middle => (ascent - descent) / 2.,
TextBaseline::Alphabetic => alphabetic_baseline,
TextBaseline::Bottom => -descent,
};
TextMetrics {
width: total_advance,
actual_boundingbox_left: anchor_x - bounding_box.min_x(),
actual_boundingbox_right: bounding_box.max_x() - anchor_x,
actual_boundingbox_ascent: bounding_box.max_y() - anchor_y,
actual_boundingbox_descent: anchor_y - bounding_box.min_y(),
font_boundingbox_ascent: ascent - anchor_y,
font_boundingbox_descent: descent + anchor_y,
em_height_ascent: ascent - anchor_y,
em_height_descent: descent + anchor_y,
hanging_baseline: hanging_baseline - anchor_y,
alphabetic_baseline: alphabetic_baseline - anchor_y,
ideographic_baseline: ideographic_baseline - anchor_y,
}
}
fn build_unshaped_text_runs<'b>(
&self,
text: &'b str,
font_group: &mut FontGroup,
) -> Vec<UnshapedTextRun<'b>> {
let mut runs = Vec::new();
let mut current_text_run = UnshapedTextRun::default();
let mut current_text_run_start_index = 0;
for (index, character) in text.char_indices() {
// TODO: This should ultimately handle emoji variation selectors, but raqote does not yet
// have support for color glyphs.
let script = Script::from(character);
let font = font_group.find_by_codepoint(&self.font_context, character, None);
if !current_text_run.script_and_font_compatible(script, &font) {
let previous_text_run = mem::replace(
&mut current_text_run,
UnshapedTextRun {
font: font.clone(),
script,
..Default::default()
},
);
current_text_run_start_index = index;
runs.push(previous_text_run)
}
current_text_run.string =
&text[current_text_run_start_index..index + character.len_utf8()];
}
runs.push(current_text_run);
runs
}
/// Find the *anchor_point* for the given parameters of a line of text.
/// See <https://html.spec.whatwg.org/multipage/#text-preparation-algorithm>.
fn find_anchor_point_for_line_of_text(
&self,
x: f32,
y: f32,
metrics: &Metrics,
metrics: &FontMetrics,
width: f32,
is_rtl: bool,
) -> Point2D<f32> {
@@ -571,13 +755,15 @@ impl<'a> CanvasData<'a> {
_ => 0.,
};
let ascent = metrics.ascent.to_f32_px();
let descent = metrics.descent.to_f32_px();
let anchor_y = match self.state.text_baseline {
TextBaseline::Top => metrics.ascent,
TextBaseline::Hanging => metrics.ascent * HANGING_BASELINE_DEFAULT,
TextBaseline::Ideographic => -metrics.descent * IDEOGRAPHIC_BASELINE_DEFAULT,
TextBaseline::Middle => (metrics.ascent - metrics.descent) / 2.,
TextBaseline::Top => ascent,
TextBaseline::Hanging => ascent * HANGING_BASELINE_DEFAULT,
TextBaseline::Ideographic => -descent * IDEOGRAPHIC_BASELINE_DEFAULT,
TextBaseline::Middle => (ascent - descent) / 2.,
TextBaseline::Alphabetic => 0.,
TextBaseline::Bottom => -metrics.descent,
TextBaseline::Bottom => -descent,
};
point2(x + anchor_x, y + anchor_y)
@@ -651,7 +837,7 @@ impl<'a> CanvasData<'a> {
}
if self.need_to_draw_shadow() {
self.draw_with_shadow(&rect, |new_draw_target: &mut dyn GenericDrawTarget| {
self.draw_with_shadow(rect, |new_draw_target: &mut dyn GenericDrawTarget| {
new_draw_target.stroke_rect(
rect,
self.state.stroke_style.clone(),
@@ -918,7 +1104,7 @@ impl<'a> CanvasData<'a> {
Some(p) => p,
None => {
self.path_builder().move_to(cp1);
cp1.clone()
*cp1
},
};
let cp1 = *cp1;
@@ -979,6 +1165,7 @@ impl<'a> CanvasData<'a> {
}
}
#[allow(clippy::too_many_arguments)]
pub fn ellipse(
&mut self,
center: &Point2D<f32>,
@@ -1042,7 +1229,7 @@ impl<'a> CanvasData<'a> {
}
},
}
self.state.transform = transform.clone();
self.state.transform = *transform;
self.drawtarget.set_transform(transform)
}
@@ -1100,14 +1287,13 @@ impl<'a> CanvasData<'a> {
match self.image_key {
Some(image_key) => {
debug!("Updating image {:?}.", image_key);
updates.push(ImageUpdate::Update(image_key, descriptor, data));
updates.push(ImageUpdate::UpdateImage(image_key, descriptor, data));
},
None => {
let key = match self.webrender_api.generate_key() {
Ok(key) => key,
Err(()) => return,
let Some(key) = self.webrender_api.generate_key() else {
return;
};
updates.push(ImageUpdate::Add(key, descriptor, data));
updates.push(ImageUpdate::AddImage(key, descriptor, data));
self.image_key = Some(key);
debug!("New image {:?}.", self.image_key);
},
@@ -1116,7 +1302,7 @@ impl<'a> CanvasData<'a> {
if let Some(image_key) =
mem::replace(&mut self.very_old_image_key, self.old_image_key.take())
{
updates.push(ImageUpdate::Delete(image_key));
updates.push(ImageUpdate::DeleteImage(image_key));
}
self.webrender_api.update_images(updates);
@@ -1155,12 +1341,12 @@ impl<'a> CanvasData<'a> {
self.state.shadow_blur = value;
}
pub fn set_shadow_color(&mut self, value: RGBA) {
pub fn set_shadow_color(&mut self, value: AbsoluteColor) {
self.backend.set_shadow_color(value, &mut self.state);
}
pub fn set_font(&mut self, font_style: FontStyleStruct) {
self.state.font_style = Some(font_style)
self.state.font_style = Some(ServoArc::new(font_style))
}
pub fn set_text_align(&mut self, text_align: TextAlign) {
@@ -1200,10 +1386,7 @@ impl<'a> CanvasData<'a> {
draw_shadow_source(&mut *new_draw_target);
self.drawtarget.draw_surface_with_shadow(
new_draw_target.snapshot(),
&Point2D::new(
shadow_src_rect.origin.x as f32,
shadow_src_rect.origin.y as f32,
),
&Point2D::new(shadow_src_rect.origin.x, shadow_src_rect.origin.y),
&self.state.shadow_color,
&Vector2D::new(
self.state.shadow_offset_x as f32,
@@ -1237,10 +1420,10 @@ impl<'a> Drop for CanvasData<'a> {
fn drop(&mut self) {
let mut updates = vec![];
if let Some(image_key) = self.old_image_key.take() {
updates.push(ImageUpdate::Delete(image_key));
updates.push(ImageUpdate::DeleteImage(image_key));
}
if let Some(image_key) = self.very_old_image_key.take() {
updates.push(ImageUpdate::Delete(image_key));
updates.push(ImageUpdate::DeleteImage(image_key));
}
self.webrender_api.update_images(updates);
@@ -1262,7 +1445,7 @@ pub struct CanvasPaintState<'a> {
pub shadow_offset_y: f64,
pub shadow_blur: f64,
pub shadow_color: Color,
pub font_style: Option<FontStyleStruct>,
pub font_style: Option<ServoArc<FontStyleStruct>>,
pub text_align: TextAlign,
pub text_baseline: TextBaseline,
}
@@ -1353,71 +1536,6 @@ impl RectExt for Rect<u32> {
}
}
fn to_font_kit_family(font_family: &font::SingleFontFamily) -> FamilyName {
match font_family {
font::SingleFontFamily::FamilyName(family_name) => {
FamilyName::Title(family_name.to_css_string())
},
font::SingleFontFamily::Generic(generic) => match generic {
font::GenericFontFamily::Serif => FamilyName::Serif,
font::GenericFontFamily::SansSerif => FamilyName::SansSerif,
font::GenericFontFamily::Monospace => FamilyName::Monospace,
font::GenericFontFamily::Fantasy => FamilyName::Fantasy,
font::GenericFontFamily::Cursive => FamilyName::Cursive,
// TODO: There is no FontFamily::SystemUi.
font::GenericFontFamily::SystemUi => unreachable!("system-ui should be disabled"),
font::GenericFontFamily::None => unreachable!("Shouldn't appear in computed values"),
},
}
}
fn load_system_font_from_style(font_style: Option<&FontStyleStruct>) -> Option<Font> {
let mut properties = Properties::new();
let style = match font_style {
Some(style) => style,
None => return load_default_system_fallback_font(&properties),
};
let family_names = style
.font_family
.families
.iter()
.map(to_font_kit_family)
.collect::<Vec<_>>();
let properties = properties
.style(match style.font_style {
font::FontStyle::NORMAL => Style::Normal,
font::FontStyle::ITALIC => Style::Italic,
_ => {
// TODO: support oblique angle.
Style::Oblique
},
})
.weight(Weight(style.font_weight.value()))
.stretch(Stretch(style.font_stretch.to_percentage().0));
let font_handle = match SystemSource::new().select_best_match(&family_names, &properties) {
Ok(handle) => handle,
Err(e) => {
error!("error getting font handle for style {:?}: {}", style, e);
return load_default_system_fallback_font(&properties);
},
};
match font_handle.load() {
Ok(f) => Some(f),
Err(e) => {
error!("error loading font for style {:?}: {}", style, e);
load_default_system_fallback_font(&properties)
},
}
}
fn load_default_system_fallback_font(properties: &Properties) -> Option<Font> {
SystemSource::new()
.select_best_match(&[FamilyName::SansSerif], properties)
.ok()?
.load()
.ok()
}
fn replace_ascii_whitespace(text: String) -> String {
text.chars()
.map(|c| match c {
@@ -1426,18 +1544,3 @@ fn replace_ascii_whitespace(text: String) -> String {
})
.collect()
}
// TODO: This currently calculates the width using just advances and doesn't
// determine the fallback font in case a character glyph isn't found.
fn font_width(text: &str, point_size: f32, font: &Font) -> f32 {
let metrics = font.metrics();
let mut width = 0.;
for c in text.chars() {
if let Some(glyph_id) = font.glyph_for_char(c) {
if let Ok(advance) = font.advance(glyph_id) {
width += advance.x() * point_size / metrics.units_per_em as f32;
}
}
}
width
}

View File

@@ -4,17 +4,20 @@
use std::borrow::ToOwned;
use std::collections::HashMap;
use std::sync::Arc;
use std::thread;
use canvas_traits::canvas::*;
use canvas_traits::ConstellationCanvasMsg;
use crossbeam_channel::{select, unbounded, Sender};
use euclid::default::Size2D;
use gfx::font_cache_thread::FontCacheThread;
use fonts::{FontCacheThread, FontContext};
use ipc_channel::ipc::{self, IpcSender};
use ipc_channel::router::ROUTER;
use log::warn;
use webrender_api::{ImageData, ImageDescriptor, ImageKey};
use net_traits::ResourceThreads;
use webrender_api::ImageKey;
use webrender_traits::ImageUpdate;
use crate::canvas_data::*;
@@ -23,14 +26,9 @@ pub enum AntialiasMode {
None,
}
pub enum ImageUpdate {
Add(ImageKey, ImageDescriptor, ImageData),
Update(ImageKey, ImageDescriptor, ImageData),
Delete(ImageKey),
}
pub trait WebrenderApi {
fn generate_key(&self) -> Result<ImageKey, ()>;
/// Attempt to generate an [`ImageKey`], returning `None` in case of failure.
fn generate_key(&self) -> Option<ImageKey>;
fn update_images(&self, updates: Vec<ImageUpdate>);
fn clone(&self) -> Box<dyn WebrenderApi>;
}
@@ -39,19 +37,20 @@ pub struct CanvasPaintThread<'a> {
canvases: HashMap<CanvasId, CanvasData<'a>>,
next_canvas_id: CanvasId,
webrender_api: Box<dyn WebrenderApi>,
font_cache_thread: FontCacheThread,
font_context: Arc<FontContext<FontCacheThread>>,
}
impl<'a> CanvasPaintThread<'a> {
fn new(
webrender_api: Box<dyn WebrenderApi>,
font_cache_thread: FontCacheThread,
resource_threads: ResourceThreads,
) -> CanvasPaintThread<'a> {
CanvasPaintThread {
canvases: HashMap::new(),
next_canvas_id: CanvasId(0),
webrender_api,
font_cache_thread,
font_context: Arc::new(FontContext::new(font_cache_thread, resource_threads)),
}
}
@@ -60,6 +59,7 @@ impl<'a> CanvasPaintThread<'a> {
pub fn start(
webrender_api: Box<dyn WebrenderApi + Send>,
font_cache_thread: FontCacheThread,
resource_threads: ResourceThreads,
) -> (Sender<ConstellationCanvasMsg>, IpcSender<CanvasMsg>) {
let (ipc_sender, ipc_receiver) = ipc::channel::<CanvasMsg>().unwrap();
let msg_receiver = ROUTER.route_ipc_receiver_to_new_crossbeam_receiver(ipc_receiver);
@@ -67,7 +67,8 @@ impl<'a> CanvasPaintThread<'a> {
thread::Builder::new()
.name("Canvas".to_owned())
.spawn(move || {
let mut canvas_paint_thread = CanvasPaintThread::new(webrender_api, font_cache_thread);
let mut canvas_paint_thread = CanvasPaintThread::new(
webrender_api, font_cache_thread, resource_threads);
loop {
select! {
recv(msg_receiver) -> msg => {
@@ -128,18 +129,16 @@ impl<'a> CanvasPaintThread<'a> {
AntialiasMode::None
};
let font_cache_thread = self.font_cache_thread.clone();
let canvas_id = self.next_canvas_id.clone();
let canvas_id = self.next_canvas_id;
self.next_canvas_id.0 += 1;
let canvas_data = CanvasData::new(
size,
self.webrender_api.clone(),
antialias,
font_cache_thread,
self.font_context.clone(),
);
self.canvases.insert(canvas_id.clone(), canvas_data);
self.canvases.insert(canvas_id, canvas_data);
canvas_id
}
@@ -181,7 +180,7 @@ impl<'a> CanvasPaintThread<'a> {
source_rect,
smoothing_enabled,
) => self.canvas(canvas_id).draw_image(
&*image_data,
image_data,
image_size,
dest_rect,
source_rect,
@@ -235,6 +234,10 @@ impl<'a> CanvasPaintThread<'a> {
Canvas2dMsg::Ellipse(ref center, radius_x, radius_y, rotation, start, end, ccw) => self
.canvas(canvas_id)
.ellipse(center, radius_x, radius_y, rotation, start, end, ccw),
Canvas2dMsg::MeasureText(text, sender) => {
let metrics = self.canvas(canvas_id).measure_text(text);
sender.send(metrics).unwrap();
},
Canvas2dMsg::RestoreContext => self.canvas(canvas_id).restore_context_state(),
Canvas2dMsg::SaveContext => self.canvas(canvas_id).save_context_state(),
Canvas2dMsg::SetLineWidth(width) => self.canvas(canvas_id).set_line_width(width),

View File

@@ -2,22 +2,36 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use std::cell::RefCell;
use std::collections::HashMap;
use canvas_traits::canvas::*;
use cssparser::RGBA;
use cssparser::color::clamp_unit_f32;
use euclid::default::{Point2D, Rect, Size2D, Transform2D, Vector2D};
use euclid::Angle;
use font_kit::font::Font;
use fonts::{ByteIndex, FontIdentifier, FontTemplateRefMethods};
use log::warn;
use lyon_geom::Arc;
use range::Range;
use raqote::PathOp;
use style::color::AbsoluteColor;
use crate::canvas_data;
use crate::canvas_data::{
Backend, CanvasPaintState, Color, CompositionOp, DrawOptions, Filter, GenericDrawTarget,
GenericPathBuilder, GradientStop, GradientStops, Path, SourceSurface, StrokeOptions,
self, Backend, CanvasPaintState, Color, CompositionOp, DrawOptions, Filter, GenericDrawTarget,
GenericPathBuilder, GradientStop, GradientStops, Path, SourceSurface, StrokeOptions, TextRun,
};
use crate::canvas_paint_thread::AntialiasMode;
thread_local! {
/// The shared font cache used by all canvases that render on a thread. It would be nicer
/// to have a global cache, but it looks like font-kit uses a per-thread FreeType, so
/// in order to ensure that fonts are particular to a thread we have to make our own
/// cache thread local as well.
static SHARED_FONT_CACHE: RefCell<HashMap<FontIdentifier, Font>> = RefCell::default();
}
#[derive(Default)]
pub struct RaqoteBackend;
impl Backend for RaqoteBackend {
@@ -29,14 +43,14 @@ impl Backend for RaqoteBackend {
color.as_raqote().a != 0
}
fn set_shadow_color<'a>(&mut self, color: RGBA, state: &mut CanvasPaintState<'a>) {
fn set_shadow_color(&mut self, color: AbsoluteColor, state: &mut CanvasPaintState<'_>) {
state.shadow_color = Color::Raqote(color.to_raqote_style());
}
fn set_fill_style<'a>(
fn set_fill_style(
&mut self,
style: FillOrStrokeStyle,
state: &mut CanvasPaintState<'a>,
state: &mut CanvasPaintState<'_>,
_drawtarget: &dyn GenericDrawTarget,
) {
if let Some(pattern) = style.to_raqote_pattern() {
@@ -44,10 +58,10 @@ impl Backend for RaqoteBackend {
}
}
fn set_stroke_style<'a>(
fn set_stroke_style(
&mut self,
style: FillOrStrokeStyle,
state: &mut CanvasPaintState<'a>,
state: &mut CanvasPaintState<'_>,
_drawtarget: &dyn GenericDrawTarget,
) {
if let Some(pattern) = style.to_raqote_pattern() {
@@ -55,10 +69,10 @@ impl Backend for RaqoteBackend {
}
}
fn set_global_composition<'a>(
fn set_global_composition(
&mut self,
op: CompositionOrBlending,
state: &mut CanvasPaintState<'a>,
state: &mut CanvasPaintState<'_>,
) {
state.draw_options.as_raqote_mut().blend_mode = op.to_raqote_style();
}
@@ -125,9 +139,9 @@ pub struct LinearGradientPattern {
impl LinearGradientPattern {
fn new(start: Point2D<f32>, end: Point2D<f32>, stops: Vec<raqote::GradientStop>) -> Self {
LinearGradientPattern {
gradient: raqote::Gradient { stops: stops },
start: start,
end: end,
gradient: raqote::Gradient { stops },
start,
end,
}
}
}
@@ -150,11 +164,11 @@ impl RadialGradientPattern {
stops: Vec<raqote::GradientStop>,
) -> Self {
RadialGradientPattern {
gradient: raqote::Gradient { stops: stops },
center1: center1,
radius1: radius1,
center2: center2,
radius2: radius2,
gradient: raqote::Gradient { stops },
center1,
radius1,
center2,
radius2,
}
}
}
@@ -177,10 +191,10 @@ impl<'a> SurfacePattern<'a> {
},
};
SurfacePattern {
image: image,
filter: filter,
extend: extend,
repeat: repeat,
image,
filter,
extend,
repeat,
transform: Transform2D::identity(),
}
}
@@ -389,7 +403,7 @@ impl GenericDrawTarget for raqote::DrawTarget {
fn create_gradient_stops(&self, gradient_stops: Vec<GradientStop>) -> GradientStops {
let mut stops = gradient_stops
.into_iter()
.map(|item| item.as_raqote().clone())
.map(|item| *item.as_raqote())
.collect::<Vec<raqote::GradientStop>>();
// https://www.w3.org/html/test/results/2dcontext/annotated-spec/canvas.html#testrefs.2d.gradient.interpolate.overlap
stops.sort_by(|a, b| a.position.partial_cmp(&b.position).unwrap());
@@ -492,7 +506,7 @@ impl GenericDrawTarget for raqote::DrawTarget {
raqote::BlendMode::SrcOut |
raqote::BlendMode::DstIn |
raqote::BlendMode::DstAtop => {
let mut options = draw_options.as_raqote().clone();
let mut options = *draw_options.as_raqote();
self.push_layer_with_blend(1., options.blend_mode);
options.blend_mode = raqote::BlendMode::SrcOver;
self.fill(path.as_raqote(), &pattern.source(), &options);
@@ -507,43 +521,61 @@ impl GenericDrawTarget for raqote::DrawTarget {
fn fill_text(
&mut self,
font: &Font,
point_size: f32,
text: &str,
text_runs: Vec<TextRun>,
start: Point2D<f32>,
pattern: &canvas_data::Pattern,
options: &DrawOptions,
draw_options: &DrawOptions,
) {
let mut start = pathfinder_geometry::vector::vec2f(start.x, start.y);
let mut ids = Vec::new();
let mut positions = Vec::new();
for c in text.chars() {
let id = match font.glyph_for_char(c) {
Some(id) => id,
None => {
warn!("Skipping non-existent glyph {}", c);
continue;
},
};
ids.push(id);
positions.push(Point2D::new(start.x(), start.y()));
let advance = match font.advance(id) {
Ok(advance) => advance,
Err(e) => {
warn!("Skipping glyph {} with missing advance: {:?}", c, e);
continue;
},
};
start += advance * point_size / 24. / 96.;
let mut advance = 0.;
for run in text_runs.iter() {
let mut positions = Vec::new();
let glyphs = &run.glyphs;
let ids: Vec<_> = glyphs
.iter_glyphs_for_byte_range(&Range::new(ByteIndex(0), glyphs.len()))
.map(|glyph| {
let glyph_offset = glyph.offset().unwrap_or(Point2D::zero());
positions.push(Point2D::new(
advance + start.x + glyph_offset.x.to_f32_px(),
start.y + glyph_offset.y.to_f32_px(),
));
advance += glyph.advance().to_f32_px();
glyph.id()
})
.collect();
// TODO: raqote uses font-kit to rasterize glyphs, but font-kit fails an assertion when
// using color bitmap fonts in the FreeType backend. For now, simply do not render these
// type of fonts.
if run.font.has_color_bitmap_or_colr_table() {
continue;
}
let template = &run.font.template;
SHARED_FONT_CACHE.with(|font_cache| {
let identifier = template.identifier();
if !font_cache.borrow().contains_key(&identifier) {
let Ok(font) = Font::from_bytes(template.data(), identifier.index()) else {
return;
};
font_cache.borrow_mut().insert(identifier.clone(), font);
}
let font_cache = font_cache.borrow();
let Some(font) = font_cache.get(&identifier) else {
return;
};
self.draw_glyphs(
font,
run.font.descriptor.pt_size.to_f32_px(),
&ids,
&positions,
&pattern.source(),
draw_options.as_raqote(),
);
})
}
self.draw_glyphs(
font,
point_size,
&ids,
&positions,
&pattern.source(),
options.as_raqote(),
);
}
fn fill_rect(
@@ -654,28 +686,23 @@ impl GenericDrawTarget for raqote::DrawTarget {
#[allow(unsafe_code)]
fn snapshot_data(&self, f: &dyn Fn(&[u8]) -> Vec<u8>) -> Vec<u8> {
let v = self.get_data();
f(unsafe {
std::slice::from_raw_parts(
v.as_ptr() as *const u8,
v.len() * std::mem::size_of::<u32>(),
)
})
f(
unsafe {
std::slice::from_raw_parts(v.as_ptr() as *const u8, std::mem::size_of_val(v))
},
)
}
#[allow(unsafe_code)]
fn snapshot_data_owned(&self) -> Vec<u8> {
let v = self.get_data();
unsafe {
std::slice::from_raw_parts(
v.as_ptr() as *const u8,
v.len() * std::mem::size_of::<u32>(),
)
.into()
std::slice::from_raw_parts(v.as_ptr() as *const u8, std::mem::size_of_val(v)).into()
}
}
}
impl Filter {
fn to_raqote(&self) -> raqote::FilterMode {
fn to_raqote(self) -> raqote::FilterMode {
match self {
Filter::Bilinear => raqote::FilterMode::Bilinear,
Filter::Nearest => raqote::FilterMode::Nearest,
@@ -852,61 +879,38 @@ pub trait ToRaqotePattern<'a> {
}
pub trait ToRaqoteGradientStop {
fn to_raqote(&self) -> raqote::GradientStop;
}
/// Clamp a 0..1 number to a 0..255 range to u8.
///
/// Whilst scaling by 256 and flooring would provide
/// an equal distribution of integers to percentage inputs,
/// this is not what Gecko does so we instead multiply by 255
/// and round (adding 0.5 and flooring is equivalent to rounding)
///
/// Chrome does something similar for the alpha value, but not
/// the rgb values.
///
/// See <https://bugzilla.mozilla.org/show_bug.cgi?id=1340484>
///
/// Clamping to 256 and rounding after would let 1.0 map to 256, and
/// `256.0_f32 as u8` is undefined behavior:
///
/// <https://github.com/rust-lang/rust/issues/10184>
#[inline]
pub fn clamp_unit_f32(val: f32) -> u8 {
clamp_floor_256_f32(val * 255.)
}
/// Round and clamp a single number to a u8.
#[inline]
pub fn clamp_floor_256_f32(val: f32) -> u8 {
val.round().clamp(0., 255.) as u8
fn to_raqote(self) -> raqote::GradientStop;
}
impl ToRaqoteGradientStop for CanvasGradientStop {
fn to_raqote(&self) -> raqote::GradientStop {
fn to_raqote(self) -> raqote::GradientStop {
let srgb = self.color.into_srgb_legacy();
let color = raqote::Color::new(
self.color.alpha.map(clamp_unit_f32).unwrap_or(0),
self.color.red.unwrap_or(0),
self.color.green.unwrap_or(0),
self.color.blue.unwrap_or(0),
clamp_unit_f32(srgb.alpha),
clamp_unit_f32(srgb.components.0),
clamp_unit_f32(srgb.components.1),
clamp_unit_f32(srgb.components.2),
);
let position = self.offset as f32;
raqote::GradientStop { position, color }
}
}
impl<'a> ToRaqotePattern<'_> for FillOrStrokeStyle {
impl ToRaqotePattern<'_> for FillOrStrokeStyle {
#[allow(unsafe_code)]
fn to_raqote_pattern(self) -> Option<Pattern<'static>> {
use canvas_traits::canvas::FillOrStrokeStyle::*;
match self {
Color(color) => Some(Pattern::Color(
color.alpha.map(clamp_unit_f32).unwrap_or(0),
color.red.unwrap_or(0),
color.green.unwrap_or(0),
color.blue.unwrap_or(0),
)),
Color(color) => {
let srgb = color.into_srgb_legacy();
Some(Pattern::Color(
clamp_unit_f32(srgb.alpha),
clamp_unit_f32(srgb.components.0),
clamp_unit_f32(srgb.components.1),
clamp_unit_f32(srgb.components.2),
))
},
LinearGradient(style) => {
let start = Point2D::new(style.x0 as f32, style.y0 as f32);
let end = Point2D::new(style.x1 as f32, style.y1 as f32);
@@ -956,15 +960,16 @@ impl Color {
}
}
impl ToRaqoteStyle for RGBA {
impl ToRaqoteStyle for AbsoluteColor {
type Target = raqote::SolidSource;
fn to_raqote_style(self) -> Self::Target {
let srgb = self.into_srgb_legacy();
raqote::SolidSource::from_unpremultiplied_argb(
self.alpha.map(clamp_unit_f32).unwrap_or(0),
self.red.unwrap_or(0),
self.green.unwrap_or(0),
self.blue.unwrap_or(0),
clamp_unit_f32(srgb.alpha),
clamp_unit_f32(srgb.components.0),
clamp_unit_f32(srgb.components.1),
clamp_unit_f32(srgb.components.2),
)
}
}

View File

@@ -8,7 +8,6 @@ use std::sync::{Arc, Mutex};
use canvas_traits::webgl::{webgl_channel, WebGLContextId, WebGLMsg, WebGLThreads};
use euclid::default::Size2D;
use fnv::FnvHashMap;
use gfx::rendering_context::RenderingContext;
use log::debug;
use sparkle::gl::GlType;
use surfman::chains::{SwapChainAPI, SwapChains, SwapChainsAPI};
@@ -16,7 +15,8 @@ use surfman::{Device, SurfaceInfo, SurfaceTexture};
use webrender::RenderApiSender;
use webrender_api::DocumentId;
use webrender_traits::{
WebrenderExternalImageApi, WebrenderExternalImageRegistry, WebrenderImageSource,
RenderingContext, WebrenderExternalImageApi, WebrenderExternalImageRegistry,
WebrenderImageSource,
};
use webxr::SurfmanGL as WebXRSurfman;
use webxr_api::LayerGrandManager as WebXRLayerGrandManager;
@@ -65,7 +65,7 @@ impl WebGLComm {
WebGLComm {
webgl_threads: WebGLThreads(sender),
image_handler: Box::new(external),
webxr_layer_grand_manager: webxr_layer_grand_manager,
webxr_layer_grand_manager,
}
}
}

View File

@@ -51,11 +51,6 @@ use webxr_api::{
use crate::webgl_limits::GLLimitsDetect;
#[cfg(feature = "xr-profile")]
fn to_ms(ns: u64) -> f64 {
ns as f64 / 1_000_000.
}
struct GLContextData {
ctx: Context,
gl: Rc<Gl>,
@@ -289,7 +284,7 @@ impl WebGLThread {
let exit = self.handle_msg(msg, &webgl_chan);
if exit {
// Call remove_context functions in order to correctly delete WebRender image keys.
let context_ids: Vec<WebGLContextId> = self.contexts.keys().map(|id| *id).collect();
let context_ids: Vec<WebGLContextId> = self.contexts.keys().copied().collect();
for id in context_ids {
self.remove_webgl_context(id);
}
@@ -323,7 +318,7 @@ impl WebGLThread {
&mut self.bound_context_id,
)
.expect("WebGLContext not found");
let glsl_version = Self::get_glsl_version(&*data.gl);
let glsl_version = Self::get_glsl_version(&data.gl);
let api_type = match data.gl.get_type() {
gl::GlType::Gl => GlType::Gl,
gl::GlType::Gles => GlType::Gles,
@@ -373,7 +368,10 @@ impl WebGLThread {
WebGLMsg::SwapBuffers(swap_ids, sender, sent_time) => {
self.handle_swap_buffers(swap_ids, sender, sent_time);
},
WebGLMsg::Exit => {
WebGLMsg::Exit(sender) => {
if let Err(e) = sender.send(()) {
warn!("Failed to send response to WebGLMsg::Exit ({e})");
}
return true;
},
}
@@ -458,7 +456,7 @@ impl WebGLThread {
WebGLImpl::apply(
&self.device,
&data.ctx,
&*data.gl,
&data.gl,
&mut data.state,
&data.attributes,
command,
@@ -497,12 +495,12 @@ impl WebGLThread {
ContextAttributeFlags::STENCIL;
let context_attributes = &ContextAttributes {
version: webgl_version.to_surfman_version(self.api_type),
flags: flags,
flags,
};
let context_descriptor = self
.device
.create_context_descriptor(&context_attributes)
.create_context_descriptor(context_attributes)
.map_err(|err| format!("Failed to create context descriptor: {:?}", err))?;
let safe_size = Size2D::new(
@@ -562,7 +560,7 @@ impl WebGLThread {
})),
};
let limits = GLLimits::detect(&*gl, webgl_version);
let limits = GLLimits::detect(&gl, webgl_version);
let size = clamp_viewport(&gl, requested_size);
if safe_size != size {
@@ -583,7 +581,7 @@ impl WebGLThread {
.device
.context_surface_info(&ctx)
.map_err(|err| format!("Failed to get context surface info: {:?}", err))?
.ok_or_else(|| format!("Failed to get context surface info"))?
.ok_or_else(|| "Failed to get context surface info".to_string())?
.framebuffer_object;
gl.bind_framebuffer(gl::FRAMEBUFFER, framebuffer);
@@ -616,7 +614,7 @@ impl WebGLThread {
};
debug!("Created state {:?}", state);
state.restore_invariant(&*gl);
state.restore_invariant(&gl);
debug_assert_eq!(gl.get_error(), gl::NO_ERROR);
self.contexts.insert(
@@ -663,7 +661,7 @@ impl WebGLThread {
// Check to see if any of the current framebuffer bindings are the surface we're about to
// throw out. If so, we'll have to reset them after destroying the surface.
let framebuffer_rebinding_info =
FramebufferRebindingInfo::detect(&self.device, &data.ctx, &*data.gl);
FramebufferRebindingInfo::detect(&self.device, &data.ctx, &data.gl);
// Resize the swap chains
if let Some(swap_chain) = self.webrender_swap_chains.get(context_id) {
@@ -676,14 +674,14 @@ impl WebGLThread {
.resize(&mut self.device, &mut data.ctx, size.to_i32())
.map_err(|err| format!("Failed to resize swap chain: {:?}", err))?;
swap_chain
.clear_surface(&mut self.device, &mut data.ctx, &*data.gl, clear_color)
.clear_surface(&mut self.device, &mut data.ctx, &data.gl, clear_color)
.map_err(|err| format!("Failed to clear resized swap chain: {:?}", err))?;
} else {
error!("Failed to find swap chain");
}
// Reset framebuffer bindings as appropriate.
framebuffer_rebinding_info.apply(&self.device, &data.ctx, &*data.gl);
framebuffer_rebinding_info.apply(&self.device, &data.ctx, &data.gl);
debug_assert_eq!(data.gl.get_error(), gl::NO_ERROR);
let has_alpha = data
@@ -764,7 +762,7 @@ impl WebGLThread {
// Check to see if any of the current framebuffer bindings are the surface we're about
// to swap out. If so, we'll have to reset them after destroying the surface.
let framebuffer_rebinding_info =
FramebufferRebindingInfo::detect(&self.device, &data.ctx, &*data.gl);
FramebufferRebindingInfo::detect(&self.device, &data.ctx, &data.gl);
debug_assert_eq!(data.gl.get_error(), gl::NO_ERROR);
debug!("Getting swap chain for {:?}", context_id);
@@ -779,7 +777,7 @@ impl WebGLThread {
&mut self.device,
&mut data.ctx,
if data.attributes.preserve_drawing_buffer {
PreserveBuffer::Yes(&*data.gl)
PreserveBuffer::Yes(&data.gl)
} else {
PreserveBuffer::No
},
@@ -795,14 +793,14 @@ impl WebGLThread {
.contains(ContextAttributeFlags::ALPHA);
let clear_color = [0.0, 0.0, 0.0, !alpha as i32 as f32];
swap_chain
.clear_surface(&mut self.device, &mut data.ctx, &*data.gl, clear_color)
.clear_surface(&mut self.device, &mut data.ctx, &data.gl, clear_color)
.unwrap();
debug_assert_eq!(data.gl.get_error(), gl::NO_ERROR);
}
// Rebind framebuffers as appropriate.
debug!("Rebinding {:?}", context_id);
framebuffer_rebinding_info.apply(&self.device, &data.ctx, &*data.gl);
framebuffer_rebinding_info.apply(&self.device, &data.ctx, &data.gl);
debug_assert_eq!(data.gl.get_error(), gl::NO_ERROR);
let SurfaceInfo {
@@ -829,14 +827,6 @@ impl WebGLThread {
#[allow(unused)]
let mut end_swap = 0;
#[cfg(feature = "xr-profile")]
{
end_swap = time::precise_time_ns();
println!(
"WEBXR PROFILING [swap buffer]:\t{}ms",
to_ms(end_swap - start_swap)
);
}
completed_sender.send(end_swap).unwrap();
}
@@ -941,7 +931,7 @@ impl WebGLThread {
image_buffer_kind: ImageBufferKind,
) -> ImageData {
let data = ExternalImageData {
id: ExternalImageId(context_id.0 as u64),
id: ExternalImageId(context_id.0),
channel_index: 0,
image_type: ExternalImageType::TextureHandle(image_buffer_kind),
};
@@ -1054,7 +1044,7 @@ impl WebGLImpl {
gl.clear_color(r, g, b, a);
},
WebGLCommand::ClearDepth(depth) => {
let value = depth.max(0.).min(1.) as f64;
let value = depth.clamp(0., 1.) as f64;
state.depth_clear_value = value;
gl.clear_depth(value)
},
@@ -1093,7 +1083,7 @@ impl WebGLImpl {
state.restore_depth_invariant(gl);
},
WebGLCommand::DepthRange(near, far) => {
gl.depth_range(near.max(0.).min(1.) as f64, far.max(0.).min(1.) as f64)
gl.depth_range(near.clamp(0., 1.) as f64, far.clamp(0., 1.) as f64)
},
WebGLCommand::Disable(cap) => match cap {
gl::SCISSOR_TEST => {
@@ -1288,7 +1278,7 @@ impl WebGLImpl {
sender.send(location).unwrap();
},
WebGLCommand::GetUniformLocation(program_id, ref name, ref chan) => {
Self::uniform_location(gl, program_id, &name, chan)
Self::uniform_location(gl, program_id, name, chan)
},
WebGLCommand::GetShaderInfoLog(shader_id, ref chan) => {
Self::shader_info_log(gl, shader_id, chan)
@@ -1297,7 +1287,7 @@ impl WebGLImpl {
Self::program_info_log(gl, program_id, chan)
},
WebGLCommand::CompileShader(shader_id, ref source) => {
Self::compile_shader(gl, shader_id, &source)
Self::compile_shader(gl, shader_id, source)
},
WebGLCommand::CreateBuffer(ref chan) => Self::create_buffer(gl, chan),
WebGLCommand::CreateFramebuffer(ref chan) => Self::create_framebuffer(gl, chan),
@@ -1426,7 +1416,7 @@ impl WebGLImpl {
alpha_treatment,
y_axis_treatment,
pixel_format,
Cow::Borrowed(&*data),
Cow::Borrowed(data),
);
gl.pixel_store_i(gl::UNPACK_ALIGNMENT, unpacking_alignment as i32);
@@ -1489,7 +1479,7 @@ impl WebGLImpl {
alpha_treatment,
y_axis_treatment,
pixel_format,
Cow::Borrowed(&*data),
Cow::Borrowed(data),
);
gl.pixel_store_i(gl::UNPACK_ALIGNMENT, unpacking_alignment as i32);
@@ -1519,7 +1509,7 @@ impl WebGLImpl {
size.width as i32,
size.height as i32,
0,
&*data,
data,
);
},
WebGLCommand::CompressedTexSubImage2D {
@@ -1533,13 +1523,13 @@ impl WebGLImpl {
} => {
gl.compressed_tex_sub_image_2d(
target,
level as i32,
xoffset as i32,
yoffset as i32,
level,
xoffset,
yoffset,
size.width as i32,
size.height as i32,
format,
&*data,
data,
);
},
WebGLCommand::TexStorage2D(target, levels, internal_format, width, height) => gl
@@ -1561,7 +1551,7 @@ impl WebGLImpl {
),
WebGLCommand::DrawingBufferWidth(ref sender) => {
let size = device
.context_surface_info(&ctx)
.context_surface_info(ctx)
.unwrap()
.expect("Where's the front buffer?")
.size;
@@ -1569,7 +1559,7 @@ impl WebGLImpl {
},
WebGLCommand::DrawingBufferHeight(ref sender) => {
let size = device
.context_surface_info(&ctx)
.context_surface_info(ctx)
.unwrap()
.expect("Where's the front buffer?")
.size;
@@ -1615,7 +1605,7 @@ impl WebGLImpl {
sender.send(value).unwrap();
},
WebGLCommand::ClientWaitSync(sync_id, flags, timeout, ref sender) => {
let value = gl.client_wait_sync(sync_id.get() as *const _, flags, timeout as u64);
let value = gl.client_wait_sync(sync_id.get() as *const _, flags, timeout);
sender.send(value).unwrap();
},
WebGLCommand::WaitSync(sync_id, flags, timeout) => {
@@ -1744,10 +1734,10 @@ impl WebGLImpl {
}
},
WebGLCommand::TexParameteri(target, param, value) => {
gl.tex_parameter_i(target, param as u32, value)
gl.tex_parameter_i(target, param, value)
},
WebGLCommand::TexParameterf(target, param, value) => {
gl.tex_parameter_f(target, param as u32, value)
gl.tex_parameter_f(target, param, value)
},
WebGLCommand::LinkProgram(program_id, ref sender) => {
return sender.send(Self::link_program(gl, program_id)).unwrap();
@@ -2503,7 +2493,7 @@ impl WebGLImpl {
///
/// To avoid hard-coding this we would need to use the `sh::GetAttributes` and `sh::GetUniforms`
/// API to look up the `x.name` and `x.mappedName` members.
const ANGLE_NAME_PREFIX: &'static str = "_u";
const ANGLE_NAME_PREFIX: &str = "_u";
fn to_name_in_compiled_shader(s: &str) -> String {
map_dot_separated(s, |s, mapped| {
@@ -2514,8 +2504,8 @@ fn to_name_in_compiled_shader(s: &str) -> String {
fn from_name_in_compiled_shader(s: &str) -> String {
map_dot_separated(s, |s, mapped| {
mapped.push_str(if s.starts_with(ANGLE_NAME_PREFIX) {
&s[ANGLE_NAME_PREFIX.len()..]
mapped.push_str(if let Some(stripped) = s.strip_prefix(ANGLE_NAME_PREFIX) {
stripped
} else {
s
})
@@ -2533,6 +2523,7 @@ fn map_dot_separated<F: Fn(&str, &mut String)>(s: &str, f: F) -> String {
mapped
}
#[allow(clippy::too_many_arguments)]
fn prepare_pixels(
internal_format: TexFormat,
data_type: TexDataType,
@@ -2885,8 +2876,8 @@ fn flip_pixels_y(
// Clamp a size to the current GL context's max viewport
fn clamp_viewport(gl: &Gl, size: Size2D<u32>) -> Size2D<u32> {
let mut max_viewport = [i32::max_value(), i32::max_value()];
let mut max_renderbuffer = [i32::max_value()];
let mut max_viewport = [i32::MAX, i32::MAX];
let mut max_renderbuffer = [i32::MAX];
#[allow(unsafe_code)]
unsafe {
gl.get_integer_v(gl::MAX_VIEWPORT_DIMS, &mut max_viewport);
@@ -3057,7 +3048,7 @@ impl WebXRBridge {
.map_err(|_| WebXRError::CommunicationError)?;
let manager = factory.build(device, contexts)?;
let manager_id = unsafe { WebXRLayerManagerId::new(self.next_manager_id) };
self.next_manager_id = self.next_manager_id + 1;
self.next_manager_id += 1;
self.managers.insert(manager_id, manager);
Ok(manager_id)
}
@@ -3100,7 +3091,8 @@ impl WebXRBridge {
contexts: &mut dyn WebXRContexts<WebXRSurfman>,
context_id: WebXRContextId,
) {
for (_, manager) in &mut self.managers {
for manager in self.managers.values_mut() {
#[allow(clippy::unnecessary_to_owned)] // Needs mutable borrow later in destroy
for (other_id, layer_id) in manager.layers().to_vec() {
if other_id == context_id {
manager.destroy_layer(device, contexts, context_id, layer_id);
@@ -3178,7 +3170,7 @@ impl WebXRLayerGrandManagerAPI<WebXRSurfman> for WebXRBridgeGrandManager {
&self,
factory: WebXRLayerManagerFactory<WebXRSurfman>,
) -> Result<WebXRLayerManager, WebXRError> {
let (sender, receiver) = webgl_channel().map_err(|_| WebXRError::CommunicationError)?;
let (sender, receiver) = webgl_channel().ok_or(WebXRError::CommunicationError)?;
let _ = self.factory_sender.send(factory);
let _ = self
.sender
@@ -3219,7 +3211,7 @@ impl<GL: WebXRTypes> WebXRLayerManagerAPI<GL> for WebXRBridgeManager {
context_id: WebXRContextId,
init: WebXRLayerInit,
) -> Result<WebXRLayerId, WebXRError> {
let (sender, receiver) = webgl_channel().map_err(|_| WebXRError::CommunicationError)?;
let (sender, receiver) = webgl_channel().ok_or(WebXRError::CommunicationError)?;
let _ = self
.sender
.send(WebGLMsg::WebXRCommand(WebXRCommand::CreateLayer(
@@ -3262,7 +3254,7 @@ impl<GL: WebXRTypes> WebXRLayerManagerAPI<GL> for WebXRBridgeManager {
_: &mut dyn WebXRContexts<GL>,
layers: &[(WebXRContextId, WebXRLayerId)],
) -> Result<Vec<WebXRSubImages>, WebXRError> {
let (sender, receiver) = webgl_channel().map_err(|_| WebXRError::CommunicationError)?;
let (sender, receiver) = webgl_channel().ok_or(WebXRError::CommunicationError)?;
let _ = self
.sender
.send(WebGLMsg::WebXRCommand(WebXRCommand::BeginFrame(
@@ -3281,7 +3273,7 @@ impl<GL: WebXRTypes> WebXRLayerManagerAPI<GL> for WebXRBridgeManager {
_: &mut dyn WebXRContexts<GL>,
layers: &[(WebXRContextId, WebXRLayerId)],
) -> Result<(), WebXRError> {
let (sender, receiver) = webgl_channel().map_err(|_| WebXRError::CommunicationError)?;
let (sender, receiver) = webgl_channel().ok_or(WebXRError::CommunicationError)?;
let _ = self
.sender
.send(WebGLMsg::WebXRCommand(WebXRCommand::EndFrame(
@@ -3315,8 +3307,8 @@ impl<'a> WebXRContexts<WebXRSurfman> for WebXRBridgeContexts<'a> {
let data = WebGLThread::make_current_if_needed_mut(
device,
WebGLContextId::from(context_id),
&mut self.contexts,
&mut self.bound_context_id,
self.contexts,
self.bound_context_id,
)?;
Some(&mut data.ctx)
}
@@ -3324,8 +3316,8 @@ impl<'a> WebXRContexts<WebXRSurfman> for WebXRBridgeContexts<'a> {
let data = WebGLThread::make_current_if_needed(
device,
WebGLContextId::from(context_id),
&self.contexts,
&mut self.bound_context_id,
self.contexts,
self.bound_context_id,
)?;
Some(&data.gl)
}

View File

@@ -1,11 +1,10 @@
[package]
name = "compositing"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2018"
publish = false
build = "build.rs"
version.workspace = true
authors.workspace = true
license.workspace = true
edition.workspace = true
publish.workspace = true
[lib]
name = "compositing"
@@ -16,34 +15,37 @@ default = []
multiview = []
[dependencies]
base = { workspace = true }
canvas = { path = "../canvas" }
compositing_traits = { workspace = true }
crossbeam-channel = { workspace = true }
embedder_traits = { workspace = true }
euclid = { workspace = true }
fnv = { workspace = true }
gfx = { path = "../gfx" }
gfx_traits = { workspace = true }
fonts = { path = "../fonts" }
fonts_traits = { workspace = true }
gleam = { workspace = true }
image = { workspace = true }
ipc-channel = { workspace = true }
keyboard-types = { workspace = true }
libc = { workspace = true }
log = { workspace = true }
msg = { workspace = true }
net = { path = "../net" }
net_traits = { workspace = true }
pixels = { path = "../pixels" }
profile_traits = { workspace = true }
script_traits = { workspace = true }
servo_config = { path = "../config" }
servo-media = { git = "https://github.com/servo/media" }
servo-media = { workspace = true }
servo_geometry = { path = "../geometry" }
servo_url = { path = "../url" }
style_traits = { workspace = true }
time = { workspace = true }
tracing = { workspace = true }
webrender = { workspace = true }
webrender_api = { workspace = true }
webrender_traits = { workspace = true }
webxr = { git = "https://github.com/servo/webxr" }
[build-dependencies]
toml = "0.5"
[dev-dependencies]
surfman = { workspace = true }

View File

@@ -1,52 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use std::env;
use std::fs::File;
use std::io::{Read, Write};
use std::path::Path;
fn main() {
let lockfile_path = Path::new(&env::var("CARGO_MANIFEST_DIR").unwrap())
.join("..")
.join("..")
.join("Cargo.lock");
let revision_file_path =
Path::new(&env::var_os("OUT_DIR").unwrap()).join("webrender_revision.rs");
let mut lockfile = String::new();
File::open(lockfile_path)
.expect("Cannot open lockfile")
.read_to_string(&mut lockfile)
.expect("Failed to read lockfile");
match toml::from_str::<toml::value::Table>(&lockfile) {
Ok(result) => {
let packages = result
.get("package")
.expect("Cargo lockfile should contain package list");
match *packages {
toml::Value::Array(ref arr) => {
let source = arr
.iter()
.find(|pkg| {
pkg.get("name").and_then(|name| name.as_str()).unwrap_or("") ==
"webrender"
})
.and_then(|pkg| pkg.get("source").and_then(|source| source.as_str()))
.unwrap_or("unknown");
let parsed: Vec<&str> = source.split("#").collect();
let revision = if parsed.len() > 1 { parsed[1] } else { source };
let mut revision_module_file = File::create(&revision_file_path).unwrap();
write!(&mut revision_module_file, "{}", format!("\"{}\"", revision)).unwrap();
},
_ => panic!("Cannot find package definitions in lockfile"),
}
},
Err(e) => panic!("{}", e),
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -5,8 +5,8 @@
use std::rc::Rc;
use gleam::gl::{self, Gl};
use image::RgbImage;
use log::trace;
use image::RgbaImage;
use log::{trace, warn};
use servo_geometry::FramebufferUintLength;
pub struct RenderTargetInfo {
@@ -31,11 +31,11 @@ impl RenderTargetInfo {
gl.tex_image_2d(
gl::TEXTURE_2D,
0,
gl::RGB as gl::GLint,
gl::RGBA as gl::GLint,
width.get() as gl::GLsizei,
height.get() as gl::GLsizei,
0,
gl::RGB,
gl::RGBA,
gl::UNSIGNED_BYTE,
None,
);
@@ -105,7 +105,7 @@ impl RenderTargetInfo {
y: i32,
width: FramebufferUintLength,
height: FramebufferUintLength,
) -> RgbImage {
) -> RgbaImage {
let width = width.get() as usize;
let height = height.get() as usize;
// For some reason, OSMesa fails to render on the 3rd
@@ -121,21 +121,25 @@ impl RenderTargetInfo {
y,
width as gl::GLsizei,
height as gl::GLsizei,
gl::RGB,
gl::RGBA,
gl::UNSIGNED_BYTE,
);
let gl_error = self.gl.get_error();
if gl_error != gl::NO_ERROR {
warn!("GL error code 0x{gl_error:x} set after read_pixels");
}
// flip image vertically (texture is upside down)
let orig_pixels = pixels.clone();
let stride = width * 3;
let stride = width * 4;
for y in 0..height {
let dst_start = y * stride;
let src_start = (height - y - 1) * stride;
let src_slice = &orig_pixels[src_start..src_start + stride];
(&mut pixels[dst_start..dst_start + stride]).clone_from_slice(&src_slice[..stride]);
pixels[dst_start..dst_start + stride].clone_from_slice(&src_slice[..stride]);
}
RgbImage::from_raw(width as u32, height as u32, pixels).expect("Flipping image failed!")
RgbaImage::from_raw(width as u32, height as u32, pixels).expect("Flipping image failed!")
}
}
@@ -148,3 +152,57 @@ impl Drop for RenderTargetInfo {
self.gl.delete_framebuffers(&self.framebuffer_ids);
}
}
#[cfg(test)]
mod test {
use gleam::gl;
use image::Rgba;
use servo_geometry::FramebufferUintLength;
use surfman::{Connection, ContextAttributeFlags, ContextAttributes, Error, GLApi, GLVersion};
use super::RenderTargetInfo;
#[test]
#[allow(unsafe_code)]
fn test_read_pixels() -> Result<(), Error> {
let connection = Connection::new()?;
let adapter = connection.create_software_adapter()?;
let mut device = connection.create_device(&adapter)?;
let context_descriptor = device.create_context_descriptor(&ContextAttributes {
version: GLVersion::new(3, 0),
flags: ContextAttributeFlags::empty(),
})?;
let mut context = device.create_context(&context_descriptor, None)?;
let gl = match connection.gl_api() {
GLApi::GL => unsafe { gl::GlFns::load_with(|s| device.get_proc_address(&context, s)) },
GLApi::GLES => unsafe {
gl::GlesFns::load_with(|s| device.get_proc_address(&context, s))
},
};
device.make_context_current(&context)?;
{
const WIDTH: FramebufferUintLength = FramebufferUintLength::new(16);
const HEIGHT: FramebufferUintLength = FramebufferUintLength::new(16);
let render_target = RenderTargetInfo::new(gl, WIDTH, HEIGHT);
render_target.bind();
render_target
.gl
.clear_color(12.0 / 255.0, 34.0 / 255.0, 56.0 / 255.0, 78.0 / 255.0);
render_target.gl.clear(gl::COLOR_BUFFER_BIT);
let img = render_target.read_back_from_gpu(0, 0, WIDTH, HEIGHT);
assert_eq!(img.width(), WIDTH.get());
assert_eq!(img.height(), HEIGHT.get());
let expected_pixel: Rgba<u8> = Rgba([12, 34, 56, 78]);
assert!(img.pixels().all(|&p| p == expected_pixel));
}
device.destroy_context(&mut context)?;
Ok(())
}
}

View File

@@ -8,16 +8,20 @@ use std::rc::Rc;
use compositing_traits::{CompositorProxy, CompositorReceiver, ConstellationMsg};
use crossbeam_channel::Sender;
use gfx::rendering_context::RenderingContext;
use profile_traits::{mem, time};
use webrender::RenderApi;
use webrender_api::DocumentId;
use webrender_traits::RenderingContext;
pub use crate::compositor::{CompositeTarget, IOCompositor, ShutdownState};
#[macro_use]
mod tracing;
mod compositor;
mod gl;
mod touch;
pub mod webview;
pub mod windowing;
/// Data used to construct a compositor.

View File

@@ -25,10 +25,7 @@ pub struct TouchPoint {
impl TouchPoint {
pub fn new(id: TouchId, point: Point2D<f32, DevicePixel>) -> Self {
TouchPoint {
id: id,
point: point,
}
TouchPoint { id, point }
}
}

View File

@@ -0,0 +1,58 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
/// Log an event from constellation at trace level.
/// - To disable tracing: RUST_LOG='compositor<constellation@=off'
/// - To enable tracing: RUST_LOG='compositor<constellation@'
macro_rules! trace_msg_from_constellation {
// This macro only exists to put the docs in the same file as the target prefix,
// so the macro definition is always the same.
($event:expr, $($rest:tt)+) => {
::log::trace!(target: $crate::tracing::LogTarget::log_target(&$event), $($rest)+)
};
}
/// Get the log target for an event, as a static string.
pub(crate) trait LogTarget {
fn log_target(&self) -> &'static str;
}
mod from_constellation {
use super::LogTarget;
macro_rules! target {
($($name:literal)+) => {
concat!("compositor<constellation@", $($name),+)
};
}
impl LogTarget for compositing_traits::CompositorMsg {
fn log_target(&self) -> &'static str {
match self {
Self::ShutdownComplete => target!("ShutdownComplete"),
Self::ChangeRunningAnimationsState(..) => target!("ChangeRunningAnimationsState"),
Self::CreateOrUpdateWebView(..) => target!("CreateOrUpdateWebView"),
Self::RemoveWebView(..) => target!("RemoveWebView"),
Self::MoveResizeWebView(..) => target!("MoveResizeWebView"),
Self::ShowWebView(..) => target!("ShowWebView"),
Self::HideWebView(..) => target!("HideWebView"),
Self::RaiseWebViewToTop(..) => target!("RaiseWebViewToTop"),
Self::TouchEventProcessed(..) => target!("TouchEventProcessed"),
Self::CreatePng(..) => target!("CreatePng"),
Self::IsReadyToSaveImageReply(..) => target!("IsReadyToSaveImageReply"),
Self::SetThrottled(..) => target!("SetThrottled"),
Self::NewWebRenderFrameReady(..) => target!("NewWebRenderFrameReady"),
Self::PipelineExited(..) => target!("PipelineExited"),
Self::PendingPaintMetric(..) => target!("PendingPaintMetric"),
Self::LoadComplete(..) => target!("LoadComplete"),
Self::WebDriverMouseButtonEvent(..) => target!("WebDriverMouseButtonEvent"),
Self::WebDriverMouseMoveEvent(..) => target!("WebDriverMouseMoveEvent"),
Self::GetClientWindow(..) => target!("GetClientWindow"),
Self::GetScreenSize(..) => target!("GetScreenSize"),
Self::GetScreenAvailSize(..) => target!("GetScreenAvailSize"),
Self::Forwarded(..) => target!("Forwarded"),
}
}
}
}

View File

@@ -0,0 +1,245 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use std::collections::HashMap;
use base::id::{PipelineId, WebViewId};
use webrender_api::units::DeviceRect;
#[derive(Debug, Default)]
pub struct WebView {
pub pipeline_id: Option<PipelineId>,
pub rect: DeviceRect,
}
#[derive(Debug, Default)]
pub struct WebViewManager<WebView> {
/// Our top-level browsing contexts. In the WebRender scene, their pipelines are the children of
/// a single root pipeline that also applies any pinch zoom transformation.
webviews: HashMap<WebViewId, WebView>,
/// The order to paint them in, topmost last.
painting_order: Vec<WebViewId>,
}
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct WebViewAlreadyExists(pub WebViewId);
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct UnknownWebView(pub WebViewId);
impl<WebView> WebViewManager<WebView> {
pub fn add(
&mut self,
webview_id: WebViewId,
webview: WebView,
) -> Result<&mut WebView, WebViewAlreadyExists> {
if self.webviews.contains_key(&webview_id) {
return Err(WebViewAlreadyExists(webview_id));
}
Ok(self.webviews.entry(webview_id).or_insert(webview))
}
pub fn remove(&mut self, webview_id: WebViewId) -> Result<WebView, UnknownWebView> {
self.painting_order.retain(|b| *b != webview_id);
self.webviews
.remove(&webview_id)
.ok_or(UnknownWebView(webview_id))
}
pub fn get(&self, webview_id: WebViewId) -> Option<&WebView> {
self.webviews.get(&webview_id)
}
pub fn get_mut(&mut self, webview_id: WebViewId) -> Option<&mut WebView> {
self.webviews.get_mut(&webview_id)
}
/// Returns true iff the painting order actually changed.
pub fn show(&mut self, webview_id: WebViewId) -> Result<bool, UnknownWebView> {
if !self.webviews.contains_key(&webview_id) {
return Err(UnknownWebView(webview_id));
}
if !self.painting_order.contains(&webview_id) {
self.painting_order.push(webview_id);
return Ok(true);
}
Ok(false)
}
/// Returns true iff the painting order actually changed.
pub fn hide(&mut self, webview_id: WebViewId) -> Result<bool, UnknownWebView> {
if !self.webviews.contains_key(&webview_id) {
return Err(UnknownWebView(webview_id));
}
if self.painting_order.contains(&webview_id) {
self.painting_order.retain(|b| *b != webview_id);
return Ok(true);
}
Ok(false)
}
/// Returns true iff the painting order actually changed.
pub fn hide_all(&mut self) -> bool {
if !self.painting_order.is_empty() {
self.painting_order.clear();
return true;
}
false
}
/// Returns true iff the painting order actually changed.
pub fn raise_to_top(&mut self, webview_id: WebViewId) -> Result<bool, UnknownWebView> {
if !self.webviews.contains_key(&webview_id) {
return Err(UnknownWebView(webview_id));
}
if self.painting_order.last() != Some(&webview_id) {
self.hide(webview_id)?;
self.show(webview_id)?;
return Ok(true);
}
Ok(false)
}
pub fn painting_order(&self) -> impl Iterator<Item = (&WebViewId, &WebView)> {
self.painting_order
.iter()
.flat_map(move |webview_id| self.get(*webview_id).map(|b| (webview_id, b)))
}
}
#[cfg(test)]
mod test {
use std::num::NonZeroU32;
use base::id::{
BrowsingContextId, BrowsingContextIndex, PipelineNamespace, PipelineNamespaceId,
TopLevelBrowsingContextId,
};
use crate::webview::{UnknownWebView, WebViewAlreadyExists, WebViewManager};
fn top_level_id(namespace_id: u32, index: u32) -> TopLevelBrowsingContextId {
TopLevelBrowsingContextId(BrowsingContextId {
namespace_id: PipelineNamespaceId(namespace_id),
index: BrowsingContextIndex(NonZeroU32::new(index).unwrap()),
})
}
fn webviews_sorted<WebView: Clone>(
webviews: &WebViewManager<WebView>,
) -> Vec<(TopLevelBrowsingContextId, WebView)> {
let mut keys = webviews.webviews.keys().collect::<Vec<_>>();
keys.sort();
keys.iter()
.map(|&id| (*id, webviews.webviews.get(id).cloned().unwrap()))
.collect()
}
#[test]
fn test() {
PipelineNamespace::install(PipelineNamespaceId(0));
let mut webviews = WebViewManager::default();
// add() adds the webview to the map, but not the painting order.
assert!(webviews.add(TopLevelBrowsingContextId::new(), 'a').is_ok());
assert!(webviews.add(TopLevelBrowsingContextId::new(), 'b').is_ok());
assert!(webviews.add(TopLevelBrowsingContextId::new(), 'c').is_ok());
assert_eq!(
webviews_sorted(&webviews),
vec![
(top_level_id(0, 1), 'a'),
(top_level_id(0, 2), 'b'),
(top_level_id(0, 3), 'c'),
]
);
assert!(webviews.painting_order.is_empty());
// add() returns WebViewAlreadyExists if the webview id already exists.
assert_eq!(
webviews.add(top_level_id(0, 3), 'd'),
Err(WebViewAlreadyExists(top_level_id(0, 3)))
);
// Other methods return UnknownWebView or None if the webview id doesnt exist.
assert_eq!(
webviews.remove(top_level_id(1, 1)),
Err(UnknownWebView(top_level_id(1, 1)))
);
assert_eq!(webviews.get(top_level_id(1, 1)), None);
assert_eq!(webviews.get_mut(top_level_id(1, 1)), None);
assert_eq!(
webviews.show(top_level_id(1, 1)),
Err(UnknownWebView(top_level_id(1, 1)))
);
assert_eq!(
webviews.hide(top_level_id(1, 1)),
Err(UnknownWebView(top_level_id(1, 1)))
);
assert_eq!(
webviews.raise_to_top(top_level_id(1, 1)),
Err(UnknownWebView(top_level_id(1, 1)))
);
// For webviews not yet visible, both show() and raise_to_top() add the given webview on top.
assert_eq!(webviews.show(top_level_id(0, 2)), Ok(true));
assert_eq!(webviews.show(top_level_id(0, 2)), Ok(false));
assert_eq!(webviews.painting_order, vec![top_level_id(0, 2)]);
assert_eq!(webviews.raise_to_top(top_level_id(0, 1)), Ok(true));
assert_eq!(webviews.raise_to_top(top_level_id(0, 1)), Ok(false));
assert_eq!(
webviews.painting_order,
vec![top_level_id(0, 2), top_level_id(0, 1)]
);
assert_eq!(webviews.show(top_level_id(0, 3)), Ok(true));
assert_eq!(webviews.show(top_level_id(0, 3)), Ok(false));
assert_eq!(
webviews.painting_order,
vec![top_level_id(0, 2), top_level_id(0, 1), top_level_id(0, 3)]
);
// For webviews already visible, show() does nothing, while raise_to_top() makes it on top.
assert_eq!(webviews.show(top_level_id(0, 1)), Ok(false));
assert_eq!(
webviews.painting_order,
vec![top_level_id(0, 2), top_level_id(0, 1), top_level_id(0, 3)]
);
assert_eq!(webviews.raise_to_top(top_level_id(0, 1)), Ok(true));
assert_eq!(webviews.raise_to_top(top_level_id(0, 1)), Ok(false));
assert_eq!(
webviews.painting_order,
vec![top_level_id(0, 2), top_level_id(0, 3), top_level_id(0, 1)]
);
// hide() removes the webview from the painting order, but not the map.
assert_eq!(webviews.hide(top_level_id(0, 3)), Ok(true));
assert_eq!(webviews.hide(top_level_id(0, 3)), Ok(false));
assert_eq!(
webviews.painting_order,
vec![top_level_id(0, 2), top_level_id(0, 1)]
);
assert_eq!(
webviews_sorted(&webviews),
vec![
(top_level_id(0, 1), 'a'),
(top_level_id(0, 2), 'b'),
(top_level_id(0, 3), 'c'),
]
);
// painting_order() returns only the visible webviews, in painting order.
let mut painting_order = webviews.painting_order();
assert_eq!(painting_order.next(), Some((&top_level_id(0, 2), &'b')));
assert_eq!(painting_order.next(), Some((&top_level_id(0, 1), &'a')));
assert_eq!(painting_order.next(), None);
drop(painting_order);
// remove() removes the given webview from both the map and the painting order.
assert!(webviews.remove(top_level_id(0, 1)).is_ok());
assert!(webviews.remove(top_level_id(0, 2)).is_ok());
assert!(webviews.remove(top_level_id(0, 3)).is_ok());
assert!(webviews_sorted(&webviews).is_empty());
assert!(webviews.painting_order.is_empty());
}
}

View File

@@ -7,20 +7,22 @@
use std::fmt::{Debug, Error, Formatter};
use std::time::Duration;
use base::id::{PipelineId, TopLevelBrowsingContextId};
use embedder_traits::{EmbedderProxy, EventLoopWaker};
use euclid::Scale;
use gfx::rendering_context::RenderingContext;
use keyboard_types::KeyboardEvent;
use libc::c_void;
use msg::constellation_msg::{PipelineId, TopLevelBrowsingContextId, TraversalDirection};
use net::protocols::ProtocolRegistry;
use script_traits::{
GamepadEvent, MediaSessionActionType, MouseButton, TouchEventType, TouchId, WheelDelta,
GamepadEvent, MediaSessionActionType, MouseButton, TouchEventType, TouchId, TraversalDirection,
WheelDelta,
};
use servo_geometry::DeviceIndependentPixel;
use servo_url::ServoUrl;
use style_traits::DevicePixel;
use webrender_api::units::{DeviceIntPoint, DeviceIntRect, DeviceIntSize, DevicePoint};
use webrender_api::units::{DeviceIntPoint, DeviceIntRect, DeviceIntSize, DevicePoint, DeviceRect};
use webrender_api::ScrollLocation;
use webrender_traits::RenderingContext;
#[derive(Clone)]
pub enum MouseWindowEvent {
@@ -51,7 +53,7 @@ pub enum EmbedderEvent {
/// message, the window must make the same GL context as in `PrepareRenderingEvent` current.
Refresh,
/// Sent when the window is resized.
Resize,
WindowResize,
/// Sent when a navigation request from script is allowed/refused.
AllowNavigationResponse(PipelineId, bool),
/// Sent when a new URL is to be loaded.
@@ -83,15 +85,24 @@ pub enum EmbedderEvent {
Keyboard(KeyboardEvent),
/// Sent when Ctr+R/Apple+R is called to reload the current page.
Reload(TopLevelBrowsingContextId),
/// Create a new top level browsing context
/// Create a new top-level browsing context.
NewWebView(ServoUrl, TopLevelBrowsingContextId),
/// Close a top level browsing context
/// Close a top-level browsing context.
CloseWebView(TopLevelBrowsingContextId),
/// Panic a top level browsing context.
/// Panic a top-level browsing context.
SendError(Option<TopLevelBrowsingContextId>, String),
/// Make a top level browsing context visible, hiding the previous
/// visible one.
/// Move and/or resize a webview to the given rect.
MoveResizeWebView(TopLevelBrowsingContextId, DeviceRect),
/// Start painting a webview, and optionally stop painting all others.
ShowWebView(TopLevelBrowsingContextId, bool),
/// Stop painting a webview.
HideWebView(TopLevelBrowsingContextId),
/// Start painting a webview on top of all others, and optionally stop painting all others.
RaiseWebViewToTop(TopLevelBrowsingContextId, bool),
/// Make a webview focused.
FocusWebView(TopLevelBrowsingContextId),
/// Make none of the webviews focused.
BlurWebView,
/// Toggles a debug flag in WebRender
ToggleWebRenderDebug(WebRenderDebugOption),
/// Capture current WebRender
@@ -103,8 +114,8 @@ pub enum EmbedderEvent {
/// Sent when the user triggers a media action through the UA exposed media UI
/// (play, pause, seek, etc.).
MediaSessionAction(MediaSessionActionType),
/// The visibility of the webview has changed.
WebViewVisibilityChanged(TopLevelBrowsingContextId, bool),
/// Set whether to use less resources, by stopping animations and running timers at a heavily limited rate.
SetWebViewThrottled(TopLevelBrowsingContextId, bool),
/// Virtual keyboard was dismissed
IMEDismissed,
/// Sent on platforms like Android where the native widget surface can be
@@ -124,7 +135,7 @@ impl Debug for EmbedderEvent {
match *self {
EmbedderEvent::Idle => write!(f, "Idle"),
EmbedderEvent::Refresh => write!(f, "Refresh"),
EmbedderEvent::Resize => write!(f, "Resize"),
EmbedderEvent::WindowResize => write!(f, "Resize"),
EmbedderEvent::Keyboard(..) => write!(f, "Keyboard"),
EmbedderEvent::AllowNavigationResponse(..) => write!(f, "AllowNavigationResponse"),
EmbedderEvent::LoadUrl(..) => write!(f, "LoadUrl"),
@@ -139,16 +150,38 @@ impl Debug for EmbedderEvent {
EmbedderEvent::Navigation(..) => write!(f, "Navigation"),
EmbedderEvent::Quit => write!(f, "Quit"),
EmbedderEvent::Reload(..) => write!(f, "Reload"),
EmbedderEvent::NewWebView(..) => write!(f, "NewWebView"),
EmbedderEvent::NewWebView(_, TopLevelBrowsingContextId(webview_id)) => {
write!(f, "NewWebView({webview_id:?})")
},
EmbedderEvent::SendError(..) => write!(f, "SendError"),
EmbedderEvent::CloseWebView(..) => write!(f, "CloseWebView"),
EmbedderEvent::FocusWebView(..) => write!(f, "FocusWebView"),
EmbedderEvent::CloseWebView(TopLevelBrowsingContextId(webview_id)) => {
write!(f, "CloseWebView({webview_id:?})")
},
EmbedderEvent::MoveResizeWebView(webview_id, _) => {
write!(f, "MoveResizeWebView({webview_id:?})")
},
EmbedderEvent::ShowWebView(TopLevelBrowsingContextId(webview_id), hide_others) => {
write!(f, "ShowWebView({webview_id:?}, {hide_others})")
},
EmbedderEvent::HideWebView(TopLevelBrowsingContextId(webview_id)) => {
write!(f, "HideWebView({webview_id:?})")
},
EmbedderEvent::RaiseWebViewToTop(
TopLevelBrowsingContextId(webview_id),
hide_others,
) => {
write!(f, "RaiseWebViewToTop({webview_id:?}, {hide_others})")
},
EmbedderEvent::FocusWebView(TopLevelBrowsingContextId(webview_id)) => {
write!(f, "FocusWebView({webview_id:?})")
},
EmbedderEvent::BlurWebView => write!(f, "BlurWebView"),
EmbedderEvent::ToggleWebRenderDebug(..) => write!(f, "ToggleWebRenderDebug"),
EmbedderEvent::CaptureWebRender => write!(f, "CaptureWebRender"),
EmbedderEvent::ToggleSamplingProfiler(..) => write!(f, "ToggleSamplingProfiler"),
EmbedderEvent::ExitFullScreen(..) => write!(f, "ExitFullScreen"),
EmbedderEvent::MediaSessionAction(..) => write!(f, "MediaSessionAction"),
EmbedderEvent::WebViewVisibilityChanged(..) => write!(f, "WebViewVisibilityChanged"),
EmbedderEvent::SetWebViewThrottled(..) => write!(f, "SetWebViewThrottled"),
EmbedderEvent::IMEDismissed => write!(f, "IMEDismissed"),
EmbedderEvent::ClearCache => write!(f, "ClearCache"),
EmbedderEvent::InvalidateNativeSurface => write!(f, "InvalidateNativeSurface"),
@@ -190,6 +223,17 @@ pub trait EmbedderMethods {
fn get_user_agent_string(&self) -> Option<String> {
None
}
/// Returns the version string of this embedder.
fn get_version_string(&self) -> Option<String> {
None
}
/// Returns the protocol handlers implemented by that embedder.
/// They will be merged with the default internal ones.
fn get_protocol_handlers(&self) -> ProtocolRegistry {
ProtocolRegistry::default()
}
}
#[derive(Clone, Copy, Debug)]
@@ -211,15 +255,85 @@ pub struct EmbedderCoordinates {
impl EmbedderCoordinates {
/// Get the unflipped viewport rectangle for use with the WebRender API.
pub fn get_viewport(&self) -> DeviceIntRect {
DeviceIntRect::from_untyped(&self.viewport.to_untyped())
self.viewport
}
/// Get the flipped viewport rectangle. This should be used when drawing directly
/// to the framebuffer with OpenGL commands.
/// Flip the given rect.
/// This should be used when drawing directly to the framebuffer with OpenGL commands.
pub fn flip_rect(&self, rect: &DeviceIntRect) -> DeviceIntRect {
let mut result = *rect;
let min_y = self.framebuffer.height - result.max.y;
let max_y = self.framebuffer.height - result.min.y;
result.min.y = min_y;
result.max.y = max_y;
result
}
/// Get the flipped viewport rectangle.
/// This should be used when drawing directly to the framebuffer with OpenGL commands.
pub fn get_flipped_viewport(&self) -> DeviceIntRect {
let fb_height = self.framebuffer.height;
let mut view = self.viewport.clone();
view.origin.y = fb_height - view.origin.y - view.size.height;
DeviceIntRect::from_untyped(&view.to_untyped())
self.flip_rect(&self.get_viewport())
}
}
#[cfg(test)]
mod test {
use euclid::{Point2D, Scale, Size2D};
use webrender_api::units::DeviceIntRect;
use super::EmbedderCoordinates;
#[test]
fn test() {
let pos = Point2D::new(0, 0);
let viewport = Size2D::new(800, 600);
let screen = Size2D::new(1080, 720);
let coordinates = EmbedderCoordinates {
hidpi_factor: Scale::new(1.),
screen,
screen_avail: screen,
window: (viewport, pos),
framebuffer: viewport,
viewport: DeviceIntRect::from_origin_and_size(pos, viewport),
};
// Check if viewport conversion is correct.
let viewport = DeviceIntRect::new(Point2D::new(0, 0), Point2D::new(800, 600));
assert_eq!(coordinates.get_viewport(), viewport);
assert_eq!(coordinates.get_flipped_viewport(), viewport);
// Check rects with different y positions inside the viewport.
let rect1 = DeviceIntRect::new(Point2D::new(0, 0), Point2D::new(800, 400));
let rect2 = DeviceIntRect::new(Point2D::new(0, 100), Point2D::new(800, 600));
let rect3 = DeviceIntRect::new(Point2D::new(0, 200), Point2D::new(800, 500));
assert_eq!(
coordinates.flip_rect(&rect1),
DeviceIntRect::new(Point2D::new(0, 200), Point2D::new(800, 600))
);
assert_eq!(
coordinates.flip_rect(&rect2),
DeviceIntRect::new(Point2D::new(0, 0), Point2D::new(800, 500))
);
assert_eq!(
coordinates.flip_rect(&rect3),
DeviceIntRect::new(Point2D::new(0, 100), Point2D::new(800, 400))
);
// Check rects with different x positions.
let rect1 = DeviceIntRect::new(Point2D::new(0, 0), Point2D::new(700, 400));
let rect2 = DeviceIntRect::new(Point2D::new(100, 100), Point2D::new(800, 600));
let rect3 = DeviceIntRect::new(Point2D::new(300, 200), Point2D::new(600, 500));
assert_eq!(
coordinates.flip_rect(&rect1),
DeviceIntRect::new(Point2D::new(0, 200), Point2D::new(700, 600))
);
assert_eq!(
coordinates.flip_rect(&rect2),
DeviceIntRect::new(Point2D::new(100, 0), Point2D::new(800, 500))
);
assert_eq!(
coordinates.flip_rect(&rect3),
DeviceIntRect::new(Point2D::new(300, 100), Point2D::new(600, 400))
);
}
}

View File

@@ -1,10 +1,10 @@
[package]
name = "servo_config"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2018"
publish = false
version.workspace = true
authors.workspace = true
license.workspace = true
edition.workspace = true
publish.workspace = true
[lib]
name = "servo_config"
@@ -14,7 +14,6 @@ path = "lib.rs"
embedder_traits = { workspace = true }
euclid = { workspace = true }
getopts = { workspace = true }
lazy_static = { workspace = true }
log = { workspace = true }
num_cpus = { workspace = true }
serde = { workspace = true, features = ["derive"] }
@@ -22,7 +21,8 @@ serde_json = { workspace = true }
servo_config_plugins = { path = "../config_plugins" }
servo_geometry = { path = "../geometry" }
servo_url = { path = "../url" }
style_config = { workspace = true }
url = { workspace = true }
[target.'cfg(not(target_os = "android"))'.dependencies]
dirs-next = "2.0"
dirs = "5.0"

View File

@@ -15,7 +15,7 @@ use std::path::PathBuf;
not(target_os = "android")
))]
pub fn default_config_dir() -> Option<PathBuf> {
let mut config_dir = ::dirs_next::config_dir().unwrap();
let mut config_dir = ::dirs::config_dir().unwrap();
config_dir.push("servo");
config_dir.push("default");
Some(config_dir)
@@ -30,14 +30,14 @@ pub fn default_config_dir() -> Option<PathBuf> {
pub fn default_config_dir() -> Option<PathBuf> {
// FIXME: use `config_dir()` ($HOME/Library/Preferences)
// instead of `data_dir()` ($HOME/Library/Application Support) ?
let mut config_dir = ::dirs_next::data_dir().unwrap();
let mut config_dir = ::dirs::data_dir().unwrap();
config_dir.push("Servo");
Some(config_dir)
}
#[cfg(all(target_os = "windows"))]
#[cfg(target_os = "windows")]
pub fn default_config_dir() -> Option<PathBuf> {
let mut config_dir = ::dirs_next::config_dir().unwrap();
let mut config_dir = ::dirs::config_dir().unwrap();
config_dir.push("Servo");
Some(config_dir)
}

View File

@@ -7,15 +7,14 @@
use std::default::Default;
use std::fs::{self, File};
use std::io::{self, Read, Write};
use std::io::Read;
use std::path::{Path, PathBuf};
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::{RwLock, RwLockReadGuard};
use std::sync::{LazyLock, RwLock, RwLockReadGuard};
use std::{env, process};
use euclid::Size2D;
use getopts::{Matches, Options};
use lazy_static::lazy_static;
use log::error;
use serde::{Deserialize, Serialize};
use servo_geometry::DeviceIndependentPixel;
@@ -27,8 +26,6 @@ use crate::{pref, set_pref};
/// Global flags for Servo, currently set on the command line.
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct Opts {
pub is_running_problem_test: bool,
/// Whether or not the legacy layout system is enabled.
pub legacy_layout: bool,
@@ -385,7 +382,7 @@ pub enum OutputOptions {
}
fn args_fail(msg: &str) -> ! {
writeln!(io::stderr(), "{}", msg).unwrap();
eprintln!("{}", msg);
process::exit(1)
}
@@ -398,7 +395,6 @@ pub fn multiprocess() -> bool {
pub fn default_opts() -> Opts {
Opts {
is_running_problem_test: false,
legacy_layout: false,
tile_size: 512,
time_profiling: None,
@@ -598,18 +594,6 @@ pub fn from_cmdline_args(mut opts: Options, args: &[String]) -> ArgumentParsingR
DebugOptions::print_usage(app_name)
}
let cwd = env::current_dir().unwrap();
let url_opt = if !opt_match.free.is_empty() {
Some(&opt_match.free[0][..])
} else {
None
};
let is_running_problem_test = url_opt.as_ref().map_or(false, |url| {
url.starts_with("http://web-platform.test:8000/2dcontext/drawing-images-to-the-canvas/") ||
url.starts_with("http://web-platform.test:8000/_mozilla/mozilla/canvas/") ||
url.starts_with("http://web-platform.test:8000/_mozilla/css/canvas_over_area.html")
});
let tile_size: usize = match opt_match.opt_str("s") {
Some(tile_size_str) => tile_size_str
.parse()
@@ -733,6 +717,7 @@ pub fn from_cmdline_args(mut opts: Options, args: &[String]) -> ArgumentParsingR
.opt_strs("user-stylesheet")
.iter()
.map(|filename| {
let cwd = env::current_dir().unwrap();
let path = cwd.join(filename);
let url = ServoUrl::from_url(Url::from_file_path(&path).unwrap());
let mut contents = Vec::new();
@@ -749,12 +734,10 @@ pub fn from_cmdline_args(mut opts: Options, args: &[String]) -> ArgumentParsingR
let legacy_layout = opt_match.opt_present("legacy-layout");
if legacy_layout {
set_pref!(layout.legacy_layout, true);
set_pref!(layout.flexbox.enabled, true);
}
let opts = Opts {
debug: debug_options.clone(),
is_running_problem_test,
legacy_layout,
tile_size,
time_profiling,
@@ -793,7 +776,7 @@ pub fn from_cmdline_args(mut opts: Options, args: &[String]) -> ArgumentParsingR
set_pref!(layout.threads, layout_threads as i64);
}
return ArgumentParsingResult::ChromeProcess(opt_match);
ArgumentParsingResult::ChromeProcess(opt_match)
}
pub enum ArgumentParsingResult {
@@ -804,9 +787,7 @@ pub enum ArgumentParsingResult {
// Make Opts available globally. This saves having to clone and pass
// opts everywhere it is used, which gets particularly cumbersome
// when passing through the DOM structures.
lazy_static! {
static ref OPTIONS: RwLock<Opts> = RwLock::new(default_opts());
}
static OPTIONS: LazyLock<RwLock<Opts>> = LazyLock::new(|| RwLock::new(default_opts()));
pub fn set_options(opts: Opts) {
MULTIPROCESS.store(opts.multiprocess, Ordering::SeqCst);

View File

@@ -3,7 +3,6 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use std::collections::HashMap;
use std::convert::TryInto;
use std::fmt;
use std::str::FromStr;
use std::sync::RwLock;
@@ -55,10 +54,7 @@ impl PrefValue {
}
pub fn is_missing(&self) -> bool {
match self {
PrefValue::Missing => true,
_ => false,
}
matches!(self, PrefValue::Missing)
}
pub fn from_json_value(value: &Value) -> Option<Self> {
@@ -161,10 +157,9 @@ impl From<PrefValue> for [f64; 4] {
fn from(other: PrefValue) -> [f64; 4] {
match other {
PrefValue::Array(values) if values.len() == 4 => {
let mut f = values.into_iter().map(|v| v.try_into());
if f.all(|v| v.is_ok()) {
let f = f.flatten().collect::<Vec<f64>>();
return [f[0], f[1], f[2], f[3]];
let f = values.into_iter().map(Into::into).collect::<Vec<f64>>();
if f.len() == 4 {
[f[0], f[1], f[2], f[3]]
} else {
panic!(
"Cannot convert PrefValue to {:?}",
@@ -191,7 +186,7 @@ pub enum PrefError {
impl fmt::Display for PrefError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
PrefError::NoSuchPref(s) | PrefError::InvalidValue(s) => f.write_str(&s),
PrefError::NoSuchPref(s) | PrefError::InvalidValue(s) => f.write_str(s),
PrefError::JsonParseErr(e) => e.fmt(f),
}
}
@@ -200,15 +195,16 @@ impl fmt::Display for PrefError {
impl std::error::Error for PrefError {}
pub struct Accessor<P, V> {
pub getter: Box<dyn Fn(&P) -> V + Sync>,
pub setter: Box<dyn Fn(&mut P, V) + Sync>,
pub getter: Box<dyn Fn(&P) -> V + Sync + Send>,
#[allow(clippy::type_complexity)]
pub setter: Box<dyn Fn(&mut P, V) + Sync + Send>,
}
impl<P, V> Accessor<P, V> {
pub fn new<G, S>(getter: G, setter: S) -> Self
where
G: Fn(&P) -> V + Sync + 'static,
S: Fn(&mut P, V) + Sync + 'static,
G: Fn(&P) -> V + Sync + Send + 'static,
S: Fn(&mut P, V) + Sync + Send + 'static,
{
Accessor {
getter: Box::new(getter),
@@ -261,7 +257,7 @@ impl<'m, P: Clone> Preferences<'m, P> {
}
/// Creates an iterator over all keys and values
pub fn iter<'a>(&'a self) -> impl Iterator<Item = (String, PrefValue)> + 'a {
pub fn iter(&self) -> impl Iterator<Item = (String, PrefValue)> + '_ {
let prefs = self.user_prefs.read().unwrap();
self.accessors
.iter()
@@ -269,16 +265,17 @@ impl<'m, P: Clone> Preferences<'m, P> {
}
/// Creates an iterator over all keys
pub fn keys<'a>(&'a self) -> impl Iterator<Item = &'a str> + 'a {
pub fn keys(&self) -> impl Iterator<Item = &'_ str> {
self.accessors.keys().map(String::as_str)
}
fn set_inner<V>(&self, key: &str, mut prefs: &mut P, val: V) -> Result<(), PrefError>
fn set_inner<V>(&self, key: &str, prefs: &mut P, val: V) -> Result<(), PrefError>
where
V: Into<PrefValue>,
{
if let Some(accessor) = self.accessors.get(key) {
Ok((accessor.setter)(&mut prefs, val.into()))
(accessor.setter)(prefs, val.into());
Ok(())
} else {
Err(PrefError::NoSuchPref(String::from(key)))
}

View File

@@ -4,22 +4,26 @@
use std::borrow::ToOwned;
use std::collections::HashMap;
use std::convert::{TryFrom, TryInto};
use std::sync::LazyLock;
use embedder_traits::resources::{self, Resource};
use gen::Prefs;
use lazy_static::lazy_static;
use log::warn;
use serde_json::{self, Value};
use crate::pref_util::Preferences;
pub use crate::pref_util::{PrefError, PrefValue};
lazy_static! {
static ref PREFS: Preferences<'static, Prefs> = {
let def_prefs: Prefs = serde_json::from_str(&resources::read_string(Resource::Preferences))
.expect("Failed to initialize config preferences.");
Preferences::new(def_prefs, &gen::PREF_ACCESSORS)
};
}
static PREFS: LazyLock<Preferences<'static, Prefs>> = LazyLock::new(|| {
let def_prefs: Prefs = serde_json::from_str(&resources::read_string(Resource::Preferences))
.expect("Failed to initialize config preferences.");
let result = Preferences::new(def_prefs, &gen::PREF_ACCESSORS);
for (key, value) in result.iter() {
set_stylo_pref_ref(&key, &value);
}
result
});
/// A convenience macro for accessing a preference value using its static path.
/// Passing an invalid path is a compile-time error.
@@ -38,9 +42,11 @@ macro_rules! pref {
#[macro_export]
macro_rules! set_pref {
($($segment: ident).+, $value: expr) => {{
let value = $value;
$crate::prefs::set_stylo_pref(stringify!($($segment).+), value);
let values = $crate::prefs::pref_map().values();
let mut lock = values.write().unwrap();
lock$ (.$segment)+ = $value;
lock$ (.$segment)+ = value;
}};
}
@@ -56,14 +62,65 @@ pub fn pref_map() -> &'static Preferences<'static, Prefs> {
}
pub fn add_user_prefs(prefs: HashMap<String, PrefValue>) {
if let Err(error) = PREFS.set_all(prefs.into_iter()) {
for (key, value) in prefs.iter() {
set_stylo_pref_ref(key, value);
}
if let Err(error) = PREFS.set_all(prefs) {
panic!("Error setting preference: {:?}", error);
}
}
pub fn set_stylo_pref(key: &str, value: impl Into<PrefValue>) {
set_stylo_pref_ref(key, &value.into());
}
fn set_stylo_pref_ref(key: &str, value: &PrefValue) {
match value.try_into() {
Ok(StyloPrefValue::Bool(value)) => style_config::set_bool(key, value),
Ok(StyloPrefValue::Int(value)) => style_config::set_i32(key, value),
Err(TryFromPrefValueError::IntegerOverflow(value)) => {
// TODO: logging doesnt actually work this early, so we should
// split PrefValue into i32 and i64 variants.
warn!("Pref value too big for Stylo: {} ({})", key, value);
},
Err(TryFromPrefValueError::UnmappedType) => {
// Most of Servos prefs will hit this. When adding a new pref type
// in Stylo, update TryFrom<&PrefValue> for StyloPrefValue as well.
},
}
}
enum StyloPrefValue {
Bool(bool),
Int(i32),
}
enum TryFromPrefValueError {
IntegerOverflow(i64),
UnmappedType,
}
impl TryFrom<&PrefValue> for StyloPrefValue {
type Error = TryFromPrefValueError;
fn try_from(value: &PrefValue) -> Result<Self, Self::Error> {
match *value {
PrefValue::Int(value) => {
if let Ok(value) = value.try_into() {
Ok(Self::Int(value))
} else {
Err(TryFromPrefValueError::IntegerOverflow(value))
}
},
PrefValue::Bool(value) => Ok(Self::Bool(value)),
_ => Err(TryFromPrefValueError::UnmappedType),
}
}
}
pub fn read_prefs_map(txt: &str) -> Result<HashMap<String, PrefValue>, PrefError> {
let prefs: HashMap<String, Value> =
serde_json::from_str(txt).map_err(|e| PrefError::JsonParseErr(e))?;
serde_json::from_str(txt).map_err(PrefError::JsonParseErr)?;
prefs
.into_iter()
.map(|(k, pref_value)| {
@@ -74,7 +131,7 @@ pub fn read_prefs_map(txt: &str) -> Result<HashMap<String, PrefValue>, PrefError
Value::Number(n) if n.is_f64() => PrefValue::Float(n.as_f64().unwrap()),
Value::String(s) => PrefValue::Str(s.to_owned()),
Value::Array(v) => {
let mut array = v.iter().map(|v| PrefValue::from_json_value(v));
let mut array = v.iter().map(PrefValue::from_json_value);
if array.all(|v| v.is_some()) {
PrefValue::Array(array.flatten().collect())
} else {
@@ -106,6 +163,14 @@ mod gen {
std::cmp::max(num_cpus::get() * 3 / 4, 1) as i64
}
fn default_font_size() -> i64 {
16
}
fn default_monospace_font_size() -> i64 {
13
}
fn black() -> i64 {
0x000000
}
@@ -129,6 +194,23 @@ mod gen {
foreground_color: i64,
}
},
fonts: {
#[serde(default)]
default: String,
#[serde(default)]
serif: String,
#[serde(default)]
#[serde(rename = "fonts.sans-serif")]
sans_serif: String,
#[serde(default)]
monospace: String,
#[serde(default = "default_font_size")]
#[serde(rename = "fonts.default-size")]
default_size: i64,
#[serde(default = "default_monospace_font_size")]
#[serde(rename = "fonts.default-monospace-size")]
default_monospace_size: i64,
},
css: {
animations: {
testing: {
@@ -147,6 +229,8 @@ mod gen {
webgpu: {
/// Enable WebGPU APIs.
enabled: bool,
/// List of comma-separated backends to be used by wgpu
wgpu_backend: String,
},
bluetooth: {
enabled: bool,
@@ -154,6 +238,7 @@ mod gen {
enabled: bool,
}
},
allow_scripts_to_close_windows: bool,
canvas_capture: {
enabled: bool,
},
@@ -207,6 +292,9 @@ mod gen {
allowed_in_nonsecure_contexts: bool,
}
},
resize_observer: {
enabled: bool,
},
script: {
asynch: bool,
},
@@ -311,6 +399,9 @@ mod gen {
layers: {
enabled: bool,
},
openxr: {
enabled: bool,
},
sessionavailable: bool,
#[serde(rename = "dom.webxr.unsafe-assume-user-intent")]
unsafe_assume_user_intent: bool,
@@ -419,12 +510,6 @@ mod gen {
shared_memory: {
enabled: bool,
},
strict: {
debug: {
enabled: bool,
},
enabled: bool,
},
throw_on_asmjs_validation_failure: {
enabled: bool,
},
@@ -460,9 +545,6 @@ mod gen {
enabled: bool,
},
legacy_layout: bool,
tables: {
enabled: bool,
},
#[serde(default = "default_layout_threads")]
threads: i64,
writing_mode: {
@@ -490,6 +572,9 @@ mod gen {
#[serde(rename = "network.http-cache.disabled")]
disabled: bool,
},
local_directory_listing: {
enabled: bool,
},
mime: {
sniff: bool,
}

View File

@@ -1,10 +1,10 @@
[package]
name = "servo_config_plugins"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2018"
publish = false
version.workspace = true
authors.workspace = true
license.workspace = true
edition.workspace = true
publish.workspace = true
[lib]
name = "servo_config_plugins"

View File

@@ -108,13 +108,12 @@ impl Build {
let num_prefs = self.path_map.len();
self.output.extend(quote! {
lazy_static::lazy_static! {
pub static ref #gen_accessors: std::collections::HashMap<String, #accessor_type> = {
pub static #gen_accessors: std::sync::LazyLock<std::collections::HashMap<String, #accessor_type>> =
std::sync::LazyLock::new(|| {
let mut map = std::collections::HashMap::with_capacity(#num_prefs);
#(#values)*
map
};
}
});
});
}

View File

@@ -132,7 +132,7 @@ impl Parse for RootTypeDef {
impl Parse for NewTypeDef {
fn parse(input: ParseStream<'_>) -> Result<Self> {
let content;
#[allow(clippy::eval_order_dependence)]
#[allow(clippy::mixed_read_write_in_expression)]
Ok(NewTypeDef {
_braces: braced!(content in input),
fields: Punctuated::parse_terminated_with(&content, Field::parse)?,

View File

@@ -1,10 +1,10 @@
[package]
name = "constellation"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2018"
publish = false
version.workspace = true
authors.workspace = true
license.workspace = true
edition.workspace = true
publish.workspace = true
[lib]
name = "constellation"
@@ -15,8 +15,10 @@ default = []
multiview = []
[dependencies]
background_hang_monitor_api = { workspace = true }
background_hang_monitor = { path = "../background_hang_monitor" }
backtrace = { workspace = true }
base = { workspace = true }
bluetooth_traits = { workspace = true }
canvas_traits = { workspace = true }
compositing_traits = { workspace = true }
@@ -24,30 +26,29 @@ crossbeam-channel = { workspace = true }
devtools_traits = { workspace = true }
embedder_traits = { workspace = true }
euclid = { workspace = true }
gfx = { path = "../gfx" }
gfx_traits = { workspace = true }
fonts = { path = "../fonts" }
fonts_traits = { workspace = true }
http = { workspace = true }
ipc-channel = { workspace = true }
keyboard-types = { workspace = true }
layout_traits = { workspace = true }
log = { workspace = true }
media = { path = "../media" }
metrics = { path = "../metrics" }
msg = { workspace = true }
net = { path = "../net" }
net_traits = { workspace = true }
parking_lot = { workspace = true }
profile_traits = { workspace = true }
script_layout_interface = { workspace = true }
script_traits = { workspace = true }
serde = { workspace = true }
servo_config = { path = "../config" }
servo_rand = { path = "../rand" }
servo_remutex = { path = "../remutex" }
servo_url = { path = "../url" }
style_traits = { workspace = true }
webgpu = { path = "../webgpu" }
webrender = { workspace = true }
webrender_api = { workspace = true }
webrender_traits = { workspace = true }
tracing = { workspace = true }
webxr-api = { git = "https://github.com/servo/webxr", features = ["ipc"] }
[target.'cfg(any(target_os="macos", all(not(target_os = "windows"), not(target_os = "ios"), not(target_os="android"), not(target_arch="arm"), not(target_arch="aarch64"))))'.dependencies]

View File

@@ -4,11 +4,9 @@
use std::collections::{HashMap, HashSet};
use base::id::{BrowsingContextGroupId, BrowsingContextId, PipelineId, TopLevelBrowsingContextId};
use euclid::Size2D;
use log::warn;
use msg::constellation_msg::{
BrowsingContextGroupId, BrowsingContextId, PipelineId, TopLevelBrowsingContextId,
};
use style_traits::CSSPixel;
use crate::pipeline::Pipeline;
@@ -30,9 +28,9 @@ pub struct NewBrowsingContextInfo {
/// Whether this browsing context inherits a secure context.
pub inherited_secure_context: Option<bool>,
/// Whether this browsing context should be treated as visible for the
/// purposes of scheduling and resource management.
pub is_visible: bool,
/// Whether this browsing context should be throttled, using less resources
/// by stopping animations and running timers at a heavily limited rate.
pub throttled: bool,
}
/// The constellation's view of a browsing context.
@@ -60,9 +58,9 @@ pub struct BrowsingContext {
/// Whether this browsing context inherits a secure context.
pub inherited_secure_context: Option<bool>,
/// Whether this browsing context should be treated as visible for the
/// purposes of scheduling and resource management.
pub is_visible: bool,
/// Whether this browsing context should be throttled, using less resources
/// by stopping animations and running timers at a heavily limited rate.
pub throttled: bool,
/// The pipeline for the current session history entry.
pub pipeline_id: PipelineId,
@@ -79,6 +77,7 @@ pub struct BrowsingContext {
impl BrowsingContext {
/// Create a new browsing context.
/// Note this just creates the browsing context, it doesn't add it to the constellation's set of browsing contexts.
#[allow(clippy::too_many_arguments)]
pub fn new(
bc_group_id: BrowsingContextGroupId,
id: BrowsingContextId,
@@ -88,7 +87,7 @@ impl BrowsingContext {
size: Size2D<f32, CSSPixel>,
is_private: bool,
inherited_secure_context: Option<bool>,
is_visible: bool,
throttled: bool,
) -> BrowsingContext {
let mut pipelines = HashSet::new();
pipelines.insert(pipeline_id);
@@ -99,7 +98,7 @@ impl BrowsingContext {
size,
is_private,
inherited_secure_context,
is_visible,
throttled,
pipeline_id,
parent_pipeline_id,
pipelines,
@@ -198,7 +197,7 @@ impl<'a> Iterator for AllBrowsingContextsIterator<'a> {
let child_browsing_context_ids = browsing_context
.pipelines
.iter()
.filter_map(|pipeline_id| pipelines.get(&pipeline_id))
.filter_map(|pipeline_id| pipelines.get(pipeline_id))
.flat_map(|pipeline| pipeline.children.iter());
self.stack.extend(child_browsing_context_ids);
return Some(browsing_context);

File diff suppressed because it is too large Load Diff

View File

@@ -31,7 +31,7 @@ impl EventLoop {
/// Create a new event loop from the channel to its script thread.
pub fn new(script_chan: IpcSender<ConstellationControlMsg>) -> Rc<EventLoop> {
Rc::new(EventLoop {
script_chan: script_chan,
script_chan,
dont_send_or_sync: PhantomData,
})
}

View File

@@ -4,6 +4,9 @@
#![deny(unsafe_code)]
#[macro_use]
mod tracing;
mod browsingcontext;
mod constellation;
mod event_loop;

View File

@@ -7,12 +7,12 @@ use std::sync::Arc;
use std::thread;
use backtrace::Backtrace;
use base::id::TopLevelBrowsingContextId;
use compositing_traits::ConstellationMsg as FromCompositorMsg;
use crossbeam_channel::Sender;
use log::{Level, LevelFilter, Log, Metadata, Record};
use msg::constellation_msg::TopLevelBrowsingContextId;
use parking_lot::ReentrantMutex;
use script_traits::{LogEntry, ScriptMsg as FromScriptMsg, ScriptToConstellationChan};
use servo_remutex::ReentrantMutex;
/// The constellation uses logging to perform crash reporting.
/// The constellation receives all `warn!`, `error!` and `panic!` messages,
@@ -55,10 +55,7 @@ impl Log for FromScriptLogger {
if let Some(entry) = log_entry(record) {
let thread_name = thread::current().name().map(ToOwned::to_owned);
let msg = FromScriptMsg::LogEntry(thread_name, entry);
let chan = self
.script_to_constellation_chan
.lock()
.unwrap_or_else(|err| err.into_inner());
let chan = self.script_to_constellation_chan.lock();
let _ = chan.send(msg);
}
}
@@ -97,10 +94,7 @@ impl Log for FromCompositorLogger {
let top_level_id = TopLevelBrowsingContextId::installed();
let thread_name = thread::current().name().map(ToOwned::to_owned);
let msg = FromCompositorMsg::LogEntry(top_level_id, thread_name, entry);
let chan = self
.constellation_chan
.lock()
.unwrap_or_else(|err| err.into_inner());
let chan = self.constellation_chan.lock();
let _ = chan.send(msg);
}
}

View File

@@ -6,14 +6,14 @@
//! Any redirects that are encountered are followed. Whenever a non-redirect
//! response is received, it is forwarded to the appropriate script thread.
use base::id::PipelineId;
use crossbeam_channel::Sender;
use http::HeaderMap;
use http::{header, HeaderMap};
use ipc_channel::ipc;
use ipc_channel::router::ROUTER;
use log::warn;
use msg::constellation_msg::PipelineId;
use net::http_loader::{set_default_accept, set_default_accept_language};
use net_traits::request::{Destination, Referrer, RequestBuilder};
use net::http_loader::{set_default_accept_language, DOCUMENT_ACCEPT_HEADER_VALUE};
use net_traits::request::{Referrer, RequestBuilder};
use net_traits::response::ResponseInit;
use net_traits::{
CoreResourceMsg, FetchChannels, FetchMetadata, FetchResponseMsg, IpcSend, NetworkError,
@@ -54,7 +54,7 @@ impl NetworkListener {
request_builder: self.request_builder.clone(),
resource_threads: self.resource_threads.clone(),
sender: self.sender.clone(),
pipeline_id: self.pipeline_id.clone(),
pipeline_id: self.pipeline_id,
should_send: false,
};
@@ -66,7 +66,17 @@ impl NetworkListener {
None,
),
None => {
set_default_accept(Destination::Document, &mut listener.request_builder.headers);
if !listener
.request_builder
.headers
.contains_key(header::ACCEPT)
{
listener
.request_builder
.headers
.insert(header::ACCEPT, DOCUMENT_ACCEPT_HEADER_VALUE);
}
set_default_accept_language(&mut listener.request_builder.headers);
CoreResourceMsg::Fetch(
@@ -119,7 +129,7 @@ impl NetworkListener {
self.request_builder.referrer = metadata
.referrer
.clone()
.map(|referrer_url| Referrer::ReferrerUrl(referrer_url))
.map(Referrer::ReferrerUrl)
.unwrap_or(Referrer::NoReferrer);
self.request_builder.referrer_policy = metadata.referrer_policy;

View File

@@ -5,37 +5,37 @@
use std::borrow::Cow;
use std::collections::{HashMap, HashSet};
use std::rc::Rc;
use std::sync::atomic::AtomicBool;
use std::sync::Arc;
use background_hang_monitor::HangMonitorRegister;
use background_hang_monitor_api::{
BackgroundHangMonitorControlMsg, BackgroundHangMonitorRegister, HangMonitorAlert,
};
use base::id::{
BrowsingContextId, HistoryStateId, PipelineId, PipelineNamespace, PipelineNamespaceId,
PipelineNamespaceRequest, TopLevelBrowsingContextId,
};
use base::Epoch;
use bluetooth_traits::BluetoothRequest;
use canvas_traits::webgl::WebGLPipeline;
use compositing_traits::{CompositionPipeline, CompositorMsg, CompositorProxy};
use crossbeam_channel::{unbounded, Sender};
use devtools_traits::{DevtoolsControlMsg, ScriptToDevtoolsControlMsg};
use embedder_traits::EventLoopWaker;
use gfx::font_cache_thread::FontCacheThread;
use fonts::FontCacheThread;
use ipc_channel::ipc::{self, IpcReceiver, IpcSender};
use ipc_channel::router::ROUTER;
use ipc_channel::Error;
use layout_traits::LayoutThreadFactory;
use log::{debug, error, warn};
use media::WindowGLContext;
use metrics::PaintTimeMetrics;
use msg::constellation_msg::{
BackgroundHangMonitorControlMsg, BackgroundHangMonitorRegister, BrowsingContextId,
HangMonitorAlert, HistoryStateId, PipelineId, PipelineNamespace, PipelineNamespaceId,
PipelineNamespaceRequest, TopLevelBrowsingContextId,
};
use net::image_cache::ImageCacheImpl;
use net_traits::image_cache::ImageCache;
use net_traits::ResourceThreads;
use profile_traits::{mem as profile_mem, time};
use script_layout_interface::{LayoutFactory, ScriptThreadFactory};
use script_traits::{
AnimationState, ConstellationControlMsg, DiscardBrowsingContext, DocumentActivity,
InitialScriptState, LayoutControlMsg, LayoutMsg, LoadData, NewLayoutInfo, SWManagerMsg,
ScriptThreadFactory, ScriptToConstellationChan, TimerSchedulerMsg, WindowSizeData,
InitialScriptState, LayoutMsg, LoadData, NewLayoutInfo, SWManagerMsg,
ScriptToConstellationChan, TimerSchedulerMsg, WindowSizeData,
};
use serde::{Deserialize, Serialize};
use servo_config::opts::{self, Opts};
@@ -47,10 +47,8 @@ use webrender_api::DocumentId;
use crate::event_loop::EventLoop;
use crate::sandboxing::{spawn_multiprocess, UnprivilegedContent};
/// A `Pipeline` is the constellation's view of a `Document`. Each pipeline has an
/// event loop (executed by a script thread) and a layout thread. A script thread
/// may be responsible for many pipelines, but a layout thread is only responsible
/// for one.
/// A `Pipeline` is the constellation's view of a `Window`. Each pipeline has an event loop
/// (executed by a script thread). A script thread may be responsible for many pipelines.
pub struct Pipeline {
/// The ID of the pipeline.
pub id: PipelineId,
@@ -66,9 +64,6 @@ pub struct Pipeline {
/// The event loop handling this pipeline.
pub event_loop: Rc<EventLoop>,
/// A channel to layout, for performing reflows and shutdown.
pub layout_chan: IpcSender<LayoutControlMsg>,
/// A channel to the compositor.
pub compositor_proxy: CompositorProxy,
@@ -98,6 +93,10 @@ pub struct Pipeline {
/// The title of this pipeline's document.
pub title: String,
/// The last compositor [`Epoch`] that was laid out in this pipeline if "exit after load" is
/// enabled.
pub layout_epoch: Epoch,
}
/// Initial setup data needed to construct a pipeline.
@@ -133,9 +132,12 @@ pub struct InitialPipelineState {
/// A channel for the background hang monitor to send messages to the constellation.
pub background_hang_monitor_to_constellation_chan: IpcSender<HangMonitorAlert>,
/// A channel for the layout thread to send messages to the constellation.
/// A channel for the layout to send messages to the constellation.
pub layout_to_constellation_chan: IpcSender<LayoutMsg>,
/// A fatory for creating layouts to be used by the ScriptThread.
pub layout_factory: Arc<dyn LayoutFactory>,
/// A channel to schedule timer events.
pub scheduler_chan: IpcSender<TimerSchedulerMsg>,
@@ -175,17 +177,17 @@ pub struct InitialPipelineState {
/// Information about the page to load.
pub load_data: LoadData,
/// Whether the browsing context in which pipeline is embedded is visible
/// for the purposes of scheduling and resource management. This field is
/// only used to notify script and compositor threads after spawning
/// a pipeline.
pub prev_visibility: bool,
/// Whether the browsing context in which pipeline is embedded is throttled,
/// using less resources by stopping animations and running timers at a
/// heavily limited rate. This field is only used to notify script and
/// compositor threads after spawning a pipeline.
pub prev_throttled: bool,
/// Webrender api.
pub webrender_image_api_sender: net_traits::WebrenderIpcSender,
pub webrender_image_api_sender: webrender_traits::WebRenderNetApi,
/// Webrender api.
pub webrender_api_sender: script_traits::WebrenderIpcSender,
pub webrender_api_sender: webrender_traits::WebRenderScriptApi,
/// The ID of the document processed by this script thread.
pub webrender_document: DocumentId,
@@ -199,9 +201,6 @@ pub struct InitialPipelineState {
/// Application window's GL Context for Media player
pub player_context: WindowGLContext,
/// Mechanism to force the compositor to process events.
pub event_loop_waker: Option<Box<dyn EventLoopWaker>>,
/// User agent string to report in network requests.
pub user_agent: Cow<'static, str>,
}
@@ -212,17 +211,12 @@ pub struct NewPipeline {
}
impl Pipeline {
/// Starts a layout thread, and possibly a script thread, in
/// a new process if requested.
pub fn spawn<Message, LTF, STF>(state: InitialPipelineState) -> Result<NewPipeline, Error>
where
LTF: LayoutThreadFactory<Message = Message>,
STF: ScriptThreadFactory<Message = Message>,
{
/// Possibly starts a script thread, in a new process if requested.
pub fn spawn<STF: ScriptThreadFactory>(
state: InitialPipelineState,
) -> Result<NewPipeline, Error> {
// Note: we allow channel creation to panic, since recovering from this
// probably requires a general low-memory strategy.
let (pipeline_chan, pipeline_port) = ipc::channel().expect("Pipeline main chan");
let (script_chan, bhm_control_chan) = match state.event_loop {
Some(script_chan) => {
let new_layout_info = NewLayoutInfo {
@@ -233,7 +227,6 @@ impl Pipeline {
opener: state.opener,
load_data: state.load_data.clone(),
window_size: state.window_size,
pipeline_port: pipeline_port,
};
if let Err(e) =
@@ -296,10 +289,9 @@ impl Pipeline {
layout_to_constellation_chan: state.layout_to_constellation_chan,
script_chan: script_chan.clone(),
load_data: state.load_data.clone(),
script_port: script_port,
script_port,
opts: (*opts::get()).clone(),
prefs: prefs::pref_map().iter().collect(),
pipeline_port: pipeline_port,
pipeline_namespace_id: state.pipeline_namespace_id,
webrender_api_sender: state.webrender_api_sender,
webrender_image_api_sender: state.webrender_image_api_sender,
@@ -317,14 +309,18 @@ impl Pipeline {
let (bhm_control_chan, bhm_control_port) =
ipc::channel().expect("Sampler chan");
unprivileged_pipeline_content.bhm_control_port = Some(bhm_control_port);
let _ = unprivileged_pipeline_content.spawn_multiprocess()?;
unprivileged_pipeline_content.spawn_multiprocess()?;
Some(bhm_control_chan)
} else {
// Should not be None in single-process mode.
let register = state
.background_monitor_register
.expect("Couldn't start content, no background monitor has been initiated");
unprivileged_pipeline_content.start_all::<Message, LTF, STF>(false, register);
unprivileged_pipeline_content.start_all::<STF>(
false,
state.layout_factory,
register,
);
None
};
@@ -338,9 +334,8 @@ impl Pipeline {
state.top_level_browsing_context_id,
state.opener,
script_chan,
pipeline_chan,
state.compositor_proxy,
state.prev_visibility,
state.prev_throttled,
state.load_data,
);
Ok(NewPipeline {
@@ -349,38 +344,37 @@ impl Pipeline {
})
}
/// Creates a new `Pipeline`, after the script and layout threads have been
/// spawned.
/// Creates a new `Pipeline`, after the script has been spawned.
#[allow(clippy::too_many_arguments)]
pub fn new(
id: PipelineId,
browsing_context_id: BrowsingContextId,
top_level_browsing_context_id: TopLevelBrowsingContextId,
opener: Option<BrowsingContextId>,
event_loop: Rc<EventLoop>,
layout_chan: IpcSender<LayoutControlMsg>,
compositor_proxy: CompositorProxy,
is_visible: bool,
throttled: bool,
load_data: LoadData,
) -> Pipeline {
let pipeline = Pipeline {
id: id,
browsing_context_id: browsing_context_id,
top_level_browsing_context_id: top_level_browsing_context_id,
opener: opener,
event_loop: event_loop,
layout_chan: layout_chan,
compositor_proxy: compositor_proxy,
id,
browsing_context_id,
top_level_browsing_context_id,
opener,
event_loop,
compositor_proxy,
url: load_data.url.clone(),
children: vec![],
animation_state: AnimationState::NoAnimationsPresent,
load_data: load_data,
load_data,
history_state_id: None,
history_states: HashSet::new(),
completely_loaded: false,
title: String::new(),
layout_epoch: Epoch(0),
};
pipeline.notify_visibility(is_visible);
pipeline.set_throttled(throttled);
pipeline
}
@@ -418,9 +412,6 @@ impl Pipeline {
if let Err(e) = self.event_loop.send(msg) {
warn!("Sending script exit message failed ({}).", e);
}
if let Err(e) = self.layout_chan.send(LayoutControlMsg::ExitNow) {
warn!("Sending layout exit message failed ({}).", e);
}
}
/// Notify this pipeline of its activity.
@@ -434,10 +425,9 @@ impl Pipeline {
/// The compositor's view of a pipeline.
pub fn to_sendable(&self) -> CompositionPipeline {
CompositionPipeline {
id: self.id.clone(),
top_level_browsing_context_id: self.top_level_browsing_context_id.clone(),
id: self.id,
top_level_browsing_context_id: self.top_level_browsing_context_id,
script_chan: self.event_loop.sender(),
layout_chan: self.layout_chan.clone(),
}
}
@@ -454,22 +444,25 @@ impl Pipeline {
.position(|id| *id == browsing_context_id)
{
None => {
return warn!(
warn!(
"Pipeline remove child already removed ({:?}).",
browsing_context_id
);
)
},
Some(index) => self.children.remove(index),
};
Some(index) => {
self.children.remove(index);
},
}
}
/// Notify the script thread that this pipeline is visible.
pub fn notify_visibility(&self, is_visible: bool) {
let script_msg = ConstellationControlMsg::ChangeFrameVisibilityStatus(self.id, is_visible);
let compositor_msg = CompositorMsg::PipelineVisibilityChanged(self.id, is_visible);
/// Set whether to make pipeline use less resources, by stopping animations and
/// running timers at a heavily limited rate.
pub fn set_throttled(&self, throttled: bool) {
let script_msg = ConstellationControlMsg::SetThrottled(self.id, throttled);
let compositor_msg = CompositorMsg::SetThrottled(self.id, throttled);
let err = self.event_loop.send(script_msg);
if let Err(e) = err {
warn!("Sending visibility change failed ({}).", e);
warn!("Sending SetThrottled to script failed ({}).", e);
}
self.compositor_proxy.send(compositor_msg);
}
@@ -504,10 +497,9 @@ pub struct UnprivilegedPipelineContent {
script_port: IpcReceiver<ConstellationControlMsg>,
opts: Opts,
prefs: HashMap<String, PrefValue>,
pipeline_port: IpcReceiver<LayoutControlMsg>,
pipeline_namespace_id: PipelineNamespaceId,
webrender_api_sender: script_traits::WebrenderIpcSender,
webrender_image_api_sender: net_traits::WebrenderIpcSender,
webrender_api_sender: webrender_traits::WebRenderScriptApi,
webrender_image_api_sender: webrender_traits::WebRenderNetApi,
webrender_document: DocumentId,
webgl_chan: Option<WebGLPipeline>,
webxr_registry: webxr_api::Registry,
@@ -516,29 +508,19 @@ pub struct UnprivilegedPipelineContent {
}
impl UnprivilegedPipelineContent {
pub fn start_all<Message, LTF, STF>(
pub fn start_all<STF: ScriptThreadFactory>(
self,
wait_for_completion: bool,
layout_factory: Arc<dyn LayoutFactory>,
background_hang_monitor_register: Box<dyn BackgroundHangMonitorRegister>,
) where
LTF: LayoutThreadFactory<Message = Message>,
STF: ScriptThreadFactory<Message = Message>,
{
) {
// Setup pipeline-namespace-installing for all threads in this process.
// Idempotent in single-process mode.
PipelineNamespace::set_installer_sender(self.namespace_request_sender);
let image_cache = Arc::new(ImageCacheImpl::new(self.webrender_image_api_sender.clone()));
let paint_time_metrics = PaintTimeMetrics::new(
self.id,
self.time_profiler_chan.clone(),
self.layout_to_constellation_chan.clone(),
self.script_chan.clone(),
self.load_data.url.clone(),
);
let (content_process_shutdown_chan, content_process_shutdown_port) = unbounded();
let layout_thread_busy_flag = Arc::new(AtomicBool::new(false));
let layout_pair = STF::create(
STF::create(
InitialScriptState {
id: self.id,
browsing_context_id: self.browsing_context_id,
@@ -559,39 +541,20 @@ impl UnprivilegedPipelineContent {
devtools_chan: self.devtools_ipc_sender,
window_size: self.window_size,
pipeline_namespace_id: self.pipeline_namespace_id,
content_process_shutdown_chan: content_process_shutdown_chan,
content_process_shutdown_chan,
webgl_chan: self.webgl_chan,
webxr_registry: self.webxr_registry,
webrender_document: self.webrender_document,
webrender_api_sender: self.webrender_api_sender.clone(),
layout_is_busy: layout_thread_busy_flag.clone(),
player_context: self.player_context.clone(),
inherited_secure_context: self.load_data.inherited_secure_context.clone(),
inherited_secure_context: self.load_data.inherited_secure_context,
},
layout_factory,
self.font_cache_thread.clone(),
self.load_data.clone(),
self.user_agent,
);
LTF::create(
self.id,
self.top_level_browsing_context_id,
self.load_data.url,
self.parent_pipeline_id.is_some(),
layout_pair,
self.pipeline_port,
background_hang_monitor_register,
self.layout_to_constellation_chan,
self.script_chan,
image_cache,
self.font_cache_thread,
self.time_profiler_chan,
self.mem_profiler_chan,
self.webrender_api_sender,
paint_time_metrics,
layout_thread_busy_flag.clone(),
self.window_size,
);
if wait_for_completion {
match content_process_shutdown_port.recv() {
Ok(()) => {},

View File

@@ -28,6 +28,7 @@ use crate::pipeline::UnprivilegedPipelineContent;
use crate::serviceworker::ServiceWorkerUnprivilegedContent;
#[derive(Deserialize, Serialize)]
#[allow(clippy::large_enum_variant)]
pub enum UnprivilegedContent {
Pipeline(UnprivilegedPipelineContent),
ServiceWorker(ServiceWorkerUnprivilegedContent),
@@ -242,6 +243,7 @@ fn setup_common<C: CommandMethods>(command: &mut C, token: String) {
}
/// A trait to unify commands launched as multiprocess with or without a sandbox.
#[allow(dead_code)]
trait CommandMethods {
/// A command line argument.
fn arg<T>(&mut self, arg: T)

View File

@@ -3,13 +3,11 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use std::cmp::PartialEq;
use std::{fmt, mem};
use std::fmt;
use base::id::{BrowsingContextId, HistoryStateId, PipelineId, TopLevelBrowsingContextId};
use euclid::Size2D;
use log::debug;
use msg::constellation_msg::{
BrowsingContextId, HistoryStateId, PipelineId, TopLevelBrowsingContextId,
};
use script_traits::LoadData;
use servo_url::ServoUrl;
use style_traits::CSSPixel;
@@ -44,7 +42,7 @@ impl JointSessionHistory {
pub fn push_diff(&mut self, diff: SessionHistoryDiff) -> Vec<SessionHistoryDiff> {
debug!("pushing a past entry; removing future");
self.past.push(diff);
mem::replace(&mut self.future, vec![])
std::mem::take(&mut self.future)
}
pub fn replace_reloader(&mut self, old_reloader: NeedsToReload, new_reloader: NeedsToReload) {
@@ -59,12 +57,12 @@ impl JointSessionHistory {
history_state_id: HistoryStateId,
url: ServoUrl,
) {
if let Some(SessionHistoryDiff::PipelineDiff {
if let Some(SessionHistoryDiff::Pipeline {
ref mut new_history_state_id,
ref mut new_url,
..
}) = self.past.iter_mut().find(|diff| match diff {
SessionHistoryDiff::PipelineDiff {
SessionHistoryDiff::Pipeline {
pipeline_reloader: NeedsToReload::No(id),
..
} => pipeline_id == *id,
@@ -74,12 +72,12 @@ impl JointSessionHistory {
*new_url = url.clone();
}
if let Some(SessionHistoryDiff::PipelineDiff {
if let Some(SessionHistoryDiff::Pipeline {
ref mut old_history_state_id,
ref mut old_url,
..
}) = self.future.iter_mut().find(|diff| match diff {
SessionHistoryDiff::PipelineDiff {
SessionHistoryDiff::Pipeline {
pipeline_reloader: NeedsToReload::No(id),
..
} => pipeline_id == *id,
@@ -93,14 +91,14 @@ impl JointSessionHistory {
pub fn remove_entries_for_browsing_context(&mut self, context_id: BrowsingContextId) {
debug!("{}: Removing entries for browsing context", context_id);
self.past.retain(|diff| match diff {
SessionHistoryDiff::BrowsingContextDiff {
SessionHistoryDiff::BrowsingContext {
browsing_context_id,
..
} => *browsing_context_id != context_id,
_ => true,
});
self.future.retain(|diff| match diff {
SessionHistoryDiff::BrowsingContextDiff {
SessionHistoryDiff::BrowsingContext {
browsing_context_id,
..
} => *browsing_context_id != context_id,
@@ -180,7 +178,7 @@ impl PartialEq for NeedsToReload {
#[derive(Debug)]
pub enum SessionHistoryDiff {
/// Represents a diff where the active pipeline of an entry changed.
BrowsingContextDiff {
BrowsingContext {
/// The browsing context whose pipeline changed
browsing_context_id: BrowsingContextId,
/// The previous pipeline (used when traversing into the past)
@@ -189,7 +187,7 @@ pub enum SessionHistoryDiff {
new_reloader: NeedsToReload,
},
/// Represents a diff where the active state of a pipeline changed.
PipelineDiff {
Pipeline {
/// The pipeline whose history state changed.
pipeline_reloader: NeedsToReload,
/// The old history state id.
@@ -201,7 +199,7 @@ pub enum SessionHistoryDiff {
/// The new url
new_url: ServoUrl,
},
HashDiff {
Hash {
pipeline_reloader: NeedsToReload,
old_url: ServoUrl,
new_url: ServoUrl,
@@ -212,7 +210,7 @@ impl SessionHistoryDiff {
/// Returns the old pipeline id if that pipeline is still alive, otherwise returns `None`
pub fn alive_old_pipeline(&self) -> Option<PipelineId> {
match *self {
SessionHistoryDiff::BrowsingContextDiff {
SessionHistoryDiff::BrowsingContext {
ref old_reloader, ..
} => match *old_reloader {
NeedsToReload::No(pipeline_id) => Some(pipeline_id),
@@ -225,7 +223,7 @@ impl SessionHistoryDiff {
/// Returns the new pipeline id if that pipeline is still alive, otherwise returns `None`
pub fn alive_new_pipeline(&self) -> Option<PipelineId> {
match *self {
SessionHistoryDiff::BrowsingContextDiff {
SessionHistoryDiff::BrowsingContext {
ref new_reloader, ..
} => match *new_reloader {
NeedsToReload::No(pipeline_id) => Some(pipeline_id),
@@ -242,7 +240,7 @@ impl SessionHistoryDiff {
reloader: &NeedsToReload,
) {
match *self {
SessionHistoryDiff::BrowsingContextDiff {
SessionHistoryDiff::BrowsingContext {
ref mut old_reloader,
ref mut new_reloader,
..
@@ -254,7 +252,7 @@ impl SessionHistoryDiff {
*new_reloader = reloader.clone();
}
},
SessionHistoryDiff::PipelineDiff {
SessionHistoryDiff::Pipeline {
ref mut pipeline_reloader,
..
} => {
@@ -262,7 +260,7 @@ impl SessionHistoryDiff {
*pipeline_reloader = reloader.clone();
}
},
SessionHistoryDiff::HashDiff {
SessionHistoryDiff::Hash {
ref mut pipeline_reloader,
..
} => {

View File

@@ -30,7 +30,7 @@ impl PartialOrd for ScheduledEvent {
impl Eq for ScheduledEvent {}
impl PartialEq for ScheduledEvent {
fn eq(&self, other: &ScheduledEvent) -> bool {
self as *const ScheduledEvent == other as *const ScheduledEvent
std::ptr::eq(self, other)
}
}
@@ -64,10 +64,9 @@ impl TimerScheduler {
/// Handle an incoming timer request.
pub fn handle_timer_request(&mut self, request: TimerSchedulerMsg) {
let TimerEventRequest(_, _, _, delay) = request.0;
let schedule = Instant::now() + Duration::from_millis(delay.get());
let event = ScheduledEvent {
request: request.0,
for_time: schedule,
for_time: Instant::now() + delay,
};
self.0.push(event);
}

View File

@@ -0,0 +1,264 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
/// Log an event from compositor at trace level.
/// - To disable tracing: RUST_LOG='constellation<compositor@=off'
/// - To enable tracing: RUST_LOG='constellation<compositor@'
/// - Recommended filters when tracing is enabled:
/// - constellation<compositor@ForwardEvent(MouseMoveEvent)=off
/// - constellation<compositor@LogEntry=off
/// - constellation<compositor@ReadyToPresent=off
macro_rules! trace_msg_from_compositor {
// This macro only exists to put the docs in the same file as the target prefix,
// so the macro definition is always the same.
($event:expr, $($rest:tt)+) => {
::log::trace!(target: $crate::tracing::LogTarget::log_target(&$event), $($rest)+)
};
}
/// Log an event from script at trace level.
/// - To disable tracing: RUST_LOG='constellation<script@=off'
/// - To enable tracing: RUST_LOG='constellation<script@'
/// - Recommended filters when tracing is enabled:
/// - constellation<script@LogEntry=off
macro_rules! trace_script_msg {
// This macro only exists to put the docs in the same file as the target prefix,
// so the macro definition is always the same.
($event:expr, $($rest:tt)+) => {
::log::trace!(target: $crate::tracing::LogTarget::log_target(&$event), $($rest)+)
};
}
/// Log an event from layout at trace level.
/// - To disable tracing: RUST_LOG='constellation<layout@=off'
/// - To enable tracing: RUST_LOG='constellation<layout@'
macro_rules! trace_layout_msg {
// This macro only exists to put the docs in the same file as the target prefix,
// so the macro definition is always the same.
($event:expr, $($rest:tt)+) => {
::log::trace!(target: $crate::tracing::LogTarget::log_target(&$event), $($rest)+)
};
}
/// Get the log target for an event, as a static string.
pub(crate) trait LogTarget {
fn log_target(&self) -> &'static str;
}
mod from_compositor {
use super::LogTarget;
macro_rules! target {
($($name:literal)+) => {
concat!("constellation<compositor@", $($name),+)
};
}
impl LogTarget for compositing_traits::ConstellationMsg {
fn log_target(&self) -> &'static str {
match self {
Self::Exit => target!("Exit"),
Self::GetBrowsingContext(..) => target!("GetBrowsingContext"),
Self::GetPipeline(..) => target!("GetPipeline"),
Self::GetFocusTopLevelBrowsingContext(..) => {
target!("GetFocusTopLevelBrowsingContext")
},
Self::IsReadyToSaveImage(..) => target!("IsReadyToSaveImage"),
Self::Keyboard(..) => target!("Keyboard"),
Self::AllowNavigationResponse(..) => target!("AllowNavigationResponse"),
Self::LoadUrl(..) => target!("LoadUrl"),
Self::ClearCache => target!("ClearCache"),
Self::TraverseHistory(..) => target!("TraverseHistory"),
Self::WindowSize(..) => target!("WindowSize"),
Self::TickAnimation(..) => target!("TickAnimation"),
Self::WebDriverCommand(..) => target!("WebDriverCommand"),
Self::Reload(..) => target!("Reload"),
Self::LogEntry(..) => target!("LogEntry"),
Self::NewWebView(..) => target!("NewWebView"),
Self::WebViewOpened(..) => target!("WebViewOpened"),
Self::CloseWebView(..) => target!("CloseWebView"),
Self::SendError(..) => target!("SendError"),
Self::FocusWebView(..) => target!("FocusWebView"),
Self::BlurWebView => target!("BlurWebView"),
Self::ForwardEvent(_, event) => event.log_target(),
Self::SetCursor(..) => target!("SetCursor"),
Self::EnableProfiler(..) => target!("EnableProfiler"),
Self::DisableProfiler => target!("DisableProfiler"),
Self::ExitFullScreen(_) => target!("ExitFullScreen"),
Self::MediaSessionAction(_) => target!("MediaSessionAction"),
Self::SetWebViewThrottled(_, _) => target!("SetWebViewThrottled"),
Self::IMEDismissed => target!("IMEDismissed"),
Self::ReadyToPresent(..) => target!("ReadyToPresent"),
Self::Gamepad(..) => target!("Gamepad"),
}
}
}
impl LogTarget for script_traits::CompositorEvent {
fn log_target(&self) -> &'static str {
macro_rules! target_variant {
($name:literal) => {
target!("ForwardEvent(" $name ")")
};
}
match self {
Self::ResizeEvent(..) => target_variant!("ResizeEvent"),
Self::MouseButtonEvent(..) => target_variant!("MouseButtonEvent"),
Self::MouseMoveEvent(..) => target_variant!("MouseMoveEvent"),
Self::TouchEvent(..) => target_variant!("TouchEvent"),
Self::WheelEvent(..) => target_variant!("WheelEvent"),
Self::KeyboardEvent(..) => target_variant!("KeyboardEvent"),
Self::CompositionEvent(..) => target_variant!("CompositionEvent"),
Self::IMEDismissedEvent => target_variant!("IMEDismissedEvent"),
Self::GamepadEvent(..) => target_variant!("GamepadEvent"),
}
}
}
}
mod from_script {
use super::LogTarget;
macro_rules! target {
($($name:literal)+) => {
concat!("constellation<script@", $($name),+)
};
}
impl LogTarget for script_traits::ScriptMsg {
fn log_target(&self) -> &'static str {
match self {
Self::CompleteMessagePortTransfer(..) => target!("CompleteMessagePortTransfer"),
Self::MessagePortTransferResult(..) => target!("MessagePortTransferResult"),
Self::NewMessagePort(..) => target!("NewMessagePort"),
Self::NewMessagePortRouter(..) => target!("NewMessagePortRouter"),
Self::RemoveMessagePortRouter(..) => target!("RemoveMessagePortRouter"),
Self::RerouteMessagePort(..) => target!("RerouteMessagePort"),
Self::MessagePortShipped(..) => target!("MessagePortShipped"),
Self::RemoveMessagePort(..) => target!("RemoveMessagePort"),
Self::EntanglePorts(..) => target!("EntanglePorts"),
Self::NewBroadcastChannelRouter(..) => target!("NewBroadcastChannelRouter"),
Self::RemoveBroadcastChannelRouter(..) => target!("RemoveBroadcastChannelRouter"),
Self::NewBroadcastChannelNameInRouter(..) => {
target!("NewBroadcastChannelNameInRouter")
},
Self::RemoveBroadcastChannelNameInRouter(..) => {
target!("RemoveBroadcastChannelNameInRouter")
},
Self::ScheduleBroadcast(..) => target!("ScheduleBroadcast"),
Self::ForwardToEmbedder(msg) => msg.log_target(),
Self::InitiateNavigateRequest(..) => target!("InitiateNavigateRequest"),
Self::BroadcastStorageEvent(..) => target!("BroadcastStorageEvent"),
Self::ChangeRunningAnimationsState(..) => target!("ChangeRunningAnimationsState"),
Self::CreateCanvasPaintThread(..) => target!("CreateCanvasPaintThread"),
Self::Focus => target!("Focus"),
Self::GetTopForBrowsingContext(..) => target!("GetTopForBrowsingContext"),
Self::GetBrowsingContextInfo(..) => target!("GetBrowsingContextInfo"),
Self::GetChildBrowsingContextId(..) => target!("GetChildBrowsingContextId"),
Self::LoadComplete => target!("LoadComplete"),
Self::LoadUrl(..) => target!("LoadUrl"),
Self::AbortLoadUrl => target!("AbortLoadUrl"),
Self::PostMessage { .. } => target!("PostMessage"),
Self::NavigatedToFragment(..) => target!("NavigatedToFragment"),
Self::TraverseHistory(..) => target!("TraverseHistory"),
Self::PushHistoryState(..) => target!("PushHistoryState"),
Self::ReplaceHistoryState(..) => target!("ReplaceHistoryState"),
Self::JointSessionHistoryLength(..) => target!("JointSessionHistoryLength"),
Self::RemoveIFrame(..) => target!("RemoveIFrame"),
Self::SetThrottledComplete(..) => target!("SetThrottledComplete"),
Self::ScriptLoadedURLInIFrame(..) => target!("ScriptLoadedURLInIFrame"),
Self::ScriptNewIFrame(..) => target!("ScriptNewIFrame"),
Self::ScriptNewAuxiliary(..) => target!("ScriptNewAuxiliary"),
Self::ActivateDocument => target!("ActivateDocument"),
Self::SetDocumentState(..) => target!("SetDocumentState"),
Self::SetLayoutEpoch(..) => target!("SetLayoutEpoch"),
Self::SetFinalUrl(..) => target!("SetFinalUrl"),
Self::TouchEventProcessed(..) => target!("TouchEventProcessed"),
Self::LogEntry(..) => target!("LogEntry"),
Self::DiscardDocument => target!("DiscardDocument"),
Self::DiscardTopLevelBrowsingContext => target!("DiscardTopLevelBrowsingContext"),
Self::PipelineExited => target!("PipelineExited"),
Self::ForwardDOMMessage(..) => target!("ForwardDOMMessage"),
Self::ScheduleJob(..) => target!("ScheduleJob"),
Self::GetClientWindow(..) => target!("GetClientWindow"),
Self::GetScreenSize(..) => target!("GetScreenSize"),
Self::GetScreenAvailSize(..) => target!("GetScreenAvailSize"),
Self::MediaSessionEvent(..) => target!("MediaSessionEvent"),
Self::RequestAdapter(..) => target!("RequestAdapter"),
Self::GetWebGPUChan(..) => target!("GetWebGPUChan"),
Self::TitleChanged(..) => target!("TitleChanged"),
}
}
}
impl LogTarget for embedder_traits::EmbedderMsg {
fn log_target(&self) -> &'static str {
macro_rules! target_variant {
($name:literal) => {
target!("ForwardToEmbedder(" $name ")")
};
}
match self {
Self::Status(..) => target_variant!("Status"),
Self::ChangePageTitle(..) => target_variant!("ChangePageTitle"),
Self::MoveTo(..) => target_variant!("MoveTo"),
Self::ResizeTo(..) => target_variant!("ResizeTo"),
Self::Prompt(..) => target_variant!("Prompt"),
Self::ShowContextMenu(..) => target_variant!("ShowContextMenu"),
Self::AllowNavigationRequest(..) => target_variant!("AllowNavigationRequest"),
Self::AllowOpeningWebView(..) => target_variant!("AllowOpeningWebView"),
Self::WebViewOpened(..) => target_variant!("WebViewOpened"),
Self::WebViewClosed(..) => target_variant!("WebViewClosed"),
Self::WebViewFocused(..) => target_variant!("WebViewFocused"),
Self::WebViewBlurred => target_variant!("WebViewBlurred"),
Self::AllowUnload(..) => target_variant!("AllowUnload"),
Self::Keyboard(..) => target_variant!("Keyboard"),
Self::GetClipboardContents(..) => target_variant!("GetClipboardContents"),
Self::SetClipboardContents(..) => target_variant!("SetClipboardContents"),
Self::SetCursor(..) => target_variant!("SetCursor"),
Self::NewFavicon(..) => target_variant!("NewFavicon"),
Self::HeadParsed => target_variant!("HeadParsed"),
Self::HistoryChanged(..) => target_variant!("HistoryChanged"),
Self::SetFullscreenState(..) => target_variant!("SetFullscreenState"),
Self::LoadStart => target_variant!("LoadStart"),
Self::LoadComplete => target_variant!("LoadComplete"),
Self::Panic(..) => target_variant!("Panic"),
Self::GetSelectedBluetoothDevice(..) => {
target_variant!("GetSelectedBluetoothDevice")
},
Self::SelectFiles(..) => target_variant!("SelectFiles"),
Self::PromptPermission(..) => target_variant!("PromptPermission"),
Self::ShowIME(..) => target_variant!("ShowIME"),
Self::HideIME => target_variant!("HideIME"),
Self::Shutdown => target_variant!("Shutdown"),
Self::ReportProfile(..) => target_variant!("ReportProfile"),
Self::MediaSessionEvent(..) => target_variant!("MediaSessionEvent"),
Self::OnDevtoolsStarted(..) => target_variant!("OnDevtoolsStarted"),
Self::ReadyToPresent(..) => target_variant!("ReadyToPresent"),
Self::EventDelivered(..) => target_variant!("EventDelivered"),
Self::PlayGamepadHapticEffect(..) => target_variant!("PlayGamepadHapticEffect"),
Self::StopGamepadHapticEffect(..) => target_variant!("StopGamepadHapticEffect"),
}
}
}
}
mod from_layout {
use super::LogTarget;
macro_rules! target {
($($name:literal)+) => {
concat!("constellation<layout@", $($name),+)
};
}
impl LogTarget for script_traits::LayoutMsg {
fn log_target(&self) -> &'static str {
match self {
Self::IFrameSizes(..) => target!("IFrameSizes"),
Self::PendingPaintMetric(..) => target!("PendingPaintMetric"),
}
}
}
}

View File

@@ -4,7 +4,7 @@
use std::collections::HashMap;
use msg::constellation_msg::TopLevelBrowsingContextId;
use base::id::TopLevelBrowsingContextId;
#[derive(Debug)]
pub struct WebViewManager<WebView> {
@@ -99,14 +99,14 @@ impl<WebView> WebViewManager<WebView> {
mod test {
use std::num::NonZeroU32;
use msg::constellation_msg::{
use base::id::{
BrowsingContextId, BrowsingContextIndex, PipelineNamespace, PipelineNamespaceId,
TopLevelBrowsingContextId,
TopLevelBrowsingContextId, WebViewId,
};
use crate::webview::WebViewManager;
fn top_level_id(namespace_id: u32, index: u32) -> TopLevelBrowsingContextId {
fn id(namespace_id: u32, index: u32) -> WebViewId {
TopLevelBrowsingContextId(BrowsingContextId {
namespace_id: PipelineNamespaceId(namespace_id),
index: BrowsingContextIndex(NonZeroU32::new(index).expect("Incorrect test case")),
@@ -115,7 +115,7 @@ mod test {
fn webviews_sorted<WebView: Clone>(
webviews: &WebViewManager<WebView>,
) -> Vec<(TopLevelBrowsingContextId, WebView)> {
) -> Vec<(WebViewId, WebView)> {
let mut keys = webviews.webviews.keys().collect::<Vec<_>>();
keys.sort();
keys.iter()
@@ -138,59 +138,59 @@ mod test {
let mut webviews = WebViewManager::default();
// add() adds the webview to the map, but does not focus it.
webviews.add(TopLevelBrowsingContextId::new(), 'a');
webviews.add(TopLevelBrowsingContextId::new(), 'b');
webviews.add(TopLevelBrowsingContextId::new(), 'c');
webviews.add(WebViewId::new(), 'a');
webviews.add(WebViewId::new(), 'b');
webviews.add(WebViewId::new(), 'c');
assert_eq!(
webviews_sorted(&webviews),
vec![
(top_level_id(0, 1), 'a'),
(top_level_id(0, 2), 'b'),
(top_level_id(0, 3), 'c'),
]
vec![(id(0, 1), 'a'), (id(0, 2), 'b'), (id(0, 3), 'c'),]
);
assert!(webviews.focus_order.is_empty());
assert_eq!(webviews.is_focused, false);
// focus() makes the given webview the latest in focus order.
webviews.focus(top_level_id(0, 2));
assert_eq!(webviews.focus_order, vec![top_level_id(0, 2)]);
webviews.focus(id(0, 2));
assert_eq!(webviews.focus_order, vec![id(0, 2)]);
assert_eq!(webviews.is_focused, true);
webviews.focus(top_level_id(0, 1));
assert_eq!(
webviews.focus_order,
vec![top_level_id(0, 2), top_level_id(0, 1)]
);
webviews.focus(id(0, 1));
assert_eq!(webviews.focus_order, vec![id(0, 2), id(0, 1)]);
assert_eq!(webviews.is_focused, true);
webviews.focus(top_level_id(0, 3));
assert_eq!(
webviews.focus_order,
vec![top_level_id(0, 2), top_level_id(0, 1), top_level_id(0, 3)]
);
webviews.focus(id(0, 3));
assert_eq!(webviews.focus_order, vec![id(0, 2), id(0, 1), id(0, 3)]);
assert_eq!(webviews.is_focused, true);
// unfocus() clears the “is focused” flag, but does not touch the focus order.
webviews.unfocus();
assert_eq!(
webviews.focus_order,
vec![top_level_id(0, 2), top_level_id(0, 1), top_level_id(0, 3)]
);
assert_eq!(webviews.focus_order, vec![id(0, 2), id(0, 1), id(0, 3)]);
assert_eq!(webviews.is_focused, false);
// focus() avoids duplicates in focus order, when the given webview has been focused before.
webviews.focus(top_level_id(0, 1));
assert_eq!(
webviews.focus_order,
vec![top_level_id(0, 2), top_level_id(0, 3), top_level_id(0, 1)]
);
webviews.focus(id(0, 1));
assert_eq!(webviews.focus_order, vec![id(0, 2), id(0, 3), id(0, 1)]);
assert_eq!(webviews.is_focused, true);
// remove() clears the “is focused” flag iff the given webview was focused.
webviews.remove(top_level_id(0, 2));
webviews.remove(id(1, 1));
assert_eq!(webviews.is_focused, true);
webviews.remove(top_level_id(0, 1));
webviews.remove(id(1, 2));
assert_eq!(webviews.is_focused, true);
webviews.remove(id(2, 1));
assert_eq!(webviews.is_focused, true);
webviews.remove(id(2, 2));
assert_eq!(webviews.is_focused, true);
webviews.remove(id(2, 3));
assert_eq!(webviews.is_focused, true);
webviews.remove(id(2, 4));
assert_eq!(webviews.is_focused, true);
webviews.remove(id(3, 1));
assert_eq!(webviews.is_focused, true);
webviews.remove(id(4, 1));
assert_eq!(webviews.is_focused, true);
webviews.remove(id(0, 2));
assert_eq!(webviews.is_focused, true);
webviews.remove(id(0, 1));
assert_eq!(webviews.is_focused, false);
webviews.remove(top_level_id(0, 3));
webviews.remove(id(0, 3));
assert_eq!(webviews.is_focused, false);
// remove() removes the given webview from both the map and the focus order.

View File

@@ -1,10 +1,10 @@
[package]
name = "deny_public_fields"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2018"
publish = false
version.workspace = true
authors.workspace = true
license.workspace = true
edition.workspace = true
publish.workspace = true
[lib]
path = "lib.rs"

View File

@@ -1,16 +0,0 @@
[package]
name = "derive_common"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
publish = false
[lib]
path = "lib.rs"
[dependencies]
darling = { workspace = true }
proc-macro2 = { workspace = true }
quote = { workspace = true }
syn = { workspace = true }
synstructure = { workspace = true }

View File

@@ -1,396 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use darling::{FromDeriveInput, FromField, FromVariant};
use proc_macro2::{Span, TokenStream};
use quote::TokenStreamExt;
use syn::{
self, AngleBracketedGenericArguments, AssocType, DeriveInput, Field, GenericArgument,
GenericParam, Ident, Path, PathArguments, PathSegment, QSelf, Type, TypeArray, TypeGroup,
TypeParam, TypeParen, TypePath, TypeSlice, TypeTuple, Variant, WherePredicate,
};
use synstructure::{self, BindStyle, BindingInfo, VariantAst, VariantInfo};
/// Given an input type which has some where clauses already, like:
///
/// struct InputType<T>
/// where
/// T: Zero,
/// {
/// ...
/// }
///
/// Add the necessary `where` clauses so that the output type of a trait
/// fulfils them.
///
/// For example:
///
/// ```ignore
/// <T as ToComputedValue>::ComputedValue: Zero,
/// ```
///
/// This needs to run before adding other bounds to the type parameters.
pub fn propagate_clauses_to_output_type(
where_clause: &mut Option<syn::WhereClause>,
generics: &syn::Generics,
trait_path: &Path,
trait_output: &Ident,
) {
let where_clause = match *where_clause {
Some(ref mut clause) => clause,
None => return,
};
let mut extra_bounds = vec![];
for pred in &where_clause.predicates {
let ty = match *pred {
syn::WherePredicate::Type(ref ty) => ty,
ref predicate => panic!("Unhanded complex where predicate: {:?}", predicate),
};
let path = match ty.bounded_ty {
syn::Type::Path(ref p) => &p.path,
ref ty => panic!("Unhanded complex where type: {:?}", ty),
};
assert!(
ty.lifetimes.is_none(),
"Unhanded complex lifetime bound: {:?}",
ty,
);
let ident = match path_to_ident(path) {
Some(i) => i,
None => panic!("Unhanded complex where type path: {:?}", path),
};
if generics.type_params().any(|param| param.ident == *ident) {
extra_bounds.push(ty.clone());
}
}
for bound in extra_bounds {
let ty = bound.bounded_ty;
let bounds = bound.bounds;
where_clause
.predicates
.push(parse_quote!(<#ty as #trait_path>::#trait_output: #bounds))
}
}
pub fn add_predicate(where_clause: &mut Option<syn::WhereClause>, pred: WherePredicate) {
where_clause
.get_or_insert(parse_quote!(where))
.predicates
.push(pred);
}
pub fn fmap_match<F>(input: &DeriveInput, bind_style: BindStyle, f: F) -> TokenStream
where
F: FnMut(&BindingInfo) -> TokenStream,
{
fmap2_match(input, bind_style, f, |_| None)
}
pub fn fmap2_match<F, G>(
input: &DeriveInput,
bind_style: BindStyle,
mut f: F,
mut g: G,
) -> TokenStream
where
F: FnMut(&BindingInfo) -> TokenStream,
G: FnMut(&BindingInfo) -> Option<TokenStream>,
{
let mut s = synstructure::Structure::new(input);
s.variants_mut().iter_mut().for_each(|v| {
v.bind_with(|_| bind_style);
});
s.each_variant(|variant| {
let (mapped, mapped_fields) = value(variant, "mapped");
let fields_pairs = variant.bindings().iter().zip(mapped_fields.iter());
let mut computations = quote!();
computations.append_all(fields_pairs.map(|(field, mapped_field)| {
let expr = f(field);
quote! { let #mapped_field = #expr; }
}));
computations.append_all(
mapped_fields
.iter()
.map(|mapped_field| match g(mapped_field) {
Some(expr) => quote! { let #mapped_field = #expr; },
None => quote!(),
}),
);
computations.append_all(mapped);
Some(computations)
})
}
pub fn fmap_trait_output(input: &DeriveInput, trait_path: &Path, trait_output: &Ident) -> Path {
let segment = PathSegment {
ident: input.ident.clone(),
arguments: PathArguments::AngleBracketed(AngleBracketedGenericArguments {
args: input
.generics
.params
.iter()
.map(|arg| match arg {
&GenericParam::Lifetime(ref data) => {
GenericArgument::Lifetime(data.lifetime.clone())
},
&GenericParam::Type(ref data) => {
let ident = &data.ident;
GenericArgument::Type(parse_quote!(<#ident as #trait_path>::#trait_output))
},
&GenericParam::Const(ref inner) => {
let ident = &inner.ident;
GenericArgument::Const(parse_quote!(#ident))
},
})
.collect(),
colon2_token: Default::default(),
gt_token: Default::default(),
lt_token: Default::default(),
}),
};
segment.into()
}
pub fn map_type_params<F>(ty: &Type, params: &[&TypeParam], self_type: &Path, f: &mut F) -> Type
where
F: FnMut(&Ident) -> Type,
{
match *ty {
Type::Slice(ref inner) => Type::from(TypeSlice {
elem: Box::new(map_type_params(&inner.elem, params, self_type, f)),
..inner.clone()
}),
Type::Array(ref inner) => {
//ref ty, ref expr) => {
Type::from(TypeArray {
elem: Box::new(map_type_params(&inner.elem, params, self_type, f)),
..inner.clone()
})
},
ref ty @ Type::Never(_) => ty.clone(),
Type::Tuple(ref inner) => Type::from(TypeTuple {
elems: inner
.elems
.iter()
.map(|ty| map_type_params(&ty, params, self_type, f))
.collect(),
..inner.clone()
}),
Type::Path(TypePath {
qself: None,
ref path,
}) => {
if let Some(ident) = path_to_ident(path) {
if params.iter().any(|ref param| &param.ident == ident) {
return f(ident);
}
if ident == "Self" {
return Type::from(TypePath {
qself: None,
path: self_type.clone(),
});
}
}
Type::from(TypePath {
qself: None,
path: map_type_params_in_path(path, params, self_type, f),
})
},
Type::Path(TypePath {
ref qself,
ref path,
}) => Type::from(TypePath {
qself: qself.as_ref().map(|qself| QSelf {
ty: Box::new(map_type_params(&qself.ty, params, self_type, f)),
position: qself.position,
..qself.clone()
}),
path: map_type_params_in_path(path, params, self_type, f),
}),
Type::Paren(ref inner) => Type::from(TypeParen {
elem: Box::new(map_type_params(&inner.elem, params, self_type, f)),
..inner.clone()
}),
Type::Group(ref inner) => Type::from(TypeGroup {
elem: Box::new(map_type_params(&inner.elem, params, self_type, f)),
..inner.clone()
}),
ref ty => panic!("type {:?} cannot be mapped yet", ty),
}
}
fn map_type_params_in_path<F>(
path: &Path,
params: &[&TypeParam],
self_type: &Path,
f: &mut F,
) -> Path
where
F: FnMut(&Ident) -> Type,
{
Path {
leading_colon: path.leading_colon,
segments: path
.segments
.iter()
.map(|segment| PathSegment {
ident: segment.ident.clone(),
arguments: match segment.arguments {
PathArguments::AngleBracketed(ref data) => {
PathArguments::AngleBracketed(AngleBracketedGenericArguments {
args: data
.args
.iter()
.map(|arg| match arg {
ty @ &GenericArgument::Lifetime(_) => ty.clone(),
&GenericArgument::Type(ref data) => GenericArgument::Type(
map_type_params(data, params, self_type, f),
),
&GenericArgument::AssocType(ref data) => {
GenericArgument::AssocType(AssocType {
ty: map_type_params(&data.ty, params, self_type, f),
..data.clone()
})
},
ref arg => panic!("arguments {:?} cannot be mapped yet", arg),
})
.collect(),
..data.clone()
})
},
ref arg @ PathArguments::None => arg.clone(),
ref parameters => panic!("parameters {:?} cannot be mapped yet", parameters),
},
})
.collect(),
}
}
fn path_to_ident(path: &Path) -> Option<&Ident> {
match *path {
Path {
leading_colon: None,
ref segments,
} if segments.len() == 1 => {
if segments[0].arguments.is_empty() {
Some(&segments[0].ident)
} else {
None
}
},
_ => None,
}
}
pub fn parse_field_attrs<A>(field: &Field) -> A
where
A: FromField,
{
match A::from_field(field) {
Ok(attrs) => attrs,
Err(e) => panic!("failed to parse field attributes: {}", e),
}
}
pub fn parse_input_attrs<A>(input: &DeriveInput) -> A
where
A: FromDeriveInput,
{
match A::from_derive_input(input) {
Ok(attrs) => attrs,
Err(e) => panic!("failed to parse input attributes: {}", e),
}
}
pub fn parse_variant_attrs_from_ast<A>(variant: &VariantAst) -> A
where
A: FromVariant,
{
let v = Variant {
ident: variant.ident.clone(),
attrs: variant.attrs.to_vec(),
fields: variant.fields.clone(),
discriminant: variant.discriminant.clone(),
};
parse_variant_attrs(&v)
}
pub fn parse_variant_attrs<A>(variant: &Variant) -> A
where
A: FromVariant,
{
match A::from_variant(variant) {
Ok(attrs) => attrs,
Err(e) => panic!("failed to parse variant attributes: {}", e),
}
}
pub fn ref_pattern<'a>(
variant: &'a VariantInfo,
prefix: &str,
) -> (TokenStream, Vec<BindingInfo<'a>>) {
let mut v = variant.clone();
v.bind_with(|_| BindStyle::Ref);
v.bindings_mut().iter_mut().for_each(|b| {
b.binding = Ident::new(&format!("{}_{}", b.binding, prefix), Span::call_site())
});
(v.pat(), v.bindings().to_vec())
}
pub fn value<'a>(variant: &'a VariantInfo, prefix: &str) -> (TokenStream, Vec<BindingInfo<'a>>) {
let mut v = variant.clone();
v.bindings_mut().iter_mut().for_each(|b| {
b.binding = Ident::new(&format!("{}_{}", b.binding, prefix), Span::call_site())
});
v.bind_with(|_| BindStyle::Move);
(v.pat(), v.bindings().to_vec())
}
/// Transforms "FooBar" to "foo-bar".
///
/// If the first Camel segment is "Moz", "Webkit", or "Servo", the result string
/// is prepended with "-".
pub fn to_css_identifier(mut camel_case: &str) -> String {
camel_case = camel_case.trim_end_matches('_');
let mut first = true;
let mut result = String::with_capacity(camel_case.len());
while let Some(segment) = split_camel_segment(&mut camel_case) {
if first {
match segment {
"Moz" | "Webkit" | "Servo" => first = false,
_ => {},
}
}
if !first {
result.push('-');
}
first = false;
result.push_str(&segment.to_lowercase());
}
result
}
/// Transforms foo-bar to FOO_BAR.
pub fn to_scream_case(css_case: &str) -> String {
css_case.to_uppercase().replace('-', "_")
}
/// Given "FooBar", returns "Foo" and sets `camel_case` to "Bar".
fn split_camel_segment<'input>(camel_case: &mut &'input str) -> Option<&'input str> {
let index = match camel_case.chars().next() {
None => return None,
Some(ch) => ch.len_utf8(),
};
let end_position = camel_case[index..]
.find(char::is_uppercase)
.map_or(camel_case.len(), |pos| index + pos);
let result = &camel_case[..end_position];
*camel_case = &camel_case[end_position..];
Some(result)
}

View File

@@ -1,13 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
extern crate darling;
extern crate proc_macro2;
#[macro_use]
extern crate quote;
#[macro_use]
extern crate syn;
extern crate synstructure;
pub mod cg;

View File

@@ -1,17 +1,21 @@
[package]
name = "devtools"
version = "0.0.1"
authors = ["The Servo Project Developers"]
license = "MPL-2.0"
edition = "2018"
publish = false
version.workspace = true
authors.workspace = true
license.workspace = true
edition.workspace = true
publish.workspace = true
[lib]
name = "devtools"
path = "lib.rs"
[build-dependencies]
chrono = { workspace = true }
[dependencies]
chrono = "0.4"
base = { workspace = true }
chrono = { workspace = true }
crossbeam-channel = { workspace = true }
devtools_traits = { workspace = true }
embedder_traits = { workspace = true }
@@ -19,7 +23,6 @@ headers = { workspace = true }
http = { workspace = true }
ipc-channel = { workspace = true }
log = { workspace = true }
msg = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
servo_config = { path = "../config" }

View File

@@ -5,7 +5,7 @@
use std::any::Any;
use std::cell::{Cell, RefCell};
use std::collections::HashMap;
use std::mem::replace;
use std::mem;
use std::net::TcpStream;
use std::sync::{Arc, Mutex};
@@ -105,7 +105,7 @@ impl ActorRegistry {
/// Get start stamp when registry was started
pub fn start_stamp(&self) -> PreciseTime {
self.start_stamp.clone()
self.start_stamp
}
pub fn register_script_actor(&self, script_id: String, actor: String) {
@@ -194,12 +194,12 @@ impl ActorRegistry {
}
},
}
let new_actors = replace(&mut *self.new_actors.borrow_mut(), vec![]);
let new_actors = mem::take(&mut *self.new_actors.borrow_mut());
for actor in new_actors.into_iter() {
self.actors.insert(actor.name().to_owned(), actor);
}
let old_actors = replace(&mut *self.old_actors.borrow_mut(), vec![]);
let old_actors = mem::take(&mut *self.old_actors.borrow_mut());
for name in old_actors {
self.drop_actor(name);
}

View File

@@ -2,142 +2,183 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
//! Liberally derived from the [Firefox JS implementation](http://mxr.mozilla.org/mozilla-central/source/toolkit/devtools/server/actors/webbrowser.js).
//! Liberally derived from the [Firefox JS implementation](https://searchfox.org/mozilla-central/source/devtools/server/actors/webbrowser.js).
//! Connection point for remote devtools that wish to investigate a particular Browsing Context's contents.
//! Supports dynamic attaching and detaching which control notifications of navigation, etc.
use std::cell::{Cell, RefCell};
use std::collections::HashMap;
use std::net::TcpStream;
use std::time::{SystemTime, UNIX_EPOCH};
use devtools_traits::DevtoolScriptControlMsg::{self, WantsLiveNotifications};
use devtools_traits::{DevtoolsPageInfo, NavigationState};
use ipc_channel::ipc::IpcSender;
use msg::constellation_msg::{BrowsingContextId, PipelineId};
use base::id::{BrowsingContextId, PipelineId};
use devtools_traits::DevtoolScriptControlMsg::{self, GetCssDatabase, WantsLiveNotifications};
use devtools_traits::{ConsoleLog, DevtoolsPageInfo, NavigationState, PageError};
use ipc_channel::ipc::{self, IpcSender};
use serde::Serialize;
use serde_json::{Map, Value};
use crate::actor::{Actor, ActorMessageStatus, ActorRegistry};
use crate::actors::emulation::EmulationActor;
use crate::actors::inspector::accessibility::AccessibilityActor;
use crate::actors::inspector::css_properties::CssPropertiesActor;
use crate::actors::inspector::InspectorActor;
use crate::actors::performance::PerformanceActor;
use crate::actors::profiler::ProfilerActor;
use crate::actors::reflow::ReflowActor;
use crate::actors::stylesheets::StyleSheetsActor;
use crate::actors::tab::TabDescriptorActor;
use crate::actors::thread::ThreadActor;
use crate::actors::timeline::TimelineActor;
use crate::actors::watcher::{SessionContext, SessionContextType, WatcherActor};
use crate::protocol::JsonPacketStream;
use crate::StreamId;
use crate::{EmptyReplyMsg, StreamId};
#[derive(Serialize)]
struct BrowsingContextTraits {
isBrowsingContext: bool,
struct FrameUpdateReply {
from: String,
#[serde(rename = "type")]
type_: String,
frames: Vec<FrameUpdateMsg>,
}
#[derive(Serialize)]
struct AttachedTraits {
reconfigure: bool,
#[serde(rename_all = "camelCase")]
struct FrameUpdateMsg {
id: u32,
is_top_level: bool,
url: String,
title: String,
}
#[derive(Serialize)]
struct ResourceAvailableReply {
from: String,
#[serde(rename = "type")]
type_: String,
resources: Vec<ResourceAvailableMsg>,
}
#[derive(Serialize)]
#[serde(rename_all = "camelCase")]
struct ResourceAvailableMsg {
#[serde(rename = "hasNativeConsoleAPI")]
has_native_console_api: Option<bool>,
name: String,
#[serde(rename = "newURI")]
new_uri: Option<String>,
resource_type: String,
time: u64,
title: Option<String>,
url: Option<String>,
}
#[derive(Serialize)]
struct ConsoleMsg {
from: String,
#[serde(rename = "type")]
type_: String,
resources: Vec<ConsoleMessageResource>,
}
#[derive(Serialize)]
#[serde(rename_all = "camelCase")]
struct ConsoleMessageResource {
message: ConsoleLog,
resource_type: String,
}
#[derive(Serialize)]
struct PageErrorMsg {
from: String,
#[serde(rename = "type")]
type_: String,
resources: Vec<PageErrorResource>,
}
#[derive(Serialize)]
#[serde(rename_all = "camelCase")]
struct PageErrorResource {
page_error: PageError,
resource_type: String,
}
#[derive(Serialize)]
struct TabNavigated {
from: String,
#[serde(rename = "type")]
type_: String,
url: String,
title: Option<String>,
#[serde(rename = "nativeConsoleAPI")]
native_console_api: bool,
state: String,
is_frame_switching: bool,
}
#[derive(Serialize)]
#[serde(rename_all = "camelCase")]
struct BrowsingContextTraits {
frames: bool,
logInPage: bool,
canRewind: bool,
is_browsing_context: bool,
log_in_page: bool,
navigation: bool,
supports_top_level_target_flag: bool,
watchpoints: bool,
}
#[derive(Serialize)]
struct BrowsingContextAttachedReply {
from: String,
#[serde(rename = "type")]
type_: String,
threadActor: String,
cacheDisabled: bool,
javascriptEnabled: bool,
traits: AttachedTraits,
}
#[derive(Serialize)]
struct BrowsingContextDetachedReply {
from: String,
#[serde(rename = "type")]
type_: String,
}
#[derive(Serialize)]
struct ReconfigureReply {
from: String,
}
#[derive(Serialize)]
struct ListFramesReply {
from: String,
frames: Vec<FrameMsg>,
}
#[derive(Serialize)]
struct FrameMsg {
id: u32,
url: String,
title: String,
parentID: u32,
}
#[derive(Serialize)]
struct ListWorkersReply {
from: String,
workers: Vec<WorkerMsg>,
}
#[derive(Serialize)]
struct WorkerMsg {
id: u32,
}
#[derive(Serialize)]
#[serde(rename_all = "camelCase")]
pub struct BrowsingContextActorMsg {
actor: String,
title: String,
url: String,
outerWindowID: u32,
browsingContextId: u32,
consoleActor: String,
/*emulationActor: String,
inspectorActor: String,
timelineActor: String,
profilerActor: String,
performanceActor: String,
styleSheetsActor: String,*/
#[serde(rename = "outerWindowID")]
outer_window_id: u32,
#[serde(rename = "browsingContextID")]
browsing_context_id: u32,
is_top_level_target: bool,
traits: BrowsingContextTraits,
// Implemented actors
accessibility_actor: String,
console_actor: String,
css_properties_actor: String,
inspector_actor: String,
reflow_actor: String,
style_sheets_actor: String,
thread_actor: String,
// Part of the official protocol, but not yet implemented.
/*storageActor: String,
memoryActor: String,
framerateActor: String,
reflowActor: String,
cssPropertiesActor: String,
animationsActor: String,
webExtensionInspectedWindowActor: String,
accessibilityActor: String,
screenshotActor: String,
changesActor: String,
webSocketActor: String,
manifestActor: String,*/
// animations_actor: String,
// changes_actor: String,
// framerate_actor: String,
// manifest_actor: String,
// memory_actor: String,
// network_content_actor: String,
// objects_manager: String,
// performance_actor: String,
// resonsive_actor: String,
// storage_actor: String,
// tracer_actor: String,
// web_extension_inspected_window_actor: String,
// web_socket_actor: String,
}
/// The browsing context actor encompasses all of the other supporting actors when debugging a web
/// view. To this extent, it contains a watcher actor that helps when communicating with the host,
/// as well as resource actors that each perform one debugging function.
pub(crate) struct BrowsingContextActor {
pub name: String,
pub title: RefCell<String>,
pub url: RefCell<String>,
pub active_pipeline: Cell<PipelineId>,
pub browsing_context_id: BrowsingContextId,
pub accessibility: String,
pub console: String,
pub _emulation: String,
pub _inspector: String,
pub _timeline: String,
pub _profiler: String,
pub _performance: String,
pub _styleSheets: String,
pub css_properties: String,
pub inspector: String,
pub reflow: String,
pub style_sheets: String,
pub thread: String,
pub _tab: String,
pub streams: RefCell<HashMap<StreamId, TcpStream>>,
pub browsing_context_id: BrowsingContextId,
pub active_pipeline: Cell<PipelineId>,
pub script_chan: IpcSender<DevtoolScriptControlMsg>,
pub streams: RefCell<HashMap<StreamId, TcpStream>>,
pub watcher: String,
}
impl Actor for BrowsingContextActor {
@@ -149,89 +190,17 @@ impl Actor for BrowsingContextActor {
&self,
_registry: &ActorRegistry,
msg_type: &str,
msg: &Map<String, Value>,
_msg: &Map<String, Value>,
stream: &mut TcpStream,
id: StreamId,
_id: StreamId,
) -> Result<ActorMessageStatus, ()> {
Ok(match msg_type {
"reconfigure" => {
if let Some(options) = msg.get("options").and_then(|o| o.as_object()) {
if let Some(val) = options.get("performReload") {
if val.as_bool().unwrap_or(false) {
let _ = self
.script_chan
.send(DevtoolScriptControlMsg::Reload(self.active_pipeline.get()));
}
}
}
let _ = stream.write_json_packet(&ReconfigureReply { from: self.name() });
ActorMessageStatus::Processed
},
// https://docs.firefox-dev.tools/backend/protocol.html#listing-browser-tabs
// (see "To attach to a _targetActor_")
"attach" => {
let msg = BrowsingContextAttachedReply {
from: self.name(),
type_: "tabAttached".to_owned(),
threadActor: self.thread.clone(),
cacheDisabled: false,
javascriptEnabled: true,
traits: AttachedTraits {
reconfigure: false,
frames: true,
logInPage: false,
canRewind: false,
watchpoints: false,
},
};
if stream.write_json_packet(&msg).is_err() {
return Ok(ActorMessageStatus::Processed);
}
self.streams
.borrow_mut()
.insert(id, stream.try_clone().unwrap());
self.script_chan
.send(WantsLiveNotifications(self.active_pipeline.get(), true))
.unwrap();
ActorMessageStatus::Processed
},
"detach" => {
let msg = BrowsingContextDetachedReply {
from: self.name(),
type_: "detached".to_owned(),
};
let _ = stream.write_json_packet(&msg);
self.cleanup(id);
ActorMessageStatus::Processed
},
"listFrames" => {
let msg = ListFramesReply {
from: self.name(),
frames: vec![FrameMsg {
//FIXME: shouldn't ignore pipeline namespace field
id: self.active_pipeline.get().index.0.get(),
parentID: 0,
url: self.url.borrow().clone(),
title: self.title.borrow().clone(),
}],
};
// TODO: Find out what needs to be listed here
let msg = EmptyReplyMsg { from: self.name() };
let _ = stream.write_json_packet(&msg);
ActorMessageStatus::Processed
},
"listWorkers" => {
let msg = ListWorkersReply {
from: self.name(),
workers: vec![],
};
let _ = stream.write_json_packet(&msg);
ActorMessageStatus::Processed
},
_ => ActorMessageStatus::Ignored,
})
}
@@ -255,61 +224,69 @@ impl BrowsingContextActor {
script_sender: IpcSender<DevtoolScriptControlMsg>,
actors: &mut ActorRegistry,
) -> BrowsingContextActor {
let emulation = EmulationActor::new(actors.new_name("emulation"));
let name = actors.new_name("target");
let DevtoolsPageInfo { title, url } = page_info;
let accessibility = AccessibilityActor::new(actors.new_name("accessibility"));
let properties = (|| {
let (properties_sender, properties_receiver) = ipc::channel().ok()?;
script_sender.send(GetCssDatabase(properties_sender)).ok()?;
properties_receiver.recv().ok()
})()
.unwrap_or_default();
let css_properties = CssPropertiesActor::new(actors.new_name("css-properties"), properties);
let inspector = InspectorActor {
name: actors.new_name("inspector"),
walker: RefCell::new(None),
pageStyle: RefCell::new(None),
page_style: RefCell::new(None),
highlighter: RefCell::new(None),
script_chan: script_sender.clone(),
browsing_context: name.clone(),
};
let timeline =
TimelineActor::new(actors.new_name("timeline"), pipeline, script_sender.clone());
let reflow = ReflowActor::new(actors.new_name("reflow"));
let profiler = ProfilerActor::new(actors.new_name("profiler"));
let performance = PerformanceActor::new(actors.new_name("performance"));
// the strange switch between styleSheets and stylesheets is due
// to an inconsistency in devtools. See Bug #1498893 in bugzilla
let styleSheets = StyleSheetsActor::new(actors.new_name("stylesheets"));
let thread = ThreadActor::new(actors.new_name("context"));
let DevtoolsPageInfo { title, url } = page_info;
let style_sheets = StyleSheetsActor::new(actors.new_name("stylesheets"));
let tabdesc = TabDescriptorActor::new(actors, name.clone());
let thread = ThreadActor::new(actors.new_name("thread"));
let watcher = WatcherActor::new(
actors,
name.clone(),
SessionContext::new(SessionContextType::BrowserElement),
);
let target = BrowsingContextActor {
name: name,
name,
script_chan: script_sender,
title: RefCell::new(String::from(title)),
title: RefCell::new(title),
url: RefCell::new(url.into_string()),
console: console,
_emulation: emulation.name(),
_inspector: inspector.name(),
_timeline: timeline.name(),
_profiler: profiler.name(),
_performance: performance.name(),
_styleSheets: styleSheets.name(),
active_pipeline: Cell::new(pipeline),
browsing_context_id: id,
accessibility: accessibility.name(),
console,
css_properties: css_properties.name(),
inspector: inspector.name(),
reflow: reflow.name(),
streams: RefCell::new(HashMap::new()),
style_sheets: style_sheets.name(),
_tab: tabdesc.name(),
thread: thread.name(),
streams: RefCell::new(HashMap::new()),
browsing_context_id: id,
active_pipeline: Cell::new(pipeline),
watcher: watcher.name(),
};
actors.register(Box::new(emulation));
actors.register(Box::new(accessibility));
actors.register(Box::new(css_properties));
actors.register(Box::new(inspector));
actors.register(Box::new(timeline));
actors.register(Box::new(profiler));
actors.register(Box::new(performance));
actors.register(Box::new(styleSheets));
actors.register(Box::new(thread));
actors.register(Box::new(reflow));
actors.register(Box::new(style_sheets));
actors.register(Box::new(tabdesc));
actors.register(Box::new(thread));
actors.register(Box::new(watcher));
target
}
@@ -318,21 +295,27 @@ impl BrowsingContextActor {
BrowsingContextActorMsg {
actor: self.name(),
traits: BrowsingContextTraits {
isBrowsingContext: true,
is_browsing_context: true,
frames: true,
log_in_page: false,
navigation: true,
supports_top_level_target_flag: true,
watchpoints: true,
},
title: self.title.borrow().clone(),
url: self.url.borrow().clone(),
//FIXME: shouldn't ignore pipeline namespace field
browsingContextId: self.browsing_context_id.index.0.get(),
browsing_context_id: self.browsing_context_id.index.0.get(),
//FIXME: shouldn't ignore pipeline namespace field
outerWindowID: self.active_pipeline.get().index.0.get(),
consoleActor: self.console.clone(),
/*emulationActor: self.emulation.clone(),
inspectorActor: self.inspector.clone(),
timelineActor: self.timeline.clone(),
profilerActor: self.profiler.clone(),
performanceActor: self.performance.clone(),
styleSheetsActor: self.styleSheets.clone(),*/
outer_window_id: self.active_pipeline.get().index.0.get(),
is_top_level_target: true,
accessibility_actor: self.accessibility.clone(),
console_actor: self.console.clone(),
css_properties_actor: self.css_properties.clone(),
inspector_actor: self.inspector.clone(),
reflow_actor: self.reflow.clone(),
style_sheets_actor: self.style_sheets.clone(),
thread_actor: self.thread.clone(),
}
}
@@ -346,20 +329,21 @@ impl BrowsingContextActor {
if let Some(p) = pipeline {
self.active_pipeline.set(p);
}
*self.url.borrow_mut() = url.as_str().to_owned();
url.as_str().clone_into(&mut self.url.borrow_mut());
if let Some(ref t) = title {
*self.title.borrow_mut() = t.clone();
self.title.borrow_mut().clone_from(t);
}
let msg = TabNavigated {
from: self.name(),
type_: "tabNavigated".to_owned(),
url: url.as_str().to_owned(),
title: title,
nativeConsoleAPI: true,
title,
native_console_api: true,
state: state.to_owned(),
isFrameSwitching: false,
is_frame_switching: false,
};
for stream in self.streams.borrow_mut().values_mut() {
let _ = stream.write_json_packet(&msg);
}
@@ -371,16 +355,70 @@ impl BrowsingContextActor {
}
*self.title.borrow_mut() = title;
}
}
#[derive(Serialize)]
struct TabNavigated {
from: String,
#[serde(rename = "type")]
type_: String,
url: String,
title: Option<String>,
nativeConsoleAPI: bool,
state: String,
isFrameSwitching: bool,
pub(crate) fn frame_update(&self, stream: &mut TcpStream) {
let _ = stream.write_json_packet(&FrameUpdateReply {
from: self.name(),
type_: "frameUpdate".into(),
frames: vec![FrameUpdateMsg {
id: self.browsing_context_id.index.0.get(),
is_top_level: true,
title: self.title.borrow().clone(),
url: self.url.borrow().clone(),
}],
});
}
pub(crate) fn document_event(&self, stream: &mut TcpStream) {
// TODO: This is a hacky way of sending the 3 messages
// Figure out if there needs work to be done here, ensure the page is loaded
for &name in ["dom-loading", "dom-interactive", "dom-complete"].iter() {
let _ = stream.write_json_packet(&ResourceAvailableReply {
from: self.name(),
type_: "resource-available-form".into(),
resources: vec![ResourceAvailableMsg {
has_native_console_api: Some(true),
name: name.into(),
new_uri: None,
resource_type: "document-event".into(),
time: SystemTime::now()
.duration_since(UNIX_EPOCH)
.unwrap_or_default()
.as_millis() as u64,
title: Some(self.title.borrow().clone()),
url: Some(self.url.borrow().clone()),
}],
});
}
}
pub(crate) fn console_message(&self, message: ConsoleLog) {
let msg = ConsoleMsg {
from: self.name(),
type_: "resource-available-form".into(),
resources: vec![ConsoleMessageResource {
message,
resource_type: "console-message".into(),
}],
};
for stream in self.streams.borrow_mut().values_mut() {
let _ = stream.write_json_packet(&msg);
}
}
pub(crate) fn page_error(&self, page_error: PageError) {
let msg = PageErrorMsg {
from: self.name(),
type_: "resource-available-form".into(),
resources: vec![PageErrorResource {
page_error,
resource_type: "error-message".into(),
}],
};
for stream in self.streams.borrow_mut().values_mut() {
let _ = stream.write_json_packet(&msg);
}
}
}

Some files were not shown because too many files have changed in this diff Show More