Closed Bug 885024 Opened 6 years ago Closed 6 years ago

"ASSERTION: FindAncestorForm should not be called if @form is set!"

Categories

(Core :: DOM: Core & HTML, defect)

x86_64
macOS
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla24

People

(Reporter: jruderman, Assigned: baku)

References

(Blocks 1 open bug)

Details

(Keywords: assertion, regression, testcase)

Attachments

(1 file, 2 obsolete files)

Attached file testcase (obsolete) —
###!!! ASSERTION: FindAncestorForm should not be called if @form is set!: '!HasAttr(kNameSpaceID_None, nsGkAtoms::form)', file content/html/content/src/nsGenericHTMLElement.cpp, line 658
Nice. Baku, please add a check for img to that assertion.
Keywords: regression
Attached patch patch (obsolete) — Splinter Review
Test included.
Attachment #765385 - Flags: review?(bzbarsky)
Comment on attachment 765385 [details] [diff] [review]
patch

No, this is backwards.  @form means nothing on <img> so HTMLImageElement::UpdateFormOwner was correct but the assert in FindAncestorForm is wrong: it should only assert !HasAttr if the element is not an image.
Attachment #765385 - Flags: review?(bzbarsky) → review-
And you should add a test that when an <img form="foo"> is added as a descendant of <form id="bar"> it still shows up on the form id="bar", even if there is another <form id="foo"> around.
Attached patch patchSplinter Review
Attachment #764995 - Attachment is obsolete: true
Attachment #765385 - Attachment is obsolete: true
Attachment #765446 - Flags: review?(bzbarsky)
Comment on attachment 765446 [details] [diff] [review]
patch

r=me

I assume this test does fail with your first patch?
Attachment #765446 - Flags: review?(bzbarsky) → review+
Keywords: checkin-needed
https://hg.mozilla.org/integration/mozilla-inbound/rev/0b124ffdeaf8
Assignee: nobody → amarchesini
Flags: in-testsuite+
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/0b124ffdeaf8
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla24
You need to log in before you can comment on or make changes to this bug.