Commit graph

18 commits

Author SHA1 Message Date
Narfinger
c3f441d7ab
OHOS CI: Allow benchmarking of files and show smaps (#37881)
OHOS CI: Now we can benchmark specific files. These files need to be in
the runs.json and in the supprt/hitrace-bench folder.
A simple testcase of parsing html from string is included (taken from
https://github.com/servo/servo/issues/37223).
We copy all files in
support/hitrace-bench into the hap of the phone.
These files can use the console.log javascript command to get their
measured output.

Additionally, this now supports reporting resident-accordings-to-smaps
which is a slightly different memory than resident.

This needs update to hitrace-bench 0.7 which will be completed once the
PR is marked ready.

Testing: On action runner here:
https://github.com/Narfinger/servo/actions/runs/16118101025/job/45477031813

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
2025-07-08 11:01:02 +00:00
Narfinger
3b73b83a9f
Allow OHOS servoshell to have a simple multiple tab implementation. (#36891)
Currently we just pause the compositor and replace the window in it
while having separate bookkeeping to remember which window belongs to
which tab.
Currently there are no tests for OHOS, so we cannot test the changes.

---------

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Co-authored-by: Jonathan Schwender <55576758+jschwe@users.noreply.github.com>
2025-06-16 08:17:31 +00:00
Narfinger
099fd10317
OHOS: Use native API to get most of the information needed for starting servoshell. (#37392)
Uses the native ohos-api crates to get the required information for
starting servoshell.
This increases the minimum API version requirement to API-14.

Testing: Tested on device.

---------

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Co-authored-by: Jonathan Schwender <55576758+jschwe@users.noreply.github.com>
2025-06-13 09:38:56 +00:00
Narfinger
ea5a20ab8d
OHOS: update ci to use api-14 and newer action (#37395)
Update the CI to use api version 14 and 5.0.2 sdk. Additionally, update
the action. This is required because of
https://github.com/servo/servo/pull/37392.

Testing: CI does not have tests.

---------

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
Co-authored-by: Jonathan Schwender <schwenderjonathan@gmail.com>
2025-06-11 19:34:09 +00:00
Narfinger
5114e24db1
Servoshell: Refactor save_output_image and implement into OHOS (#37237)
Split out `save_output_image_if_necessary` into its own file so the code
can be shared by servoshell on the desktop and ohos.
Additionally, hook it up to the loop in OHOS and have OHOS allow
exiting.

Testing: Manual testing on ohos and desktop.

---------

Signed-off-by: Narfinger <Narfinger@users.noreply.github.com>
2025-06-11 08:51:44 +00:00
Jonathan Schwender
78f74d0d5e
ohos: servoshell: Use Flex{Column} to avoid Column bug (#37087)
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>
2025-05-24 01:37:46 +00:00
Euclid Ye
86957be5f0
Create config_dir if none exist for caching (#35761)
* Create config_dir if none exist for caching

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

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

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

* downgrade the log to trace verbosity

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

* update wpt-test

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

---------

Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com>
2025-03-18 18:36:33 +00:00
Jonathan Schwender
78f7d525cc
Rename ohos app bundle (#35790)
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>
2025-03-05 07:56:00 +00:00
Jonathan Schwender
bb1d2bd0f2
ohos: Improve argument filtering (#34422)
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>
2024-12-02 08:17:53 +00:00
Jonathan Schwender
7489e3d5f4
ohos: Support swiping to go back (#34433)
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>
2024-12-01 12:06:04 +00:00
Jonathan Schwender
538ac61a82
ohos: Add basic IME and keyboard support (#34188)
* 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>
2024-11-15 15:04:48 +00:00
Mukilan Thiyagarajan
114cf9a1cc
ohos: avoid passing some cli arguments to servo (#34237)
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>
2024-11-13 12:50:40 +00:00
Jonathan Schwender
9fcfe09e51
ohos: Add toast prompt (#33621)
* ohos: Add toast prompt

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>

* ohos: Add toast on `load_ended`

Signed-off-by: Jonathan Schwender <jonathan.schwender@huawei.com>

* Apply review feedback

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>
2024-10-03 16:33:21 +00:00
Jonathan Schwender
e534c7d461
ohos: Allow passing arguments to servoshell (#33588)
* 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>
2024-10-02 04:27:18 +00:00
Jonathan Schwender
7fdaccde55
ohos: Support product flavors (#33512)
* 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>
2024-09-26 06:58:30 +00:00
Jonathan Schwender
88ffe9f7a5
ohos: Bundle resource files in hap (#33513)
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>
2024-09-24 04:29:53 +00:00
Jonathan Schwender
d3d6a22d27
ohos: Add back and fwd button to vendored app (#33511)
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>
2024-09-23 03:57:34 +00:00
Mukilan Thiyagarajan
157e28c59b
openharmony: add servoshell for ohos (#33295)
* openharmony: add servoshell for ohos

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

* ohos: handle missing signing config on forks

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>

---------

Signed-off-by: Mukilan Thiyagarajan <mukilan@igalia.com>
2024-09-20 08:20:27 +00:00