docs(ohos): document set_bounds semantics for natural vs child webviews - #20
Open
ddxwzc-boop wants to merge 1 commit into
Open
docs(ohos): document set_bounds semantics for natural vs child webviews#20ddxwzc-boop wants to merge 1 commit into
ddxwzc-boop wants to merge 1 commit into
Conversation
ArkTS now distinguishes natural-layout webviews (created without style.width: runtime width/height stripped, "100%" sizing follows window resizes) from explicit-bounds child webviews (accept width/height at creation and runtime). Update the set_bounds comment to match and note the BuilderNode.update caveat: runtime resizes of child webviews size the Web node but do not reliably notify ArkWeb to relayout.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Comment-only change. Documents the OHOS webview sizing semantics introduced by the child-webview bounds fix (companion to Eulogizethesun/openharmony-ability#45 and Eulogizethesun/tauri#73):
style.width— the main webview of each window): runtimeset_boundswidth/height is stripped ArkTS-side, so they keep"100%"sizing and follow window resizes naturally. This is what prevents the resize-relayout regression fixed earlier (explicit pixel dims on resize desync ArkWeb page layout).is_child=truewith bounds →WebViewStyle{x,y,w,h}): accept width/height at creation and at runtime.BuilderNode.updatecaveat: runtime resizes of child webviews size the Web node but do not reliably notify ArkWeb to relayout the page content (stale layout until next navigation).Context
0cac4c3(openharmony-ability) replacedWebViewStylewidth/height with"100%"natural layout to fix a main-webview resize bug, which silently broke child webview geometry: a child created at(x, y, w, h)rendered window-sized at(x, y), so its bottom-right overflow was clipped by the window edge. The fix restores explicit sizing with anaturalLayoutguard; this wry comment update reflects the final semantics so future readers don't re-introduce either regression.Testing
No functional change (comments only). The behavior it documents was verified on device (HUAWEI MateBook Pro 2in1): the
create_webview (multi-webview)manual test renders the exact 300x200 @(50,50) child rect, and main-window resize keeps page layout in sync.