Closed
Bug 900724
Opened 13 years ago
Closed 13 years ago
Prevent form-association when creating elements in template contents.
Categories
(Core :: DOM: HTML Parser, defect)
Core
DOM: HTML Parser
Tracking
()
RESOLVED
FIXED
mozilla26
People
(Reporter: wchen, Assigned: wchen)
References
()
Details
Attachments
(2 files)
|
3.40 KB,
patch
|
hsivonen
:
review+
|
Details | Diff | Splinter Review |
|
3.39 KB,
patch
|
hsivonen
:
review+
|
Details | Diff | Splinter Review |
Update the <template> parser implementation to disallow form association of elements in template content. e.g.
<form><template><input></template></form>
<template><form><input></form></template>
The <input> elements should not be associated with the <form> elements.
http://html5.org/tools/web-apps-tracker?from=8114&to=8115
| Assignee | ||
Updated•13 years ago
|
Summary: Disallow form-association in template contents. → Prevent form-association when creating elements in template contents.
| Assignee | ||
Comment 1•13 years ago
|
||
I ran into a related bug while working on the update. In the following markup:
<template><form><input></form></template>
According to the spec (http://www.whatwg.org/specs/web-apps/current-work/#association-of-controls-and-forms), the input should not be associated with the form element because it is not inserted into a document. However, this is not the case in Gecko because we do not check the "inserted into a document" bit.
I've excluded this case from my tests. I rather fix the issue in a follow-up bug since it is a different problem.
Attachment #784798 -
Flags: review?(hsivonen)
| Assignee | ||
Comment 2•13 years ago
|
||
Attachment #784799 -
Flags: review?(hsivonen)
Comment 3•13 years ago
|
||
Comment on attachment 784798 [details] [diff] [review]
Prevent form association when creating elements in template contents.
Does the "form == null || " bit add value? It looks like an unnecessary comparison to me. r+ in any case.
Attachment #784798 -
Flags: review?(hsivonen) → review+
Updated•13 years ago
|
Attachment #784799 -
Flags: review?(hsivonen) → review+
| Assignee | ||
Comment 4•13 years ago
|
||
(In reply to Henri Sivonen (:hsivonen) from comment #3)
> Comment on attachment 784798 [details] [diff] [review]
> Prevent form association when creating elements in template contents.
>
> Does the "form == null || " bit add value? It looks like an unnecessary
> comparison to me. r+ in any case.
For majority of the cases, form == null and I wanted to short circuit isTemplateContents() because it looks through the stack. I wasn't sure if the compiler would be able to optimize it. In any case, it reads closer to the spec so I've left it in there.
https://hg.mozilla.org/integration/mozilla-inbound/rev/cc84be0b4a5d
Comment 5•13 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/cc84be0b4a5d
Is the test upstreamable?
Status: NEW → RESOLVED
Closed: 13 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla26
Updated•13 years ago
|
Flags: needinfo?(wchen)
| Assignee | ||
Comment 6•13 years ago
|
||
(In reply to :Ms2ger from comment #5)
> https://hg.mozilla.org/mozilla-central/rev/cc84be0b4a5d
>
> Is the test upstreamable?
I would say no because this test doesn't completely test the specified behavior. I left out some tests because I only fixed the parser piece but there is still a DOM piece that needs to be fixed.
Flags: needinfo?(wchen)
You need to log in
before you can comment on or make changes to this bug.
Description
•