Closed Bug 1682297 Opened 3 years ago Closed 3 years ago

[wpt-sync] Sync PR 26889 - Fix ShapeDetection handling of broken HTMLImageElements

Categories

(Testing :: web-platform-tests, task, P4)

task

Tracking

(firefox86 fixed)

RESOLVED FIXED
86 Branch
Tracking Status
firefox86 --- fixed

People

(Reporter: mozilla.org, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

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

b'Fredrik S\xc3\xb6derqvist <fs@opera.com>' wrote:

Fix ShapeDetection handling of broken HTMLImageElements

When an HTMLImageElement's 'src' is set to the empty string, the state
of the image request will be 'broken', and thus the promise should be
rejected with an InvalidStateError exception per the rules at [1].

Move the intrinsic size check below the image existence check, and use
a more direct method of getting at the size (no need to go through the
BitmapImageSource interface when we're already fiddling with internals).

Also add a check for IsLoaded() to better match the spec wording
'fully decodable'.

[1] https://wicg.github.io/shape-detection-api/#image-sources-for-detection

Bug: 789511
Change-Id: I69ac4a9081cfff7f9c7c8f7edf39667e3dd1eb4d

Reviewed-on: https://chromium-review.googlesource.com/2587165
WPT-Export-Revision: a757091e0912a6d0d8b4cbfc0e972c975abd940f

CI Results

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

Total 2 tests and 3 subtests

Status Summary

Firefox

OK : 2
FAIL: 6

Chrome

OK : 2
PASS: 2
FAIL: 4

Safari

OK : 2
FAIL: 6

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

/shape-detection/detection-HTMLImageElement-empty-src.https.html: OK [GitHub], SKIP [Gecko-android-em-7.0-x86_64-debug-geckoview, Gecko-android-em-7.0-x86_64-opt-geckoview, Gecko-android-em-7.0-x86_64-qr-debug-geckoview, Gecko-android-em-7.0-x86_64-qr-opt-geckoview, Gecko-linux1804-64-debug, Gecko-linux1804-64-opt, Gecko-linux1804-64-qr-debug, Gecko-linux1804-64-qr-opt, Gecko-windows10-64-debug, Gecko-windows10-64-opt, Gecko-windows10-64-qr-debug, Gecko-windows10-64-qr-opt, Gecko-windows7-32-debug, Gecko-windows7-32-opt] (Chrome: OK, Safari: OK)
Face - detect(empty src): FAIL (Chrome: FAIL, Safari: FAIL)
Barcode - detect(empty src): FAIL (Chrome: FAIL, Safari: FAIL)
Text - detect(empty src): FAIL (Chrome: FAIL, Safari: FAIL)
/shape-detection/detection-HTMLImageElement-zero-dimension-image.https.html: OK [GitHub], SKIP [Gecko-android-em-7.0-x86_64-debug-geckoview, Gecko-android-em-7.0-x86_64-opt-geckoview, Gecko-android-em-7.0-x86_64-qr-debug-geckoview, Gecko-android-em-7.0-x86_64-qr-opt-geckoview, Gecko-linux1804-64-debug, Gecko-linux1804-64-opt, Gecko-linux1804-64-qr-debug, Gecko-linux1804-64-qr-opt, Gecko-windows10-64-debug, Gecko-windows10-64-opt, Gecko-windows10-64-qr-debug, Gecko-windows10-64-qr-opt, Gecko-windows7-32-debug, Gecko-windows7-32-opt] (Chrome: OK, Safari: OK)
Face - detect(0x0): FAIL (Chrome: PASS, Safari: FAIL)
Barcode - detect(0x0): FAIL (Chrome: FAIL, Safari: FAIL)
Text - detect(0x0): FAIL (Chrome: PASS, Safari: FAIL)

Tests Disabled in Gecko Infrastructure

/shape-detection/detection-HTMLImageElement-empty-src.https.html: OK [GitHub], SKIP [Gecko-android-em-7.0-x86_64-debug-geckoview, Gecko-android-em-7.0-x86_64-opt-geckoview, Gecko-android-em-7.0-x86_64-qr-debug-geckoview, Gecko-android-em-7.0-x86_64-qr-opt-geckoview, Gecko-linux1804-64-debug, Gecko-linux1804-64-opt, Gecko-linux1804-64-qr-debug, Gecko-linux1804-64-qr-opt, Gecko-windows10-64-debug, Gecko-windows10-64-opt, Gecko-windows10-64-qr-debug, Gecko-windows10-64-qr-opt, Gecko-windows7-32-debug, Gecko-windows7-32-opt] (Chrome: OK, Safari: OK)
/shape-detection/detection-HTMLImageElement-zero-dimension-image.https.html: OK [GitHub], SKIP [Gecko-android-em-7.0-x86_64-debug-geckoview, Gecko-android-em-7.0-x86_64-opt-geckoview, Gecko-android-em-7.0-x86_64-qr-debug-geckoview, Gecko-android-em-7.0-x86_64-qr-opt-geckoview, Gecko-linux1804-64-debug, Gecko-linux1804-64-opt, Gecko-linux1804-64-qr-debug, Gecko-linux1804-64-qr-opt, Gecko-windows10-64-debug, Gecko-windows10-64-opt, Gecko-windows10-64-qr-debug, Gecko-windows10-64-qr-opt, Gecko-windows7-32-debug, Gecko-windows7-32-opt] (Chrome: OK, Safari: OK)

Pushed by wptsync@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/dd96f385886d
[wpt PR 26889] - Fix ShapeDetection handling of broken HTMLImageElements, a=testonly
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 86 Branch
You need to log in before you can comment on or make changes to this bug.