WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
Bug 59048
Need to track whether overlay scrollbar is currently visible and in lower-righthand corner
https://bugs.webkit.org/show_bug.cgi?id=59048
Summary
Need to track whether overlay scrollbar is currently visible and in lower-rig...
Beth Dakin
Reported
2011-04-20 17:23:24 PDT
<
rdar://problem/9211232
> We need to know in the UI process if an overlay scrollbar is visible AND in the lower righthand corner. Patch coming in a moment.
Attachments
Patch
(18.25 KB, patch)
2011-04-20 17:38 PDT
,
Beth Dakin
mjs
: review-
Details
Formatted Diff
Diff
Patch that sends a rect through the client
(19.13 KB, patch)
2011-04-21 13:38 PDT
,
Beth Dakin
mitz: review+
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Beth Dakin
Comment 1
2011-04-20 17:38:23 PDT
Created
attachment 90459
[details]
Patch
WebKit Review Bot
Comment 2
2011-04-20 17:39:36 PDT
Attachment 90459
[details]
did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'Source/WebCore/ChangeLog', u'Source/WebCor..." exit_code: 1 Source/WebCore/platform/mac/ScrollAnimatorMac.h:86: The parameter name "showing" adds no information, so it should be removed. [readability/parameter_name] [5] Total errors found: 1 in 20 files If any of these errors are false positives, please file a bug against check-webkit-style.
mitz
Comment 3
2011-04-20 21:29:52 PDT
Comment on
attachment 90459
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=90459&action=review
I wonder if the naming here can be improved. I pointed out one specific name I found problematic, but I also find it odd that everything in the internal naming differs from the external method: scrollbar <-> scroller thumb (which is more accurate, I think) showing <-> visible south-east corner <-> window-resize… something Maybe our naming should be more along the lines of “the scroll thumb is touching the corner”. I was going to r+ but it occurred to me that I’m not sure this does the right thing in the two-scrollbars-neither-of-which-can-cover-the-corner case. Does it?
> Source/WebCore/page/ChromeClient.h:310 > + virtual void setScrollbarIsShowingInSouthEastCorner(bool) { }
This name may not be the best for a function in a client interface, which is essentially a delegate. This might sound like the client is asked to show or hide something, but in reality it is just being notified. I don’t have a super-great name, but maybe something like scrollbarVisibilityInSouthEastCornerDidChange(bool).
Maciej Stachowiak
Comment 4
2011-04-20 21:53:43 PDT
Comment on
attachment 90459
[details]
Patch Mitz was too kind to r-, but it looks like this either needs some revision, or significant additional explanation.
Beth Dakin
Comment 5
2011-04-21 10:09:23 PDT
(In reply to
comment #3
)
> (From update of
attachment 90459
[details]
) > View in context:
https://bugs.webkit.org/attachment.cgi?id=90459&action=review
> > I wonder if the naming here can be improved. I pointed out one specific name I found problematic, but I also find it odd that everything in the internal naming differs from the external method: > scrollbar <-> scroller thumb (which is more accurate, I think) > showing <-> visible > south-east corner <-> window-resize… something > > Maybe our naming should be more along the lines of “the scroll thumb is touching the corner”. >
I knew the naming was going to be a problem at review-time, though I only predicted that south-east corner would be a problem. I agree that "scroller thumb" and "visible" would be an improvement over "scrollbar" and "showing" respectively. However, I really hate the window-resize phrase, and I think south-east corner is much more expressive. I adopted south-east in the first place because I saw it in the code of another component, and I really liked it. That being said, I can probably come up with something more consistent.
> I was going to r+ but it occurred to me that I’m not sure this does the right thing in the two-scrollbars-neither-of-which-can-cover-the-corner case. Does it? >
Hummm, there is a bug in this case with my patch. With my patch, you can never resize the window when the vertical scrollbar is fully scrolled, and that should not always be the case in the two-scrollbar situation. I will have to think on this. A bool may be insufficient here.
> > Source/WebCore/page/ChromeClient.h:310 > > + virtual void setScrollbarIsShowingInSouthEastCorner(bool) { } > > This name may not be the best for a function in a client interface, which is essentially a delegate. This might sound like the client is asked to show or hide something, but in reality it is just being notified. I don’t have a super-great name, but maybe something like scrollbarVisibilityInSouthEastCornerDidChange(bool).
Will think on this too.
Beth Dakin
Comment 6
2011-04-21 13:38:13 PDT
Created
attachment 90589
[details]
Patch that sends a rect through the client
mitz
Comment 7
2011-04-21 14:44:52 PDT
Comment on
attachment 90589
[details]
Patch that sends a rect through the client View in context:
https://bugs.webkit.org/attachment.cgi?id=90589&action=review
> Source/WebCore/platform/mac/ScrollAnimatorMac.mm:426 > + _animator->setVisibleScrollerThumbRect(WebCore::IntRect());
I don’t think the WebCore:: qualifier is needed here!
> Source/WebCore/platform/mac/ScrollAnimatorMac.mm:506 > + , m_visibleScrollerThumbRect(IntRect())
No need to initialize an IntRect member variable
> Source/WebKit2/UIProcess/WebPageProxy.cpp:156 > + , m_visibleScrollerThumbRect(IntRect())
Unnecessary initialization
> Source/WebKit2/UIProcess/WebPageProxy.h:494 > + const WebCore::IntRect& visibleScrollerThumbRect() const { return m_visibleScrollerThumbRect; }
I think typically functions that return an IntRect just return it by value, not a by (const) reference.
> Source/WebKit2/UIProcess/API/mac/WKView.mm:1599 > + const IntRect& visibleThumbRect = _data->_page->visibleScrollerThumbRect(); > + NSRect visibleThumbNSRect = NSMakeRect(visibleThumbRect.x(), visibleThumbRect.y(), visibleThumbRect.width(), visibleThumbRect.height());
IntRect has an operator NSRect() so I think the conversion can just happen automatically or with a cast.
Beth Dakin
Comment 8
2011-04-21 15:50:24 PDT
Thanks Dan! I fixed all of the things you found, and committed the change with revision 84553.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug