Closed Bug 167001 Opened 22 years ago Closed 20 years ago

Anything below the baseline goes out of input field

Categories

(Core :: Layout: Text and Fonts, defect)

x86
Windows 2000
defect
Not set
major

Tracking

()

RESOLVED FIXED
Future

People

(Reporter: kazhik, Assigned: smontagu)

References

Details

(Keywords: testcase, topembed-, Whiteboard: [adt3] [ETA Needed])

Attachments

(4 files, 13 obsolete files)

965 bytes, patch
dbaron
: review-
dbaron
: superreview-
Details | Diff | Splinter Review
902 bytes, image/png
Details
3.37 KB, patch
smontagu
: review+
dbaron
: superreview-
Details | Diff | Splinter Review
4.23 KB, patch
dbaron
: review+
dbaron
: superreview+
Details | Diff | Splinter Review
Underline goes out of input field.

Testcase:
http://bugzilla.mozilla.gr.jp/showattachment.cgi?attach_id=1015

Maybe this is a side-effect of the fix for bug 156943.
This might be a regression introduced by bug 156943, which was taken on the
branch to address a concern for a major embeddor. Nominating for topembed.
Blocks: 154896
Severity: normal → major
Keywords: nsbeta1+, topembed+
Whiteboard: [adt2] [ETA Needed]
Target Milestone: --- → mozilla1.0.2
I still see the problem even after I disabled the change for bug 156943. Are you
sure that this is a regression? Would you mind posting 2 screen shot before and
after patch 156943 for comparision?  Thanks
Status: NEW → ASSIGNED
Keywords: intl
QA Contact: ruixu → ylong
reassign to shanjian
Assignee: yokoyama → shanjian
Status: ASSIGNED → NEW
In the case of Win98SE, I add "line-height: 100%;" to the place which defines
the style of each attribute of the input element in the \res\forms.css.
A text will come to be settled in a box about the following test cases.

Isn't this patch considered to be an effective method? Please give me your
advice.

bug 167001:
http://bugzilla.mozilla.gr.jp/showattachment.cgi?attach_id=1015

bug 90884:
attachment 42348 [details], attachment 49900 [details], attachment 86782 [details]

bug 70019:
attachment 26070 [details], attachment 32052 [details]

In \res\forms.css on Win98SE or in layout/html/document/src/forms.css:

/* default inputs, text inputs, and selects */
input {
  padding: 1px 0 1px 0;
  border: 2px inset ThreeDFace;
  background-color: -moz-Field;
  color: -moz-FieldText;
  font: -moz-field;
  line-height: 100%;       <- Addition
  text-align: start;

select {
  margin: 0;
  border-color: ThreeDFace;
  background-color: -moz-Field;
  color: -moz-FieldText;
  font: -moz-list;
  line-height: 100%;¡¡¡¡¡¡¡¡¡¡<- Addition
  white-space: nowrap;

/* buttons */
button, 
input[type="reset"],
input[type="button"],
input[type="submit"] { 
  padding: 2px 0 2px 0;
  border: 2px outset ButtonFace;
  background-color: ButtonFace;
  color: ButtonText; 
  font: -moz-button;
  line-height: 100%;       <- Addition
  white-space: pre;
Bug 90884 and Bug 82265 are fixed on 20021100604-trunk/WinXP.
But, I can reproduce this problem with the build.
Attached file testcase (obsolete) —
Attached patch patch (obsolete) — Splinter Review
Since the height of the font based on mMaxHeight with the
CalculateSizeStandard() function of
layout/html/forms/src/nsTextControlFrame.cpp differs from the line height based
on mEmHeight that is asked by calculation, a font moves slightly up and down.

With a patch, it is made for the height of the font and the line height to
become the same.

Since the patch of bug 156943 was also moving the baseline when lang was "ja",
it was changed.
Attached image screen shot (obsolete) —
Attachment #110438 - Flags: review?(shanjian)
reassign to ftang.
Assignee: shanjian → ftang
Attachment #110438 - Flags: review?(shanjian) → review+
Attached patch patch for textarea (obsolete) — Splinter Review
A patch for the height of the TEXTAREA field.
ftang, review this patch also?
Attached file testcase for textarea (obsolete) —
Attached patch patch for a vertical scroll bar (obsolete) — Splinter Review
When displaying on the TEXTAREA field at one more line, the patch was added so
that a vertical scroll bar might not be displayed.
Attached image screen shot for textarea (obsolete) —
Comment on attachment 111188 [details] [diff] [review]
patch for a vertical scroll bar

The third patch is not bug fix and has become change of specification.
Since examination is not fully made, it withdraws.
Attachment #111188 - Attachment is obsolete: true
saito- are you signed up to fix this bug? Looks like you are. Please let me know
which patch you want me to review when you are ready. Send me mail plesase. 
Comment on attachment 111157 [details] [diff] [review]
patch for textarea

I am sorry to have made it confusing.
The patch of which I want to ask a review is the first patch.
Attachment #111157 - Attachment is obsolete: true
Status: NEW → ASSIGNED
I cannot reproduce the problem on the trunk with winxp any more, in all bugzilla
text field. I try some japanese site, the input  method underline also show up.
it looks like the problem is gone. wfm
URL: a¾»
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → WORKSFORME
No, I can still reproduce this bug with 2003021308-trunk/WinXP.
( http://bugzilla.mozilla.gr.jp/showattachment.cgi?attach_id=1015 )
I can see the problem in the attached testcases on 02-12 trunk build /WinXP
also, re-open.
Status: RESOLVED → VERIFIED
Re-open
Status: VERIFIED → REOPENED
Resolution: WORKSFORME → ---
i18n triage team: nsbeta1+/adt3
Whiteboard: [adt2] [ETA Needed] → [adt3] [ETA Needed]
i18n triage team: over to Simon for a look.  
Assignee: ftang → smontagu
Status: REOPENED → NEW
Component: Internationalization → Layout: Fonts and Text
Keywords: intl
Summary: Underline goes out of input field → Anything below the baseline goes out of input field
Discussed in topembed bug triage.  Minusing.
Keywords: topembed+topembed-
retargeting
Target Milestone: mozilla1.0.2 → Future
Keywords: testcase
Attached patch patchSplinter Review
I cannot reproduce this bug with this simply patch.
Does it have problem?
Comment on attachment 158414 [details] [diff] [review]
patch

David Baron:
I think that "line-height: normal !important" is mistake of bug 82265.
In INPUT element, 'line-height' should be '1', not be 'normal'.
Attachment #158414 - Flags: review?(dbaron)
Attachment #158414 - Flags: superreview?(dbaron)
Attachment #158414 - Flags: superreview+
Attachment #158414 - Flags: review?(dbaron)
Attachment #158414 - Flags: review+
Patch checked in.
URL: a¾»a��
Status: NEW → RESOLVED
Closed: 22 years ago20 years ago
Resolution: --- → FIXED
This patch broke Mac build.
http://bugzilla.mozilla.gr.jp/attachment.cgi?id=2377&action=view

reopening.
please back it out.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
I think the Mac build's problem is Mac widget bug.
This bug was not reproduced on Mac.
I think the reason is the top of editor is not content top on Mac.
But on other OS, the top of editor is content top.

Mike Pinkerton, Brian Ryner:

Can you fix by Mac widget?
My guess:
On mac, if the top of editor is same as content top (not border top),
the text may be overlaped bottom-border.

Isn't the top raised intentionally?
The regression on Mac occurs in Japanese locale, not in English locale.
That's related to Bug 109176 and Bug 233781.

Workaround for Japanese locale on Mac is setting as follows in
Mozilla.app/Contents/MacOS/res/platform-forms.css:
input { font-family: 'Lucida grande', sans-serif !important; }
or 
input { line-height: normal !important; }

BTW, why Mac Mozilla build uses
http://lxr.mozilla.org/mozilla/source/layout/html/document/src/win/platform-forms.css
instead of
http://lxr.mozilla.org/mozilla/source/layout/html/document/src/mac/platform-forms.css
?
I think that we needs new directory as following.

layout/html/document/src/
 +- mac
 +- cocoa <- new directory.
 +- ...

And changing the role.

mac ... for MacOS X builds( Mozilla/Firefox )
cocoa ... for Camino

who can allow to create new directory?
Attached patch patch for Mac OS X and Camino (obsolete) — Splinter Review
For Mac OS X and Camino.
But I cannot test it.
Comment on attachment 158633 [details] [diff] [review]
patch for Mac OS X and Camino

Brian Ryner:

I cannot test this patch.
Please test and review it.
Attachment #158633 - Flags: review?(bryner)
Attached patch patch for Mac OS X and Camino (obsolete) — Splinter Review
Sorry. my mistake.
Attachment #158633 - Attachment is obsolete: true
In Bugzilla-jp, attachment 158634 [details] [diff] [review] is works fine.

Please review and superreview it.
(In reply to comment #26)
> (From update of attachment 158414 [details] [diff] [review])
> David Baron:
> I think that "line-height: normal !important" is mistake of bug 82265.
> In INPUT element, 'line-height' should be '1', not be 'normal'.

So should Bug 258889 be invalid then (it was caused by this bug here)? I'm not
quite sure if a input field should look like in Attachment 158578 [details] (notice the
space between input border and text in trunk build). IMO the text should still
be vertically centered, but i let someone else decide.
OK, I'm thinking the original patch is a bad idea in general.  Has the original
patch been backed out?  Perhaps it should be, and we should ensure that input
fields are big enough to hold a line at 'line-height: normal', which they seem
to be in most cases?
I think bug 258889 is not invalid.

The new bug is new alignment problem.
I think the line-height being '1' is correctly.
Comment on attachment 158414 [details] [diff] [review]
patch

I'm changing my mind about this.  'line-height: normal' should mean that we use
the font's recommended spacing, which is what we should be doing.  I really
didn't like this idea from the start, and I'm not sure why I marked it review+
in the first place.
Attachment #158414 - Flags: superreview-
Attachment #158414 - Flags: superreview+
Attachment #158414 - Flags: review-
Attachment #158414 - Flags: review+
comment 39:

Wait.
Why backout?
I want you to think this problem.
On our enviroment, the text information is lacked 'normal'.
e.x., We cannot understand i and j.
I don't understand comment 42, but I think 'normal' is the correct line-height.

However, does this get better if you |#undef FONT_LEADING_APIS_V2| in
nsHTMLReflowState.cpp (after the include of nsIFontMetrics.h)?
Attached image screenshot
See this screenshot.

If the patch is backedout, we cannot understand j and y.
Because decent is cutted.
I'm aware of that, but it's the wrong fix.

I suspect that part of the problem is that line-heights are handled differently
on Windows from other platforms, and on Windows East Asian fonts are handled
differently from other fonts.  This is what FONT_LEADING_APIS_V2 is about, if my
memory is correct.  Adding ifdefs like that leads to bugs that are in the code
followed by one of the three paths (non-Windows, Windows Western fonts, Windows
Asian fonts) and not the other.  The solution is to fix the cross-platform API
so that it does the right thing rather than adding per-platform ifdefs and
fixing bugs on some platforms and leaving them on others.  Then again, I'm not
sure if that's the problem here -- so it would help if someone answered my
question in comment 43.

I'm not inclined to allow more differences between Windows and other platforms
in this regard, because that's just making the underlying problems harder to
fix.  I'm also in general inclined to be skeptical of changes to the code for
all platforms and fonts that are driven by the needs of East Asian fonts under
Windows, since the code for handling of East Asian fonts under Windows is
different enough from everything else that problems dealing with them seem
likely to be in the specialized code for them rather than in the cross-platform
cross-font code.  Differences like that should be abstracted away in the
platform-specific backend unless they're really needed for all platforms, in
which case they should really be made for all platforms. 

I'm also not sure why increasing the line-height isn't increasing the size of
the input.  That seems like the real bug to solve.
Attachment #158634 - Flags: superreview?(dbaron)
Attachment #158634 - Flags: review?(bryner)
FYI,  bug 218032 is about FONT_LEADING_APIS_V2 on non-Windows platforms.
(In reply to comment #43)
> I don't understand comment 42, but I think 'normal' is the correct line-height.
> 
> However, does this get better if you |#undef FONT_LEADING_APIS_V2| in
> nsHTMLReflowState.cpp (after the include of nsIFontMetrics.h)?

I think that we get a better result, if |FONT_LEADING_APIS_V2| is not defined,
since |aLineHeight| and |aDesiredSize.height| in the attachment 110438 [details] [diff] [review] are
equal, we get these height of the font from the functions of
|CalculateSizeStandard| and |aReflowState.CalcLineHeight|.
The line height of the input box has normal line height that is |mEmHeight +
mInternalLeading| at nsFontMetricsWin.cpp. The text line height has the computed
line height that is |emHeight * NORMAL_LINE_HEIGHT_FACTOR| at
nsHTMLReflowState.cpp. The base line of the input box shifts upword only the
half of leading as folows.

leading = |emHeight * NORMAL_LINE_HEIGHT_FACTOR| - |mEmHeight + mInternalLeading|.
Attached patch patch for shifting a baseline (obsolete) — Splinter Review
Attachment #110437 - Attachment is obsolete: true
Attachment #110438 - Attachment is obsolete: true
Attachment #110439 - Attachment is obsolete: true
Attachment #111186 - Attachment is obsolete: true
Attachment #111189 - Attachment is obsolete: true
Attached file testcase for patch (obsolete) —
Attachment #158634 - Attachment is obsolete: true
Attached image screenshot for patch (obsolete) —
I think that this bug does not restrict with the problem which occurs only with
an input box.
URL: a��
Comment on attachment 159395 [details] [diff] [review]
patch for shifting a baseline

The leading is supposed to occur at the beginning of the block.  See CSS1 or
CSS2.

Perhaps the correct simple solution would be a FONT_LEADING_APIS_V2 ifdef in
nsTextControlFrame::CalculateSizeStandard ?  (Is that involved in this code?)
Attachment #159395 - Flags: review-
This patch increases the line-height of the input box (although the height of
the textarea also increases).
Attachment #159395 - Attachment is obsolete: true
Attachment #159399 - Attachment is obsolete: true
Attachment #159400 - Attachment is obsolete: true
Attachment #159448 - Flags: review?(ftang)
Attachment #159448 - Flags: review?(ftang)
Attachment #159448 - Flags: review?(smontagu)
Comment on attachment 159448 [details] [diff] [review]
patch for increasing the line-height

>+  nsIRenderingContext* aRendContext = aReflowState.rendContext;

If aRendContext is becoming a local variable instead of an argument, you should
change the name to rendContext.
Attachment #159448 - Attachment is obsolete: true
Attachment #159951 - Flags: superreview?(smontagu)
Attachment #159951 - Flags: review?(smontagu)
Attachment #159448 - Flags: review?(smontagu)
Comment on attachment 159951 [details] [diff] [review]
patch for increasing the line-height

r=smontagu. I'm not a super-reviewer, so transferring sr request to dbaron.
Attachment #159951 - Flags: superreview?(smontagu)
Attachment #159951 - Flags: superreview?(dbaron)
Attachment #159951 - Flags: review?(smontagu)
Attachment #159951 - Flags: review+
Comment on attachment 159951 [details] [diff] [review]
patch for increasing the line-height

So would this change behavior if it weren't ifdef'd?
In the case of original code, the height of the line box is a |mMaxHeight| of
font metrics. If FONT_LEADING_APIS_V2 is not defined, the calculated line
height is NormalLineHeight that is |mEmHeight + mInternalLeading|.

Because |mMaxHeight| and |mEmHeight + mInternalLeading| is equel, although that
is now satisfactory, in future the same problem may occur except windows.

Is this patch acceptable?
(In reply to comment #59)
> (From update of attachment 159951 [details] [diff] [review])
> So would this change behavior if it weren't ifdef'd?

If the meaning is related with the following code and FONT_LEADING_APIS_V2 is
not defined, the patch does not change the behavior.

+#ifdef FONT_LEADING_APIS_V2
+  fontHeight = aReflowState.CalcLineHeight(aPresContext, rendContext,
aReflowState.frame);
+#else
   fontMet->GetHeight(fontHeight);
+#endif // FONT_LEADING_APIS_V2
Comment on attachment 160033 [details] [diff] [review]
 patch for using calculated line-height

The patch of attachment 159951 [details] [diff] [review] affects windows build, only when
FONT_LEADING_APIS_V2 is defined. I think that the patch of attachment 160033 [details] [diff] [review] is
better although it affects all build.
Attachment #160033 - Flags: review?(dbaron)
Comment on attachment 160033 [details] [diff] [review]
 patch for using calculated line-height

Agreed.  Thanks for going through so many versions of this patch, and sorry for
the delay.
Attachment #160033 - Flags: review?(dbaron) → review+
Attachment #159951 - Flags: superreview?(dbaron) → superreview-
Attachment #160033 - Flags: superreview?(dbaron)
Attachment #160033 - Flags: superreview?(dbaron) → superreview+
Thanks dbaron, please check into the trunk.
smontagu, could you check in attachment 160033 [details] [diff] [review], since dbaron's review and
super-review were done?
Fix checked in.
Status: REOPENED → RESOLVED
Closed: 20 years ago20 years ago
Resolution: --- → FIXED
This fix caused Bug 263806 on Mac.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: