Closed Bug 20387 Opened 25 years ago Closed 25 years ago

scroll bars appearing in single line text control (scrollbars)

Categories

(Core :: Layout: Form Controls, defect, P2)

defect

Tracking

()

VERIFIED FIXED

People

(Reporter: buster, Assigned: kinmoz)

References

Details

after the switch to gfx text controls, vertical scroll bars started showing up
in single line text controls after they get focus.
Assignee: rods → buster
Looks like a gfx scrollbar issue
Status: NEW → ASSIGNED
Target Milestone: M13
moved to M13.
QA Contact update.
*** Bug 20303 has been marked as a duplicate of this bug. ***
*** Bug 21793 has been marked as a duplicate of this bug. ***
*** Bug 21786 has been marked as a duplicate of this bug. ***
Priority: P3 → P2
this only happens in empty text controls.
The problem seems to be that when we delete the last character in a text
control, we get this content model:
body@01F1C62C style=font-family: -moz-fixed; background-color: rgb(255,255,255)
 white-space: pre;  refcount=19<
  br@01F8AE5C refcount=4<>
  Text@01F8D760 refcount=16<>
>
The layout system creates 2 lines for this, instead of just 1, so the subdoc is
1 line taller than it should be, hence the sroll bar.

I thought we had code in the editor that went through and removed empty text
nodes from the content tree as a post process to delete.  Joe, if you point me
to this code, I'll see why we're getting the extra empty node.  I did find the
code that collapses adjacent text nodes, but that code doesn't do anything
special if the two nodes being collapsed are both empty.  Maybe it should just
delete them?
*** Bug 21967 has been marked as a duplicate of this bug. ***
I've talked with steve about this.  Now he gets to play with the fire that is
nsTextEditRules::AfterEdit().  Be very afraid.
Whiteboard: fix in hand
*** Bug 22147 has been marked as a duplicate of this bug. ***
turns out I only have part of the fix.  The fix I have seems to work for text
controls in HTML content, but not in XUL.  I don't yet understand why there is a
difference.  I'm investigating.

Dev note:  The subdoc height is 210, the BR height is 240, the line height in
300.  See nsLineLayout.cpp line 1546,
nscoord lineHeight = psd->mMaxY - psd->mMinY;   // ((45)-(-210))
maybe if the vert alignment were set to bottom, it would work?
Assignee: buster → kin
Status: ASSIGNED → NEW
Depends on: 12825
Whiteboard: fix in hand
I will check in the tiny editor fix that removes empty text controls when
the bogus BR node is created. This was causing the the document to have 2 lines,
making it too tall and invoking the vertical scroll bar.  This fixes this
problem in default (no CSS style) text controls.  But Kin is working on a fix
that solves the problem even when CSS makes the interior subdocument shorter
than the content, as can be done with CSS (all default text controls in XUL
exhibit this today.)  That is bug 12825.
Status: NEW → ASSIGNED
Accepting bug.
*** Bug 22460 has been marked as a duplicate of this bug. ***
*** Bug 22771 has been marked as a duplicate of this bug. ***
*** Bug 22756 has been marked as a duplicate of this bug. ***
OS: Windows NT → All
Hardware: PC → All
migrating over platform information from duplicate bug 22756.
*** Bug 23143 has been marked as a duplicate of this bug. ***
*** Bug 20342 has been marked as a duplicate of this bug. ***
*** Bug 24009 has been marked as a duplicate of this bug. ***
I suggest you take the space out of "scroll bars" in the Summary to make this
bug more visible to searches.
Summary: scroll bars appearing in single line text control → scrollbars appearing in single line text control
Modified summary so that "scroll bars" doesn't have a space.
Summary: scrollbars appearing in single line text control → scroll bars appearing in single line text control (scrollbars)
Target Milestone: M13 → M14
I'm working on this right now, but I don't think I'll make tonight's M13
midnight deadline. Moving to M14 since it isn't an M13 stopper.
*** Bug 23598 has been marked as a duplicate of this bug. ***
*** Bug 25316 has been marked as a duplicate of this bug. ***
Whiteboard: Fix in hand. Reviewed by buster@netscape.com. Will checkin soon.
Fix checked in:

    mozilla/layout/html/forms/src/nsGfxTextControlFrame.cpp  revision 3.132
    mozilla/layout/html/forms/src/nsGfxTextControlFrame.h    revision 3.51

r=buster@netscape.com

Fix should appear in 02/02/2000 8am builds.

Marking fixed. Clearing status whiteboard.
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Whiteboard: Fix in hand. Reviewed by buster@netscape.com. Will checkin soon.
*** Bug 26180 has been marked as a duplicate of this bug. ***
*** Bug 26951 has been marked as a duplicate of this bug. ***
*** Bug 27074 has been marked as a duplicate of this bug. ***
No longer a problem. Verifying
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.