Commit graph

309 commits

Author SHA1 Message Date
Tony
5a76906d64
Allow setting userscripts directly without the need of files (#35388)
* Allow settings userscripts through preferences

Signed-off-by: Tony <legendmastertony@gmail.com>

* mach fmt instead of cargo fmt

Signed-off-by: Tony <legendmastertony@gmail.com>

* Fix pref loading not working for array values

Signed-off-by: Tony <legendmastertony@gmail.com>

* Use pref! in userscripts instead

Signed-off-by: Tony <legendmastertony@gmail.com>

* Implement the model jdm suggested
- Remove userscripts from all places and move it to servoshell
- Add in `UserContentManager` struct and passing it through `Servo::new`
all the way down to script thread

Signed-off-by: Tony <legendmastertony@gmail.com>

* Apply suggestions from code review and format

Signed-off-by: Tony <legendmastertony@gmail.com>

* Revert unrelated change

Signed-off-by: Tony <legendmastertony@gmail.com>

---------

Signed-off-by: Tony <legendmastertony@gmail.com>
Signed-off-by: Tony <68118705+Legend-Master@users.noreply.github.com>
2025-03-27 03:00:08 +00:00
Isaac Marovitz
ed995e61a6
servoshell: Use sRGB colorspace on macOS (#35683)
* servoshell: Use sRGB colorspace on macOS

Signed-off-by: Isaac Marovitz <isaacryu@icloud.com>

* Make lint happy

Signed-off-by: Isaac Marovitz <isaacryu@icloud.com>

* Address review

Signed-off-by: Isaac Marovitz <isaacryu@icloud.com>

* Move to helper function

Signed-off-by: Isaac Marovitz <isaacryu@icloud.com>

* Rebase Cargo.lock

Signed-off-by: Isaac Marovitz <isaacryu@icloud.com>

* Fix build

Signed-off-by: Isaac Marovitz <isaacryu@icloud.com>

* Fix build (again)

Signed-off-by: Isaac Marovitz <isaacryu@icloud.com>

---------

Signed-off-by: Isaac Marovitz <isaacryu@icloud.com>
2025-03-24 23:59:27 +00:00
Manuel Rego
8f79b77c13
Add --enable-experimental-web-platform-features command line (#36022)
This command line argument will enable a set of web platform features
that are under development but not ready to be enabled by default.

Signed-off-by: Manuel Rego Casasnovas <rego@igalia.com>
Co-authored-by: Oriol Brufau <obrufau@igalia.com>
2025-03-19 12:18:36 +00:00
Sebastian C
99d4baa533
bugfix: servoshell: prevent 0 pixel dimensions for render area (#35967)
Signed-off-by: Sebastian C <sebsebmc@gmail.com>
2025-03-18 18:59:16 +00:00
Euclid Ye
86957be5f0
Create config_dir if none exist for caching (#35761)
* Create config_dir if none exist for caching

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>

* remove specialized behaviour for ohos; copy prefs.json if necessary

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>

* downgrade the log to trace verbosity

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>

* update wpt-test

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-03-18 18:36:33 +00:00
DK Liao
bcdd34e2aa
chore: Move unsafe operations in unsafe functions to unsafe blocks (#36017)
Signed-off-by: DK Liao <dklassic@gmail.com>
2025-03-18 06:19:35 +00:00
Simon Wülker
bb0d08432e
Migrate to the 2024 edition (#35755)
* Migrate to 2024 edition

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

* Allow unsafe_op_in_unsafe_fn lint

This lint warns by default in the 2024
edition, but is *way* too noisy for servo.

We might enable it in the future, but not now.

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

* Compile using the 2024 edition

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

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-03-13 10:28:11 +00:00
Oriol Brufau
7594dc6991
Remove legacy layout (layout 2013) (#35943)
We were already not compiling it and not running tests on it by default.
So it's simpler to just completely remove it.

Signed-off-by: Oriol Brufau <obrufau@igalia.com>
2025-03-13 07:26:57 +00:00
Jonathan Schwender
f7ddac249b
ohos: Remove direct link to ace_napi.z (#35921)
The underlying issue was solved in napi-ohos 1.0.2,
and we have already updated to 1.0.4

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2025-03-11 19:34:32 +00:00
chickenleaf
52119c339c
servoshell: Allow keyboard interaction with dialogs (enter / escape) (#35673)
Signed-off-by: L Ashwin B <lashwinib@gmail.com>
2025-03-10 14:32:39 +00:00
Kafji
34047f8da8
Allow domain-like as URL location input (#35756)
* Allow domain-like as URL location input

Before this patch, domain with subdomain (e.g. book.servo.org) won't be
treated as URL location.

This patch retifies that by adding Firefox's location bar behavior:

  - book.servo.org is URL location
  - book.servo.org. is URL location
  - .book.servo.org is not URL location

Fixes #35754.

Signed-off-by: Kafji <k@kafji.net>

* Chain location input interpretation attempts

Signed-off-by: Kafji <k@kafji.net>

---------

Signed-off-by: Kafji <k@kafji.net>
2025-03-10 03:24:48 +00:00
webbeef
aa76847502
Remove obsolete memory profiler console output (#35861)
Signed-off-by: webbeef <me@webbeef.org>
2025-03-08 02:41:08 +00:00
dependabot[bot]
db1c23569b
build(deps): bump egui_glow in the egui-related group (#35838)
Bumps the egui-related group with 1 update: [egui_glow](https://github.com/emilk/egui).


Updates `egui_glow` from 0.31.0 to 0.31.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.31.0...0.31.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>
2025-03-07 13:49:02 +00:00
dependabot[bot]
18668e3042
build(deps): bump android_logger from 0.14.1 to 0.15.0 (#35840)
Bumps [android_logger](https://github.com/rust-mobile/android_logger-rs) from 0.14.1 to 0.15.0.
- [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/compare/0.14.1...v0.15.0)

---
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>
2025-03-07 13:49:00 +00:00
webbeef
139774e6b5
Add an about:memory page (#35728)
This patch exposes a servo internal DOM API that is only made available to about:
pages on the navigator object to request memory reports. The about:memory page itself is
loaded like other html resources (eg. bad cert, net error) and makes use of this new API.

On the implementation side, notable changes:
- components/script/routed_promise.rs abstracts the setup used to fulfill a promise when the
  work needs to be routed through the constellation. The goal is to migrate other similar
  promise APIs in followup (eg. dom/webgpu/gpu.rs, bluetooth.rs).
- a new message is added to request a report from the memory reporter, and the memory reporter
  creates a json representation of the set of memory reports.
- the post-processing of memory reports is done in Javascript in the about-memory.html page,
  providing the same results as the current Rust code that outputs to stdout. We can decide
  later if we want to remove the current output.

Signed-off-by: webbeef <me@webbeef.org>
2025-03-07 05:25:08 +00:00
dependabot[bot]
621f8eb22d
build(deps): bump the egui-related group with 5 updates (#35810)
Bumps the egui-related group with 5 updates:

| Package | From | To |
| --- | --- | --- |
| [egui](https://github.com/emilk/egui) | `0.31.0` | `0.31.1` |
| [egui-winit](https://github.com/emilk/egui) | `0.31.0` | `0.31.1` |
| [ecolor](https://github.com/emilk/egui) | `0.31.0` | `0.31.1` |
| [emath](https://github.com/emilk/egui) | `0.31.0` | `0.31.1` |
| [epaint](https://github.com/emilk/egui) | `0.31.0` | `0.31.1` |


Updates `egui` from 0.31.0 to 0.31.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.31.0...0.31.1)

Updates `egui-winit` from 0.31.0 to 0.31.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.31.0...0.31.1)

Updates `ecolor` from 0.31.0 to 0.31.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.31.0...0.31.1)

Updates `emath` from 0.31.0 to 0.31.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.31.0...0.31.1)

Updates `epaint` from 0.31.0 to 0.31.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.31.0...0.31.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
- dependency-name: ecolor
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: egui-related
- dependency-name: emath
  dependency-type: indirect
  update-type: version-update:semver-patch
  dependency-group: egui-related
- dependency-name: epaint
  dependency-type: indirect
  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>
2025-03-06 17:34:12 +00:00
Jonathan Schwender
ce9566c5fe
servoshell: Minor fixes to cli help. (#35794)
Fixes the `--pref` enable hint to use `_` instead of dots.
Remove `--prefs-file` from the hint, since the hint is placed
directly after the long option. (The help line displayed as
`--prefs-file --prefs-file /path/to/prefs.json` before).

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2025-03-04 20:13:07 +00:00
Simon Wülker
3d320fa96a
Update rustfmt to the 2024 style edition (#35764)
* Use 2024 style edition

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

* Reformat all code

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

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-03-03 11:26:53 +00:00
Martin Robinson
6300e820b4
servoshell: Rename Minibrowser::is_in_browser_rect to Minibrowser::is_in_egui_toolbar_rect (#35717)
"browser rect" is a bit of a misnomer as the browser is the entire
window, but this function is trying to determine if a point is on the
non-WebView toolbar portion of the GUI.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-03-03 11:19:50 +00:00
webbeef
27970e1847
Set a valid default value for the --userscripts command line option (#35740)
This prevents a crash when not specifying the path and matches the help message for that option.

Signed-off-by: webbeef <me@webbeef.org>
2025-03-02 07:14:18 +00:00
Narfinger
5fa014d389
servoshell: Read prefs.json from bundle on OHOS (#35581)
* Allows to read the prefs.json from the hap bundle on OHOS.

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>

* incorporate suggestions

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>

* incoroporate requested changes

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>

---------

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
2025-03-01 10:53:35 +00:00
Martin Robinson
06d4272462
libservo: Stop double-buffering OffscreenRenderingContext (#35638)
The `OffscreenRenderingContext` does not need to be double-buffered.
Instead, when resizing the framebuffer, create a new one and blit the
old contents onto the new surface. This allows immediately displaying
the contents without having to render paint the WebRender scene one more
time. In addition to speeding up the rendering pipeline, the goal here
is to reduce flickering during resizes (though there is more work to
do).

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-02-28 11:41:56 +00:00
chickenleaf
0065e63190
Remove tinyfiledialogs dependency (#35674)
Signed-off-by: L Ashwin B <lashwinib@gmail.com>
2025-02-27 20:02:58 +00:00
Xiaocheng Hu
11f54b9f23
layout: Implement a non-recursive version of CSS quotes (#34770)
* Squash and don't explicitly use noto-cjk in tests

Signed-off-by: Xiaocheng Hu <xiaochengh.work@gmail.com>

* Mark quotes-034.html.ini failure

Signed-off-by: Xiaocheng Hu <xiaochengh.work@gmail.com>

* Address review comments

Signed-off-by: Xiaocheng Hu <xiaochengh.work@gmail.com>

---------

Signed-off-by: Xiaocheng Hu <xiaochengh.work@gmail.com>
2025-02-27 16:00:21 +00:00
Delan Azabani
276f6a3ba7
libservo: Clean up interfaces for alert()/confirm()/prompt() (#35579)
Signed-off-by: Delan Azabani <dazabani@igalia.com>
2025-02-27 02:49:08 +00:00
Martin Robinson
9d5171f3c5
libservo: Add WebView immediately to the Compositor (#35662)
When creating a `WebView`, let the Compositor know synchronously that
it exists. This allows the embedder to immediately call methods like
`WebView::focus()`. In addition remove messages associated with the
`WebViewDelegate::notify_ready_to_show()` method (and the method
itself), as now `WebView`s can be shown immediately.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-02-26 16:16:48 +00:00
Josh Matthews
de66f72197
Allow webdriver screenshots to occur immediately upon request. (#35677)
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-02-26 15:45:19 +00:00
chickenleaf
56fbfc9d27
Blocks all background webview interactions when a dialog is open (#35671)
Signed-off-by: L Ashwin B <lashwinib@gmail.com>
2025-02-26 11:18:51 +00:00
chickenleaf
e956f0c5af
servoshell: Port SelectDevice dialog code to use egui instead of tinyfiledialogs (#35657)
Signed-off-by: L Ashwin B <lashwinib@gmail.com>
2025-02-26 09:59:47 +00:00
Martin Robinson
23524a5413
libservo: Move size handling to RenderContext from WindowMethods (#35621)
This is the first step toward removing `WindowMethods`, which will
gradually be integrated into the `WebView` and `WebViewDelegate`. Sizing
of the `WebView` is now handled by the a size associated with a
`RenderingContext`. `WebView`s will eventually just paint the entire
size of their `RenderingContext`. Notes:

- This is transitionary step so now there is a `WebView::resize` and a
  `WebView::move_resize`. The first is the future which will resize the
  `WebView` and its associated `RenderingContext`. The second is a
  function that the virtual `WebView`s that will soon be replaced by a
  the one-`WebView` per `WebView` model.
- We do not need to call `WebView::move_resize` at as much any longer
  because the default size of the `WebView` is to take up the whole
  `RenderingContext`.
- `SurfmanRenderingContext` is no longer exposed in the API, as a
  surfman context doesn't naturally have a size unless a surface is
  bound to it.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-02-25 15:03:53 +00:00
Martin Robinson
c844ed232a
servoshell: Fall back to PNG format when outputting an image (#35648)
A recent change, #35538 added the ability to dump different output image
formats. Unfortunately, this necessitated adding a file extension to the
output image for WPT tests. This had two problems:

1. The original change never landed properly in WPT for unknown reasons.
2. It interfered with the way that temporary files were cleaned up
   during WPT runs.

This change modifies the image dumping code to fall back to PNG format
when there is no valid file extension on the output image and reverts
the change made to the WPT runner.

Fixes #35635.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-02-25 08:38:28 +00:00
DK Liao
3f6b21d8e1
feat: support IME cursor area (#35623)
* feat: support IME cursor area

Signed-off-by: DK Liao <dklassic@gmail.com>

* use winit::dpi  for LogicalPosition instead

Signed-off-by: DK Liao <dklassic@gmail.com>

* perform ./mach fmt

Signed-off-by: DK Liao <dklassic@gmail.com>

---------

Signed-off-by: DK Liao <dklassic@gmail.com>
2025-02-25 08:19:00 +00:00
Bi Fuguo
f3a8bf8ca2
Touch handler: Fix race condition and rate-limit move events (#35537)
* TouchSequenceInfo is added to store information about a touch sequence.
  For details about TouchSequenceInfo, see the code comments.
The handling_touch_move attribute is added to the TouchHandler, indicating that the script is processing the touch move event.
  When handling_touch_move is set to true, the touch move event does not need to be sent to the script thread.

Signed-off-by: kongbai1996 <1782765876@qq.com>

* move touch state, active_touch_point and handling_touch_move to TouchSequenceInfo form TouchHandler.
remove TouchSequenceInfo end_sequence property, add Finished state mark sequence end.
if preventDefault on touchup, do not prevent Fling.

Signed-off-by: kongbai1996 <1782765876@qq.com>

* Refactor Touchhandler

- Add a newtype wrapper for the TouchSequenceId
- Move more state back into the TouchSequenceState
- Rename TouchAction to TouchMoveAction,
  since it only covers immediate actions now.
  Everything else is handled via state, since
  it needs to wait on the handler.

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>

* Fix test-tidy

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>

* Fix clippy missing-default lint

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>

* Fix remaining clippy lints

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>

* Remove accidental committed test file

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>

* Remove wrong todo comment

(move events that are sent to script are just raw  touchpoints,
 no merging needed)

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>

* Fix preventdefault after long touch_down handler

Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>

---------

Signed-off-by: kongbai1996 <1782765876@qq.com>
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Co-authored-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2025-02-25 07:13:16 +00:00
Simon Wülker
be6765447d
Update to rust 1.85 (#35628)
* Update to rust 1.85

This is needed for cargo-deny

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

* Upgrade crown

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

* Clippy fixes

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

* Re-upgrade cargo-deny to 0.18

Keeping it locked to 0.18 just in case they
update their required rustc version again

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

---------

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
2025-02-24 17:44:35 +00:00
Yerkebulan Tulibergenov
4d1e9f19b5
chore: silence unused import warning in app_state.rs (#35612)
Signed-off-by: Yerkebulan Tulibergenov <yerkebulan@gmail.com>
2025-02-23 00:33:29 +00:00
chickenleaf
f6e2e3d418
servoshell: Port Permission dialog code to use egui instead of tinyfiledialogs (#35577)
Signed-off-by: L Ashwin B <lashwinib@gmail.com>
2025-02-21 14:28:55 +00:00
Jason Tsai
9c8a47e993
fix(servoshell): blank view when close non focused tab (#35569)
Signed-off-by: Jason Tsai <git@pews.dev>
2025-02-21 06:10:13 +00:00
Martin Robinson
54b5c7b632
compositing: Move image output and shutdown management out of the compositor (#35538)
This is a step toward the renderer-per-WebView goal. It moves various
details out of `IOCompositor`.

- Image output: This is moved to servoshell as now applications can
  access the image contents of a `WebView` via
  `RenderingContext::read_to_image`. Most options for this are moved to
  `ServoShellPreferences` apart from `wait_for_stable_image` as this
  requires a specific kind of coordination in the `ScriptThread` that is
  also very expensive. Instead, paint is now simply delayed until a
  stable image is reached and `WebView::paint()` returns a boolean.
  Maybe this can be revisited in the future.
- Shutdown: Shutdown is now managed by libservo itself. Shutdown state
  is shared between the compositor and `Servo` instance. In the future,
  this sharing might be unecessary.
- `CompositeTarget` has been removed entirely. This no longer needs to
   be passed when creating a Servo instance.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Ngo Iok Ui (Wu Yu Wei) <yuweiwu@pm.me>
2025-02-20 18:27:49 +00:00
Martin Robinson
5465bfc2af
libservo: Move GL acclerated media setup out of RenderingContext and simplify it (#35553)
This moves the GL accelerated media setup out of `RenderingContext`
which prevents making libservo dependo on the Wayland and X11 versions
of surfman explicitly. This support is experimental and (honestly) a bit
broken. I've confirmed that this works as well as it did before the
change.

The main thing here is that the configuration, which currently needs
surfman types, moves to servoshell. In addition:

1. Instead of passing the information to the Constellation, the setup is
   stored statically. This is necessary to avoid introducing a
   dependency on `media` in `webrender_traits`. It's quite likely that
   `media` types should move to the internal embedding API to avoid
   this. This is preserved for a followup change.
2. The whole system of wrapping the media channels in an abstract type
   is removed. They could be either mpsc channels or IPC channels. This
   was never going to work because mpsc channels cannot be serialized
   and deserialized with serde. Instead this just uses IPC channels. We
   also have other ways of doing this kind of abstraction in Servo so we
   do not need another. The `mpsc` version was hard-coded to be
   disabled.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-02-20 13:52:18 +00:00
DK Liao
7831bced76
chore: cleanup IME code for Servoshell (#35546)
Signed-off-by: DK Liao <dklassic@gmail.com>
2025-02-20 05:33:50 +00:00
chickenleaf
b0561c78c7
servoshell: Port Authentication dialog code to use egui intead of tinyfiledialogs (#35507)
Signed-off-by: L Ashwin B <lashwinib@gmail.com>
2025-02-19 13:42:48 +00:00
DK Liao
720bc725b0
feat: support pre-edit text display for IME (#35535)
* feat: support pre-edit text display for IME

Signed-off-by: DK Liao <dklassic@gmail.com>

* enable ime by show_ime

Signed-off-by: DK Liao <dklassic@gmail.com>

---------

Signed-off-by: DK Liao <dklassic@gmail.com>
2025-02-19 11:22:57 +00:00
Martin Robinson
e5c9a0365d
libservo: Rework and clarify the rendering model of the WebView (#35522)
Make the rendering model of the `WebView` clearer:

1. `WebViewDelegate::notify_new_frame_ready()` indicates that the
   WebView has become dirty and needs to be repainted.
2. `WebView::paint()` asks Servo to paint the contents of the `WebView`
   into the `RenderingContext`.
3. `RenderingContext::present()` does a buffer swap if the
   `RenderingContext` is actually double-buffered.

This is documented and all in-tree embedders are updated to work with
this new model.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Ngo Iok Ui (Wu Yu Wei) <yuweiwu@pm.me>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2025-02-19 10:35:56 +00:00
Martin Robinson
f34f2d9d0a
libservo: Expose SoftwareRenderingContext and WindowRenderingContext (#35501)
Expose two easy-to-use wrappers around `SurfmanRenderingContext` that
make the API simpler to use:

- `WindowRenderingContext`: This `RenderingContext` is a newtype around
  `SurfmanRenderingContext` takes a `raw-window-handle` display and window
  and creates a full window rendering context.
- `SoftwareRenderingContext`: is wraps `SurfmanRenderingContext` and
  adds a swap chain in order to expose a software GL rendering context.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-02-18 14:50:41 +00:00
Josh Matthews
1d606bb85c
Make WebBluetooth an optional feature. (#35479)
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-02-18 04:13:43 +00:00
Bi Fuguo
3fe42a0b5a
implement Touchevent prevent default behavior (#35031)
* implement Touchevent prevent default behavior

* The status change logic of the `TouchHandler` is changed.
> The `WaitingForScript` state is canceled. TouchAction can be identified
  based on the current touch type and numbers if touch points.
* Sends current event to script thread along with recognized `TouchAction`.
> After dispatch event, script thread sends a `TouchEventProcess(EventResult)`
  message to main thread. If the event is set to `DefaultAllowed`, the
  corresponding `TouchAction` information is added.
* After receiving `DefaultAllowed(TouchAction)` message, main thread executes corresponding action.
> `DefaultPrevented(TouchEventType)` is received. Use `prevent_click` to mark
  that the default `Click` is blocked, and `prevent_move` to mark that the
  default `Scroll` and `Zoom` are blocked. In this way, all TouchActions
  implement preventDefault.
Signed-off-by: Bi Fuguo <1782765876@qq.com>

* fix some suggestions

* support preventDefault fling
* move `TouchAction` to share touch directory
* check preventDefault everytime when touch
* fix zoom ineffective

Signed-off-by: Bi Fuguo <1782765876@qq.com>

* fix some suggestions

rename on_event_processed to  on_touch_event_processed
clear unused features

Signed-off-by: Bi Fuguo <1782765876@qq.com>

* Optimizes pan performance by continuously sliding without waiting for the eventhandler.

Signed-off-by: kongbai1996 <1782765876@qq.com>

* resolve conflict

Signed-off-by: kongbai1996 <1782765876@qq.com>

---------

Signed-off-by: Bi Fuguo <1782765876@qq.com>
Signed-off-by: kongbai1996 <1782765876@qq.com>
2025-02-17 10:50:04 +00:00
Martin Robinson
6dce329acc
libservo: Expose an OffscreenRenderingContext and use it for servoshell (#35465)
Create a new `RenderingContext` which is used to render to a
`SurfmanRenderingContext`-related offscreen buffer. This allows having a
temporary place to render Servo and then blitting the results to a
subsection of the parent `RenderingContext`.

The goal with this change is to remove the details of how servoshell
renders from the `Compositor` and prepare for the compositor-per-WebView
world.


Co-authred-by: Ngo Iok Ui (Wu Yu Wei) <yuweiwu@pm.me>

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2025-02-17 08:35:05 +00:00
Martin Robinson
a17b2e0cb2
servoshell: Actually set the Servo delegate in servoshell (#35502)
This was implemented, but unset.

Fixes #35481.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2025-02-16 23:13:19 +00:00
chickenleaf
32c13bcb1e
servoshell: Port input dialog code to use egui intead of tinyfiledialogs (#35464)
Signed-off-by: L Ashwin B <lashwinib@gmail.com>
2025-02-14 15:02:39 +00:00
Mukilan Thiyagarajan
c95bd9d052
libservo: change 'request_fullscreen_state_change' API to a notification (#35445)
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2025-02-13 09:04:41 +00:00