You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: native decoder/method wire-shape and default-value bugs (#1625)
Cross-referenced against the current Lynx engine source (lynx,
lynx-stack), including the actual native dispatch code (not just
.d.ts type declarations, which are occasionally wrong themselves).
- View.Event: animationDecoder read the animation/transition payload
from "detail", but real Lynx events carry it under "params" -
confirmed both in events.d.ts and directly in the Android dispatch
code (TransitionAnimationManager/LynxKeyframeAnimator construct a
plain LynxCustomEvent, whose paramsName() is "params", not the
LynxDetailEvent subclass used elsewhere). Broke all
on(Animation|Transition)(Start|End|Cancel)[Main][With] combinators
on native.
Also handles Android's legacy (pre-"new animator") transition path,
confirmed live in TransitionAnimationManager: it reports
animation_type as "transition-<property>" (e.g. "transition-width")
and sends neither animation_name nor new_animator at all. Added
LegacyTransitionAnimation to AnimationType for this shape and made
animationName optional for it. new_animator is only ever sent as an
explicit `true` by the new C++ animation engine (animation.cc's
CreateEventAndSend sets it unconditionally for both keyframe and
transition events); pre-"new animator" engines omit it entirely for
keyframe animations too, not just legacy transitions (confirmed in
LynxKeyframeAnimator.java and Harmony's ui_base.cc, both of which
only ever set animation_type/animation_name). So newAnimator now
defaults to False whenever the field is absent, regardless of
AnimationType, rather than being keyed off LegacyTransitionAnimation.
- Refresh.Event: RefreshStateChangeEvent.state was decoded as
MisoString, but the wire sends Lynx's RefreshState enum as a number
(0=Idle, 1=OverDragRelease, 2=Refreshing per refresh.d.ts). Broke
onRefreshStateChange* on native.
- Overlay.Event: touchState was decoded as MisoString, but the wire
sends Lynx's OverlayTouchState enum as a number (overlay.d.ts).
errorCode was decoded as MisoString, but Android (the only platform
implementing binderror) sends a raw Int - confirmed directly in
LynxCustomEvent.addDetail(String, Object), which stores it
unconverted. This contradicts both overlay.d.ts's own declaration
and the public lynxjs.org docs (both say `errorCode: string`), but
the dispatch code is the actual wire behavior. Broke
onOverlayTouch*/onError* on native.
- List.Method: scrollToPosition sent the target index under the key
"position". The engine accepts both "position" and "index" as
aliases (confirmed in both the Android and Harmony dispatch code),
so this was not actually broken - "index" is just the current
canonical name per list.d.ts, and this is a forward-compatible
rename rather than a functional fix. defaultScrollToPosition and
defaultAutoScroll also set stpSmooth/start to True against the
engine's documented/actual defaults of false.
ScrollView.Method has its own separate AutoScroll type (autoScroll
is shared between <list> and <scroll-view> per list.d.ts's
ScrollViewParams) with the identical wrong default: defaultAutoScroll
set start = True despite its own "sensible defaults (stopped)" doc
comment. Fixed the same way.
- View.Property: ignoreFocus_ took a MisoString, but the property is
boolean on the wire (props.d.ts, confirmed on lynxjs.org) and every
sibling boolean property in the file uses Bool/boolProp; its own
doc example (ignoreFocus_ True) didn't even typecheck.
accessibilityElementsHidden_ and accessibilityExclusiveFocus_'s
Haddocks both claimed "Default Value: True" against props.d.ts's
documented default of false for both. accessibilityElementsHidden_'s
doc example also called the function accessibilityExclusiveHidden_,
which doesn't exist.
- View.Method: defaultTakeScreenshot set format = ".png" (the engine
only accepts the literal strings "jpeg"/"png") and scale = 0.5
against the documented/engine default of 1 (confirmed on
lynxjs.org). defaultBoundingClientRect set
androidEnableTransformProps = True against the documented/engine
default of False (methods.d.ts, confirmed on lynxjs.org).
0 commit comments