Closed Bug 1194493 Opened 10 years ago Closed 10 years ago

the filename field of <input type=file> renders incorrectly in vertical writing mode with dir=rtl

Categories

(Core :: Layout: Form Controls, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla43
Tracking Status
firefox43 --- fixed

People

(Reporter: jfkthame, Assigned: jfkthame)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 1 obsolete file)

Testcase: data:text/html,<div style="writing-mode:vertical-rl" dir=rtl><input type=file> Result: The text "No file selected." should be shown (vertically) as a placeholder, but it actually renders horizontally and is clipped so that only the first letter (and a bit) is visible. Note that without dir=rtl, it renders as expected.
This was a bug in the (rudimentary) vertical-drawing support in nsTextBoxFrame that was added in bug 1123284: it fails to set the mVertical flag on the nsFontMetrics before using it to draw, so we end up drawing in whatever direction the last user of these metrics had set. (Eventually, we should aim to get rid of nsTextBoxFrame and use nsTextFrame everywhere, with its more fully-developed bidi and vertical support, but for now this fixes the glaring bug.)
Attachment #8648007 - Flags: review?(smontagu)
Assignee: nobody → jfkthame
Status: NEW → ASSIGNED
Blocks: 1123284
Oops, failed to refresh the patch before uploading, sorry for the noise.
Attachment #8648017 - Flags: review?(smontagu)
Attachment #8648007 - Attachment is obsolete: true
Attachment #8648007 - Flags: review?(smontagu)
Comment on attachment 8648017 [details] [diff] [review] Ensure the 'mVertical' flag is set appropriately on the nsFontMetrics we use to draw text for an nsTextBoxFrame Review of attachment 8648017 [details] [diff] [review]: ----------------------------------------------------------------- The patch makes sense, but if this was the problem I don't understand why it worked before without dir=rtl.
Attachment #8648017 - Flags: review?(smontagu) → review+
(In reply to Simon Montagu :smontagu from comment #4) > Comment on attachment 8648017 [details] [diff] [review] > Ensure the 'mVertical' flag is set appropriately on the nsFontMetrics we use > to draw text for an nsTextBoxFrame > > Review of attachment 8648017 [details] [diff] [review]: > ----------------------------------------------------------------- > > The patch makes sense, but if this was the problem I don't understand why it > worked before without dir=rtl. Because the button and the textbox use the same nsFontMetrics; so in the case where the button is drawn first (ltr), the vertical flag has been set by that, and the textbox doesn't change it.
url: https://hg.mozilla.org/integration/mozilla-inbound/rev/22b685186a10600851a8a6f1d05608eb13e68baf changeset: 22b685186a10600851a8a6f1d05608eb13e68baf user: Jonathan Kew <jkew@mozilla.com> date: Sun Aug 16 15:09:08 2015 +0100 description: Bug 1194493 - Ensure the 'mVertical' flag is set appropriately on the nsFontMetrics we use to draw text for an nsTextBoxFrame. r=smontagu
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla43
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: