RESOLVED FIXED 96049
Chromium: Scrollbar with tickmarks doesn't respond to clicks
https://bugs.webkit.org/show_bug.cgi?id=96049
Summary Chromium: Scrollbar with tickmarks doesn't respond to clicks
Sailesh Agrawal
Reported 2012-09-06 18:23:56 PDT
Chromium: Scrollbar with tickmarks doesn't respond to clicks
Attachments
Patch (6.05 KB, patch)
2012-09-06 18:32 PDT, Sailesh Agrawal
no flags
Patch (6.42 KB, patch)
2012-09-07 11:06 PDT, Sailesh Agrawal
no flags
Patch (16.20 KB, patch)
2012-09-07 17:21 PDT, Sailesh Agrawal
no flags
Patch (16.88 KB, patch)
2012-09-07 17:55 PDT, Sailesh Agrawal
no flags
Patch (17.00 KB, patch)
2012-09-07 18:26 PDT, Sailesh Agrawal
no flags
Patch (17.06 KB, patch)
2012-09-07 18:29 PDT, Sailesh Agrawal
no flags
Patch (17.06 KB, patch)
2012-09-08 13:08 PDT, Sailesh Agrawal
no flags
Patch (15.14 KB, patch)
2012-09-08 14:48 PDT, Sailesh Agrawal
no flags
Patch (16.57 KB, patch)
2012-09-08 15:09 PDT, Sailesh Agrawal
no flags
Patch (20.17 KB, patch)
2012-09-08 17:29 PDT, Sailesh Agrawal
no flags
Patch (29.91 KB, patch)
2012-09-12 17:49 PDT, Sailesh Agrawal
no flags
Patch for landing (29.92 KB, patch)
2012-09-13 20:23 PDT, Sailesh Agrawal
no flags
Patch for landing (29.69 KB, patch)
2012-09-14 13:30 PDT, Sailesh Agrawal
no flags
Patch for landing (29.76 KB, patch)
2012-09-18 13:33 PDT, Sailesh Agrawal
no flags
Patch for landing (27.72 KB, patch)
2012-09-18 15:35 PDT, Sailesh Agrawal
no flags
Sailesh Agrawal
Comment 1 2012-09-06 18:32:34 PDT
Build Bot
Comment 2 2012-09-06 22:07:40 PDT
Nico Weber
Comment 3 2012-09-06 22:11:46 PDT
Does the apple port have this problem too? Does this patch fix things there as well? Is it possible to test this?
Sailesh Agrawal
Comment 4 2012-09-07 09:52:27 PDT
> Does the apple port have this problem too? Does this patch fix things there as well? The apple port doesn't draw tickmarks on the scrollbar. > Is it possible to test this? I'm not sure if there's a way to add tickmarks from a test. Looking into it right now.
Nico Weber
Comment 5 2012-09-07 09:53:25 PDT
There is, see the test I added here: https://bugs.webkit.org/show_bug.cgi?id=91949
Sailesh Agrawal
Comment 6 2012-09-07 10:48:58 PDT
Just talked to Nico offline. Current there's no way to force the scrollbar code to draw in overlay mode. This means that this fix isn't testable right now. I'll check with dpranke to see if we have 10.7/10.8 bots running chromium layout tests. If we do I'll send out a separate patch to add the testing infrastructure and add a test for this.
Sailesh Agrawal
Comment 7 2012-09-07 11:06:15 PDT
Sailesh Agrawal
Comment 8 2012-09-07 17:21:36 PDT
Sailesh Agrawal
Comment 9 2012-09-07 17:36:21 PDT
Actually, adding the test infrastructure turned out the be fairly simple. I've included it with this patch. On my 10.8 box, the test fails without my fix and passes with my fix. I've kicked Let me know if this looks ok and I'll add Beth and other folks to the review. Thanks
kov's GTK+ EWS bot
Comment 10 2012-09-07 17:36:58 PDT
Sailesh Agrawal
Comment 11 2012-09-07 17:55:53 PDT
Sailesh Agrawal
Comment 12 2012-09-07 18:26:17 PDT
Sailesh Agrawal
Comment 13 2012-09-07 18:29:59 PDT
Sailesh Agrawal
Comment 14 2012-09-07 18:30:47 PDT
> After reading the ChangeLog entry, I would've expected this to set the locked alpha to oldTrackAlpha, not 1. > It looks like the lockedalpha is always either 0 or 1 (right?), so maybe it could just be a bool instead? Done. Changed to a bool. > one ; should be enough Done. > How do async tests work? Do they fail if finishJSTests() isn't called after a timeout? Or after the event loop doesn't have any events left? It fails after a timeout.
Build Bot
Comment 15 2012-09-07 19:09:10 PDT
Build Bot
Comment 16 2012-09-07 21:18:18 PDT
Sailesh Agrawal
Comment 17 2012-09-08 13:08:18 PDT
Build Bot
Comment 18 2012-09-08 13:39:28 PDT
Sailesh Agrawal
Comment 19 2012-09-08 14:48:16 PDT
Build Bot
Comment 20 2012-09-08 14:59:19 PDT
Sailesh Agrawal
Comment 21 2012-09-08 15:09:15 PDT
Build Bot
Comment 22 2012-09-08 15:39:24 PDT
Sailesh Agrawal
Comment 23 2012-09-08 17:29:38 PDT
Sailesh Agrawal
Comment 24 2012-09-10 10:02:08 PDT
Hi Beth, could you please take a look. Thanks!
Beth Dakin
Comment 25 2012-09-10 11:43:48 PDT
Comment on attachment 162970 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=162970&action=review > Source/WebCore/platform/mac/ScrollbarThemeMac.mm:216 > + NSNumber* number = objc_getAssociatedObject(painter, &gLockedAlphaKey); This definitely does not seem like the right approach. If you want to call NSScrollerImp API, you should not use objc_getAssociatedObject/objc_setAssociatedObject. You should call it the same way we call all of the other NSScrollerImp APIs, by declaring it in NSScrollerImpDetails.h > Source/WebCore/platform/mac/ScrollbarThemeMac.mm:225 > + objc_setAssociatedObject(painter, &gLockedAlphaKey, [NSNumber numberWithBool:isLocked], OBJC_ASSOCIATION_RETAIN); Same as above.
Sailesh Agrawal
Comment 26 2012-09-10 12:33:56 PDT
(In reply to comment #25) > (From update of attachment 162970 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=162970&action=review > > > Source/WebCore/platform/mac/ScrollbarThemeMac.mm:216 > > + NSNumber* number = objc_getAssociatedObject(painter, &gLockedAlphaKey); > > This definitely does not seem like the right approach. If you want to call NSScrollerImp API, you should not use objc_getAssociatedObject/objc_setAssociatedObject. You should call it the same way we call all of the other NSScrollerImp APIs, by declaring it in NSScrollerImpDetails.h Hi Beth, this actually doesn't call NSScrollerImp APIs. Instead it just associates some data with the instance of NSScrollerImp. Another way to do this would be to keep a std::map<NSScrollerImp, bool> but using objc_getAssociatedObject() is much more straight forward.
Beth Dakin
Comment 27 2012-09-10 12:35:39 PDT
(In reply to comment #26) > (In reply to comment #25) > > (From update of attachment 162970 [details] [details]) > > View in context: https://bugs.webkit.org/attachment.cgi?id=162970&action=review > > > > > Source/WebCore/platform/mac/ScrollbarThemeMac.mm:216 > > > + NSNumber* number = objc_getAssociatedObject(painter, &gLockedAlphaKey); > > > > This definitely does not seem like the right approach. If you want to call NSScrollerImp API, you should not use objc_getAssociatedObject/objc_setAssociatedObject. You should call it the same way we call all of the other NSScrollerImp APIs, by declaring it in NSScrollerImpDetails.h > > Hi Beth, this actually doesn't call NSScrollerImp APIs. Instead it just associates some data with the instance of NSScrollerImp. > > Another way to do this would be to keep a std::map<NSScrollerImp, bool> but using objc_getAssociatedObject() is much more straight forward. Why does the data need to be associated with the NSScrollerImp instead of a WebCore object?
Sailesh Agrawal
Comment 28 2012-09-10 12:39:12 PDT
(In reply to comment #27) > (In reply to comment #26) > > (In reply to comment #25) > > > (From update of attachment 162970 [details] [details] [details]) > > > View in context: https://bugs.webkit.org/attachment.cgi?id=162970&action=review > > > > > > > Source/WebCore/platform/mac/ScrollbarThemeMac.mm:216 > > > > + NSNumber* number = objc_getAssociatedObject(painter, &gLockedAlphaKey); > > > > > > This definitely does not seem like the right approach. If you want to call NSScrollerImp API, you should not use objc_getAssociatedObject/objc_setAssociatedObject. You should call it the same way we call all of the other NSScrollerImp APIs, by declaring it in NSScrollerImpDetails.h > > > > Hi Beth, this actually doesn't call NSScrollerImp APIs. Instead it just associates some data with the instance of NSScrollerImp. > > > > Another way to do this would be to keep a std::map<NSScrollerImp, bool> but using objc_getAssociatedObject() is much more straight forward. > > Why does the data need to be associated with the NSScrollerImp instead of a WebCore object? Either one will work. Associating the data with NSScrollerImp is direct. Associating the data with ScrollbarThemeClient involves piping a lot of call out to Source/WebKit/*.
Beth Dakin
Comment 29 2012-09-10 12:42:39 PDT
(In reply to comment #28) > (In reply to comment #27) > > (In reply to comment #26) > > > (In reply to comment #25) > > > > (From update of attachment 162970 [details] [details] [details] [details]) > > > > View in context: https://bugs.webkit.org/attachment.cgi?id=162970&action=review > > > > > > > > > Source/WebCore/platform/mac/ScrollbarThemeMac.mm:216 > > > > > + NSNumber* number = objc_getAssociatedObject(painter, &gLockedAlphaKey); > > > > > > > > This definitely does not seem like the right approach. If you want to call NSScrollerImp API, you should not use objc_getAssociatedObject/objc_setAssociatedObject. You should call it the same way we call all of the other NSScrollerImp APIs, by declaring it in NSScrollerImpDetails.h > > > > > > Hi Beth, this actually doesn't call NSScrollerImp APIs. Instead it just associates some data with the instance of NSScrollerImp. > > > > > > Another way to do this would be to keep a std::map<NSScrollerImp, bool> but using objc_getAssociatedObject() is much more straight forward. > > > > Why does the data need to be associated with the NSScrollerImp instead of a WebCore object? > > Either one will work. > > Associating the data with NSScrollerImp is direct. > > Associating the data with ScrollbarThemeClient involves piping a lot of call out to Source/WebKit/*. I really don't like the idea of adding data members to an AppKit object. I think we should stick to WebCore objects here. Can you associate it with Scrollbar instead of ScrollbarThemeClient?
Sailesh Agrawal
Comment 30 2012-09-10 12:54:30 PDT
(In reply to comment #29) > (In reply to comment #28) > > (In reply to comment #27) > > > (In reply to comment #26) > > > > (In reply to comment #25) > > > > > (From update of attachment 162970 [details] [details] [details] [details] [details]) > > > > > View in context: https://bugs.webkit.org/attachment.cgi?id=162970&action=review > > > > > > > > > > > Source/WebCore/platform/mac/ScrollbarThemeMac.mm:216 > > > > > > + NSNumber* number = objc_getAssociatedObject(painter, &gLockedAlphaKey); > > > > > > > > > > This definitely does not seem like the right approach. If you want to call NSScrollerImp API, you should not use objc_getAssociatedObject/objc_setAssociatedObject. You should call it the same way we call all of the other NSScrollerImp APIs, by declaring it in NSScrollerImpDetails.h > > > > > > > > Hi Beth, this actually doesn't call NSScrollerImp APIs. Instead it just associates some data with the instance of NSScrollerImp. > > > > > > > > Another way to do this would be to keep a std::map<NSScrollerImp, bool> but using objc_getAssociatedObject() is much more straight forward. > > > > > > Why does the data need to be associated with the NSScrollerImp instead of a WebCore object? > > > > Either one will work. > > > > Associating the data with NSScrollerImp is direct. > > > > Associating the data with ScrollbarThemeClient involves piping a lot of call out to Source/WebKit/*. > > I really don't like the idea of adding data members to an AppKit object. I think we should stick to WebCore objects here. Can you associate it with Scrollbar instead of ScrollbarThemeClient? Currently ScrollbarThemeMac only has access to ScrollbarThemeClient, which is an abstract class. Would it be ok to store it in a std::map instead?
Beth Dakin
Comment 31 2012-09-11 12:28:00 PDT
(In reply to comment #30) > > Currently ScrollbarThemeMac only has access to ScrollbarThemeClient, which is an abstract class. > > Would it be ok to store it in a std::map instead? Can you add a data member to ScrollbarThemeClient?
Beth Dakin
Comment 32 2012-09-11 12:33:40 PDT
(In reply to comment #31) > (In reply to comment #30) > > > > Currently ScrollbarThemeMac only has access to ScrollbarThemeClient, which is an abstract class. > > > > Would it be ok to store it in a std::map instead? > > Can you add a data member to ScrollbarThemeClient? Well, I guess you would still be adding the data to Scrollbar, but with pure virtual accessors on ScrollbarThemeClient. Would that work?
Sailesh Agrawal
Comment 33 2012-09-11 12:34:53 PDT
(In reply to comment #32) > (In reply to comment #31) > > (In reply to comment #30) > > > > > > Currently ScrollbarThemeMac only has access to ScrollbarThemeClient, which is an abstract class. > > > > > > Would it be ok to store it in a std::map instead? > > > > Can you add a data member to ScrollbarThemeClient? > > Well, I guess you would still be adding the data to Scrollbar, but with pure virtual accessors on ScrollbarThemeClient. Would that work? Yep, sounds good. I'll give it a try. Thanks!
Sailesh Agrawal
Comment 34 2012-09-12 17:49:46 PDT
Sailesh Agrawal
Comment 35 2012-09-12 17:50:21 PDT
(In reply to comment #32) > (In reply to comment #31) > > (In reply to comment #30) > > > > > > Currently ScrollbarThemeMac only has access to ScrollbarThemeClient, which is an abstract class. > > > > > > Would it be ok to store it in a std::map instead? > > > > Can you add a data member to ScrollbarThemeClient? > > Well, I guess you would still be adding the data to Scrollbar, but with pure virtual accessors on ScrollbarThemeClient. Would that work? Done! Please take another look. Thanks.
Beth Dakin
Comment 36 2012-09-13 15:35:14 PDT
Comment on attachment 163747 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=163747&action=review Looks good! > Source/WebCore/platform/chromium/ScrollbarThemeChromiumMac.mm:138 > + } else { You should remove the curly braces for the else since it only has only line.
Sailesh Agrawal
Comment 37 2012-09-13 20:23:03 PDT
Created attachment 164038 [details] Patch for landing
Sailesh Agrawal
Comment 38 2012-09-14 10:30:43 PDT
(In reply to comment #36) > (From update of attachment 163747 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=163747&action=review > > Looks good! > > > Source/WebCore/platform/chromium/ScrollbarThemeChromiumMac.mm:138 > > + } else { > > You should remove the curly braces for the else since it only has only line. Updated patch. Could you c+? Thanks!
WebKit Review Bot
Comment 39 2012-09-14 11:05:17 PDT
Comment on attachment 164038 [details] Patch for landing Rejecting attachment 164038 [details] from commit-queue. Failed to run "['/mnt/git/webkit-commit-queue/Tools/Scripts/webkit-patch', '--status-host=queues.webkit.org', '-..." exit_code: 2 Last 500 characters of output: ilter Hunk #1 succeeded at 154 (offset 1 line). patching file LayoutTests/ChangeLog Hunk #1 succeeded at 1 with fuzz 3. patching file LayoutTests/fast/scrolling/scrollbar-tickmarks-hittest-expected.txt patching file LayoutTests/fast/scrolling/scrollbar-tickmarks-hittest.html patching file ChangeLog Hunk #1 succeeded at 1 with fuzz 3. Failed to run "[u'/mnt/git/webkit-commit-queue/Tools/Scripts/svn-apply', u'--force', u'--reviewer', u'Beth Dakin']" exit_code: 1 cwd: /mnt/git/webkit-commit-queue Full output: http://queues.webkit.org/results/13844755
Sailesh Agrawal
Comment 40 2012-09-14 13:30:55 PDT
Created attachment 164215 [details] Patch for landing
WebKit Review Bot
Comment 41 2012-09-14 13:54:12 PDT
Comment on attachment 164215 [details] Patch for landing Attachment 164215 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/13852554
Sailesh Agrawal
Comment 42 2012-09-18 13:33:38 PDT
Created attachment 164612 [details] Patch for landing
WebKit Review Bot
Comment 43 2012-09-18 13:48:00 PDT
Comment on attachment 164612 [details] Patch for landing Attachment 164612 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/13892308
Peter Beverloo (cr-android ews)
Comment 44 2012-09-18 14:11:29 PDT
Comment on attachment 164612 [details] Patch for landing Attachment 164612 [details] did not pass cr-android-ews (chromium-android): Output: http://queues.webkit.org/results/13900298
Sailesh Agrawal
Comment 45 2012-09-18 15:35:51 PDT
Created attachment 164631 [details] Patch for landing
Sailesh Agrawal
Comment 46 2012-09-18 15:38:44 PDT
Looks like the changes to CCScrollbarLayerImpl.h requires a 3 sided patch. +jamesr to confirm
James Robinson
Comment 47 2012-09-18 15:41:41 PDT
I don't think you should need to touch CCScrollbarLayerImpl. We don't do mouse hit testing on that object at any point.
Sailesh Agrawal
Comment 48 2012-09-18 19:22:37 PDT
Hi Beth, could I get another r+/c+? The try bots are all green now. Thanks!
WebKit Review Bot
Comment 49 2012-09-18 20:38:41 PDT
Comment on attachment 164631 [details] Patch for landing Clearing flags on attachment: 164631 Committed r128963: <http://trac.webkit.org/changeset/128963>
WebKit Review Bot
Comment 50 2012-09-18 20:38:47 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.