Closed
Bug 298677
Opened 19 years ago
Closed 19 years ago
regression: Vertical scrollbar draws over toolbar and tabs when location or search bar has focus during scrolling
Categories
(Core Graveyard :: Widget: Mac, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: waynegwoods, Assigned: mark)
References
Details
(Keywords: regression)
Attachments
(3 files, 3 obsolete files)
5.65 KB,
text/plain
|
Details | |
12.57 KB,
patch
|
jaas
:
review+
jhpedemonte
:
review+
shaver
:
approval1.8b3+
|
Details | Diff | Splinter Review |
14.72 KB,
patch
|
mikepinkerton
:
review+
sfraser_bugs
:
superreview+
benjamin
:
approval1.8b4+
|
Details | Diff | Splinter Review |
UI drawing bug. I think it's Mac-only.
- Navigate to a page long enough to make the vertical scrollbar appear, e.g.
http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/
- Place the cursor focus into the location bar or search bar
- Using the mouse, grab the scroller and move it up and down.
- Shortly you should notice a slight glitch as the scroller jumps unexpectedly.
- Look at the top left side of the browser window. You should notice a section
of the scrollbar has been drawn over the top of the toolbars and tabs.
This can also happen if you move a scrollbar associated with a form element. In
which case it can often draw over the top of the web page, rather than the
toolbar. Sometimes it only seems to happen as soon as I let go of the scroller,
though.
Focusing the box for entering the bug description (which I'm currently typing
into), I even managed to get the scrollbar graphics to draw all the way down the
left side of the browser window, by moving the window scrollbar enough.
It first occurred in the 20050622 Firefox nightly build. I haven't tested
Seamonkey yet. Using Mac OS X 10.4.1. Fresh profile. No extensions or themes.
Comment 1•19 years ago
|
||
Also happens here... :-/
Is this a recent regression?
Reporter | ||
Comment 2•19 years ago
|
||
Yeah, the 20050622 Fx nightly is the first one to display it. It still exists in
the 20050623 nightly.
I just confirmed it exists in Seamonkey as well (20050623 nightly).
Comment 3•19 years ago
|
||
In SeaMonkey 2005062410 (mac) I can get a duplicate scrollbar in the browser
window, Chatzilla window, MailNews... This also happens with the horizontal
scrollbar. See also bug 298679.
Updated•19 years ago
|
Flags: blocking1.8b4?
Keywords: regression
Comment 4•19 years ago
|
||
Similar problem: advanced search page here on bugzilla, the < input> at the top
has focus on page-load. Just move the scrollbar on one of the (any, really)
select boxes. A short vertical scrollbar appears at the top left of the window,
just under the tabbar.
Putting the focus on the location bar, and that scrollbar disappeared.
Comment 5•19 years ago
|
||
*** Bug 298679 has been marked as a duplicate of this bug. ***
Updated•19 years ago
|
Flags: blocking-aviary1.1?
Summary: Vertical scrollbar draws over toolbar and tabs when location or search bar has focus during scrolling → regression: Vertical scrollbar draws over toolbar and tabs when location or search bar has focus during scrolling
Comment 6•19 years ago
|
||
This was caused by the CFRunLoop checkin. Any idea why that would cause this issue?
Comment 7•19 years ago
|
||
Bug 205873 may inspire a fix for this.
Updated•19 years ago
|
Flags: blocking1.8b4? → blocking1.8b3+
Reporter | ||
Comment 9•19 years ago
|
||
The scroll widget also jumps a bit within its normal track, i.e. jumps out from
under the mouse. I don't think it's been noted that when it does so, the whole
page also jumps. So I guess it's more than just a redrawing effect, as the
browser is treating the move as a valid scroll. It's like when some other field
has the focus, that the browser is trying to treat that field as the entire
window for the scroll, and of course failing badly.
Comment 10•19 years ago
|
||
This patch installs a Carbon Event handler for drawing events on native Mac
controls, which ensures that the port origin is set correctly before calling
the next handler (which will actually do the drawing). It's essentially the
patch from bug 205873.
Attachment #188003 -
Flags: superreview?(jhpedemonte)
Attachment #188003 -
Flags: review?(joshmoz)
Comment 11•19 years ago
|
||
Simon's patch solves half the problem. No more drawing where it shouldn't, but
the scrollbar still skips in sync with the cursor. As said in the summary but
more exactly, do this:
1. load slashdot.org (its nice and long)
2. click in the google search field in the toolbar so that the caret blinks there
3. put your mouse down on the scrollbar for the page and slowly move down the page
4. notice that when you do this, it "skips" based on the caret drawing
Comment 12•19 years ago
|
||
I meant that it skips in sync with the caret drawing (not the cursor), and only
when the caret is drawing outside the content area, like in the URL or search
fields.
Assignee | ||
Comment 13•19 years ago
|
||
Jumping around when the caret is going is also an origin problem. If you
collapse all of the toolbars above a vertical scrollbar, that scrollbar won't
skip. If you open a sidebar to the left of a horizontal scrollbar, that
scrollbar will skip. Open a find bar and put the caret there if you're nervous
about not being able to see it.
When the caret is going, it seems like something is causing the scrollbars to be
read (GetControl32BitValue?) without going through the expected code path with
the proper origin set. The immediate solution I thought of was an
StOriginSetter in nsNativeScrollbar.cpp, but that won't work. I wanted to use
libSystem_debug to see what else might be touching that control and do other
neat debugging things, but was prevented by bug 299661.
Comment 14•19 years ago
|
||
Personally, I am less and less convinced that Bug 298679 is a duplicate of this.
But this is only a hunch, based on the two very different behaviours.
Comment 15•19 years ago
|
||
Comment on attachment 188003 [details] [diff] [review]
Patch
Unfortunately, I'm not a superreviewer, but I will review this patch anyway.
+ ControlRef theControl;
+ ::GetEventParameter(inEvent, kEventParamDirectObject, typeControlRef, NULL,
sizeof(ControlRef), NULL, &theControl);
+
+ CGrafPtr controlPort; // port we're drawing into (usually the control's
port)
+ if (::GetEventParameter(inEvent, kEventParamGrafPort, typeGrafPtr, NULL,
sizeof(CGrafPtr), NULL, &controlPort) != noErr)
+ controlPort = ::GetWindowPort(::GetControlOwner(theControl));
Since |theControl| is only needed in the case where the second
|::GetEventParameter| fails, why not just get |theControl| in the failure case.
In bug 205873, you mentioned that this patch may allow you to get rid of many
of the |StartDraw/EndDraw| calls. So in this code, the calls would then just
go down the |!macControl->IsDrawing()| path, correct? Would be still need to
keep around the |IsDrawing()| case?
Nit: Tabbing issues. Some lines use them, others don't. I know the file is
already riddled with them, but it would be best not to add any more.
Nit: Some lines over 80 chars in length.
With that fixed, r=jhpedemonte. Since the next alpha is imminent, can we get
this patch in to fix the phantom scrollbars, and keep the bug open to continue
work on the remaining issues?
Attachment #188003 -
Flags: superreview?(jhpedemonte) → review+
Assignee | ||
Comment 16•19 years ago
|
||
I don't like this hack. Nobody who's heard about it likes it. Nobody who
looks at it will like it. I'm only putting it here for coordination, as a
last-ditch possibility.
The call to GetControl32BitValue() is giving bad results. As suspected, it's
got something to do with the origin. Resetting the origin doesn't help, but
it's possible to test that the origin is what it's supposed to be and discard
data known to be faulty. That's what this hack does.
Installing a Carbon event handler on the scrollbar and using that to handle
tracking doesn't help, either.
Comment 17•19 years ago
|
||
Comment on attachment 188003 [details] [diff] [review]
Patch
looks good
Attachment #188003 -
Flags: review?(joshmoz)
Attachment #188003 -
Flags: review+
Attachment #188003 -
Flags: approval1.8b3?
Comment 18•19 years ago
|
||
Comment on attachment 188003 [details] [diff] [review]
Patch
a=shaver for 1.8b3
Attachment #188003 -
Flags: approval1.8b3? → approval1.8b3+
Comment 19•19 years ago
|
||
Comment on attachment 188003 [details] [diff] [review]
Patch
This patch checked in. Keeping bug open for the jumpy scrolling.
Attachment #188003 -
Attachment is obsolete: true
Updated•19 years ago
|
Flags: blocking1.8b4+
Flags: blocking1.8b3-
Flags: blocking1.8b3+
Flags: blocking-aviary1.1?
Flags: blocking-aviary1.1+
Assignee | ||
Comment 20•19 years ago
|
||
Gross. I get the same goofy scrollbar behavior at www.apple.com. Must be that
JavaScript redrawing. No carets necessary.
Comment 21•19 years ago
|
||
Interestingly, the 'goofy behaviour' doesn't happen if one uses the up- or
down-arrow; only if one actually slides the scrolling slider up or down with the
mouse.
Assignee | ||
Comment 22•19 years ago
|
||
We're only calling GetControl32BitValue() when the user moves the thumb
indicator directly. For clicks on the up or down buttons, or in the scrollbar
above or below the thumb, we adjust the last-known position by the size of a
line or the viewable area, respectively.
Reporter | ||
Comment 23•19 years ago
|
||
FYI bug 300095 appeared at the same time as this one. Does it share the same
root cause?
Comment 24•19 years ago
|
||
BugZilla says 'Zarro boogs' when I try to find Bug 300095.
BTW, when will a new nightly build become available?
Comment 25•19 years ago
|
||
(In reply to comment #24)
> BugZilla says 'Zarro boogs' when I try to find Bug 300095.
Clicking on the bug link isn't that hard!
Comment 26•19 years ago
|
||
In dismissal of Comment #25: What a fine line in sarcasm! But it would have been
more helpful, and saved the Mozilla system time, to say that the link (which
does NOT appear in the e-mail notification) can be found under Bug #298677.
Comment 28•19 years ago
|
||
Mark, since Alpha2 is wrapping up right now, are you confident enough in your
'hack' patch to check it in for now, so it at least works in Alpha2? Then we
can continue to work on this in the trunk to find the 'correct' fix. What's
everyone think of that?
Assignee | ||
Comment 29•19 years ago
|
||
Comment on attachment 188402 [details] [diff] [review]
Hack to handle jumping scrollbar
I have complete confidence in the hack, I just don't like the approach. It's
better than nothing, and since nothing is exactly what we were able to come up
with so far, I'd set it loose on a2.
Attachment #188402 -
Flags: superreview?(sfraser_bugs)
Attachment #188402 -
Flags: review?(joshmoz)
Comment 30•19 years ago
|
||
Comment on attachment 188402 [details] [diff] [review]
Hack to handle jumping scrollbar
Does this patch do the right thing for a scrollbar inside an iframe (like the
one on the Edit Attachment page)?
Comment 31•19 years ago
|
||
Debugging the jittery scrollbars: everytime I see the |portBounds| get set to
(0,0) in |DoScrollAction()|, preceding it I see the |::SetOrigin(0,0)| call in
|nsWindow::WidgetToScreen()|.
Comment 32•19 years ago
|
||
Hmm, scratch that, looks like it's just a coincidence.
Assignee | ||
Comment 33•19 years ago
|
||
Comment on attachment 188402 [details] [diff] [review]
Hack to handle jumping scrollbar
Simon, scrollbars in iframes work properly with the hack, but now that your
event-based drawing patch is in, I'm seeing drawing artifacts. The thumb, or
part of it, is now drawing in the "wrong" position, but the hack prevents the
document from jumping. Prior to the event-based redraws, the hack prevented
document jumping AND incorrect scrollbar appearance.
We'd need something better than this for a2, so I'm cancelling the review
requests.
Attachment #188402 -
Flags: superreview?(sfraser_bugs)
Attachment #188402 -
Flags: review?(joshmoz)
Comment 34•19 years ago
|
||
Scrollbar drawing turds are bug 300058. See also bug 300095.
Assignee | ||
Comment 35•19 years ago
|
||
Comment on attachment 188003 [details] [diff] [review]
Patch
This is in, it shouldn't be obsolete.
Attachment #188003 -
Attachment is obsolete: false
Assignee | ||
Comment 36•19 years ago
|
||
I finally found where the origin was being set for the caret and not restored
for the scrollbars. It was in the rendering context.
Once upon a time, which is to say, before January 2002, nsRenderingContextMac
would save and restore the origin and a few other key settings. I'm bringing
that behavior back, wrapped in #ifdef MOZ_WIDGET_COCOA, because we don't care
about the origin with Cocoa. If you don't believe me, ask Camino.
This fixes the jumpy scrollbars with the caret. They're still jumping with
that JavaScript counter at www.apple.com. That's most likely another failure
to restore the origin.
It would be nice to sneak this into 1.8b3/1.1a2 if there's still time for that.
It's a pretty high-profile thing to have broken.
Attachment #188402 -
Attachment is obsolete: true
Attachment #188812 -
Flags: superreview?(sfraser_bugs)
Attachment #188812 -
Flags: review?(joshmoz)
Attachment #188812 -
Flags: approval1.8b3?
Assignee | ||
Comment 37•19 years ago
|
||
Note that in addition to fixing the jumping, the new patch also handles
scrollbars drawing in the wrong spot. The event handler-based drawing patch in
attachment 188003 [details] [diff] [review] to this bug can be backed out, which will resolve dependent
bug 300058 (scrollbar turds).
Just as the new patch doesn't solve the jumpy behavior at www.apple.com, it
doesn't prevent the scrollbar from drawing in the wrong place at that page. The
event handler at least fixes the drawing there. But since the scrollbar is
pretty useless on that page anyway, it might be worth dropping the event handler
to flush the turds.
Reporter | ||
Comment 38•19 years ago
|
||
(In reply to comment #36)
> Once upon a time, which is to say, before January 2002, nsRenderingContextMac
> would save and restore the origin and a few other key settings. I'm bringing
> that behavior back, wrapped in #ifdef MOZ_WIDGET_COCOA, because we don't care
> about the origin with Cocoa. If you don't believe me, ask Camino.
>
> This fixes the jumpy scrollbars with the caret. They're still jumping with
> that JavaScript counter at www.apple.com. That's most likely another failure
> to restore the origin.
Sounds great! Why was that behaviour removed in the first place? :)
Assignee | ||
Comment 39•19 years ago
|
||
*** Bug 300244 has been marked as a duplicate of this bug. ***
Comment 40•19 years ago
|
||
Comment on attachment 188812 [details] [diff] [review]
Patch for jumping scrollbar
Yeah, this is a disaster on the Mac right now; a=shaver for checkin in the next
24 hours, pending reviews.
Attachment #188812 -
Flags: approval1.8b3? → approval1.8b3+
Comment 41•19 years ago
|
||
(In reply to comment #38)
> Sounds great! Why was that behaviour removed in the first place? :)
It was removed because it didn't make sense in a world in which
creation/destruction of RCs is not cleanly nested. We moved from a
'save/restore' model to a 'set before use' model (which worked just fine until
CFRunLoop came along).
Comment 42•19 years ago
|
||
The history of the nsRenderingContextMac behavior can be seen by looking at the
CVS log:
http://bonsai.mozilla.org/cvslog.cgi?file=mozilla/gfx/src/mac/nsRenderingContextMac.cpp
The changes we're talking about here were mostly added in version 1.136. Bug
113480#13 has a comment describing what changed. Essentially, this is when we
moved to a "set before use" pattern in the rendering context. When testing for
regressions, look at bug 103234 bug 104781, bug 120228.
The reason that the save/restore stuff was removed was that it doesn't make
sense in a world in which RC creation/destruction is not cleanly nested. It's
analagous to the NSQuickDrawView issues we've also been having. Although I don't
disagree with this patch in principle, it might bring back some of those other
rendering bugs.
Assignee | ||
Comment 43•19 years ago
|
||
I can't reproduce any of the problems in bug 113480, bug 103234, bug 105946, bug
104871, or bug 120228.
Since most of gfx assumes that it'll receive a useless origin, there's a lot of
origin resetting going on anyway. Restoring the origin in the destructor can
suck for long-lived rendering contexts, but it's OK in the caret case for now
(see DONT_REUSE_RENDERING_CONTEXT in nsCaret.cpp). A long-lived rendering
context may be why this patch doesn't work for www.apple.com.
Maybe it's better to restore when the last graphic state is popped?
(Trying that...)
Yeah, that works too, but it still doesn't solve www.apple.com.
Assignee | ||
Comment 44•19 years ago
|
||
I'm still able to force ludicrous scrollbar behavior and drawing in the wrong
parts of the window if the scrollbar is manipulated while reloading. In fact,
the scrollbar appears (incorrectly) disconnected from the document while
reloading, but that doesn't prevent it from being jittery. See also bug 299384
(crash when using scrollbar and reloading), bug 299643 (content not updating
when using widgets and loading). This occurs with any combination of the draw
event patch and the origin restoration patch. The jumping and drawing is
probably yet another origin in need of restoration. The scrollbar not being
attached is probably something else.
I don't think we should let this hold up what we've got so far.
Assignee | ||
Updated•19 years ago
|
Attachment #188812 -
Flags: review?(joshmoz) → review?(pinkerton)
Assignee | ||
Comment 45•19 years ago
|
||
I can resolve the apple.com case by turning the unrestoring SetOrigin calls in
nsWindow into StOriginSetters that restore the origin when they're done. The
port is already being restored there by StPortSetters.
The draw event handler is now mostly redundant. It should be removed because
it caused bug 300058, and because it wasn't really immune to all problems
either. Carbon is being really adamant about restoring evil port states. I
haven't taken it out as a part of this patch yet because it's still saving us
from drawing the scrollbar in the wrong spot if the scrollbar is being
manipulated while reloading.
Assignee | ||
Updated•19 years ago
|
Assignee: joshmoz → mark
Attachment #188812 -
Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #188985 -
Flags: superreview?(sfraser_bugs)
Attachment #188985 -
Flags: review?(pinkerton)
Assignee | ||
Updated•19 years ago
|
Attachment #188812 -
Flags: superreview?(sfraser_bugs)
Attachment #188812 -
Flags: review?(pinkerton)
Assignee | ||
Comment 46•19 years ago
|
||
This last patch handles scrollbars redrawing in the wrong location during/after
reload. This is implemented by calling ::SetControlVisibility to make controls
invisible without redraw when Destroy() is called. The comment tells why other
methods of tracking Destroy() won't work.
This last case was occurring even with the draw event handler, but the
scrollbar was drawing at the top-right instead of the top-left.
The draw event handler is now gone.
There may be some more origin-related problems lurking after switching to
CFRunLoop. Areas to watch out for: clipboard, plugins, Java. There shouldn't
be anything else scrollbar-specific. I think we're done here.
Attachment #188985 -
Attachment is obsolete: true
Attachment #189081 -
Flags: superreview?(sfraser_bugs)
Attachment #189081 -
Flags: review?(pinkerton)
Assignee | ||
Updated•19 years ago
|
Attachment #188985 -
Flags: superreview?(sfraser_bugs)
Attachment #188985 -
Flags: review?(pinkerton)
Assignee | ||
Comment 47•19 years ago
|
||
Comment on attachment 189081 [details] [diff] [review]
v4, handle all known cases
+ NS_IMETHOD Destroy();
+
Extra newline won't be checked in.
Comment 48•19 years ago
|
||
Comment on attachment 189081 [details] [diff] [review]
v4, handle all known cases
Good work.
Attachment #189081 -
Flags: superreview?(sfraser_bugs) → superreview+
Comment 49•19 years ago
|
||
Is it too late to get this in for 1.8b3/DeerPark a2?
Comment 50•19 years ago
|
||
Comment on attachment 189081 [details] [diff] [review]
v4, handle all known cases
r=pink
sorry for the delay.
Attachment #189081 -
Flags: review?(pinkerton) → review+
Assignee | ||
Updated•19 years ago
|
Attachment #189081 -
Flags: approval1.8b4?
Updated•19 years ago
|
Attachment #189081 -
Flags: approval1.8b4? → approval1.8b4+
Assignee | ||
Comment 51•19 years ago
|
||
Checked in.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Reporter | ||
Comment 52•19 years ago
|
||
FYI, seemingly related (but not identical) bug still occurring: bug 304607
You need to log in
before you can comment on or make changes to this bug.
Description
•