This change adds a shadow-tree widget for `<input type=color>` elements.
It also involves some changes to the way layout interacts with the DOM,
because currently all `input` and `textarea` elements are rendered as
plain text and their descendants are ignored. This obviously doesn't
work for `<input type={color, date, range, etc}>`.

<details><summary>HTML used for the screenshot above</summary>
```html
<input type=color>
```
</details>
Testing: I doubt that this affects WPT tests, because the appearance and
behaviour of the widget is almost entirely unspecified.
---------
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
Added a new workflow that benchmarks simple startup and loading of
servo.org on HarmonyOS.
Needs https://github.com/servo/ci-runners/pull/34 to be merged and
applied to the runners.
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Bumps the objc2-related group with 2 updates:
[objc2-app-kit](https://github.com/madsmtm/objc2) and
[objc2-foundation](https://github.com/madsmtm/objc2).
Updates `objc2-app-kit` from 0.2.2 to 0.3.1
<details>
<summary>Commits</summary>
<ul>
<li><a
href="97c2ebaac1"><code>97c2eba</code></a>
Merge pull request <a
href="https://redirect.github.com/madsmtm/objc2/issues/464">#464</a>
from madsmtm/new-versions</li>
<li><a
href="b329dd049f"><code>b329dd0</code></a>
Update Cargo.lock</li>
<li><a
href="8428734b3b"><code>8428734</code></a>
Bump icrate version 0.0.2 -> 0.0.3</li>
<li><a
href="6a7cc09dc3"><code>6a7cc09</code></a>
Bump block2 version 0.2.0-alpha.8 -> 0.2.0</li>
<li><a
href="87d598ebd2"><code>87d598e</code></a>
Bump objc2 version 0.3.0-beta.5 -> 0.4.0</li>
<li><a
href="153d189636"><code>153d189</code></a>
Bump objc2-encode version 2.0.0-pre.4 -> 2.0.0</li>
<li><a
href="699fca319e"><code>699fca3</code></a>
Bump objc-sys version 0.3.0 -> 0.3.1</li>
<li><a
href="0f4a937d58"><code>0f4a937</code></a>
Merge pull request <a
href="https://redirect.github.com/madsmtm/objc2/issues/465">#465</a>
from madsmtm/fix-before-release</li>
<li><a
href="0139798efb"><code>0139798</code></a>
Disable mutation tests on GNUStep (for now)</li>
<li><a
href="72561dd510"><code>72561dd</code></a>
Fix GNUStep CI not running on Foundation</li>
<li>Additional commits viewable in <a
href="https://github.com/madsmtm/objc2/compare/objc2-0.2.2...objc-sys-0.3.1">compare
view</a></li>
</ul>
</details>
<br />
Updates `objc2-foundation` from 0.2.2 to 0.3.1
<details>
<summary>Commits</summary>
<ul>
<li><a
href="97c2ebaac1"><code>97c2eba</code></a>
Merge pull request <a
href="https://redirect.github.com/madsmtm/objc2/issues/464">#464</a>
from madsmtm/new-versions</li>
<li><a
href="b329dd049f"><code>b329dd0</code></a>
Update Cargo.lock</li>
<li><a
href="8428734b3b"><code>8428734</code></a>
Bump icrate version 0.0.2 -> 0.0.3</li>
<li><a
href="6a7cc09dc3"><code>6a7cc09</code></a>
Bump block2 version 0.2.0-alpha.8 -> 0.2.0</li>
<li><a
href="87d598ebd2"><code>87d598e</code></a>
Bump objc2 version 0.3.0-beta.5 -> 0.4.0</li>
<li><a
href="153d189636"><code>153d189</code></a>
Bump objc2-encode version 2.0.0-pre.4 -> 2.0.0</li>
<li><a
href="699fca319e"><code>699fca3</code></a>
Bump objc-sys version 0.3.0 -> 0.3.1</li>
<li><a
href="0f4a937d58"><code>0f4a937</code></a>
Merge pull request <a
href="https://redirect.github.com/madsmtm/objc2/issues/465">#465</a>
from madsmtm/fix-before-release</li>
<li><a
href="0139798efb"><code>0139798</code></a>
Disable mutation tests on GNUStep (for now)</li>
<li><a
href="72561dd510"><code>72561dd</code></a>
Fix GNUStep CI not running on Foundation</li>
<li>Additional commits viewable in <a
href="https://github.com/madsmtm/objc2/compare/objc2-0.2.2...objc-sys-0.3.1">compare
view</a></li>
</ul>
</details>
<br />
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 <dependency name> major version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's major version (unless you unignore this specific
dependency's major version or upgrade to it yourself)
- `@dependabot ignore <dependency name> minor version` will close this
group update PR and stop Dependabot creating any more for the specific
dependency's minor version (unless you unignore this specific
dependency's minor version or upgrade to it yourself)
- `@dependabot ignore <dependency name>` will close this group update PR
and stop Dependabot creating any more for the specific dependency
(unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore <dependency name>` will remove all of the ignore
conditions of the specified dependency
- `@dependabot unignore <dependency name> <ignore condition>` will
remove the ignore condition of the specified dependency and ignore
conditions
</details>
---------
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>
This commit corrects the geometry details provided under the OH platform
by getting the offset from the OS. OH port provides correct offset and
available space.
Fixes: #36466
---------
Signed-off-by: Astraea Quinn Skoutelli <astraea.quinn.skoutelli@huawei.com>
Signed-off-by: Jonathan Schwender <55576758+jschwe@users.noreply.github.com>
Co-authored-by: Jonathan Schwender <55576758+jschwe@users.noreply.github.com>
This allows us to easily filter logs related to the servo app via our
domain tag, e.g.
The domain value was chosen empirically and doesn't seem to collide as
of now. From the OpenHarmony side there are no requirements on the value
as long as it is between `0x0000` and `0xFFFF`. A value of zero (current
status) doesn't allow filtering in hilog.
```
hdc shell hilog -D 0xE0C3
```
Testing: No functional changes
Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
This PR allows us to set the `log_filter` via `prefs.json` as well as
commandline arguments.
Priority goes commandline > prefs.json > compile-time default.
Testing: I compiled and run servo on an OH device, and then checked the
logs:
```
hdc hilog | tee log | rg 'Set log_filter to'
```
```
05-08 15:25:59.389 55824 55993 D A00000/org.servo.servo/servoshell::prefs: Set log_filter to: Some("debug,geometry=trace")
```
Signed-off-by: Astraea Quinn Skoutelli <astraea.quinn.skoutelli@huawei.com>
Most sites that feature detect Service Workers in Servo immediately
break when this pref is enabled, since our implementation is very
incomplete. This provides a poor user experience when recommending the
`--enable-experimental-web-platform-features` flag.
Testing: Existing test coverage should be unchanged.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
Properly passes user-agent from servoshell args to the preferences.
Testing:
```bash
RUST_LOG=warn WAYLAND_DISPLAY='' ./mach run -r --screen-size=375x812 --window-size=375x812 --pref=dom_svg_enabled --pref=dom_intersection_observer_enabled --user-agent "Mozilla/5.0 (iPhone; CPU iPhone OS 14_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0.3 Mobile/15E148 Safari/604.1"
RUST_LOG=warn WAYLAND_DISPLAY='' ./mach run -r --screen-size=375x812 --window-size=375x812 --pref=dom_svg_enabled --pref=dom_intersection_observer_enabled
```
Fixes: N/A
---------
Signed-off-by: Astraea Quinn Skoutelli <astraea.quinn.skoutelli@huawei.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
Bumps [winit](https://github.com/rust-windowing/winit) from 0.30.9 to
0.30.10.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/rust-windowing/winit/releases">winit's
releases</a>.</em></p>
<blockquote>
<h2>Winit version 0.30.10</h2>
<h3>Added</h3>
<ul>
<li>On Windows, add
<code>IconExtWindows::from_resource_name</code>.</li>
<li>On Windows, add <code>CursorGrabMode::Locked</code>.</li>
<li>On Wayland, add <code>WindowExtWayland::xdg_toplevel</code>.</li>
</ul>
<h3>Changed</h3>
<ul>
<li>On macOS, no longer need control of the main
<code>NSApplication</code> class (which means you can now override it
yourself).</li>
<li>On iOS, remove custom application delegates. You are now allowed to
override the
application delegate yourself.</li>
<li>On iOS, no longer act as-if the application successfully open all
URLs. Override
<code>application:didFinishLaunchingWithOptions:</code> and provide the
desired behaviour yourself.</li>
</ul>
<h3>Fixed</h3>
<ul>
<li>On Windows, fixed ~500 ms pause when clicking the title bar during
continuous redraw.</li>
<li>On macOS, <code>WindowExtMacOS::set_simple_fullscreen</code> now
honors <code>WindowExtMacOS::set_borderless_game</code></li>
<li>On X11 and Wayland, fixed pump_events with
<code>Some(Duration::Zero)</code> blocking with <code>Wait</code>
polling mode</li>
<li>On Wayland, fixed a crash when consequently calling
<code>set_cursor_grab</code> without pointer focus.</li>
<li>On Wayland, ensure that external event loop is woken-up when using
pump_events and integrating via <code>FD</code>.</li>
<li>On Wayland, apply fractional scaling to custom cursors.</li>
<li>On macOS, fixed <code>run_app_on_demand</code> returning without
closing open windows.</li>
<li>On macOS, fixed <code>VideoMode::refresh_rate_millihertz</code> for
fractional refresh rates.</li>
<li>On macOS, store monitor handle to avoid panics after going in/out of
sleep.</li>
<li>On macOS, allow certain invalid monitor handles and return
<code>None</code> instead of panicking.</li>
<li>On Windows, fixed <code>Ime::Preedit</code> cursor offset
calculation.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="2385410366"><code>2385410</code></a>
Winit version 0.30.10</li>
<li><a
href="6db1343c0b"><code>6db1343</code></a>
wayland: bump wayland-rs to avoid yanked release</li>
<li><a
href="a26899a75d"><code>a26899a</code></a>
windows: fix incorrect cursor_range calculation in Ime::Preedit</li>
<li><a
href="80bddda641"><code>80bddda</code></a>
macOS: Fix monitors connected via certain Thunderbolt hubs</li>
<li><a
href="5f1e9f6cc1"><code>5f1e9f6</code></a>
macOS: Store UUID in MonitorHandle instead of CGDirectDisplayID</li>
<li><a
href="57baf72741"><code>57baf72</code></a>
Allow the user to register the application delegate on iOS</li>
<li><a
href="da7a09658a"><code>da7a096</code></a>
fix: Support fractional refresh rates in video modes on macOS (<a
href="https://redirect.github.com/rust-windowing/winit/issues/4191">#4191</a>)</li>
<li><a
href="53321dc6f5"><code>53321dc</code></a>
Swizzle sendEvent: instead of subclassing NSApplication</li>
<li><a
href="6556cde246"><code>6556cde</code></a>
macOS: Close windows automatically when exiting</li>
<li><a
href="7672fd5657"><code>7672fd5</code></a>
wayland: support fractional scale for custom cursor</li>
<li>Additional commits viewable in <a
href="https://github.com/rust-windowing/winit/compare/v0.30.9...v0.30.10">compare
view</a></li>
</ul>
</details>
<br />
[](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>
Instead of returning true / false it's better to return a Result (even
if we continue ignoring possible error).
Testing: Doesn't change any behavior
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
This ensures that the select element is usable when there are a lot of
options.
Testing: We don't have tests for servoshell.
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
Adds a convenience macro that adds sane defaults to the tracing macro.
Closes: #36534
Testing:
- Pass in sample test cases and compare against expected behaviour.
---------
Signed-off-by: Astraea Quinn Skoutelli <astraea.quinn.skoutelli@huawei.com>
1. Move click event trigger from embedding layer to `ScriptThread`
2. Previously, the logic is to trigger click event at same position as
`MouseButtonAction::Up` if `MouseButtonAction::Up` is within 10px of
`MouseButtonAction::Down`, in embedding layer. This PR ~~removes the
condition~~ moves the check to `ScriptThread`.
Testing: tested for webdriver with self written test case. Perform
actions of pointermove, pointerdown, pointerup in sequence. Click event
can now be triggered.
Fixes: #35395
cc @xiaochengh @jdm
For `MAYBE? TODO:` part I added, should we do it? I read the
[spec](https://w3c.github.io/uievents/#event-type-click), it doesn't
specify we have to implement MDN's way.
If we should work in the MDN's way, it also should be fixed in another
PR, as this PR doesn't regress anything. Also I am not sure what is the
best way to do it.
Should I handle it in
4d4f94936f/components/script/dom/document.rs (L1296-L1297)?
---------
Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
This file used to contain the `EmbedderDelegate` and `WindowMethods`
traits, but these are gone now, so we can move the one remaining enum
to be in `compositor.rs` where it is used. This change also stops
exposing the `compositing` crate as public Servo API.
Testing: This does not change behavior so is covered by existing tests.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Expose a `ServoBuilder` for easily creating Servo instances using
default values. This change enables removing `EmbedderTraits`.
Testing: This is covered by `Servo` unit tests.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Fixes the following warning:
```
warning: servoshell@0.0.1: Could not generate git version information: "dyld[59398]: Symbol not found: _libintl_setlocale\n Referenced from: <CB4FE7B2-A5DC-34F0-8247-A96F45D664E8> /opt/homebrew/Cellar/git/2.48.1/bin/git\n Expected in: <0DA2D46D-7A17-3860-809D-71FD05B785FA> /Library/Frameworks/GStreamer.framework/Versions/1.0/lib/libintl.8.dylib\n"
```
This was discussed in
https://github.com/servo/servo/issues/36435#issuecomment-2794224073.
mach sets DYLD_LIBRARY_PATH, which is currently necessary for our unit
tests, but causes git to fail in the build script. Simply unsetting the
environment variable before invoking git works around this problem.
Testing: Tested manually on macos and verified the warning does not
occur anymore.
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
This PR allows setting the log-filter according to the env_filter spec
via CLI arguments.
Testing is currently in progress, will be done on machines running OHOS.
---------
Signed-off-by: Astraea Quinn Skoutelli <astraea.quinn.skoutelli@huawei.com>
Co-authored-by: Jonathan Schwender <schwenderjonathan@gmail.com>
libservo: Make zooming and HiDPI scaling work per-`WebView`
This change moves all zooming and HiDPI scaling to work per-`WebView` in
both libservo and Compositor. This means that you can pinch zoom one
`WebView` and it should now work independently of other `WebView`s.
This is accomplished by making each `WebView` in the WebRender scene
have its own scaling reference frame.
All WebViews are now expected to manage their HiDPI scaling factor and
this can be set independently of other WebViews. Perhaps in the future
this will become a Servo-wide setting.
This allows full removal of the `WindowMethods` trait from Servo.
Testing: There are not yet any tests for the WebView API, but I hope
to add those soon.
Co-authored-by: Shubham Gupta <shubham13297@gmail.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Shubham Gupta <shubham13297@gmail.com>
This exposes a new method of creating `WebView`s using the Rust builder
pattern. This will be more important as we add more kinds of
configuration options for `WebView` such as size and HiDPI scaling.
Testing: The API currently doesn't have tests, but functionality is
ensured by the fact that servoshell is the test harness.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Bumps [hilog](https://github.com/openharmony-rs/hilog) from 0.1.1 to
0.2.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/openharmony-rs/hilog/releases">hilog's
releases</a>.</em></p>
<blockquote>
<h2>v0.2.0</h2>
<h2>What's Changed</h2>
<ul>
<li>Feature: allow dynamic filter swaps by <a
href="https://github.com/PartiallyUntyped"><code>@PartiallyUntyped</code></a>
in <a
href="https://redirect.github.com/openharmony-rs/hilog/pull/4">openharmony-rs/hilog#4</a></li>
</ul>
<h2>New Contributors</h2>
<ul>
<li><a
href="https://github.com/PartiallyUntyped"><code>@PartiallyUntyped</code></a>
made their first contribution in <a
href="https://redirect.github.com/openharmony-rs/hilog/pull/4">openharmony-rs/hilog#4</a></li>
</ul>
<p><strong>Full Changelog</strong>: <a
href="https://github.com/openharmony-rs/hilog/commits/v0.2.0">https://github.com/openharmony-rs/hilog/commits/v0.2.0</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a
href="https://github.com/openharmony-rs/hilog/commits/v0.2.0">compare
view</a></li>
</ul>
</details>
<br />
[](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>
[OHOS]Bugfix: unimplemented WebviewDelegate.sceen_geometry causes failed
page loading
this [PR 36223](https://github.com/servo/servo/pull/36223) causes that
some page can not be loaded on ohos platform. The newly added
WebviewDelegate.screen_geometry is unimplemented at ohos platform
Besides, this commit also fix the bug that failed to copy the prefs.json
to cache dir when the servo is started at the first time after an ohos
application is installed, due to the cache dir is not existed.
@mrobinson @jschwe
Testing: the ohos platform test demo hap
Fixes: No issue exists i can find
Signed-off-by: coding-joedow <ibluegalaxy_taoj@163.com>
Manually call `git rev-parse --short HEAD` to retrieve the commit hash,
instead of using Emitter from vergen_git2. This helps remove
dependencies and shorten compile time.
Testing: It doesn't require tests because it is a refactoring for
removing dependencies
Fixes: #36435
Signed-off-by: Kingsley Yung <kingsley@kkoyung.dev>
This changes removes animation tracking from the `WindowMethods` trait
and moves it to `ServoDelegate` and `WebViewDelegate`.
- Animation changes per-`WebView` are now triggered in the compositor
only when the value is updated there, rather than right after ticking
animations.
- Both `WebView` and `Servo` now expose an `animation()` method, so
tracking animation state actually becomes unecessary in many cases,
such as that of desktop servoshell, which can just read the value
when the event loop spins.
Testing: No tests necessary as the API layer is still untested. Later,
tests will be added for the `WebView` API and this can be tested then.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
implement the `ClipboardItem` interface
Testing: covered by existing wpt tests
part of #36084
---------
Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
Some methods are implemented fully, while others are implemented
partly. With these implementations, there are no observed crashes
when running the trusted-types web-platform-tests.
Most notably, the tests/wpt/tests/trusted-types/idlharness.window.js
is now fully passing.
Part of #36258
Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
Messages that are sent to the `Constellation` have pretty ambiguous
names.
This change does two renames:
- `ConstellationMsg` → `EmbedderToConstellationMessage`
- `ScriptMsg` → `ScriptToConstellationMessage`
This naming reflects that the `Constellation` stands in between the
embedding layer and the script layer and can receive messages from both.
Soon both of these message types will live in `constellation_traits`,
reflecting the idea that the `_traits` variant for a crate is
responsible for exposing the API for that crate.
Testing: No new tests are necessary here as this just renames two enums.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Running tests with --enable-experimental-web-platform-features would
make so many of them fail asserts because of this feature.
Testing: No need to test since
`--enable-experimental-web-platform-features` isn't used by default
This is part of #36315
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
https://github.com/user-attachments/assets/9aba75ff-4190-4a85-89ed-d3f3aa53d3b0
Among other things this adds a new `EmbedderMsg::ShowSelectElementMenu`
to tell the embedder to display a select popup at the given location.
This is a draft because some small style adjustments need to be made:
* the select element should always have the width of the largest option
* the border should be part of the shadow tree
Apart from that, it's mostly ready for review.
<details><summary>HTML for demo video</summary>
```html
<html>
<body>
<select id="c" name="choice">
<option value="first">First Value</option>
<option value="second">Second Value</option>
<option value="third">Third Value</option>
</select>
</body>
</html>
```
</details>
---
<!-- 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] Part of https://github.com/servo/servo/issues/3551
- [ ] 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. -->
---------
Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
`WindowMethods` is used by the embedding layer to get information from
the embedder. This change moves the functionality for getting screen
size and `WebView` offsets to `WebViewDelegate`.
This is important because `WebView`s might be on different screens or
have different offsets on the screen itself, so it makes sense for this
to be per-`WebView` and not global to the embedder. HiDPI and animation
state functionality will move to the embedder in subsequent changes.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
<!-- 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 just modify the
`WebView` API surface a bit.
<!-- 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. -->
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
- Remove `EmbedderMethods::get_user_agent_string`. This is now part of
the `Preferences` data structure, which should allow it to be
per-`WebView` in the future.
- Remove `EmbedderMethods::get_version_string`. This was used to include
some data along with WebRender captures about the Servo version. This
isn't really necessary and it was done to replace code in the past
that output the WebRender version, so also isn't what the original
code did. I think we can just remove this entirely.
The idea with these changes is that `EmbedderMethods` can be removed
in a followup and the rest of the methods can be added to
`ServoDelegate`. These two methods are ones that cannot be added to a
delegate as they are used during `Servo` initialization.
Testing: There is currently no testing for libservo. These changes are
meant
as preparation for adding a suite of `WebView` unit tests.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* 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>
* 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>
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>
* 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>
* 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>
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>
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>
* 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>
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>