Commit graph

4028 commits

Author SHA1 Message Date
Samson
c0bee7cb86
Format toml files (#30112)
* Add taplo fmt config for toml fmt

* fmt toml files

* Add even-better-toml to extensions recommendations
2023-08-17 15:07:43 +00:00
Atbrakhi
2f3a956821
Add missing EmbedderMsg::ReadyToPresent (#30109) 2023-08-16 16:36:45 +00:00
Delan Azabani
2778beeb7a
winit: initial minibrowser (#29976)
* winit: add minibrowser feature that depends on egui{,-winit}

* winit: carve out some space at the top of headed windows

* winit: minimal toolbar and egui/winit integration (but no painting)

* winit: try to paint with egui_glow (doesn’t work yet)

* winit: add comment about toolbar size

* Add framebuffer object, set it as glow's target

* compositing: clear only the viewport, not the whole framebuffer

* plumb the actual size of the egui toolbar to webrender

* fix formatting

* winit: fix crash when fbo is zero

* winit: don’t bother binding the framebuffer object

* winit: remove unsafe and get toolbar_height

* winit: location field should reflect the current top-level url

* [NFC] winit: move Minibrowser out of App::run

* winit: clean up toolbar height code

* winit: make App own the Minibrowser if any

* winit: make the go button work

* winit:make the location field reflect the current top-level url

* winit: allow enabling minibrowser from command line

* winit: tell compositor to repaint WR and flush when we repaint

* winit: fix bug where location field edits would get overridden

* winit: borrow the minibrowser once in App::handle_events

* winit: address todo about viewport origin coordinates

* winit: fix some minor problems with comments and errors

* winit: update location field once per HistoryChanged event

* winit: rename Window::set_toolbar_size to set_toolbar_height

* winit: take toolbar height into account in hit testing

* winit: pass egui only relevant CursorMoved events

* winit: scratch that, coalesce minibrowser updates instead

* ensure both minibrowser and WR are repainted on every frame

* compositing: only skip framebuffer clear in external present mode

* winit: destroy egui glow Painter when shutting down

* winit: clean up and fix license lint

* fix duplicate versions lint by downgrading bytemuck_derive

was egui_glow ^0.22.0 (0.22.0)
→ egui/bytemuck ^0.22.0 (0.22.0)
→ epaint/bytemuck ^0.22.0 (0.22.0)
→ bytemuck ^1.7.2 (1.13.1)
→ bytemuck_derive ^1.4 (1.4.1)
→ syn ^2.0.1 (2.0.28)

now lock has bytemuck_derive 1.4.0
→ syn ^1.0.99 (1.0.103)

* fix duplicate versions lint by disabling egui-winit/links

(we don’t need support for hyperlinks in our use of egui)

* squelch duplicate versions lint by excluding clipboard-win

* winit: fix compile warnings

* winit: make gleam an optional dependency under /minibrowser

* winit: remove cargo feature, since it’s not really optional

* winit: extract Minibrowser and related code to separate module

* winit: remove unnecessary trailing comma

* winit: simplify the ServoUrl serialisation optimisation

---------

Co-authored-by: atbrakhi <atbrakhi@igalia.com>
2023-08-15 08:08:50 +00:00
Martin Robinson
78c7011240
Make native-bluetooth a default feature (#30097)
This features is turned on unconditionally by `./mach build`.
2023-08-14 14:44:47 +00:00
Martin Robinson
c46631a1ce
Remove dependency on surfman-chains (#30090)
This functionality is now part of surfman itself.
2023-08-11 14:24:10 +00:00
Martin Robinson
170cd44fa4
Clean up some unused code after switching to rustls (#30081)
The SSL certificate resource is no longer used as these certificates are
loaded via the webpki-roots crate.
2023-08-09 01:02:02 +00:00
Ngo Iok Ui (Wu Yu Wei)
3fea90a231
Use raw handles to create surfman context instead (#29871) 2023-08-03 10:54:30 +00:00
Martin Robinson
f3c7db7d0f
Set the MacOS rpath in the build script (#30054)
Use the build script to set the rpath in MacOS instead of mach. This is
another step toward allowing building servo without mach.
2023-08-01 14:46:28 +00:00
Martin Robinson
2ecdb8f45e
Embed git hash using vergen instead of mach (#30030)
Embed the git hash into the servo binary using vergen instead of using
custom Python code in mach. The benefit here is ones less difference
between a normal cargo run and building via mach in addition to removing
a bunch of code.
2023-07-28 05:03:06 +00:00
Delan Azabani
dfeced5a8e
[NFC] winit: document event handling and improve naming (#30016)
* compositing: rename WindowEvent to EmbedderEvent

* winit: rename winit_event_to_{servo → embedder}_event

* winit: rename ServoEvent::Awakened to WakerEvent

* winit: document App::handle_events and rename locals

* servo: rename Servo.embedder_events to messages_for_embedder

* winit: rustdoc link to EmbedderEvent

* winit: use new name queue_embedder_events_for_winit_event
2023-07-24 05:30:18 +00:00
Martin Robinson
d31cdb682f
Make the choice of layout runtime setting
Co-authored-by: Samson <16504129+sagudev@users.noreply.github.com>
2023-07-06 14:49:24 +02:00
Martin Robinson
c58d74fe62
Remove UWP / Hololens support 2023-07-05 09:12:09 +02:00
bors-servo
ed72efa154
Auto merge of #29956 - mrobinson:update-mozangle, r=jdm
Update mozangle

This should allow servo to take advantage of faster compilation times on Windows.

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

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
2023-07-02 02:23:26 +02:00
Martin Robinson
96eeb5865c Update mozangle
This should allow servo to take advantage of faster compilation speeds
on Windows.
2023-07-01 18:41:54 +02:00
Martin Robinson
e681e2b3f3 Set the Windows subsystem using a rust directive
This is one less thing that mach has to do now.
2023-07-01 15:04:26 +02:00
michaelgrigoryan25
f0690ec7c1 Remove ports/libmlservo 2023-05-22 19:31:08 +04:00
michaelgrigoryan25
545c8a0ded Undo deletion of ports/libmlservo/Cargo.toml 2023-05-22 19:20:28 +04:00
michaelgrigoryan25
05e1e0ea9e Merge branch 'master' into issue#29773 2023-05-22 19:05:25 +04:00
michaelgrigoryan25
72085994b0 Remove ports/libmlservo 2023-05-22 16:06:31 +04:00
michaelgrigoryan25
644a6089b3 Fix: Invalid fields in libservo InitOptions 2023-05-22 11:59:37 +04:00
Michael Grigoryan
a1e9f55bba
Update ports/winit/headed_window.rs
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
2023-05-21 09:49:51 +04:00
michaelgrigoryan25
b3ce330398 Fix: Fixed a namespacing error 2023-05-21 00:18:46 +04:00
michaelgrigoryan25
93819dc542 Patch: Applied code patches for clippy warnings 2023-05-19 08:01:38 +04:00
Martin Robinson
2f4c47bfe7 Start the transition to workspace dependencies
This will ultimately make it simpler to update crate dependencies and
reduce duplicate when specifying requirements. Generally, this change
does not touch dependencies that are only used by a single crate. We
could consider moving them to workspace dependencies in the future.
2023-05-17 11:59:35 +02:00
sagudev
dffb75a4c6 cargo-fix for 2021 2023-05-07 15:45:56 +02:00
dependabot[bot]
a6b6b7cb41
Bump winit from 0.28.2 to 0.28.3
Bumps [winit](https://github.com/rust-windowing/winit) from 0.28.2 to 0.28.3.
- [Release notes](https://github.com/rust-windowing/winit/releases)
- [Changelog](https://github.com/rust-windowing/winit/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-windowing/winit/compare/v0.28.2...v0.28.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-17 17:28:00 +00:00
dependabot[bot]
6cf8013b93
Bump winit from 0.28.1 to 0.28.2
Bumps [winit](https://github.com/rust-windowing/winit) from 0.28.1 to 0.28.2.
- [Release notes](https://github.com/rust-windowing/winit/releases)
- [Changelog](https://github.com/rust-windowing/winit/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-windowing/winit/compare/v0.28.1...v0.28.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-07 11:06:10 +00:00
bors-servo
05c431f626
Auto merge of #29443 - delan:fix-thread-crash-output, r=jdm
Improve winit/mach segfault output

This patch improves the output that you see when the winit port segfaults, especially when the segfault happens on a layout or script thread, by making two changes to our crash handler and one change to mach.

* we make the crash handler use stderr instead of stdout, because [std::io::stdout](https://doc.rust-lang.org/std/io/fn.stdout.html) allocates when first called, which will often cause a second segfault
* we make the crash handler reraise the signal to terminate abnormally, allowing mach to distinguish it from exiting normally with the same status code as a signal number
* we make mach print different messages for whether the process terminated by signal or exited normally

You can try this yourself by running servo with the following patch:

```diff
diff --git a/components/layout_thread/lib.rs b/components/layout_thread/lib.rs
index ac1a7fe21e..77c4c9d087 100644
--- a/components/layout_thread/lib.rs
+++ b/components/layout_thread/lib.rs
@@ -589,6 +589,7 @@ impl LayoutThread {
             rw_data: &rw_data,
             possibly_locked_rw_data: &mut possibly_locked_rw_data,
         };
+        unsafe { std::ptr::read::<usize>(std::ptr::null()); }
         while self.handle_request(&mut rw_data) {
             // Loop indefinitely.
         }
```

Before:

```
$ ./mach run -d about:blank
[should print “Stack trace for "Layout(1,1)"” here, but segfaults]
Servo exited with return value 11
```

After:

```
$ ./mach run -d about:blank
Caught signal 11 in thread "Layout(1,1)"
[should ideally print backtrace here, but segfaults]
Servo was terminated by signal 11
```

---
<!-- 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 #29442

<!-- Either: -->
- [ ] There are tests for these changes OR
- [x] These changes do not require tests because it would be impractical to test them

(r? @jdm, @SimonSapin based on git log for crash handler)
2023-02-28 15:29:50 +01:00
Delan Azabani
07c1286334 Improve winit/mach segfault output 2023-02-28 21:54:48 +08:00
Josh Matthews
a99dd55584 Ensure winit windows are cleaned up before TLS disappears. 2023-02-27 10:10:17 -05:00
Thomas Gardner
140dda9968 Bump surfman to 0.6
Update to the new release of surfman, and consume it without using the
`patches` section in Cargo.toml.
2023-02-24 19:00:57 +11:00
Josh Matthews
f64814f249 Fix macOS extensions in winit. 2023-02-21 19:15:32 +11:00
Thomas Gardner
f89602948e Bump winit to 0.28.1
This fixes the following wayland-client error:

	Attempted to dispatch unknown opcode 0 for wl_shm, aborting.
2023-02-21 19:15:32 +11:00
Martin Robinson
423cc34cb0 Bump euclid to 0.22
- Also updates raqote to latest with an upgrade of font-kit to 0.11
  applied on as a patch
- Update lyon_geom to the latest version

Major change:

- All matrices are now stored in row major order. This means that
  parameters to rotation functions no longer should be negated.
- `post_...()` functions are now named `then()`. `pre_transform()` is removed,
  so `then()` is used and the order of operations changed.
2023-01-26 08:59:21 +01:00
dependabot[bot]
0b747e8a15
Bump smallvec from 1.8.0 to 1.9.0
Bumps [smallvec](https://github.com/servo/rust-smallvec) from 1.8.0 to 1.9.0.
- [Release notes](https://github.com/servo/rust-smallvec/releases)
- [Commits](https://github.com/servo/rust-smallvec/compare/v1.8.0...v1.9.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-19 16:32:09 +00:00
dependabot[bot]
20c437878b
Bump cbindgen from 0.14.6 to 0.20.0
Bumps [cbindgen](https://github.com/eqrion/cbindgen) from 0.14.6 to 0.20.0.
- [Release notes](https://github.com/eqrion/cbindgen/releases)
- [Changelog](https://github.com/eqrion/cbindgen/blob/master/CHANGES)
- [Commits](https://github.com/eqrion/cbindgen/compare/v0.14.6...v0.20.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-06 01:45:34 +00:00
Josh Matthews
f8a44d0ad4 Remove env_logger duplicate. 2022-04-01 02:26:19 -04:00
Josh Matthews
369a5c0370 Update image/png. 2022-04-01 02:07:17 -04:00
Josh Matthews
471650ba90 Update keyboard-types. 2022-04-01 00:35:22 -04:00
s-maurice
4784564d5c move servo_version from config crate to ports/libsimpleservo/api/src/lib.rs and duplicate in ports/winit/main2.rs
Signed-off-by: s-maurice <51819025+s-maurice@users.noreply.github.com>
2022-03-06 01:43:46 +01:00
Josh Matthews
898f66bcd0 Update rustc. 2021-12-02 17:05:19 -05:00
bors-servo
9693111c97
Auto merge of #28591 - servo:jdm-patch-51, r=jdm
Update rustc to latest nightly.

None
2021-11-01 10:19:52 -04:00
Josh Matthews
01681e79c4 Update nightly rustc. 2021-11-01 08:46:18 -04:00
Josh Matthews
6b50d7025c Create initial browser id for compositor on startup. 2021-10-18 09:58:32 -04:00
yvt
41b3726271 feat: shorten thread names
The Linux kernel imposes a 15-byte limit on thread names[1]. This means
information that does not fit in this limit, e.g., the pipeline ID of
layout and script threads, is lost in a debugger and profiler (see the
first column of the table below).

This commit shortens the thread names used in Servo to maximize the
amount of information conveyed. It also rectifies some inconsistencies
in the names.

|       Before      |       After       |
|-------------------|-------------------|
| `BluetoothThread` | `Bluetooth`       |
| `CanvasThread`    | `Canvas`          |
| `display alert d` | `AlertDialog`     |
| `FontCacheThread` | `FontCache`       |
| `GLPlayerThread`  | `GLPlayer`        |
| `HTML Parser`     | `Parse:www.examp` |
| `LayoutThread Pi` | `Layout(1,1)`     |
| `Memory profiler` | `MemoryProfiler`  |
| `Memory profiler` | `MemoryProfTimer` |
| `OfflineAudioCon` | `OfflineACResolv` |
| `PullTimelineMar` | `PullTimelineDat` |
| `ScriptThread Pi` | `Script(1,1)`     |
| `WebWorker for h` | `WW:www.example.` |
| `ServiceWorker f` | `SW:www.example.` |
| `ServiceWorkerMa` | `SvcWorkerManage` |
| `Time profiler t` | `TimeProfTimer`   |
| `Time profiler`   | `TimeProfiler`    |
| `WebGL thread`    | `WebGL`           |
| `Choose a device` | `DevicePicker`    |
| `Pick a file`     | `FilePicker`      |
| `Pick files`      | `FilePicker`      |

[1]: https://stackoverflow.com/questions/5026531/thread-name-longer-than-15-chars
2021-07-19 00:57:48 +09:00
bors-servo
94e337f22f
Auto merge of #28308 - philip-lamb:phil-ime-textentry, r=jdm
Improve IME messaging to embedder with insertion point index and mult…

…iline flag.

<!-- Please describe your changes on the following line: -->
This improves handling of IME requests in the embedder by passing the location of the insertion point along with the current text, and a boolean flag 'multiline' (true for HTML textarea, false otherwise) which allows the embedder to be more clever about handling of the 'enter' or 'return' keys.

Tested and working in an embedding example.

---
<!-- 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. -->
2021-03-29 23:10:17 -04:00
Philip Lamb
b8a74e89cf Improve IME messaging to embedder with insertion point index and multiline flag. 2021-03-29 17:55:54 +13:00
Philip Lamb
b19438ad07 Minor fixes in simpleservo: improve embedding C header generation. Don't recursively panic if embedder doesn't throw on panic. Make init_with_gl unavailable when doing non-WGL windows build. 2021-03-29 16:47:32 +13:00
Josh Matthews
21e31547ea Don't use headless winit event loop on macOS. 2021-03-14 17:24:30 -04:00
Paulo E. Castro
84b06ab6d1 Work around absense of winit::event_loop in headless case. 2021-03-11 00:24:13 +00:00