Closed Bug 1977369 Opened 25 days ago Closed 22 days ago

[wpt-sync] Sync PR 53766 - [Trusted Types] Handle policy functions without return values.

Categories

(Core :: DOM: Security, task, P4)

task

Tracking

()

RESOLVED FIXED
142 Branch
Tracking Status
firefox142 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

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

Daniel Vogelheim <vogelheim@chromium.org> wrote:

[Trusted Types] Handle policy functions without return values.

When a user-supplied policy callback does not return a value, the
expected behaviour differs between manually calling a regular policy
and the default policy being called automatically. This was previously
handled by the same code.

Here, we split out the trusted type creation function in an "Internal"
method, which can then be called from both the API function and the
default policy. They each then need to do their own handling of the
"null-ish" String case.

Bug: 430335244
Change-Id: I67d422d04685453437ae0fd4edcd93aac45230ec
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6718391
Reviewed-by: Yifan Luo \<lyf@chromium.org>
Commit-Queue: Daniel Vogelheim \<vogelheim@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1486831}

Component: web-platform-tests → DOM: Security
Product: Testing → Core

CI Results

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

Total 1 tests and 3 subtests

Status Summary

Firefox

OK : 1
PASS : 3
FAIL : 3

Chrome

CRASH: 1

Safari

OK : 1
PASS : 2
FAIL : 1

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

  • /trusted-types/policy-without-return-value.sub.html [wpt.fyi]
    • createHTML with a policy that returns undefined: FAIL [GitHub], PASS [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, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-32-24h2-debug, Gecko-windows11-32-24h2-opt, Gecko-windows11-64-24h2-debug, Gecko-windows11-64-24h2-opt] (Safari: PASS)
    • createScript with a policy that returns undefined: FAIL [GitHub], PASS [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, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-32-24h2-debug, Gecko-windows11-32-24h2-opt, Gecko-windows11-64-24h2-debug, Gecko-windows11-64-24h2-opt] (Safari: PASS)
    • createScriptURL with a policy that returns undefined: FAIL [GitHub], PASS [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, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-32-24h2-debug, Gecko-windows11-32-24h2-opt, Gecko-windows11-64-24h2-debug, Gecko-windows11-64-24h2-opt] (Safari: FAIL)
Pushed by wptsync@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/7a178909a330 https://hg.mozilla.org/integration/autoland/rev/a4fafcc0c6c6 [wpt PR 53766] - [Trusted Types] Handle policy functions without return values., a=testonly
Status: NEW → RESOLVED
Closed: 22 days ago
Resolution: --- → FIXED
Target Milestone: --- → 142 Branch
You need to log in before you can comment on or make changes to this bug.