Pass the build directory to gradle via an environment variable, to
support custom profiles.
Building the custom profiles already works, but follow-up commands
expect the artifact at the location of the profile.
This allows switching the android release build to production (in a
follow-up PR).
Testing: We don't run any runtime tests for android in CI
---------
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
ParseFromString currently complains that it matches multiple trace
lines. The reason for that is a bit unclear as it should only produce
one alert. Local testing shows that it produces multiple (even for one
run). This should at least give us the metric back.
Testing: This is currently untested. As it is a small CI change that
can't break a broken test it should be fine.
Fixes: https://github.com/servo/servo/issues/42992
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
In preparation for the next release, bump the version number to 0.1. 0.1
will be an LTS release, which receives extended support in terms of
security updates (e.g. spidermonkey security updates). Please keep in
mind that as always no specific guarantees or response times are given,
and any updated are provided on a best effort basis.
Previously some projects had a demo integration of servo based on some
version of servo, and then never or rarely updated it. Providing an LTS
release offers an option to embedders to integrate servo, while reducing
API churn and having a somewhat fixed schedule to adhere to in terms of
upgrades. Currently, the plan is for a new LTS release every 6 months,
with additional documentation regarding API changes and recommended
migration patterns (best-effort and subject to change).
Testing: No functional changes. Additional testing will be performed
post-merge on the newly created release branch.
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
This script automates the signing, packaging and notarization of
servoshell on macOS.
This is a first step towards: #40031 and #12532. While we could let a
maintainer code-sign and upload the signed release, probably this should
be integrated into CI, which would require additional work.
This script started out quite simple as part of `./mach package`.
However, since the script has access to secrets, it shouldn't be part of
mach (to minimize the amout of code that needs to be trusted).
We also needed to save state and be able to resume operations, since
notarizing can take quite long and the stapling needs to wait until
notarization has completed.
Since notarizing can take long (up to a day has been observed during
first tests), we save artifacts and the notarization ID, and add a
`--check-status` command that can be used to poll if notarization has
been finished.
Testing: Manually testing required. A signed and notarized `.dmg`
artifact has [been
uploaded](https://servo.zulipchat.com/#narrow/channel/500774-tsc/topic/Signing.20macos.20Servoshell/near/576256648)
to zulip, allowing others to verify the notarization worked.
---------
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Because of the move of the reporting function to
update_user_interface_state and the multiple events of
LoadStatus::Complete, the previous reporting did not work correctly
anymore.
This fixes it by manually summing up the reports for
'resident-according-to-smaps' and using the hitrace-bencher
point_filter_type Largest.
This should restore the bencher graph.
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Testing: No automatic test but manual test here:
https://github.com/Narfinger/servo/actions/runs/22617931816
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Currently the bencher tests for harmonyos have a suspiciously low ram
usage. However, Scenario tests and speedometer work.
The most likely explanation is that we forgot to add the certificate
while switching hitrace-bencher to use mitmproxy.
Hence, we add the flag.
Testing: This does not have an automatic test but manually testing shows
that we will have the certificate errors otherwise.
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
It turns out the HarmonyOS version numbers can be confusing. This now
puts it as the same as the OpenHarmony version numbers.
As the SDKs are backwards compatible everything should still work with
newer SDKs.
Testing: CI will test compilation and installation and manually tested
by me.
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Update ohos.yml hitrace-bench and runs.json to 0.10.0
Testing: This should be testing using CI
Signed-off-by: jane <5373400+janeoa@users.noreply.github.com>
This updates the Openharmony required version to API lvl 21 (6.0.0.1
OpenHarmony and 6.0.1 HarmonyOS).
We need API level 19+ for https://github.com/servo/servo/pull/41738,
however an API level 19 SDK was never released for OpenHarmony. API-20
seems to be the same as the the 6.0-beta release, so we are playing it
safe and directly going for the API-21 release, which is also the 6.0.1
release that the actual HarmonyOS 6 update was, so it should be the most
polished.
This also has the update for the version used in CI.
The HarmonyOS runners are already updated.
Testing: Successful openharmony run here:
https://github.com/Narfinger/servo/actions/runs/21755920480
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
This version bump is a bit delayed, since I forgot to open the PR before
FOSDEM. The actual release will thus likely not be based on this commit,
but backported to the release branch, to stay in sync with our monthly
report.
There still has been no resolution on the `0.1` version bump situation,
hence another bump of the patch version.
Testing: Not required
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
We can start initializing servo without needing to wait for the
creation of a window.
This allows us to perform initialization of servo itself,
concurrently to the app UI thread setting up the app UI.
Once the native window is ready, we can then let servo create
the first window and load the initial URL.
This is also interesting in the context of using servo as a
webview library, where loading the library / initialising the
webview and loading the first url are typically decoupled
steps.
Note: on the android port the Java code is not touched, which means that
we effectively still
perform the initialization at the same point in time on android.
The change to call the base servo initialiation from the Java app, can
be done in a seperate PR, perhaps by someone more familiar with android
than me.
Follow-up PRs will add multi-window support, which means that some of
the multi-webview related code in this PR has open todos,
which will be addressed by follow-ups.
Testing: The ohos-port is tested in CI, the android port was manually
tested by me.
---------
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
pauseCompositor/resumeCompositor have been renamed
topausePainting/resumePainting in 824f551. This renames the Java methods
to fix the regression.
Testing: Built servoview.aar and tested in Android app.
Fixes#41826
Signed-off-by: Niklas Merz <niklasmerz@apache.org>
Changed most #[allow]s to #[expect]s, mainly for
clippy::too_many_arguments
Removed unfulfilled expectations
This is my first opensource contribution, so please let me know if
anything should
be done differently.
Testing: Refactor
Part of: #40838
---------
Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
Signed-off-by: TimurBora <timurborisov5561@gmail.com>
Co-authored-by: Tim van der Lippe <TimvdLippe@users.noreply.github.com>
Replace `allow` with `expect` lints for `unused`, `unsafe_code`,
`dead_code`, and `non_upper_case_globals`.
Testing: So far just check it compiled on `x86_64-linux` on NixOS. Need
to use the module `system.fontconfig.enable = true;` I think in my NixOS
config.
Part of: #40383
Searching `allow\(.*\)` for `.rs` files shows the following. for
(total_results:total_files) went from `707:386` to `675:368`, a
reduction of `32:18`.
How many files is too many files per PR? I feel like the 20-30 I have is
too big.
---------
Signed-off-by: Wayne Van Son <waynevanson@gmail.com>
`expect` is wrong here because whether or not the resulting symbol is
snake-cased depends entirely on what is passed to the macro.
Testing: This just fixes a build warning, so should not effect
behavior.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Currently, commandline arguments need to be used like this:
'--psn=--tracing_filter' which people can easily forget and use
'--psn=tracing_filter'.
This happened to multiple people and leads to weird issues, since the
argument is silently dropped.
Because OHOS appends a lot of other arguments and we don't have a good
way to filter out the OS provided arguments, we now print a big error
message that hopefully should be noticed by the user for a couple of
commonly used arguments.
Testing: Tested on device with and without the correct way to invoke
arguments.
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
---------
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Turns out we can squeeze a bit more out of rippy.png, as well as a
single byte off the big logo with a few new tricks I found.
This PR also converts the new kebab menu icon in the Android app to webp
like all the others, for another 3kb saved.
Testing: Manual.
Signed-off-by: lumiscosity <averyrudelphe@gmail.com>
This crate is just using system APIs to get the resident and virtual
memory size of the current process. We can do this directly with
`mach2`, which also allows more flexibility if we want to fetch other
values in the future.
This does require duplicating `mach2` as the version used by `gilrs` is
older. Presumably, some future release of `gilrs` will upgrade soon.
Testing: There aren't really tests for this, but I tested it manually by
running the memory reporter and ensuring that both the old and new
values were
the same.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Changed some allow to expects and removed the unfulfilled expectations.
Testing: Refactor
Part of: #40383
Signed-off-by: anonmiraj <nabilmalek48@gmail.com>
Remove the public API to trigger shutdown and instead trigger the
process from `Servo`'s implementation of `Drop` trait.
This makes it hard to create issues involving the order of destruction
of `Servo` and `WebView`s. It will also allow us to implement
asynchronous shutdown in the future.
Testing: Should be covered by existing unit tests.
Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
As discussed in the tsc-channel, prepare for the next release by cutting
a version on the last day of the month.
Note: The actual release would happen ~ 2 weeks from now, when the blog
post for november is ready.
This commit was produced by running `./mach release 0.0.3`.
Testing: Not required. Additional pre-release testing will happen after
the version bump and before the release, with potential patches being
cherry-picked to a release branch.
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
This change is a major re-architecture of servoshell to support multiple
windows. Unfortunately it was not possible to do this incrementally, but
@mukilan and I did this together so we feel more confident about these
changes.
The main change here is that now the `HashMap` of windows that `App`
has can be filled with more than one `ServoShellWindow`.
`ServoShellWindow` is a wrapper around a `PlatformWindow` which can
either be headed, headless, or for embedded platforms. Embedded
platforms (Android and OHOS) are only expected to have a single window,
but there is no reason that more windows cannot be added.
There is still a little bit more work to be done in order to fully
enable
mulitple windows, so this change is just the architectural preparation.
This change enables the embedded and desktop versions of servoshell to
start to be fully integrated so that the entire `RunningAppState` is
shared between them.
Testing: servoshell is the test harness so these changes are covered
by the WPT tests.
---------
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
This makes it mostly that the correct keyboard will be selected and we
don't start with an uppercase letter.
Testing: Compiled on OHOS and looked on the phone.
Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Instead of relying on `Sevo::animating()` in servoshell to drive the
event loop, it is sufficient to just let the `RefreshDriver` wake it up
when it is time to re-render.
This allows us to remove `Servo::animating()` completely. It is a bit
odd that there is a global API to track this, rather than per-`WebView`
or window, so this change just removes it entirely.
Testing: This should make the main loop of headless servoshell more
efficient,
but I do not think this difference is going to be observable in any way.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Ran ./mach release 0.0.2 to update the version number and update the
license.html
This is in preperation for the v0.0.2 release with the next nightly, as
discussed on zulip.
Testing: Not tested
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
This adds an implementation of `VsyncRefreshDriver` ensuring that frame
updates are driven by the system compositor.
Testing: This should increase the smoothness of animations, but I'm
not sure how to test that exactly.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Change the installation directory to Servo.
This was discussed during the October TSC meeting
and removes the outdated reference to mozilla research.
Testing: Manually tested the windows installer
Fixes: #40068
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
This change makes it so that Servo handles touch events on Android.
Flinging becomes a bit less native, but with two big benefits:
1. Before touch event handling on Android wasn't standards compliant,
because web content didn't get a chance to call `preventDefault()` on
touch events, whcih important for proper site behavior.
2. This unifies all touch event handling across Servo platforms. This
means that improvements to things like fling will benefit all
platforms equally. In addition, fling on Android can be integrated
into Servo's animation handler.
Generally, this also just makes things much simpler to reason about on
Android.
Testing: This kind of input handling isn't tested in Servo yet.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This change adds a full implementation of pinch zoom, including
center-aware zooming. Before this kind of pinch zooming was only enabled
on OpenHarmony. Now all pinch zooms must come with a focal point, which
determines the center point of the zoom. This enables full pinch zoom on
Android and has OpenHarmony use the same system for pinch zoom.
Every WebView now has a `PinchZoom` which describes the viewport of the
pinch zoom and handles panning with proper chaining of zoom viewport
panning to scroll layer scrolling. In addition, the collection of touch
actions is simplified by storing an array and turning each into a
ScrollZoomEvent when appropriate.
Caveats:
- We've noticed some hard to diagnose bugs with clamping the panning
viewport, but we'll tackle those later once we figure out how to
reliably reproduce them.
- Keyboard scroll events currently do not properly pan the pinch zoom
viewport. This will be handled in a followup.
Testing: There are currently no tests for this kind of touch interaction
as there's no way to read the pinch zoom from a WebView. It's processed
asynchronously. Once that API is added, we should be able to add some
simple tests, but many things are still unaccessible such as the pan
position in the pinch zoom viewport.
Fixes#4224.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Co-authored-by: Rakhi Sharma <atbrakhi@igalia.com>
These commits add a new settings screen to the app, then add:
1) a setting to disable a developer-targeted UI element (an indicator
about whether the app is polling continuously for events)
2) a toggle for experimental web platform features
The page needs to be reloaded after switching the toggle before any
changes can be observed.
Testing: Manually tested by visiting https://developer.mozilla.org with
the setting enabled and disabled. No automated testing for Android yet.
Fixes: #39791
---------
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
Focusing the location bar in the Android app shows the onscreen
keyboard, but clicking on a link in the current document does not make
it disappear. This change ensures the input focus is reset appropriately
and ensures the keyboard disappear when the location bar is not being
edited.
Testing: Manually tested. No automated tests for Android app at this
time.
Fixes: #40008
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
Use Release mode for gradle for production builds and Debug for any
other builds.
This fixes an exception when building for android with a custom cargo
profile.
`SERVO_TARGET_DIR` is read in `apk/jni/Android.mk` and specifies the
folder
libservoshell.so is expected to be in.
Testing: Tested manually with `./mach build --android --production`
Fixes: #34564
---------
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Signed-off-by: Jonathan Schwender <55576758+jschwe@users.noreply.github.com>
Co-authored-by: Mukilan Thiyagarajan <mukilanthiagarajan@gmail.com>
This is the most basic integration possible. Current limitations
include:
* the done button doesn't trigger form submission/keyboard hiding
* IME events don't trigger inputs (ie. pressing and holding a letter to
get more options)
However, it is infinitely better than the current integration.
Testing: Manually tested in the Android emulator.
Fixes: #12127 (we can open more specific issues after this)
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
Another tiny binary size win for Android! .webp assets are supported
since API level 17, and Servo is built against 33, so this shouldn't
cause issues.
Testing: Manual.
Signed-off-by: lumiscosity <averyrudelphe@gmail.com>
This shows up sometimes in code reviews, so it makes sense that tidy
enforces it. `rustfmt` supports this via comment normalization, but it
does many other things and is still an unstable feature (with bugs).
Testing: There are new tidy tests for this change.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Losslessly optimizes the Android resources. These are the only non-test
PNGs remaining in the project, to my knowledge.
Testing: Unnecessary, since this only optimizes assets.
Signed-off-by: maple! <averyrudelphe@gmail.com>