Bug 33751

Summary: Frame::matchLabelsAgainstElement should take id attribute into account (as well as name)
Product: WebKit Reporter: John Sullivan <sullivan>
Component: FormsAssignee: John Sullivan <sullivan>
Status: RESOLVED FIXED    
Severity: Normal CC: webkit.review.bot
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: PC   
OS: OS X 10.5   
Attachments:
Description Flags
Test case that was reduced from http://www.autotrader.com
none
Patch for platform-agnostic and Mac versions of the relevant code.
none
Revised patch that fixes the doubled semicolon. darin: review+

Description John Sullivan 2010-01-15 19:01:11 PST
Frame::matchLabelsAgainstElement() is used at least by Safari for trying to guess what kind of data is expected by a form field -- e.g., phone number, street address, zip code, etc.

Currently this function only checks the name attribute of the given element. It would do a better job of guessing if it also checked the id attribute when the name attribute check fails.
Comment 1 John Sullivan 2010-01-15 19:02:13 PST
Created attachment 46725 [details]
Test case that was reduced from http://www.autotrader.com
Comment 2 John Sullivan 2010-01-15 19:05:13 PST
This bug is in radar as 7538330.
Comment 3 John Sullivan 2010-01-15 19:10:39 PST
Created attachment 46726 [details]
Patch for platform-agnostic and Mac versions of the relevant code.
Comment 4 WebKit Review Bot 2010-01-15 19:15:31 PST
Attachment 46726 [details] did not pass style-queue:

Failed to run "WebKitTools/Scripts/check-webkit-style" exit_code: 1
WebCore/page/Frame.cpp:542:  More than one command on the same line  [whitespace/newline] [4]
Total errors found: 1
Comment 5 John Sullivan 2010-01-15 19:48:30 PST
Created attachment 46728 [details]
Revised patch that fixes the doubled semicolon.
Comment 6 Darin Adler 2010-01-16 10:42:09 PST
Comment on attachment 46728 [details]
Revised patch that fixes the doubled semicolon.

I'm not so fond with the name "mutable" in the local variable names here. It's also too bad we have no way to write regression tests for this function.

r=me despite that tho
Comment 7 John Sullivan 2010-01-16 17:04:48 PST
Checked in as r53367.