Bug 69248 - translateZ(0) shifts file name in file input
Summary: translateZ(0) shifts file name in file input
Alias: None
Product: WebKit
Classification: Unclassified
Component: Forms (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Simon Fraser (smfr)
URL: http://jsfiddle.net/NWR2f/1/
Keywords: InRadar
: 79280 89292 (view as bug list)
Depends on:
Reported: 2011-10-03 04:08 PDT by a5951153
Modified: 2012-08-21 00:27 PDT (History)
11 users (show)

See Also:

Patch 1 (3.91 KB, patch)
2012-08-07 02:38 PDT, yosin
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description a5951153 2011-10-03 04:08:06 PDT
See url

if the url above doesn't work:

input {-webkit-transform: translateZ(0);}
<input type="file" name="file">
<input type="submit" value="Upload">
Comment 1 Radar WebKit Bug Importer 2011-10-04 10:11:28 PDT
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. ***