Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6)

Issue 7531023: Improve Autofill heuristics when detecting labels from previous elements. (Closed)

Created:
9 years, 4 months ago by Ilya Sherman
Modified:
9 years, 4 months ago
Reviewers:
dhollowa
CC:
chromium-reviews, GeorgeY, brettw-cc_chromium.org, darin-cc_chromium.org, Paweł Hajdan Jr., Ilya Sherman
Visibility:
Public.

Description

Improve Autofill heuristics when detecting labels from previous elements. Support HTML like """Name <span class="required">*</span> <input type="text" name="name">""" Of course, pull at a thread and... Other changes also included to avoid regressions: * When parsing address fields for heuristics, we try to skip over unlabeled fields in the middle of an address. Updated the code not to also skip over unlabeled fields at the *end* of an address, as these might be part of a different section entirely. * Tighten the credit card number regex to require the word "card". * Add "csc" to the credit card security code regex. * When inferring labels based on <div> structure, be willing to scan up the tree past the closest parent that is a <div>. * Also when inferring labels based on <div> structure, we previously would only stop early if we were about to escape from a <table> element. Also stop early if we are about to escape from a <fieldset> element. If we see either of these elements, we expect the field label to be contained with the element. * Allow <label> elements to misuse the 'for' attribute to specify the element's name rather than its id. BUG=87517 TEST=browser_tests --gtest_filter=FormStructureBrowserTest.DataDrivenHeuristics* Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=95019

Patch Set 1 #

Patch Set 2 : Lots of fixes #

Patch Set 3 : Rebase #

Total comments: 4

Patch Set 4 : Address review comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1512 lines, -205 lines) Patch
M chrome/browser/autofill/address_field.cc View 1 4 chunks +16 lines, -3 lines 0 comments Download
M chrome/browser/autofill/autofill_resources.grd View 1 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/autofill/form_structure_browsertest.cc View 1 2 1 chunk +8 lines, -0 lines 0 comments Download
M chrome/renderer/autofill/form_manager.cc View 1 2 3 11 chunks +136 lines, -111 lines 0 comments Download
A chrome/test/data/autofill/heuristics/input/16_crbug_87517.html View 1 chunk +1229 lines, -0 lines 0 comments Download
M chrome/test/data/autofill/heuristics/output/02_checkout_ae.com.out View 1 2 2 chunks +6 lines, -6 lines 0 comments Download
M chrome/test/data/autofill/heuristics/output/03_checkout_crutchfield.com.out View 1 2 1 chunk +14 lines, -14 lines 0 comments Download
M chrome/test/data/autofill/heuristics/output/03_checkout_gamestop.com.out View 1 2 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/data/autofill/heuristics/output/04_checkout_ikea.com.out View 1 2 1 chunk +12 lines, -12 lines 0 comments Download
M chrome/test/data/autofill/heuristics/output/04_checkout_jr.com.out View 1 2 1 chunk +8 lines, -8 lines 0 comments Download
M chrome/test/data/autofill/heuristics/output/04_checkout_lowes.com.out View 1 2 1 chunk +3 lines, -3 lines 0 comments Download
M chrome/test/data/autofill/heuristics/output/05_checkout_nordstrom.com.out View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/test/data/autofill/heuristics/output/05_checkout_petco.com.out View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/test/data/autofill/heuristics/output/06_checkout_qvc.com.out View 1 2 2 chunks +4 lines, -4 lines 0 comments Download
M chrome/test/data/autofill/heuristics/output/06_checkout_urbanoutfitters.com.out View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M chrome/test/data/autofill/heuristics/output/09_register_ebay.com.out View 1 2 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/data/autofill/heuristics/output/09_register_ecomm.dell.com.out View 1 2 1 chunk +1 line, -1 line 0 comments Download
M chrome/test/data/autofill/heuristics/output/10_register_jbox.com.out View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/test/data/autofill/heuristics/output/12_register_officedepot.com.out View 1 2 1 chunk +1 line, -1 line 0 comments Download
chrome/test/data/autofill/heuristics/output/13_register_supershuttle.com.out View 1 2 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/test/data/autofill/heuristics/output/14_register_yahoo.com.out View 1 2 1 chunk +6 lines, -6 lines 0 comments Download
M chrome/test/data/autofill/heuristics/output/15_crbug_40687.out View 1 2 1 chunk +3 lines, -3 lines 0 comments Download
M chrome/test/data/autofill/heuristics/output/15_crbug_53075.out View 1 2 1 chunk +19 lines, -19 lines 0 comments Download
A chrome/test/data/autofill/heuristics/output/16_crbug_87517.out View 1 1 chunk +32 lines, -0 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Ilya Sherman
9 years, 4 months ago (2011-07-29 23:34:37 UTC) #1
dhollowa
LGTM. Pending comment requests and small readability request. These seem like very positive changes from ...
9 years, 4 months ago (2011-08-01 22:16:53 UTC) #2
Ilya Sherman
http://codereview.chromium.org/7531023/diff/3001/chrome/renderer/autofill/form_manager.cc File chrome/renderer/autofill/form_manager.cc (right): http://codereview.chromium.org/7531023/diff/3001/chrome/renderer/autofill/form_manager.cc#newcode106 chrome/renderer/autofill/form_manager.cc:106: // has leading whitespace. On 2011/08/01 22:16:54, dhollowa wrote: ...
9 years, 4 months ago (2011-08-01 23:59:35 UTC) #3
dhollowa
9 years, 4 months ago (2011-08-02 00:24:19 UTC) #4
SLGTM.  Thanks.

On 2011/08/01 23:59:35, Ilya Sherman wrote:
>
http://codereview.chromium.org/7531023/diff/3001/chrome/renderer/autofill/for...
> File chrome/renderer/autofill/form_manager.cc (right):
> 
>
http://codereview.chromium.org/7531023/diff/3001/chrome/renderer/autofill/for...
> chrome/renderer/autofill/form_manager.cc:106: // has leading whitespace.
> On 2011/08/01 22:16:54, dhollowa wrote:
> > Some examples in this comment would help the casual reader.  The comment as
it
> > stands is on par with directly reading the code.  ;-)
> 
> Done.
> 
>
http://codereview.chromium.org/7531023/diff/3001/chrome/renderer/autofill/for...
> chrome/renderer/autofill/form_manager.cc:221: } else if
> (previous.isElementNode()) {
> On 2011/08/01 22:16:54, dhollowa wrote:
> > Instead of "else if", it would be more readable IMO if you pulled the
|break|
> > into subsequent "if" blocks.  More like the original code.  And then pull
the
> > "All other elements are..." comment up above the second "if".
> >  
> 
> Done.

Powered by Google App Engine
This is Rietveld 408576698