[BLOCKER] SetScrollPreference(nsScrollPreference_kNeverScroll) not working properly

VERIFIED FIXED in M10

Status

()

Core
Layout: View Rendering
P3
normal
VERIFIED FIXED
19 years ago
19 years ago

People

(Reporter: buster, Assigned: kinmoz)

Tracking

Trunk
x86
Windows NT
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

19 years ago
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.

Updated

19 years ago
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.

Updated

19 years ago
Status: NEW → ASSIGNED

Updated

19 years ago
Target Milestone: M10
(Reporter)

Comment 2

19 years ago
gfx text controls are now on by default, so I'm getting lots of complaints about
this problem.  any update, patrick?  thanks.
(Reporter)

Comment 3

19 years ago
*** Bug 12191 has been marked as a duplicate of this bug. ***

Comment 4

19 years ago
*** Bug 12196 has been marked as a duplicate of this bug. ***
(Reporter)

Comment 5

19 years ago
*** Bug 12203 has been marked as a duplicate of this bug. ***
(Reporter)

Comment 6

19 years ago
*** Bug 5542 has been marked as a duplicate of this bug. ***
(Assignee)

Comment 7

19 years ago
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

Comment 8

19 years ago
*** Bug 12197 has been marked as a duplicate of this bug. ***

Comment 9

19 years ago
A slightly related issue is that the url editfield does not scroll automatically
when you type in a real long URL.
(Assignee)

Comment 10

19 years ago
The autoscrolling while typing problem is bug #7153.
(Assignee)

Updated

19 years ago
Assignee: beard → kin
Status: ASSIGNED → NEW
(Assignee)

Comment 11

19 years ago
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.
(Assignee)

Updated

19 years ago
Status: NEW → ASSIGNED
(Assignee)

Comment 12

19 years ago
Accepting bug.
(Assignee)

Comment 13

19 years ago
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.
(Assignee)

Updated

19 years ago
Blocks: 12438
(Assignee)

Updated

19 years ago
Status: ASSIGNED → RESOLVED
Last Resolved: 19 years ago
Resolution: --- → FIXED
(Assignee)

Comment 14

19 years ago
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.

Updated

19 years ago
QA Contact: beppe → cpratt

Updated

19 years ago
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.