Closed Bug 2023456 Opened 8 months ago Closed 7 months ago

[wpt-sync] Sync PR 58508 - Remove additional elements from the active formatting elements list

Categories

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

task

Tracking

()

RESOLVED FIXED
151 Branch
Tracking Status
firefox151 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

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

Javier Fernández García-Boente <jfernandez@igalia.com> wrote:

Remove additional elements from the active formatting elements list

Our current implementation of the adoption algorithm [1] misses one of
the step defined in the specification:

13.4- If innerLoopCounter is greater than 3 and node is in the list of active formatting elements, then remove node from the list of active formatting elements.

This causes that some extra reconstruction is done, causing different
DOM trees than the ones Firefox and Safari builds in some malformed HTML
content.

Some of the failures in the removed from the expected.txt files are
examples of these interop issues in the DOM reconstruction provided by
the adoption algorithm. I have defined an unit tests with one of these
examples, because I think it's easier to understand and debug these
cases.

[1]
html.spec.whatwg.org/multipage/parsing.html#adoption-agency-algorithm

Bug: 40775952
Change-Id: I92a79e68c21f85a52822a57deccbb48ae21afc52
Reviewed-on: https://chromium-review.googlesource.com/7535115
WPT-Export-Revision: c7878bc01d2afbcacfbba3a1b79979e1f99e36ac

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 20 tests and 4 subtests

Status Summary

Firefox

OK : 1[GitHub] 20[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-24h2-debug, Gecko-windows11-32-24h2-opt, Gecko-windows11-64-24h2-debug, Gecko-windows11-64-24h2-opt]
PASS: 84[GitHub] 521[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-24h2-debug, Gecko-windows11-32-24h2-opt, Gecko-windows11-64-24h2-debug, Gecko-windows11-64-24h2-opt]
FAIL: 1[GitHub] 128[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-24h2-debug, Gecko-windows11-32-24h2-opt, Gecko-windows11-64-24h2-debug, Gecko-windows11-64-24h2-opt]

Chrome

OK : 1
PASS: 84
FAIL: 1

Safari

OK : 1
PASS: 4
FAIL: 81

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

  • /sanitizer-api/sanitizer-javascript-url.html [wpt.fyi]
    • setHTML testcase built-in-animating-url-attributes-list/2, "<svg><animateMotion attributeName="href"></svg>": FAIL
    • parseHTML testcase built-in-animating-url-attributes-list/2, "<svg><animateMotion attributeName="href"></svg>": FAIL
    • setHTML testcase built-in-animating-url-attributes-list/3, "<svg><animateMotion attributeName="xlink:href"></svg>": FAIL
    • parseHTML testcase built-in-animating-url-attributes-list/3, "<svg><animateMotion attributeName="xlink:href"></svg>": FAIL
  • /sanitizer-api/sanitizer-modifiers.tentative.html [wpt.fyi]
    • sanitizer.replaceElementWithChildren does not allow 'html' element.: FAIL
  • /sanitizer-api/sethtml-tree-construction.tentative.html [wpt.fyi]
    • Testcase #71, "<table><div><td>", config: "{ "replaceWithChildrenElements": ["table"] }".: FAIL (Chrome: PASS, Safari: FAIL)
  • /sanitizer-api/sethtml-with-trustedtypes-createParserOptions.tentative.html [wpt.fyi]
    • ShadowRoot.setHTMLUnsafe: passing a TrustedParserOptions overrides default policy: FAIL
    • Element.setHTMLUnsafe: passing a TrustedParserOptions overrides default policy: FAIL
  • /sanitizer-api/sethtml-with-trustedtypes-immutable.tentative.html [wpt.fyi]
    • setHTML: createParserOptions doesn't mutate original object: FAIL
    • setHTML: createParserOptions doesn't mutate sanitizer object: FAIL
    • setHTMLUnsafe: createParserOptions doesn't mutate original object: FAIL
    • setHTMLUnsafe: createParserOptions doesn't mutate sanitizer object: FAIL
  • /sanitizer-api/sethtml-with-trustedtypes.tentative.html [wpt.fyi]
    • ShadowRoot.setHTML: createParserOptions can inject a sanitizer config: FAIL
    • ShadowRoot.setHTML: createParserOptions can inject a sanitizer: FAIL
    • ShadowRoot.setHTML: createParserOptions can override a sanitizer config: FAIL
    • ShadowRoot.setHTML: createParserOptions can remove a sanitizer: FAIL
    • ShadowRoot.setHTML: createParserOptions returning null fails: FAIL
    • ShadowRoot.setHTML: createParserOptions returning undefined fails: FAIL
    • ShadowRoot.setHTML: createParserOptions returning 0 fails: FAIL
    • ShadowRoot.setHTML: createParserOptions returning 123 fails: FAIL
    • ShadowRoot.setHTML: createParserOptions returning "foo" fails: FAIL
    • ShadowRoot.setHTMLUnsafe: createParserOptions can inject a sanitizer config: FAIL
    • ShadowRoot.setHTMLUnsafe: createParserOptions can inject a sanitizer: FAIL
    • ShadowRoot.setHTMLUnsafe: createParserOptions can override a sanitizer config: FAIL
    • ShadowRoot.setHTMLUnsafe: createParserOptions returning null fails: FAIL
    • ShadowRoot.setHTMLUnsafe: createParserOptions returning undefined fails: FAIL
    • ShadowRoot.setHTMLUnsafe: createParserOptions returning 0 fails: FAIL
    • ShadowRoot.setHTMLUnsafe: createParserOptions returning 123 fails: FAIL
    • ShadowRoot.setHTMLUnsafe: createParserOptions returning "foo" fails: FAIL
    • ShadowRoot.innerHTML: createParserOptions can inject a sanitizer config: FAIL
    • ShadowRoot.innerHTML: createParserOptions can inject a sanitizer: FAIL
    • ShadowRoot.innerHTML: createParserOptions can override a sanitizer config: FAIL
    • ShadowRoot.innerHTML: createParserOptions returning null fails: FAIL
    • ShadowRoot.innerHTML: createParserOptions returning undefined fails: FAIL
    • ShadowRoot.innerHTML: createParserOptions returning 0 fails: FAIL
    • ShadowRoot.innerHTML: createParserOptions returning 123 fails: FAIL
    • ShadowRoot.innerHTML: createParserOptions returning "foo" fails: FAIL
    • ShadowRoot.beforebegin: createParserOptions can inject a sanitizer config: FAIL
    • ShadowRoot.beforebegin: createParserOptions can inject a sanitizer: FAIL
    • ShadowRoot.beforebegin: createParserOptions can override a sanitizer config: FAIL
    • ShadowRoot.beforebegin: createParserOptions returning null fails: FAIL
    • ShadowRoot.beforebegin: createParserOptions returning undefined fails: FAIL
    • ShadowRoot.beforebegin: createParserOptions returning 0 fails: FAIL
    • ShadowRoot.beforebegin: createParserOptions returning 123 fails: FAIL
    • ShadowRoot.beforebegin: createParserOptions returning "foo" fails: FAIL
    • ShadowRoot.afterend: createParserOptions can inject a sanitizer config: FAIL
    • ShadowRoot.afterend: createParserOptions can inject a sanitizer: FAIL
    • ShadowRoot.afterend: createParserOptions can override a sanitizer config: FAIL
    • ShadowRoot.afterend: createParserOptions returning null fails: FAIL
    • ShadowRoot.afterend: createParserOptions returning undefined fails: FAIL
    • ShadowRoot.afterend: createParserOptions returning 0 fails: FAIL
    • ShadowRoot.afterend: createParserOptions returning 123 fails: FAIL
    • ShadowRoot.afterend: createParserOptions returning "foo" fails: FAIL
    • ShadowRoot.setHTMLUnsafe: createParserOptions works after createHTML: FAIL
    • Element.setHTML: createParserOptions can inject a sanitizer config: FAIL
    • Element.setHTML: createParserOptions can inject a sanitizer: FAIL
    • Element.setHTML: createParserOptions can override a sanitizer config: FAIL
    • Element.setHTML: createParserOptions can remove a sanitizer: FAIL
    • Element.setHTML: createParserOptions returning null fails: FAIL
    • Element.setHTML: createParserOptions returning undefined fails: FAIL
    • Element.setHTML: createParserOptions returning 0 fails: FAIL
    • Element.setHTML: createParserOptions returning 123 fails: FAIL
    • Element.setHTML: createParserOptions returning "foo" fails: FAIL
    • Element.setHTMLUnsafe: createParserOptions can inject a sanitizer config: FAIL
    • Element.setHTMLUnsafe: createParserOptions can inject a sanitizer: FAIL
    • Element.setHTMLUnsafe: createParserOptions can override a sanitizer config: FAIL
    • Element.setHTMLUnsafe: createParserOptions returning null fails: FAIL
    • Element.setHTMLUnsafe: createParserOptions returning undefined fails: FAIL
    • Element.setHTMLUnsafe: createParserOptions returning 0 fails: FAIL
    • Element.setHTMLUnsafe: createParserOptions returning 123 fails: FAIL
    • Element.setHTMLUnsafe: createParserOptions returning "foo" fails: FAIL
    • Element.innerHTML: createParserOptions can inject a sanitizer config: FAIL
    • Element.innerHTML: createParserOptions can inject a sanitizer: FAIL
    • Element.innerHTML: createParserOptions can override a sanitizer config: FAIL
    • Element.innerHTML: createParserOptions returning null fails: FAIL
    • Element.innerHTML: createParserOptions returning undefined fails: FAIL
    • Element.innerHTML: createParserOptions returning 0 fails: FAIL
    • Element.innerHTML: createParserOptions returning 123 fails: FAIL
    • Element.innerHTML: createParserOptions returning "foo" fails: FAIL
    • Element.outerHTML: createParserOptions can inject a sanitizer config: FAIL
    • Element.outerHTML: createParserOptions can inject a sanitizer: FAIL
    • Element.outerHTML: createParserOptions can override a sanitizer config: FAIL
    • Element.outerHTML: createParserOptions returning null fails: FAIL
    • Element.outerHTML: createParserOptions returning undefined fails: FAIL
    • Element.outerHTML: createParserOptions returning 0 fails: FAIL
    • Element.outerHTML: createParserOptions returning 123 fails: FAIL
    • Element.outerHTML: createParserOptions returning "foo" fails: FAIL
    • Element.createContextualFragment: createParserOptions can inject a sanitizer config: FAIL
    • Element.createContextualFragment: createParserOptions can inject a sanitizer: FAIL
    • Element.createContextualFragment: createParserOptions can override a sanitizer config: FAIL
    • Element.createContextualFragment: createParserOptions returning null fails: FAIL
    • Element.createContextualFragment: createParserOptions returning undefined fails: FAIL
    • Element.createContextualFragment: createParserOptions returning 0 fails: FAIL
    • Element.createContextualFragment: createParserOptions returning 123 fails: FAIL
    • Element.createContextualFragment: createParserOptions returning "foo" fails: FAIL
    • Element.afterbegin: createParserOptions can inject a sanitizer config: FAIL
    • Element.afterbegin: createParserOptions can inject a sanitizer: FAIL
    • Element.afterbegin: createParserOptions can override a sanitizer config: FAIL
    • Element.afterbegin: createParserOptions returning null fails: FAIL
    • Element.afterbegin: createParserOptions returning undefined fails: FAIL
    • Element.afterbegin: createParserOptions returning 0 fails: FAIL
    • Element.afterbegin: createParserOptions returning 123 fails: FAIL
    • Element.afterbegin: createParserOptions returning "foo" fails: FAIL
    • Element.beforeend: createParserOptions can inject a sanitizer config: FAIL
    • Element.beforeend: createParserOptions can inject a sanitizer: FAIL
    • Element.beforeend: createParserOptions can override a sanitizer config: FAIL
    • Element.beforeend: createParserOptions returning null fails: FAIL
    • Element.beforeend: createParserOptions returning undefined fails: FAIL
    • Element.beforeend: createParserOptions returning 0 fails: FAIL
    • Element.beforeend: createParserOptions returning 123 fails: FAIL
    • Element.beforeend: createParserOptions returning "foo" fails: FAIL
    • Element.beforebegin: createParserOptions can inject a sanitizer config: FAIL
    • Element.beforebegin: createParserOptions can inject a sanitizer: FAIL
    • Element.beforebegin: createParserOptions can override a sanitizer config: FAIL
    • Element.beforebegin: createParserOptions returning null fails: FAIL
    • Element.beforebegin: createParserOptions returning undefined fails: FAIL
    • Element.beforebegin: createParserOptions returning 0 fails: FAIL
    • Element.beforebegin: createParserOptions returning 123 fails: FAIL
    • Element.beforebegin: createParserOptions returning "foo" fails: FAIL
    • Element.afterend: createParserOptions can inject a sanitizer config: FAIL
    • Element.afterend: createParserOptions can inject a sanitizer: FAIL
    • Element.afterend: createParserOptions can override a sanitizer config: FAIL
    • Element.afterend: createParserOptions returning null fails: FAIL
    • Element.afterend: createParserOptions returning undefined fails: FAIL
    • Element.afterend: createParserOptions returning 0 fails: FAIL
    • Element.afterend: createParserOptions returning 123 fails: FAIL
    • Element.afterend: createParserOptions returning "foo" fails: FAIL
    • Element.setHTMLUnsafe: createParserOptions works after createHTML: FAIL
Pushed by wptsync@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/179d4a91d1ad https://hg.mozilla.org/integration/autoland/rev/903b8a571ca9 [wpt PR 58508] - Remove additional elements from the active formatting elements list, a=testonly
Status: NEW → RESOLVED
Closed: 7 months ago
Resolution: --- → FIXED
Target Milestone: --- → 151 Branch
You need to log in before you can comment on or make changes to this bug.