Closed Bug 1732073 Opened 1 year ago Closed 1 year ago

[wpt-sync] Sync PR 30904 - [layout] Fix metrics DCHECK.

Categories

(Core :: Layout: Block and Inline, task, P4)

task

Tracking

()

RESOLVED FIXED
95 Branch
Tracking Status
firefox95 --- fixed

People

(Reporter: mozilla.org, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

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

Ian Kilpatrick <ikilpatrick@chromium.org> wrote:

[layout] Fix metrics DCHECK.

Previously we'd hit this check quite often in clusterfuzz:
Crash Type: CHECK failure
Crash Address:
Crash State:
!metrics_.IsEmpty() || IsEmptyLineBox() in ng_physical_line_box_fragment.cc
blink::NGPhysicalLineBoxFragment::NGPhysicalLineBoxFragment
scoped_refptr\<blink::NGPhysicalLineBoxFragment> base::MakeRefCounted\<blink::NGPh

This particular testcase is an atomic-inline with a saturated -ve margin
at the bottom.

As a result the call to BaselineMetrics within the inline layout
algorithm:
https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/layout/ng/inline/ng_inline_layout_algorithm.cc;l=589-593?q=baselinemetrics&ss=chromium

would result in a FontHeight of [LayoutUnit::Min(), LayoutUnit()].

This would return true for FontHeight::IsEmpty() as it only checked the
ascent.

This fixes the issue by checking the descent as will within IsEmpty().

Bug: 1243485
Change-Id: I63d9dd57a6e08dd361f21c68b60fabe025e7befc
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3173984
Commit-Queue: Koji Ishii \<kojii@chromium.org>
Reviewed-by: Koji Ishii \<kojii@chromium.org>
Cr-Commit-Position: refs/heads/main@{#923759}

Component: web-platform-tests → Layout: Block and Inline
Product: Testing → Core

CI Results

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

Total 1 tests

Status Summary

Firefox

PASS: 1

Chrome

PASS: 1

Safari

PASS: 1

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Pushed by wptsync@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/f6bdf3be5fcd
[wpt PR 30904] - [layout] Fix metrics DCHECK., a=testonly
Pushed by wptsync@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/31f66bca4771
[wpt PR 30904] - [layout] Fix metrics DCHECK., a=testonly
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 95 Branch
You need to log in before you can comment on or make changes to this bug.