Closed Bug 1558793 Opened 5 years ago Closed 3 years ago

Add assert back into SetFormElement

Categories

(Core :: DOM: HTML Parser, enhancement, P3)

65 Branch
enhancement

Tracking

()

RESOLVED FIXED
94 Branch
Tracking Status
firefox94 --- fixed

People

(Reporter: jkt, Assigned: edgar)

References

Details

Attachments

(1 file)

Add back in assert into parser/html/nsHtml5TreeOperation.cpp:

NS_ASSERTION(formControl, "Form-associated element did not implement nsIFormControl.");

Also we can remove formControl from this line too:

  if (formControl &&
      !aNode->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::form)) {

However we have at least a few crashing tests:
layout/base/crashtests/49122-1.html
tests/reftest/tests/layout/reftests/bugs/81947-1.html
browser/extensions/formautofill/test/unit/heuristics/third_party/test_CDW.js

This code is called when nsHtml5TreeBuilder::createElement( is triggered, it looks to me like the only other caller of significance is <img> when in an imagemap.

:hsivonen I made this a follow up bug as it appears Img is now the issue instead.

Priority: -- → P3
Assignee: nobody → echen
Component: DOM: Core & HTML → DOM: HTML Parser

I think the comment and assertion are not valid any more as img is a form-associated element, https://html.spec.whatwg.org/#form-associated-element. And we do already handle the img case well.

Pushed by echen@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/1c5d2eecb0f2
Remove invalid comment and assertion in nsHtml5TreeOperation::SetFormElement; r=hsivonen
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 94 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: