Bug 119174

Summary: <input type="search"> doesn't correctly handle the "size" attribute
Product: WebKit Reporter: Antoine Quint <graouts>
Component: FormsAssignee: Antoine Quint <graouts>
Status: RESOLVED FIXED    
Severity: Normal CC: buildbot, commit-queue, rniwa, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Testcase
none
Patch
none
Archive of layout-test-results from webkit-ews-10 for mac-mountainlion-wk2
none
Archive of layout-test-results from webkit-ews-06 for mac-mountainlion
none
Archive of layout-test-results from webkit-ews-03 for mac-mountainlion
none
Patch
none
Patch for landing
none
Patch for landing none

Description Antoine Quint 2013-07-27 00:15:10 PDT
Created attachment 207579 [details]
Testcase

Per http://www.w3.org/html/wg/drafts/html/master/forms.html#the-size-attribute, the "size" attribute should make it so that the user agent ensures the minimal display of the number of characters specified in the search field. However, the padding due to the rounded corners, the display of the magnifying glass to the left and potentially the clear button to the right don't seem to be taken into account and an <input type="text" size="20"> and an <input type="search" size="20"> are rendered with the same size even though fewer characters are visible to the user in the <input type="search"> case.
Comment 1 Radar WebKit Bug Importer 2013-07-27 00:15:28 PDT
<rdar://problem/14567753>
Comment 2 Antoine Quint 2013-08-01 10:47:21 PDT
Created attachment 207936 [details]
Patch
Comment 3 Darin Adler 2013-08-01 10:55:03 PDT
Comment on attachment 207936 [details]
Patch

Looks OK. Unfortunate to have to add more rendering-related functions to HTMLInputElement.
Comment 4 Tim Horton 2013-08-01 11:10:01 PDT
Comment on attachment 207936 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=207936&action=review

> Source/WebCore/ChangeLog:8
> +        and as a result we would not guarantee that we could show the number of characeters set by

typo characters

> Source/WebCore/ChangeLog:11
> +        To make the process of reporting extra width due to decorations, we add a new decorationWidth()

there's something wrong with this sentence.

> Source/WebCore/html/InputType.cpp:317
> +LayoutUnit InputType::decorationWidth() const

LayoutUnits all the way out here? Is that right?
Comment 5 Antoine Quint 2013-08-01 11:22:13 PDT
(In reply to comment #4)
> (From update of attachment 207936 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=207936&action=review
> 
> > Source/WebCore/ChangeLog:8
> > +        and as a result we would not guarantee that we could show the number of characeters set by
> 
> typo characters
> 
> > Source/WebCore/ChangeLog:11
> > +        To make the process of reporting extra width due to decorations, we add a new decorationWidth()
> 
> there's something wrong with this sentence.

Indeed, I'll fix the ChangeLog.

> > Source/WebCore/html/InputType.cpp:317
> > +LayoutUnit InputType::decorationWidth() const
> 
> LayoutUnits all the way out here? Is that right?

Would a float be more suitable here?
Comment 6 Build Bot 2013-08-01 12:45:52 PDT
Comment on attachment 207936 [details]
Patch

Attachment 207936 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.appspot.com/results/1312140

New failing tests:
fast/forms/search-cancel-button-style-sharing.html
fast/forms/search-display-none-cancel-button.html
fast/forms/searchfield-heights.html
fast/forms/control-restrict-line-height.html
fast/forms/placeholder-pseudo-style.html
fast/forms/search-rtl.html
fast/css/text-overflow-input.html
fast/forms/placeholder-position.html
fast/repaint/search-field-cancel.html
fast/forms/input-appearance-height.html
fast/forms/search-vertical-alignment.html
fast/forms/box-shadow-override.html
fast/forms/search/search-size-with-decorations.html
fast/css/input-search-padding.html
fast/forms/search-styled.html
Comment 7 Build Bot 2013-08-01 12:45:54 PDT
Created attachment 207945 [details]
Archive of layout-test-results from webkit-ews-10 for mac-mountainlion-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: webkit-ews-10  Port: mac-mountainlion-wk2  Platform: Mac OS X 10.8.4
Comment 8 Build Bot 2013-08-01 13:53:53 PDT
Comment on attachment 207936 [details]
Patch

Attachment 207936 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.appspot.com/results/1320107

New failing tests:
fast/forms/search-cancel-button-style-sharing.html
fast/forms/search-display-none-cancel-button.html
fast/forms/searchfield-heights.html
fast/forms/control-restrict-line-height.html
fast/forms/placeholder-pseudo-style.html
fast/forms/search-rtl.html
fast/css/text-overflow-input.html
fast/forms/placeholder-position.html
fast/repaint/search-field-cancel.html
fast/forms/input-appearance-height.html
fast/forms/search-vertical-alignment.html
fast/forms/box-shadow-override.html
fast/forms/search/search-size-with-decorations.html
fast/css/input-search-padding.html
fast/forms/search-styled.html
Comment 9 Build Bot 2013-08-01 13:53:55 PDT
Created attachment 207949 [details]
Archive of layout-test-results from webkit-ews-06 for mac-mountainlion

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: webkit-ews-06  Port: mac-mountainlion  Platform: Mac OS X 10.8.4
Comment 10 Build Bot 2013-08-01 14:58:22 PDT
Comment on attachment 207936 [details]
Patch

Attachment 207936 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.appspot.com/results/1322050

New failing tests:
fast/forms/search-cancel-button-style-sharing.html
fast/forms/search-display-none-cancel-button.html
fast/forms/searchfield-heights.html
fast/forms/control-restrict-line-height.html
fast/forms/placeholder-pseudo-style.html
fast/forms/search-rtl.html
fast/css/text-overflow-input.html
fast/forms/placeholder-position.html
fast/repaint/search-field-cancel.html
fast/forms/input-appearance-height.html
fast/forms/search-vertical-alignment.html
fast/forms/box-shadow-override.html
fast/forms/search/search-size-with-decorations.html
fast/css/input-search-padding.html
fast/forms/search-styled.html
Comment 11 Build Bot 2013-08-01 14:58:24 PDT
Created attachment 207956 [details]
Archive of layout-test-results from webkit-ews-03 for mac-mountainlion

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: webkit-ews-03  Port: mac-mountainlion  Platform: Mac OS X 10.8.4
Comment 12 Antoine Quint 2013-08-02 02:19:45 PDT
Created attachment 207995 [details]
Patch
Comment 13 Antoine Quint 2013-08-02 06:30:15 PDT
Created attachment 208006 [details]
Patch for landing
Comment 14 WebKit Commit Bot 2013-08-02 06:31:45 PDT
Comment on attachment 208006 [details]
Patch for landing

Rejecting attachment 208006 [details] from commit-queue.

Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.appspot.com', '--bot-id=webkit-cq-03', 'validate-changelog', '--check-oops', '--non-interactive', 208006, '--port=mac']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit

ChangeLog entry in LayoutTests/ChangeLog contains OOPS!.

Full output: http://webkit-queues.appspot.com/results/1338165
Comment 15 Antoine Quint 2013-08-02 06:35:31 PDT
Created attachment 208007 [details]
Patch for landing
Comment 16 WebKit Commit Bot 2013-08-02 07:57:01 PDT
Comment on attachment 208007 [details]
Patch for landing

Clearing flags on attachment: 208007

Committed r153647: <http://trac.webkit.org/changeset/153647>
Comment 17 WebKit Commit Bot 2013-08-02 07:57:04 PDT
All reviewed patches have been landed.  Closing bug.