[wpt-sync] Sync PR 64325 - [HiC] Fix CanvasTransform with CSS object-fit
Categories
(Core :: Graphics: Canvas2D, task, P4)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox162 | --- | fixed |
People
(Reporter: wpt-sync, Unassigned)
References
()
Details
(Whiteboard: [wptsync downstream])
Sync web-platform-tests PR 64325 into mozilla-central (this bug is closed when the sync is complete).
PR: https://github.com/web-platform-tests/wpt/pull/64325
Details from upstream follow.
Stephen Chenney <schenney@chromium.org> wrote:
[HiC] Fix CanvasTransform with CSS object-fit
When CSS object-fit is used the canvas bitmap may not fill the canvas
element's layout box or may be clipped or may be rescaled. Previously,
this was not accounted for in the CanvasTransform resulting in
incorrectly positioned elements for hit testing and selection.Fix the issue by keeping the offset for the bitmap in the canvas child
paint state and then applying it to the canvas transform.Fixed: 567607176
Change-Id: If19ce2b7dc79db040171a1a89ea0d48ccc28a9ff
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8510719
Commit-Queue: Stefan Zager \<szager@chromium.org>
Auto-Submit: Stephen Chenney \<schenney@chromium.org>
Reviewed-by: Stefan Zager \<szager@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1729310}
| Assignee | ||
Updated•15 days ago
|
| Assignee | ||
Updated•12 days ago
|
| Assignee | ||
Updated•12 days ago
|
| Assignee | ||
Comment 1•12 days ago
|
||
Pushed to try (stability) https://treeherder.mozilla.org/jobs?repo=try&landoInstance=lando-prod-2025&landoCommitID=116367
| Assignee | ||
Comment 2•8 days ago
|
||
CI Results
Ran 4 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI
Total 15 tests and 1 subtests
Status Summary
Firefox
OK : 8[GitHub] 14[Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
PASS : 3
FAIL : 8[GitHub] 45[Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
TIMEOUT: 1
ERROR : 1
NOTRUN : 2
Chrome
OK : 8
PASS : 8
Safari
OK : 8
FAIL : 8
Links
Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base
Details
New Tests That Don't Pass
- /html/canvas/element/manual/draw-element-image/hit-test/elementsFromPoint-object-fit-contain-tall.tentative.html [wpt.fyi]
- Canvas descendants' transforms are correct when object-fit: contain is active.:
FAIL(Chrome:PASS, Safari:FAIL)
- Canvas descendants' transforms are correct when object-fit: contain is active.:
- /html/canvas/element/manual/draw-element-image/hit-test/elementsFromPoint-object-fit-contain-wide.tentative.html [wpt.fyi]
- Canvas descendants' transforms are correct when object-fit: contain is active.:
FAIL(Chrome:PASS, Safari:FAIL)
- Canvas descendants' transforms are correct when object-fit: contain is active.:
- /html/canvas/element/manual/draw-element-image/hit-test/elementsFromPoint-object-fit-cover-tall.tentative.html [wpt.fyi]
- Canvas descendants' transforms are correct when object-fit: cover is active.:
FAIL(Chrome:PASS, Safari:FAIL)
- Canvas descendants' transforms are correct when object-fit: cover is active.:
- /html/canvas/element/manual/draw-element-image/hit-test/elementsFromPoint-object-fit-cover-wide.tentative.html [wpt.fyi]
- Canvas descendants' transforms are correct when object-fit: cover is active.:
FAIL(Chrome:PASS, Safari:FAIL)
- Canvas descendants' transforms are correct when object-fit: cover is active.:
- /html/canvas/element/manual/draw-element-image/hit-test/elementsFromPoint-object-fit-fill-tall.tentative.html [wpt.fyi]
- Canvas descendants' transforms are correct when object-fit: fill is active.:
FAIL(Chrome:PASS, Safari:FAIL)
- Canvas descendants' transforms are correct when object-fit: fill is active.:
- /html/canvas/element/manual/draw-element-image/hit-test/elementsFromPoint-object-fit-fill-wide.tentative.html [wpt.fyi]
- Canvas descendants' transforms are correct when object-fit: fill is active.:
FAIL(Chrome:PASS, Safari:FAIL)
- Canvas descendants' transforms are correct when object-fit: fill is active.:
- /html/canvas/element/manual/draw-element-image/hit-test/elementsFromPoint-object-fit-none-tall.tentative.html [wpt.fyi]
- Canvas descendants' transforms are correct when object-fit none is active.:
FAIL(Chrome:PASS, Safari:FAIL)
- Canvas descendants' transforms are correct when object-fit none is active.:
- /html/canvas/element/manual/draw-element-image/hit-test/elementsFromPoint-object-fit-none-wide.tentative.html [wpt.fyi]
- Canvas descendants' transforms are correct when object-fit: none is active.:
FAIL(Chrome:PASS, Safari:FAIL)
- Canvas descendants' transforms are correct when object-fit: none is active.:
- /html/canvas/element/manual/draw-element-image/hit-test/elementsFromPoint-update-element-geometry-offscreen.tentative.html [wpt.fyi]
- Canvas descendants are hittable after OffscreenCanvas.updateElementGeometry.:
FAIL - Canvas descendants are hit in reverse update order.:
FAIL - Re-updating an element moves it to the top of the hit testing list.:
FAIL - preserveHitTestOrder: true preserves existing hit testing order.:
FAIL - preserveHitTestOrder: false moves element to top of the hit testing list.:
FAIL - preserveHitTestOrder: true preserves order when another element is on top.:
FAIL - preserveHitTestOrder: true adds element to hit testing stack if not already present.:
FAIL - preserveHitTestOrder works when updating via ElementImage on OffscreenCanvas.:
FAIL - updateElementGeometry clip restricts hit testing on OffscreenCanvas.:
FAIL
- Canvas descendants are hittable after OffscreenCanvas.updateElementGeometry.:
- /html/canvas/element/manual/draw-element-image/hit-test/elementsFromPoint-update-element-geometry.tentative.html [wpt.fyi]
- Canvas descendants are hittable after updateElementGeometry.:
FAIL - Canvas descendants are hit in reverse update order.:
FAIL - Re-updating an element moves it to the top of the hit testing list.:
FAIL - preserveHitTestOrder: true preserves existing hit testing order.:
FAIL - preserveHitTestOrder: false moves element to top of the hit testing list.:
FAIL - Canvas transform set via updateElementGeometry should be used for hit testing:
FAIL - Inline canvas transform set via updateElementGeometry should be used for hit testing:
FAIL - updateElementGeometry preserves canvasTransform when omitted and respects preserveHitTestOrder:
FAIL - updateElementGeometry interoperates with drawElementImage hit testing order:
FAIL - clearElementGeometry removes element from hit testing stack.:
FAIL - clearElementGeometry clears canvasTransform.:
FAIL - preserveHitTestOrder: true adds element to hit testing stack if not already present.:
FAIL - Elements with pointer-events: none are not hit-testable until pointer-events is removed.:
FAIL - updateElementGeometry and clearElementGeometry accept ElementImage.:
FAIL - updateElementGeometry clip restricts hit testing and is cleared by clearElementGeometry.:
FAIL - updateElementGeometry clip is evaluated in the coordinate space of canvasTransform.:
FAIL - drawElementImage with source and destination offsets clips hit-testing identically to manual updateElementGeometry.:
FAIL - updateElementGeometry supports clip with ElementImage.:
FAIL - Hit test clip rect does not clip element rendering in drawElementImage.:
FAIL - Setting or clearing hit test clip rect does not trigger canvas paint events.:
FAIL
- Canvas descendants are hittable after updateElementGeometry.:
- /html/canvas/element/manual/draw-element-image/hit-test/elementsFromPoint.tentative.html [wpt.fyi]
- Canvas descendants are hittable after being drawn.:
FAIL - Canvas descendants are hit in reverse drawing order.:
FAIL - Re-drawing an element moves it to the top of the hit testing list.:
FAIL - Pointer-events: none and inert should be excluded from elementsFromPoint:
FAIL - CSS transform should be used for hit testing:
FAIL - Canvas transform should be used for hit testing:
FAIL
- Canvas descendants are hittable after being drawn.:
- /html/canvas/element/manual/draw-element-image/hit-test/low-dpi-hit-test.tentative.html [wpt.fyi]:
ERROR- single target:
TIMEOUT - multiple targets, should only hit first:
NOTRUN - single target miss:
NOTRUN
- single target:
- /html/canvas/element/manual/draw-element-image/hit-test/selection.tentative.html [wpt.fyi]
- Double-clicking on canvas should be able to modify selection.:
FAIL
- Double-clicking on canvas should be able to modify selection.:
- /html/canvas/element/manual/draw-element-image/hit-test/z-index.tentative.html [wpt.fyi]
- Draw order trumps z-index in hit testing.:
FAIL
- Draw order trumps z-index in hit testing.:
| Assignee | ||
Comment 3•8 days ago
|
||
CI Results
Ran 4 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI
Total 15 tests and 1 subtests
Status Summary
Firefox
OK : 8[GitHub] 14[Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
PASS : 3
FAIL : 8[GitHub] 45[Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
TIMEOUT: 1
ERROR : 1
NOTRUN : 2
Chrome
OK : 8
PASS : 8
Safari
OK : 8
FAIL : 8
Links
Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base
Details
New Tests That Don't Pass
- /html/canvas/element/manual/draw-element-image/hit-test/elementsFromPoint-object-fit-contain-tall.tentative.html [wpt.fyi]
- Canvas descendants' transforms are correct when object-fit: contain is active.:
FAIL(Chrome:PASS, Safari:FAIL)
- Canvas descendants' transforms are correct when object-fit: contain is active.:
- /html/canvas/element/manual/draw-element-image/hit-test/elementsFromPoint-object-fit-contain-wide.tentative.html [wpt.fyi]
- Canvas descendants' transforms are correct when object-fit: contain is active.:
FAIL(Chrome:PASS, Safari:FAIL)
- Canvas descendants' transforms are correct when object-fit: contain is active.:
- /html/canvas/element/manual/draw-element-image/hit-test/elementsFromPoint-object-fit-cover-tall.tentative.html [wpt.fyi]
- Canvas descendants' transforms are correct when object-fit: cover is active.:
FAIL(Chrome:PASS, Safari:FAIL)
- Canvas descendants' transforms are correct when object-fit: cover is active.:
- /html/canvas/element/manual/draw-element-image/hit-test/elementsFromPoint-object-fit-cover-wide.tentative.html [wpt.fyi]
- Canvas descendants' transforms are correct when object-fit: cover is active.:
FAIL(Chrome:PASS, Safari:FAIL)
- Canvas descendants' transforms are correct when object-fit: cover is active.:
- /html/canvas/element/manual/draw-element-image/hit-test/elementsFromPoint-object-fit-fill-tall.tentative.html [wpt.fyi]
- Canvas descendants' transforms are correct when object-fit: fill is active.:
FAIL(Chrome:PASS, Safari:FAIL)
- Canvas descendants' transforms are correct when object-fit: fill is active.:
- /html/canvas/element/manual/draw-element-image/hit-test/elementsFromPoint-object-fit-fill-wide.tentative.html [wpt.fyi]
- Canvas descendants' transforms are correct when object-fit: fill is active.:
FAIL(Chrome:PASS, Safari:FAIL)
- Canvas descendants' transforms are correct when object-fit: fill is active.:
- /html/canvas/element/manual/draw-element-image/hit-test/elementsFromPoint-object-fit-none-tall.tentative.html [wpt.fyi]
- Canvas descendants' transforms are correct when object-fit none is active.:
FAIL(Chrome:PASS, Safari:FAIL)
- Canvas descendants' transforms are correct when object-fit none is active.:
- /html/canvas/element/manual/draw-element-image/hit-test/elementsFromPoint-object-fit-none-wide.tentative.html [wpt.fyi]
- Canvas descendants' transforms are correct when object-fit: none is active.:
FAIL(Chrome:PASS, Safari:FAIL)
- Canvas descendants' transforms are correct when object-fit: none is active.:
- /html/canvas/element/manual/draw-element-image/hit-test/elementsFromPoint-update-element-geometry-offscreen.tentative.html [wpt.fyi]
- Canvas descendants are hittable after OffscreenCanvas.updateElementGeometry.:
FAIL - Canvas descendants are hit in reverse update order.:
FAIL - Re-updating an element moves it to the top of the hit testing list.:
FAIL - preserveHitTestOrder: true preserves existing hit testing order.:
FAIL - preserveHitTestOrder: false moves element to top of the hit testing list.:
FAIL - preserveHitTestOrder: true preserves order when another element is on top.:
FAIL - preserveHitTestOrder: true adds element to hit testing stack if not already present.:
FAIL - preserveHitTestOrder works when updating via ElementImage on OffscreenCanvas.:
FAIL - updateElementGeometry clip restricts hit testing on OffscreenCanvas.:
FAIL
- Canvas descendants are hittable after OffscreenCanvas.updateElementGeometry.:
- /html/canvas/element/manual/draw-element-image/hit-test/elementsFromPoint-update-element-geometry.tentative.html [wpt.fyi]
- Canvas descendants are hittable after updateElementGeometry.:
FAIL - Canvas descendants are hit in reverse update order.:
FAIL - Re-updating an element moves it to the top of the hit testing list.:
FAIL - preserveHitTestOrder: true preserves existing hit testing order.:
FAIL - preserveHitTestOrder: false moves element to top of the hit testing list.:
FAIL - Canvas transform set via updateElementGeometry should be used for hit testing:
FAIL - Inline canvas transform set via updateElementGeometry should be used for hit testing:
FAIL - updateElementGeometry preserves canvasTransform when omitted and respects preserveHitTestOrder:
FAIL - updateElementGeometry interoperates with drawElementImage hit testing order:
FAIL - clearElementGeometry removes element from hit testing stack.:
FAIL - clearElementGeometry clears canvasTransform.:
FAIL - preserveHitTestOrder: true adds element to hit testing stack if not already present.:
FAIL - Elements with pointer-events: none are not hit-testable until pointer-events is removed.:
FAIL - updateElementGeometry and clearElementGeometry accept ElementImage.:
FAIL - updateElementGeometry clip restricts hit testing and is cleared by clearElementGeometry.:
FAIL - updateElementGeometry clip is evaluated in the coordinate space of canvasTransform.:
FAIL - drawElementImage with source and destination offsets clips hit-testing identically to manual updateElementGeometry.:
FAIL - updateElementGeometry supports clip with ElementImage.:
FAIL - Hit test clip rect does not clip element rendering in drawElementImage.:
FAIL - Setting or clearing hit test clip rect does not trigger canvas paint events.:
FAIL
- Canvas descendants are hittable after updateElementGeometry.:
- /html/canvas/element/manual/draw-element-image/hit-test/elementsFromPoint.tentative.html [wpt.fyi]
- Canvas descendants are hittable after being drawn.:
FAIL - Canvas descendants are hit in reverse drawing order.:
FAIL - Re-drawing an element moves it to the top of the hit testing list.:
FAIL - Pointer-events: none and inert should be excluded from elementsFromPoint:
FAIL - CSS transform should be used for hit testing:
FAIL - Canvas transform should be used for hit testing:
FAIL
- Canvas descendants are hittable after being drawn.:
- /html/canvas/element/manual/draw-element-image/hit-test/low-dpi-hit-test.tentative.html [wpt.fyi]:
ERROR- single target:
TIMEOUT - multiple targets, should only hit first:
NOTRUN - single target miss:
NOTRUN
- single target:
- /html/canvas/element/manual/draw-element-image/hit-test/selection.tentative.html [wpt.fyi]
- Double-clicking on canvas should be able to modify selection.:
FAIL
- Double-clicking on canvas should be able to modify selection.:
- /html/canvas/element/manual/draw-element-image/hit-test/z-index.tentative.html [wpt.fyi]
- Draw order trumps z-index in hit testing.:
FAIL
- Draw order trumps z-index in hit testing.:
Comment 5•7 days ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/d14518a150be
https://hg.mozilla.org/mozilla-central/rev/0ccd598c069a
Description
•