Closed Bug 2089402 Opened 19 days ago Closed

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

Categories

(Core :: Layout: Images, Video, and HTML Frames, 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 64434 into mozilla-central (this bug is closed when the sync is complete).

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

Alan Baradlay <zalan@apple.com> wrote:

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

WebKit export from bug: REGRESSION (<!---->macOS 26)<!---->:<!----> inset box-<!---->shadow with large spread on a wrapped inline element paints outside the element as full-<!---->width bands

<pre>
Inset box-shadow with a large spread paints outside the box on an inline box

<div style="width: 200px">
before
<span style="box-shadow: inset 0 0 0 400px blue">
first <br>
second
</span>
</div>

The blue inset shadow should stop at the end of each line's fragment. Instead it ran 400px past it to the containing block.
When an inline box is split across lines, the incoming edge value (where it breaks) is "open" and the box keeps growing to the next line.
(Note inset shadows are clipped to the padding box)

paintRect expansion = blur extent + spread
+--------------------------+- - - - - - - - - - - - - - - - -+
|##########################| |
|###+----------------------+- - - - - - - - - - - - - - -+ |
|###| hole, reaching the break edge | |
|###+----------------------+- - - - - - - - - - - - - - -+ |
|##########################| |
+--------------------------+- - - - - - - - - - - - - - - - -+
|<--- clip: padding box -->| everything past here is clipped

On trunk we call shapeForInnerHole.fillOuterShape() when shapeForInnerHole is empty (i.e. inset shadow covers the box).
With no hole left, we just call fill on the "grown" rect before any clip is applied.

+-----------+- - - - - - - - - - - - - -+
|###########|###########################|
+-----------+- - - - - - - - - - - - - -+
fragment spread carries it 400px
past the line break

but what we should do instead is this:

+-----------+
|###########|
+-----------+
fragment

So let's call borderShape.fillInnerShape() instead. borderShape is the box itself, not the "grown" rect, and its inner shape is the padding box.

It also fixes blocks: on trunk a block with a transparent border paints the shadow under the border (the outer shape is the border box),
now it stops at the padding box.

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

Whiteboard: [wptsync downstream] → [wptsync downstream error]
Component: web-platform-tests → Layout: Images, Video, and HTML Frames
Product: Testing → Core
Whiteboard: [wptsync downstream error] → [wptsync downstream]

CI Results

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

Total 11 tests

Status Summary

Firefox

PASS: 3[GitHub] 9[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: 2

Chrome

PASS: 3

Safari

PASS: 3

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

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