Closed Bug 9708 Opened 25 years ago Closed 25 years ago

[BLOCKER] SetScrollPreference(nsScrollPreference_kNeverScroll) not working properly

Categories

(Core :: Web Painting, defect, P3)

x86
Windows NT
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: buster, Assigned: kinmoz)

References

()

Details

the ender text control uses SetScrollPreference(nsScrollPreference_kNeverScroll) to tell the scrolling view it is contained within that it never wants scroll bars. However, when a text control is constructed, it looks like sometimes space is reservered for a h-scroll bar. You can see this on sample 8 in viewer (on windows at least) if you turn GFX widgets on.
Summary: SetScrollPreference(nsScrollPreference_kNeverScroll) not working properly → [BLOCKER] SetScrollPreference(nsScrollPreference_kNeverScroll) not working properly
I'm marking this as a blocker for enabling gfx-widgets. This bug causes garbage to be placed in the right hand area of text-fields.
Status: NEW → ASSIGNED
Target Milestone: M10
gfx text controls are now on by default, so I'm getting lots of complaints about this problem. any update, patrick? thanks.
*** Bug 12191 has been marked as a duplicate of this bug. ***
*** Bug 12196 has been marked as a duplicate of this bug. ***
*** Bug 12203 has been marked as a duplicate of this bug. ***
*** Bug 5542 has been marked as a duplicate of this bug. ***
I have a fix for this bug which modifies nsScrollFrame::Reflow(). Should I check it in? Index: nsScrollFrame.cpp =================================================================== RCS file: /cvsroot/mozilla/layout/html/base/src/nsScrollFrame.cpp,v retrieving revision 1.115 diff -c -r1.115 nsScrollFrame.cpp *** nsScrollFrame.cpp 1999/08/19 14:34:27 1.115 --- nsScrollFrame.cpp 1999/08/20 19:47:58 *************** *** 510,517 **** // Get the scrollbar dimensions (width of the vertical scrollbar and the // height of the horizontal scrollbar) in twips ! nscoord sbWidth, sbHeight; ! GetScrollbarDimensions(aPresContext, sbWidth, sbHeight); // Compute the scroll area size (area inside of the border edge and inside // of any vertical and horizontal scrollbars), and whether space was left --- 510,535 ---- // Get the scrollbar dimensions (width of the vertical scrollbar and the // height of the horizontal scrollbar) in twips ! nscoord sbWidth = 0, sbHeight = 0; ! PRBool getScrollBarDimensions = PR_TRUE; ! nsIView *view = 0; ! ! GetView(&view); ! ! if (view) { ! nsCOMPtr<nsIScrollableView> scrollableView = do_QueryInterface(view); ! ! if (scrollableView) { ! nsresult rv = NS_OK; ! nsScrollPreference scrollPref = nsScrollPreference_kAuto; ! rv = scrollableView->GetScrollPreference(scrollPref); ! if (NS_SUCCEEDED(rv) && scrollPref == nsScrollPreference_kNeverScroll) ! getScrollBarDimensions = PR_FALSE; ! } ! } ! ! if (getScrollBarDimensions) ! GetScrollbarDimensions(aPresContext, sbWidth, sbHeight); // Compute the scroll area size (area inside of the border edge and inside // of any vertical and horizontal scrollbars), and whether space was left
*** Bug 12197 has been marked as a duplicate of this bug. ***
A slightly related issue is that the url editfield does not scroll automatically when you type in a real long URL.
The autoscrolling while typing problem is bug #7153.
Assignee: beard → kin
Status: ASSIGNED → NEW
Spoke with beard, who gave a thumbs up on the patch. Reassigning bug to kin@netscape.com. Will checkin after I verify that it works properly on Linux and Mac.
Status: NEW → ASSIGNED
Accepting bug.
I ran this patch by troy@netscape.com who shed alot of light on the problem. My fix is just a hack around the current problem which is that nsScrollFrame only handles two cases, the first being scrollbars are always visible, and scrollbars auto visible. The hack is also contrary to the frame and view control flow that is used. According to Troy, the proper fix is to teach nsScrollFrame how to handle a third option where scrollbars are never visible, and add a style preference for this to layout. I probably won't be checking this patch in.
Blocks: 12438
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Fix checked into: mozilla/layout/html/base/src/nsScrollFrame.cpp revision 1.117 Modified nsScrollFrame::Reflow() to set the scrollbar dimensions to zero if the scrollbars are hidden. This is the patch mentioned above, with some slight modifications to correct ref counting, and is a temporary fix! Bug #12825 "Need style properties that control scrollbar visibility" has been opened to make sure a more permanent fix is put into place sometime after beta.
QA Contact: beppe → cpratt
Status: RESOLVED → VERIFIED
Component: Layout: View Rendering → Layout: Web Painting
You need to log in before you can comment on or make changes to this bug.