I have a function which attempts to calculate the width of a scrollbar by putting two elements on to the page, one inside the other and forcing the inner element to a larger height than the outer which is overflow: auto; Then by subtracting the outer width from the inner we get the scrollbar width. This works in nearly all applications, apparent from when -webkit-scrollbar styles are applied to the scrolling element, and the element is visibility: hidden (note that if the element is visible, then it works as expected). Test case with element visible - works as expected: http://sprymedia.co.uk/media/misc/webkit/custom_scroll_visible.html Test case with element hidden - doesn't work: http://sprymedia.co.uk/media/misc/webkit/custom_scroll_hidden.html If -webkit-scrollbar styles are not applied, then it will work regardless of visibility. Tested in WebKit r121825 and shipping Safari 5.1.7 (7534.57.2). Filed in 'New Bugs' as I'm not sure if this is a Javascript or rendering engine issue.
Created attachment 210584 [details] Patch
(In reply to comment #1) > Created an attachment (id=210584) [details] > Patch Incase of custom-scrollbars webkit considers the visibility property and incase its hidden doesnot apply the scollbars properties. Same is not for non-customscrollbars. In either case scrollbar properties are applied. Behaviour should be same for both since even if element visibility:hidden space is set for that element.
(In reply to comment #1) > Created an attachment (id=210584) [details] > Patch Hi Darin. Can you please review this patch?
I don’t think I have the expertise to review this. Maybe Beth Dakin, Simon Fraser, or Hyatt?
Comment on attachment 210584 [details] Patch Seems reasonable.
(In reply to comment #5) > (From update of attachment 210584 [details]) > Seems reasonable. Thanks for the review Simon. Anything else needs to be done?
Comment on attachment 210584 [details] Patch Clearing flags on attachment: 210584 Committed r155323: <http://trac.webkit.org/changeset/155323>
All reviewed patches have been landed. Closing bug.
*** Bug 66306 has been marked as a duplicate of this bug. ***