Closed Bug 1896567 Opened 5 months ago Closed 4 months ago

[wpt-sync] Sync PR 46247 - Fix print only object bitmap image loading

Categories

(Core :: DOM: Core & HTML, task, P4)

task

Tracking

()

RESOLVED FIXED
128 Branch
Tracking Status
firefox128 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

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

Traian Captan <tcaptan@chromium.org> wrote:

Fix print only object bitmap image loading

An object element with image data that is not rendered on screen will
not initially load the image. This is because of step 2 of the spec
algorithm which states that "if the element is not being rendered,
then jump to the step below labeled fallback", skipping over step 3.5
to actually "Fetch request". [1]

If the object element is to be displayed in printing mode, the bitmap
image loading will be kicked off by the post layout call back
HTMLPlugInElement::CustomStyleForLayoutObject. This will be too late
for the first print rendering, however it will render on subsequent
print attempts if they are made.

The proposed fix for this issue is to follow the pattern in
Document::WillPrintSoon, which gets called before printing, to
ensure that bitmap images in all object elements in the doc are loaded
before printing.

PrintRenderFrameHelper::PrintRequestedPages is modified to also call
WillPrintSoon so that printing from the system print dialog works as
expected. This matches
PrintRenderFrameHelper::RequestPrintPreview which calls it for the
print preview path.

WebFrameTestProxy::StartTest was modified to call WillPrintSoon` so
that wpt tests for print only will load the images before dumping the
print rendering pixels and match the system print dialog and print
preview paths.

[1]https://html.spec.whatwg.org/multipage/iframe-embed-object.html#the-object-element

Bug: 41477900
Change-Id: I937d1dfff548235ef4967a625f2e0e5132b95b93

Reviewed-on: https://chromium-review.googlesource.com/5535938
WPT-Export-Revision: 6f563194a9d48a4df4cb12f05914f73dbc241bf0

Component: web-platform-tests → DOM: Core & HTML
Product: Testing → Core
Whiteboard: [wptsync downstream] → [wptsync downstream error]
Whiteboard: [wptsync downstream error] → [wptsync downstream]

CI Results

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

Total 3 tests

Status Summary

Firefox

OK : 1
FAIL: 1[Gecko-android-em-7.0-x86_64-lite-qr-opt-geckoview, Gecko-android-em-7.0-x86_64-qr-debug-geckoview, Gecko-android-em-7.0-x86_64-qr-opt-geckoview] 3[Gecko-linux1804-64-qr-debug, Gecko-linux1804-64-qr-opt, Gecko-windows11-32-2009-qr-debug, Gecko-windows11-32-2009-qr-opt, Gecko-windows11-64-2009-qr-debug, Gecko-windows11-64-2009-qr-opt, GitHub]

Chrome

OK : 1
PASS: 2
FAIL: 1

Safari

OK : 1
PASS: 1

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

Firefox-only Failures

New Tests That Don't Pass

Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e70354aa3082 [wpt PR 46247] - Fix print-only object bitmap-image loading, a=testonly https://hg.mozilla.org/integration/autoland/rev/a8b147f9a1b2 [wpt PR 46247] - Update wpt metadata, a=testonly
Status: NEW → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Target Milestone: --- → 128 Branch
You need to log in before you can comment on or make changes to this bug.