Bug 11771

Summary: Add a test for resetting a textarea form control
Product: WebKit Reporter: Kirby White <KwhiteRight>
Component: FormsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: ddkilzer, mrowe
Priority: P4 Keywords: HasReduction
Version: 420+   
Hardware: PC   
OS: All   
Attachments:
Description Flags
Test case
none
Unit test for resetting textarea controls
none
Unit test including pixel test adele: review+

Description Kirby White 2006-12-06 14:30:47 PST
Resetting a form with an <input type="reset"> or <button type="reset"> control doesn't clear a <textarea>, nor set it to its default value if it has one.
Comment 1 Kirby White 2006-12-06 15:21:10 PST
Created attachment 11758 [details]
Test case

I can't assign this to myself, but I have a patch ready as soon as I make the unit test.
Comment 2 Mark Rowe (bdash) 2006-12-06 15:43:29 PST
Your test case already works correctly for me in both WebKit 418.9.1 and ToT.
Comment 3 Kirby White 2006-12-06 19:46:34 PST
Created attachment 11760 [details]
Unit test for resetting textarea controls

Sorry, I was using a flawed testcase, with a syntactic error that didn't carry over to the reduced one I posted.

Since I already have it, though, here's a test for the problem that turned out not to be a problem.  I've verified that this test works, and at the same time checked that no other tests catch the problem, by building a deliberately broken library.

I'd really like to make a PNG for this test, since the value of the textarea in JS might not match the value displayed on the page if it doesn't update properly.  But I can't find any information on how to do that.  Any pointers?
Comment 4 Alexey Proskuryakov 2006-12-06 21:44:17 PST
To create a pixel test, just remove the dumpAsText() call, and add a --pixel switch to run-webkit-tests when generating the results.
Comment 5 Kirby White 2006-12-07 09:11:08 PST
Created attachment 11762 [details]
Unit test including pixel test

Great, thanks!  Here's the full test.
Comment 6 Mark Rowe (bdash) 2006-12-07 16:27:03 PST
Landed in r18067.