Commit graph

12 commits

Author SHA1 Message Date
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