diff options
author | JoeDow <ibluegalaxy_taoj@163.com> | 2025-04-11 14:52:07 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-11 06:52:07 +0000 |
commit | 80a6ba5e420828eee90d231ef79f3efbdc53608d (patch) | |
tree | 361ee9680459752cde574d2887a9a35e13a4f513 /ports/servoshell/egl/ohos/simpleservo.rs | |
parent | 5df4c760d36d056292161eef221165c9f41c6125 (diff) | |
download | servo-80a6ba5e420828eee90d231ef79f3efbdc53608d.tar.gz servo-80a6ba5e420828eee90d231ef79f3efbdc53608d.zip |
Implement WebviewDelegate.screen_geometry for OHOS (#36459)
[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>
Diffstat (limited to 'ports/servoshell/egl/ohos/simpleservo.rs')
-rw-r--r-- | ports/servoshell/egl/ohos/simpleservo.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/ports/servoshell/egl/ohos/simpleservo.rs b/ports/servoshell/egl/ohos/simpleservo.rs index 22db879c24b..db9399d8b8d 100644 --- a/ports/servoshell/egl/ohos/simpleservo.rs +++ b/ports/servoshell/egl/ohos/simpleservo.rs @@ -66,6 +66,15 @@ pub fn init( ); }); + // Ensure cache dir exists before copy `prefs.json` + let _ = crate::prefs::default_config_dir().inspect(|path| { + if !path.exists() { + fs::create_dir_all(path).unwrap_or_else(|e| { + log::error!("Failed to create config directory at {:?}: {:?}", path, e) + }) + } + }); + // Try copy `prefs.json` from {this.context.resource_prefsDir}/servo/ // to `config_dir` if none exist let source_prefs = resource_dir.join("prefs.json"); |