Closed Bug 2089360 Opened 15 days ago Closed 6 days ago

[wpt-sync] Sync PR 64328 - WebKit export of https://bugs.webkit.org/show_bug.cgi?id=328386

Categories

(Core :: Layout: Grid, task, P4)

task

Tracking

()

RESOLVED FIXED
162 Branch
Tracking Status
firefox162 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 64328 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/64328
Details from upstream follow.

Jessica Cheung <jcheung23@apple.com> wrote:

WebKit export of https://bugs.webkit.org/show_bug.cgi?id=328386

WebKit export from bug: On dentaistudy.<!---->com,<!----> entry field does not return to initial position after dismissing keyboard

<pre>
On dentaistudy.com, entry field does not return to initial position after dismissing keyboard

On dentaistudy.com, which uses interactive-widget=resizes-content, the
text input moves up when the virtual keyboard appears but does not move
back down after the keyboard is dismissed. This is a grid layout bug,
not an interactive-widget bug: resizes-content just makes it easy to
reproduce, because the keyboard shrinks the page's height: 100dvh grid
and dismissing it grows the grid back.

The input sits below an auto row whose grid item has min-height: 0.
When the grid gets shorter, that row correctly shrinks to fit the
remaining space, and the item is stretched to the smaller row. When the
grid gets taller again, the row should grow back to the item's content
height, but it stays small, so the input stays where the keyboard moved
it.

GridTrackSizingAlgorithmStrategy::logicalHeightForGridItem() measures an
item by calling layoutIfNeeded() and reading its logicalHeight(). If the
item isn't marked for layout, nothing is recomputed, so the row gets the
item's old stretched height. This can happen when the grid's intrinsic
logical height cache has no value for the item.

clearGridItemOverridingSizesBeforeLayout() removes each item's
overriding size without marking the item for layout. Now, it flags items
that had a block-axis overriding size with
NeedsLayoutForIntrinsicLogicalHeight.

When logicalHeightForGridItem() measures a flagged item that has no
cached value, it marks the item for layout, so its real content height
is used. The flag is then cleared, so each item is relaid out at most
once per grid layout.

Add a layout test that exercises replicates this use case with the keyboard.
Add a WPT test that exercises this grid layout issue.

WebKit-Bug: <a href="https://bugs.webkit.org/show_bug.cgi?id=328386">https://bugs.webkit.org/show_bug.cgi?id=328386</a>
WebKit-Canonical-Link: <a href="https://commits.webkit.org/324575@main">https://commits.webkit.org/324575@main</a>
</pre>

Whiteboard: [wptsync downstream] → [wptsync downstream error]
Component: web-platform-tests → Layout: Grid
Product: Testing → Core
Whiteboard: [wptsync downstream error] → [wptsync downstream]

CI Results

Ran 11 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 105 tests

Status Summary

Firefox

OK : 1[GitHub] 59[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
PASS: 1[GitHub] 4[Gecko-linux2204-64-wayland-debug, Gecko-linux2204-64-wayland-opt] 841[Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt] 882[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
FAIL: 44[Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt] 45[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]

Chrome

OK : 1
PASS: 1

Safari

OK : 1
FAIL: 1

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

Status: NEW → RESOLVED
Closed: 6 days ago
Resolution: --- → FIXED
Target Milestone: --- → 162 Branch
You need to log in before you can comment on or make changes to this bug.