Closed Bug 2087728 Opened 1 month ago Closed 20 days ago

[wpt-sync] Sync PR 64333 - [Blink] Fix dynamic form association during parsing

Categories

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

task

Tracking

()

RESOLVED FIXED
162 Branch
Tracking Status
firefox162 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

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

Christoph Schwering <schwering@google.com> wrote:

[Blink] Fix dynamic form association during parsing

This CL fixes a bug which leads to an inconsistency between
HTMLInputElement.form and HTMLFormElement.elements.

In the following snippet, t should be associated with f because t
is parsed while the form element pointer is f:

\<form id=f>
\<div id=d>
\<script>
document.body.appendChild(document.getElementById('d'));
\</script>
\<input id=t>
\</div>
\</form>

Indeed, t.form === f, but f.elements.length === 0.

This is because HTMLFormElement::DidAssociateByParser() is a no-op
during parsing.

This CL fixes this issue.

Bug: 347059988, 578370708
Change-Id: Ia0c3cb605ed52f5d6ff0952fb108ad1c6a6a6964
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8666000
Reviewed-by: Mason Freed \<masonf@chromium.org>
Commit-Queue: Christoph Schwering \<schwering@google.com>
Cr-Commit-Position: refs/heads/main@{#1730867}

Whiteboard: [wptsync downstream] → [wptsync downstream error]
Component: web-platform-tests → DOM: Core & HTML
Product: Testing → Core
Whiteboard: [wptsync downstream error] → [wptsync downstream]
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 7 tests and 2 subtests

Status Summary

Firefox

OK : 1[GitHub] 7[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-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
PASS: 2[GitHub] 116[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-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]
FAIL: 7

Chrome

OK : 1
PASS: 1
FAIL: 1

Safari

OK : 1
PASS: 2

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

  • /html/semantics/forms/form-control-infrastructure/form_attribute.html [wpt.fyi]
    • [BUTTON] A control that is not in the document but has the form attribute set is associated with the nearest ancestor form if one exists: FAIL
    • [FIELDSET] A control that is not in the document but has the form attribute set is associated with the nearest ancestor form if one exists: FAIL
    • [INPUT] A control that is not in the document but has the form attribute set is associated with the nearest ancestor form if one exists: FAIL
    • [OBJECT] A control that is not in the document but has the form attribute set is associated with the nearest ancestor form if one exists: FAIL
    • [OUTPUT] A control that is not in the document but has the form attribute set is associated with the nearest ancestor form if one exists: FAIL
    • [SELECT] A control that is not in the document but has the form attribute set is associated with the nearest ancestor form if one exists: FAIL
    • [TEXTAREA] A control that is not in the document but has the form attribute set is associated with the nearest ancestor form if one exists: FAIL
Pushed by wptsync@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/5ea6da77241b https://hg.mozilla.org/integration/autoland/rev/faa1e11292a9 [wpt PR 64333] - [Blink] Fix dynamic form association during parsing, a=testonly
Status: NEW → RESOLVED
Closed: 20 days ago
Resolution: --- → FIXED
Target Milestone: --- → 162 Branch
You need to log in before you can comment on or make changes to this bug.