Closed Bug 1085311 Opened 10 years ago Closed 10 years ago

vertical writing-mode support for single-line <input> fields

Categories

(Core :: Layout: Form Controls, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla36

People

(Reporter: jfkthame, Assigned: xidorn)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 2 obsolete files)

Simple testcases: data:text/html,<input style="writing-mode:vertical-lr;" value="foo"> data:text/html,<div style="writing-mode:vertical-lr;"> hello <input value="foo"> world Currently, on trunk build with vertical mode enabled, the input field remains horizontal, although the text within it is vertical (and so only a couple of characters are visible). Just resizing the field with CSS to make it tall and narrow does *not* help, as the text ends up offset horizontally (depending on the height) and hence clipped from view.
Attachment #8515755 - Flags: review?(jfkthame)
Attachment #8515755 - Attachment description: patch → vertical text support for text control
I guess we need new border/padding/margin CSS properties to describe styles for the controls? e.g -moz-padding-block-start, -moz-padding-inline-end?
For part of this, see bug 1083134 re -moz-*-{start,end}, and its blocker bug 649142. We'll need additional properties for the block direction, too.
Comment on attachment 8515755 [details] [diff] [review] vertical text support for text control Review of attachment 8515755 [details] [diff] [review]: ----------------------------------------------------------------- LGTM, thanks. One writing-mode fix as noted below, please. (Just FYI, I also have some baseline- and fontmetrics-related patches coming in other bugs that will improve the results this gives, especially for vertical-rl mode.) ::: layout/forms/nsTextControlFrame.cpp @@ +425,5 @@ > DISPLAY_PREF_WIDTH(this, result); > > float inflation = nsLayoutUtils::FontSizeInflationFor(this); > + // We don't care about the writing mode here > + WritingMode wm; This seems wrong in principle; CalcIntrinsicSize could in theory return a different result for vertical vs horizontal modes. I suspect in practice it doesn't matter (AFAICS, it would only become significant if scrollbars are present and the vertical and horizontal bars have different widths), but let's pass the right value anyway.
Attachment #8515755 - Flags: review?(jfkthame) → review+
(In reply to Jonathan Kew (:jfkthame) from comment #4) > Comment on attachment 8515755 [details] [diff] [review] > vertical text support for text control > > Review of attachment 8515755 [details] [diff] [review]: > ----------------------------------------------------------------- > > LGTM, thanks. One writing-mode fix as noted below, please. > > (Just FYI, I also have some baseline- and fontmetrics-related patches coming > in other bugs that will improve the results this gives, especially for > vertical-rl mode.) > > ::: layout/forms/nsTextControlFrame.cpp > @@ +425,5 @@ > > DISPLAY_PREF_WIDTH(this, result); > > > > float inflation = nsLayoutUtils::FontSizeInflationFor(this); > > + // We don't care about the writing mode here > > + WritingMode wm; > > This seems wrong in principle; CalcIntrinsicSize could in theory return a > different result for vertical vs horizontal modes. I forgot that it is always possible to get the writing mode from frame... BTW, is this bug only for the single line text <input>? Button ones and others depend on the new CSS properties I think.
Assignee: nobody → quanxunzhen
Attachment #8515755 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #8516277 - Flags: review+
(In reply to Xidorn Quan [:xidorn] (UTC+11) from comment #5) > BTW, is this bug only for the single line text <input>? Yes, I was intending this bug to be specifically about single-line text <input>. > Button ones and > others depend on the new CSS properties I think. Right; and they'll involve different frame classes. So we can file separate bugs as needed.
Comment on attachment 8516277 [details] [diff] [review] vertical text support for text control, r=jfkthame Review of attachment 8516277 [details] [diff] [review]: ----------------------------------------------------------------- ::: layout/forms/nsTextControlFrame.cpp @@ +142,5 @@ > } > > nsresult > nsTextControlFrame::CalcIntrinsicSize(nsRenderingContext* aRenderingContext, > + const WritingMode& aWM, Oh, one other thing - we usually pass WritingMode parameters by value rather than const reference, as they're only an 8-bit value. Did you have a specific reason to use the reference here? If not, let's remove it.
Attachment #8516277 - Attachment is obsolete: true
Attachment #8517050 - Flags: review+
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: