Closed
Bug 566879
Opened 15 years ago
Closed 15 years ago
[HTML5] HTML5 parser incorrect behavior with form controls
Categories
(Core :: DOM: HTML Parser, defect, P2)
Core
DOM: HTML Parser
Tracking
()
RESOLVED
FIXED
Tracking | Status | |
---|---|---|
blocking2.0 | --- | final+ |
People
(Reporter: dricks2222, Assigned: hsivonen)
References
()
Details
(Keywords: regression)
Attachments
(1 file, 2 obsolete files)
7.32 KB,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3
Build Identifier:
If you have a form with input controls (checkbox, radiobuttons, textbox) and that you replace some of them using innerHTML in Javascript, the control's state coming from this innerHTML are not applied.
Reproducible: Always
Steps to Reproduce:
1. Test the give URL with Firefox 3.7a5 with html5 parser enabled
2. Put a value inside the textbox.
3. Click on a radio or on the checkbox
Actual Results:
The value in the textbox is still there.
The clicked radio or checkbox is checked.
Expected Results:
The textbox should be empty.
Only the radio1 radiobutton should be checked.
It works OK if you disable HTML5 parser (about:config -> html5.enable = false ).
or if you use a previous version of firefox.
Tested on Windows XP and on Ubuntu 10.04 with the latest builds of Firefox (20100519)
Note :
If the controls aren't included in a FORM element, it works.
Comment 2•15 years ago
|
||
Confirmed with Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.3a5pre) Gecko/20100519 Minefield/3.7a5pre
Comment 3•15 years ago
|
||
Are we ending up doing state restoration here when we didn't use to before?
Assignee | ||
Comment 4•15 years ago
|
||
Could be fallout from bug 562013.
Summary: HTML5 parser incorrect behavior with form controls → [HTML5] HTML5 parser incorrect behavior with form controls
Updated•15 years ago
|
blocking2.0: ? → final+
Comment 5•15 years ago
|
||
I am a new Mozilla developer. I am thinking of working on this bug, but I need help to get started.
Can somebody please point me to the source code that would need to be changed?
Comment 6•15 years ago
|
||
This depends on bug 569538, and after that is fixed form element handling
needs to be change if element is created in innerHTML.
Form elements are under content/html/content
http://mxr.mozilla.org/mozilla-central/source/content/html/content/src/
Assignee | ||
Updated•15 years ago
|
Priority: -- → P2
Assignee | ||
Comment 7•15 years ago
|
||
Assignee: nobody → hsivonen
Status: NEW → ASSIGNED
Assignee | ||
Comment 8•15 years ago
|
||
This test case doesn't fail appropriately without the fix. Is it necessary to simulate user input to make sure the intermediate form state gets saved?
Attachment #449856 -
Attachment is obsolete: true
Comment 9•15 years ago
|
||
Your patch did'nt apply cleanly on trunk
hfongarnand@hfongarnand-desktop:~/Programmes/mozilla-central$ cat ./formrestore.patch | patch -p1
patching file content/html/content/src/nsHTMLInputElement.cpp
Hunk #2 succeeded at 134 (offset 2 lines).
Hunk #3 FAILED at 509.
Hunk #4 succeeded at 2955 (offset 119 lines).
1 out of 4 hunks FAILED -- saving rejects to file content/html/content/src/nsHTMLInputElement.cpp.rej
patching file content/html/content/src/nsHTMLSelectElement.cpp
patching file content/html/content/src/nsHTMLSelectElement.h
patching file content/html/content/src/nsHTMLTextAreaElement.cpp
Hunk #1 succeeded at 76 with fuzz 2.
Hunk #2 succeeded at 205 with fuzz 1 (offset 22 lines).
Hunk #3 FAILED at 230.
Hunk #4 succeeded at 679 (offset 15 lines).
1 out of 4 hunks FAILED -- saving rejects to file content/html/content/src/nsHTMLTextAreaElement.cpp.rej
Assignee | ||
Comment 10•15 years ago
|
||
(In reply to comment #9)
> Your patch did'nt apply cleanly on trunk
Conflicting stuff landed. Here's the patch rebased to tip.
Attachment #449858 -
Attachment is obsolete: true
Comment 11•15 years ago
|
||
ok, tested on my ubuntu box...
it seem's to fix the problem!
Assignee | ||
Comment 12•15 years ago
|
||
Comment on attachment 450095 [details] [diff] [review]
Fix with a test case
It seems the test tests the right thing after all, and I previously mistested the test...
Attachment #450095 -
Attachment description: Fix with a bogus test case, rebased to tip → Fix with a test case
Attachment #450095 -
Flags: review?(Olli.Pettay)
Updated•15 years ago
|
Attachment #450095 -
Flags: review?(Olli.Pettay) → review+
Assignee | ||
Comment 13•15 years ago
|
||
Thanks. Pushed http://hg.mozilla.org/mozilla-central/rev/a1f73f137c41
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•