Bug 69248

Summary: translateZ(0) shifts file name in file input
Product: WebKit Reporter: a5951153
Component: FormsAssignee: Simon Fraser (smfr) <simon.fraser>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, eric, jonlee, kyle.wanamaker, mifenton, simon.fraser, simulus, tkent, webkit-bug-importer, webkit.review.bot, yosin
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
URL: http://jsfiddle.net/NWR2f/1/
Attachments:
Description Flags
Patch 1 none

Description a5951153 2011-10-03 04:08:06 PDT
See url

if the url above doesn't work:

<style>
input {-webkit-transform: translateZ(0);}
</style>
<input type="file" name="file">
<input type="submit" value="Upload">
Comment 1 Radar WebKit Bug Importer 2011-10-04 10:11:28 PDT
<rdar://problem/10231217>
Comment 2 simurai 2012-06-27 09:26:29 PDT
Note: In the jsFiddle http://jsfiddle.net/NWR2f/1/ of this bug, you have to disable "Normalized CSS" to see it.

I made another one http://jsfiddle.net/Am4CD/ and it appears that any kind of transform causes the "No file chosen" text to be pushed down too much and it's relative to the distance to the top/root.
Comment 3 yosin 2012-08-06 23:49:04 PDT
Filenames/"No file selected" are rendered in RenderFileUploadControl::paintObject and Y-coordinate is calculated as below[1]:

LayoutUnit textY = buttonRenderer->absoluteBoundingBoxRectIgnoringTransforms().y()
+ buttonRenderer->baselinePosition(AlphabeticBaseline, true, HorizontalLine, PositionOnContainingLine);

Note: It seems translate(1) doesn't shift out text. So, does translate(0) cause the problem?

= References =
[1] http://trac.webkit.org/browser/trunk/Source/WebCore/rendering/RenderFileUploadControl.cpp#L149

BTW, how about rendering text by shadow DOM rather than rendering object?
Comment 4 yosin 2012-08-07 02:38:29 PDT
Created attachment 156899 [details]
Patch 1
Comment 5 yosin 2012-08-07 02:39:12 PDT
Comment on attachment 156899 [details]
Patch 1

Could you review this patch?
Thanks in advance.
Comment 6 yosin 2012-08-07 18:11:07 PDT
Comment on attachment 156899 [details]
Patch 1

Clearing flags on attachment: 156899

Committed r124960: <http://trac.webkit.org/changeset/124960>
Comment 7 yosin 2012-08-07 18:11:12 PDT
All reviewed patches have been landed.  Closing bug.
Comment 8 Kent Tamura 2012-08-18 17:37:29 PDT
*** Bug 89292 has been marked as a duplicate of this bug. ***
Comment 9 Kent Tamura 2012-08-21 00:27:44 PDT
*** Bug 79280 has been marked as a duplicate of this bug. ***