Bug 33751 - Frame::matchLabelsAgainstElement should take id attribute into account (as well as name)
Summary: Frame::matchLabelsAgainstElement should take id attribute into account (as we...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: John Sullivan
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2010-01-15 19:01 PST by John Sullivan
Modified: 2010-01-16 17:04 PST (History)
1 user (show)

See Also:


Attachments
Test case that was reduced from http://www.autotrader.com (71 bytes, text/html)
2010-01-15 19:02 PST, John Sullivan
no flags Details
Patch for platform-agnostic and Mac versions of the relevant code. (6.58 KB, patch)
2010-01-15 19:10 PST, John Sullivan
no flags Details | Formatted Diff | Diff
Revised patch that fixes the doubled semicolon. (6.58 KB, patch)
2010-01-15 19:48 PST, John Sullivan
darin: review+
Details | Formatted Diff | Diff

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