Closed Bug 2091628 Opened 6 days ago Closed 2 days ago

[wpt-sync] Sync PR 64519 - [svg] Use the replaced content rect for embedded SVG documents

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 64519 into mozilla-central (this bug is closed when the sync is complete).

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

Felipe Erias <felipeerias@igalia.com> wrote:

[svg] Use the replaced content rect for embedded SVG documents

When the flag SVGEmbeddedAsReplacedElement is enabled, object-fit and
object-position apply to in-process SVG documents in \<object> and
\<embed>. The child frame is sized and positioned by the replaced content
rect, but coordinate mapping still uses the offset of the content box.
When the replaced content rect has a different offset, pointer events
get the wrong target and coordinates, scrollIntoView scrolls to the
wrong position, and IntersectionObserver reports wrong results.

LocalFrameView and LayoutView now map between the child and parent
documents using the offset of the replaced content rect.

Since object-fit can also extend the child frame beyond the content box,
visual rects mapped out of the child document are clipped by the
LayoutEmbeddedObject. Where the child frame covers only part of the
content box, pointer events over the rest now target the \<object> or
\<embed> element instead of the child frame.

Changes to object-fit or object-position only invalidate paint, so the
child frame keeps its old size and position. With the flag enabled,
these changes on a LayoutEmbeddedObject now schedule a geometry update
in the parent LocalFrameView and a paint property update on the child
LayoutView.

Apart from the handling of style changes, these changes do not depend on
the flag. For other frames and plugins, the replaced content rect has
the same offset as the content box, so the offset used for coordinate
mapping does not change. The exception is a frame owner that is the
effective root scroller, whose replaced content rect has a zero offset.
Coordinate mapping now uses that offset, as painting and hit testing
already do.

Tests:
/wpt/css/css-images/object-fit-change-svg-001o.html
/wpt/css/css-images/object-fit-svg-intersection-observer.sub.html
/wpt/css/css-images/object-fit-svg-pointer-events.html
/wpt/css/css-images/object-fit-svg-scroll-into-view.html

Bug: 41302806
Change-Id: I0ad803f1a4da18a3949c9f6738eb23ceb15ce10f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8585219
Reviewed-by: Fredrik Söderquist \<fs@opera.com>
Commit-Queue: Felipe Erias \<felipeerias@igalia.com>
Reviewed-by: Ian Kilpatrick \<ikilpatrick@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1732547}

Component: web-platform-tests → Layout: Images, Video, and HTML Frames
Product: Testing → Core

CI Results

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

Total 520 tests and 18 subtests

Status Summary

Firefox

OK : 3[GitHub] 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-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
PASS : 6[Gecko-linux2204-64-wayland-debug, Gecko-linux2204-64-wayland-opt] 7[GitHub] 3518[Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt] 3934[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 : 89[Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt] 140[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 : 3
FAIL : 7

Safari

OK : 2
FAIL : 4
TIMEOUT: 2
NOTRUN : 2

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

Tests Disabled in Gecko Infrastructure

Pushed by wptsync@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/49f24a9f9069 https://hg.mozilla.org/integration/autoland/rev/82410265c22c [wpt PR 64519] - [svg] Use the replaced content rect for embedded SVG documents, a=testonly
Status: NEW → RESOLVED
Closed: 2 days ago
Resolution: --- → FIXED
Target Milestone: --- → 162 Branch
You need to log in before you can comment on or make changes to this bug.