Bug 11771 - Add a test for resetting a textarea form control
Summary: Add a test for resetting a textarea form control
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: 420+
Hardware: PC All
: P4 Normal
Assignee: Nobody
URL:
Keywords: HasReduction
Depends on:
Blocks:
 
Reported: 2006-12-06 14:30 PST by Kirby White
Modified: 2006-12-07 16:27 PST (History)
2 users (show)

See Also:


Attachments
Test case (300 bytes, text/html)
2006-12-06 15:21 PST, Kirby White
no flags Details
Unit test for resetting textarea controls (2.31 KB, patch)
2006-12-06 19:46 PST, Kirby White
no flags Details | Formatted Diff | Diff
Unit test including pixel test (33.37 KB, patch)
2006-12-07 09:11 PST, Kirby White
adele: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.