Commit graph

49043 commits

Author SHA1 Message Date
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