The `Column()` height and thus also the XComponent height extends beyond
the physical display for unknown reasons. This is a problem on websites
that have a footer bar, since the footer is partially below the display
end.
Using Flex with Column direction works as expected.
Testing: Manual inspection with DevEco Testing inspecting the height of
the children elements in ArkUI
Fixes: Part of the servoshell surface extending beyond the physical
screen on ohos
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Workflow changes includes to allow a given runs.json file to be read by
hitrace-bench and perform the benchmarks.
It depends on the updated CI tools. Requires CI modification in
https://github.com/servo/ci-runners/pull/36.
Testing: This change was tested on the CI.
4261677656
A corresponding bencher output is here:
99a369f7-e6c3-4141-83f9-0ecddac484a5?back=L2NvbnNvbGUvcHJvamVjdHMvc2Vydm8tY2kvcmVwb3J0cz9wZXJfcGFnZT04JnBhZ2U9MQ%3D%3D
Signed-off-by: Narfinger <Narfinger@users.noreply.github.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>
The `shell` suffix causes issues with the startup profiling tools on
OpenHarmony. The profiler fails to detect the start of the app.
This is fixed by renaming the app. I tried various
different variations and identified the `shell`
suffix to be the culprit.
E.g. `org.servo.shell` has the same issue, so its not
a length issue.
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
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>
* 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>
Instead of telling the Constellation to tell the embedder that new
frames are ready, have the compositor tell the embedder directly. This
should reduce frame latency. Now, after processing compositor
updates, run any pending `WebView::new_frame_ready` delegate methods.
This change also removes the `refresh` call from the Java interface as
that was the only other place that the compositor was rendering the
WebRender scene outside of event looping spinning. This `refresh` call
was completely unused.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
* crown: Pass `--cfg crown` to rustc from crown
also includes minor fix in crown for wrapper running based on clippy code
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* fix doc
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* Update python/servo/command_base.py
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
Signed-off-by: Samson <16504129+sagudev@users.noreply.github.com>
---------
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Signed-off-by: Samson <16504129+sagudev@users.noreply.github.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
* crown: Support Rc<T::Promise> and callback objects parameterized over a trait..
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* crown: Verify that attributes match between trait associated types and impls.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* crown: Check type aliases as part of associated type checks.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* crown: Add periods to all diagnostic messages.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Tidy.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Fix compile-fail test expectations.
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
---------
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
* Fix deprecated PanicInfo alias
Fixes:
```rust
use of deprecated type alias `std::panic::PanicInfo`: use `PanicHookInfo` instead
```
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
* build: upgrade rustc to 1.82.0
Tracking issue for the silenced lints:
https://github.com/servo/servo/issues/34591
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
---------
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
* android: Fix onScroll source
Scrolling should be based on `e2`, the second event, since dX and
dY are relative to e2 and not e1.
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
* android: Fix flinging down on android.
We need to ensure x and y are inside the window, otherwise servo will
not scroll!
Our fling implementation will set `mCurX` and `mCurY` to a very high
initial value when flinging with a negative velocity, since we don't
know the size of our content page and the android `OverScroller`
needs to know the size of the page.
Setting the page size to a ridiculously high value ensures that flinging
will not be cut of short, even if we fling farther then the edge of the
screen, starting from the touch up point.
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
---------
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
This avoids future crashes if new unknown parameters
are passed by the runtime to the app.
It does make it slightly more inconvenient for the user,
since they must use `=` and space at the right place now.
This will also be updated in the book accordingly
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Override the `onBackPress` callback, which by default
brings the application to the background and instead
tell servo to go back one page.
Users can invoke this by swiping from the left edge to the middle.
There is no equivalent callback / gesture to go forward.
In the default browser swiping from the right side to the middle
also invokes the goBack callback.
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
* ohos: Add basic IME and keyboard support
- Add extremely basic support for keyboard events
- Add basic IME support
- Showing and hiding the IME
- inserting text
- deleting characters
- very basic configuration of the IME
Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
* Apply suggestions from code review
Improve the log message
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
Signed-off-by: Jonathan Schwender <55576758+jschwe@users.noreply.github.com>
* Update ports/servoshell/egl/ohos.rs
Co-authored-by: Mukilan Thiyagarajan <mukilanthiagarajan@gmail.com>
Signed-off-by: Jonathan Schwender <55576758+jschwe@users.noreply.github.com>
* ohos: Bump the minimum required SDK version to 5.0
Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
* ohos: Remove pub from callbacks
The callbacks don't need to be public, as we will be registering them.
Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
* Rename composition event
Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
* ohos: clippy in log
Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
* ohos: address some clippy warnings
Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
* ohos: Raise Error in mach if unsupported SDK version is used.
Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
* Add keyboard-types dependency for android
Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
---------
Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
Signed-off-by: Jonathan Schwender <55576758+jschwe@users.noreply.github.com>
Co-authored-by: Josh Matthews <josh@joshmatthews.net>
Co-authored-by: Mukilan Thiyagarajan <mukilanthiagarajan@gmail.com>
These following four OHOS specific arguments are being passed by the
OHOS runtime to the EntryAbility, which then passess them on to Servo's
argument parsing logic:
* `--debugApp=false`
* `--send_to_erms_targetAppDistType=os_integration`
* `--send_to_erms_targetAppProvisionType=release`
* `--send_to_erms_targetBundleType=0`
When Servo's argument parsing logic encounters an unrecognized argument,
it terminates the process after logging an error to stderr (which is not
visible in hilog).
This patch simply filters out these arguments so the parsing logic
doesn't fail.
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
* Convert settings.gradle to Kotlin Script
Stage 1 of #33742
Signed-off-by: clocks <doomsdayrs@gmail.com>
* servoview-local: Convert build.gradle to Kotlin Script
Stage 1 of #33742
Signed-off-by: clocks <doomsdayrs@gmail.com>
* Convert build.gradle to Kotlin Script
This was a trickier one, as I wanted to maintain compatibility with the rest of the files while facilitating this migration.
Closures are annoying, another annoyance of loosely typed languages in an OOP project.
Migration of child build scripts will require the reverse code and or migration of this scripts functions to kotlin lambdas / functions (which are just jvm functions).
Code based off of the following guide.
https://docs.gradle.org/current/userguide/kotlin_dsl.html#groovy_closures_from_kotlin
Stage 1 of #33742
Signed-off-by: clocks <doomsdayrs@gmail.com>
* servoapp: Convert build.gradle to Kotlin Script
Migrated deprecated API usages.
There are two more, but ignored for now.
("splits.density", "capitalize")
Stage 1 of #33742
Signed-off-by: clocks <doomsdayrs@gmail.com>
* servoview: Convert build.gradle to Kotlin Script
Migrated deprecated API usages.
There are two more, but ignored for now.
("splits.density", "capitalize")
Stage 1 of #33742
Signed-off-by: clocks <doomsdayrs@gmail.com>
* servoview: Replace ResourceGroovyMethods with Kotlin File.walk
Signed-off-by: clocks <doomsdayrs@gmail.com>
* Replace Groovy Closures with Kotlin Lambda types
Stage 1 of #33742
Signed-off-by: clocks <doomsdayrs@gmail.com>
* Move Utility fields to buildSrc
Using extra fields is quite annoying and makes it hard to maintain
API stability.
"buildSrc" is designed for this task, and thus is being used
for said task.
This means that when editing build.gradle files in an Android Studio,
there is a direct reference to the source of a function.
(Easier time referring to documentation, source of function, etc).
More information here:
https://docs.gradle.org/current/userguide/sharing_build_logic_between_subprojects.html
Stage 1 of #33742
Signed-off-by: clocks <doomsdayrs@gmail.com>
* Sync target SDK to 33
Signed-off-by: clocks <doomsdayrs@gmail.com>
* Make Notification actions immutable.
Otherwise android lint will be upset.
Signed-off-by: clocks <doomsdayrs@gmail.com>
* Move dependencies from servoview to servoapp
ServoView does not use them.
Signed-off-by: clocks <doomsdayrs@gmail.com>
* Add POST_NOTIFICATIONS to manifest
Signed-off-by: clocks <doomsdayrs@gmail.com>
* Add host to intent-filter
Use "*" for any host, lets hope this works.
Signed-off-by: clocks <doomsdayrs@gmail.com>
* Solve ndkBuild tasks not being linked
The problem stems from something something groovy wishy washy unclear
execution order something Kotlin explicit execution order.
Merge tasks exist after the project is evaluated.
The problem is that simply running afterEvaluate causes an
ConcurrentModificationException. This is because of creating a new
task while looping over existing tasks. To remedy this we simply
filter the tasks first, than create and link the new task.
Signed-off-by: clocks <doomsdayrs@gmail.com>
* Add documentation to why some functions are extensions to Project
Signed-off-by: clocks <doomsdayrs@gmail.com>
* android: drop the host directives from AndroidManifest.xml
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
---------
Signed-off-by: clocks <doomsdayrs@gmail.com>
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
* ohos: Bump minimum CMake version
By bumping the minimum CMake version, we avoid a deprecation warning.
The OH 4.0 SDK ships with CMake 3.16, so we can be sure that we have CMake 3.16
or newer available.
Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
* ohos: Allow passing arguments to servoshell
Allows passing options passed via `wants` to the Ability through to servoshell.
This allows easier debugging, either by calling servoshell from a test app,
or from the commandline, e.g.
```
hdc shell aa start -a EntryAbility -b org.servo.servoshell -U "https://www.wikipedia.org" \
--pb dom.webgpu.enabled true \
--ps dom.webgpu.wgpu_backend "gl" \
--pi layout.threads 4
```
Note: While the OH `wants` API differentiates between boolean, string and integer values, we convert
everything back to strings, so we can reuse the same parsing code as the desktop servoshell.
Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
---------
Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
* ohos: Support product flavors
Support different product flavors (e.g. with different signing
configurations) by supporting --flavor on ohos.
The flavor influences the package path for OH packages, so
allow the flavor parameter on build + package + install
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
* Fix smoketest
Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
---------
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
Bundle resource files into the .hap, so they are available
as files in the application sandbox, instead of included
into the shared library.
This should slightly reduce the binary size in debug and
release mode.
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
25372340 added back and forward apis to the ohos servoshell.
157e28c5 vendored the ohos demo ArkTS app into the servo repo,
but did not include the back and forward buttons, which
were added in the meantime.
This commit adds the missing back and forward buttons to the ArkTS code.
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
* android: publish nightly builds for aarch64
Publish the aarch64 apk and aar packages to both Github Releases
and S3 so that it can be linked from servo.org.
The focus is on getting a working version of the APK on the homepage,
so few issues are resolved with temporary solutions:
1) We publish the "release" profile instead of "production" since the
latter will need changes in the gradle configuration (the changes
required was previously blocked on #32720 which is now closed).
2) The scheme for the version code is simple and doesn't consider
other factors such as API level and product variants discussed in the
Android docs (https://developer.android.com/google/play/publishing/multiple-apks#VersionCodes)
This should be fine for now as we don't publish to any store yet.
The change also makes it so that the 'Release nightly' workflow will
endup building all 4 variants for the Android target, but only aarch64
is uploaded. This is because GH Actions doesn't have a good way to skip
a specific job in a matrix and the additionally code complexity needed
to acheive it (either generating a JSON dynamically in a new job and using
`fromJSON` in the matrix definition or skipping each individual step
based on matrix.target and `inputs.upload`) didn't seem worth the cost
saved (this is executed only once a day).
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
* android: add attestation for nightly build artifacts
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
---------
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
* Update layout of servoshell android app
Signed-off-by: Daniel Adams <msub2official@gmail.com>
* Remove gap after loop/idle text
Signed-off-by: Daniel Adams <msub2official@gmail.com>
---------
Signed-off-by: Daniel Adams <msub2official@gmail.com>
* asan: Add suppression for known false positive
Signed-off-by: ede1998 <online@erik-hennig.me>
* fix: re-suppress lazy_static leaks
lazy_static is still used by dependencies and still leaks
from static variables.
Signed-off-by: ede1998 <online@erik-hennig.me>
* fix: Memory leak of Box<NetworkingTaskSource>
Signed-off-by: ede1998 <online@erik-hennig.me>
---------
Signed-off-by: ede1998 <online@erik-hennig.me>
* remove from rand
Mutex<OsRng> can be initialized in compile time.
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
* remove from layout_2020
Mutex<()> can be initialize in compile time
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
* remove from media
`IS_MULTIPROCESS` doesn't be used.
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
* remove lazy_static from dependencies
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
* rewrite suppressed_leaks_for_asan.txt
For all of lazy_static was replaced with LazyLock.
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
---------
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
* Update mozjs
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* Fix changed readTransfer callback
https://bugzilla.mozilla.org/show_bug.cgi?id=1842713
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* Use NewExternalArrayBuffer from glue
d33454be74
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* Fix columnorigin and filename being in latin1
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* fixup newexternalarray
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* Float16 (this might require more work for codegen support)
https://bugzilla.mozilla.org/show_bug.cgi?id=1833647
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* js.strict is removed
https://bugzilla.mozilla.org/show_bug.cgi?id=1621603
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* asm options are now somewhere else
https://hg.mozilla.org/mozilla-central/rev/26045c88e3972957087d535e7f259e08857bd2a2
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* Comment out offthread compilation
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* Set NDK to 26
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* Fix 1-origin handling
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* Expect `FinalizationRegistry` interface
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* Good expectations
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* more expectations
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* Add `WeakRef` to interfaces expectation
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* mozjs upgrade: fixes for Android
Android NDK's layout has changed in r26 and 'lib64' no longer exists
under `toolchain/llvm/prebuilt/linux-x86_64`. The libraries that used to
be it are now present in `lib` folder itself.
This patch updates the build configuration to use the `lib` folder
instead when configuring the LIBCLANG_PATH environment variable.
This patch also updates to a newer mozjs version that includes fixes for
linker errors faced on Android (see #32769).
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
* Patch libz-sys & update mozjs
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* update NDK version in README
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
* Use servo/mozjs
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* Update mozjs again
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
---------
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
This PR adds support for signing all APKs we produce on the CI
with a custom signing key. Currently the logic falls back to
the debug key (which is generated by AGP and not persistent) if
the environment variable for the keystore is not set. This allows
local developer builds to work without requiring a key store.
Once #32720 is resolved, we could sign just the production builds
and remove the conditional logic.
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
rust-analyzer breaks on Linux (when invoked without mach), because it
tries to compile the c files, and doesn't find `mach_init.h`
Since we don't need task_info on non-mac platforms, just make the
crate empty on other platforms.
Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>
The way our shell.nix works requires crown's Cargo.toml to be
self-contained so that it can be built as a nix derivation in
isolation.
Fixes#32552.
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
* fix localhost
Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
* android: parse search bar field in rust
Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
* Update comment to reflect new function behavior
---------
Signed-off-by: Gae24 <96017547+Gae24@users.noreply.github.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>