Chromium: Scrollbar with tickmarks doesn't respond to clicks
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Sep 2012 03:39:04 +0000 (03:39 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 19 Sep 2012 03:39:04 +0000 (03:39 +0000)
commit7d11bea6347741f59488a90d8ac33c0af55731b0
tree9a82b5db42c4228414762f2f07da3aa9929ecad4
parentb7e13ab03e20c409a62a6fac04b28a291aebe680
Chromium: Scrollbar with tickmarks doesn't respond to clicks
https://bugs.webkit.org/show_bug.cgi?id=96049

Patch by Sailesh Agrawal <sail@chromium.org> on 2012-09-18
Reviewed by Beth Dakin.

.:

Update exported symbols.

* Source/autotools/symbols.filter:

Source/Platform:

Added isAlphaLocked and setIsAlphaLocked.

* chromium/public/WebScrollbar.h:
(WebScrollbar):

Source/WebCore:

Currently when a scrollbar has tickmarks its forced to be visible by setting its alpha to 1.0. The alpha value is reset to its old value at the end of the drawing routine. This approach doesn't work with the hit testing code which relies on the scrollbar's alpha value

Unfortunately there doesn't seem to be anyway to force a scrollbar to be visible. The closest API is -[NSScrollerImpPair lockOverlayScrollerState:]. Unfortunately this locks both the horizontal and vertical scrollbar. It also doesn't expand the knob width.

My fix simply adds a new alphaLocked attribute to the scrollbar. If this attribute is set to true then hit testing will return true.

Test: fast/scrolling/scrollbar-tickmarks-hittest.html

* WebCore.exp.in:
* WebCore.order:
* page/Settings.cpp:
(WebCore):
(WebCore::Settings::setUsesOverlayScrollbars): Sets the usesOverlayScrollbars flag.
(WebCore::Settings::usesOverlayScrollbars): Gets the usesOverlayScrollbars flag.
* page/Settings.h:
(Settings):
* platform/Scrollbar.cpp:
(WebCore::Scrollbar::Scrollbar):
* platform/Scrollbar.h:
(WebCore::Scrollbar::isAlphaLocked):
(WebCore::Scrollbar::setIsAlphaLocked):
(Scrollbar):
* platform/ScrollbarThemeClient.h:
(ScrollbarThemeClient):
* platform/chromium/ScrollbarThemeChromiumMac.mm:
(WebCore::ScrollbarThemeChromiumMac::paint): Updated to set and unset the alphaLocked attribute.
* platform/chromium/support/WebScrollbarImpl.cpp:
(WebKit::WebScrollbarImpl::isAlphaLocked):
(WebKit):
(WebKit::WebScrollbarImpl::setIsAlphaLocked):
* platform/chromium/support/WebScrollbarImpl.h:
(WebScrollbarImpl):
* platform/graphics/chromium/cc/CCScrollbarLayerImpl.cpp:
(WebCore::CCScrollbarLayerImpl::CCScrollbarLayerImpl):
(WebCore::CCScrollbarLayerImpl::CCScrollbar::isAlphaLocked):
(WebCore):
(WebCore::CCScrollbarLayerImpl::CCScrollbar::setIsAlphaLocked):
* platform/graphics/chromium/cc/CCScrollbarLayerImpl.h:
(CCScrollbar):
(CCScrollbarLayerImpl):
* platform/mac/NSScrollerImpDetails.mm:
(WebCore::recommendedScrollerStyle): Check the usesOverlayScrollbars setting to see if overlay scrollbars should be forced on.
* platform/mac/ScrollAnimatorMac.mm:
(WebCore::ScrollAnimatorMac::shouldScrollbarParticipateInHitTesting): Updated to check the alphaLocked attribute.
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::reset): Resets the usesOverlayScrollbars setting.
(WebCore::InternalSettings::setUsesOverlayScrollbars): Sets the usesOverlayScrollbars setting.
(WebCore):
* testing/InternalSettings.h:
(InternalSettings):
* testing/InternalSettings.idl: Add a new setUsesOverlayScrollbars function.

Source/WebKit/chromium:

Pipe isAlphaLocked and setIsAlphaLocked.

* src/WebPluginScrollbarImpl.cpp:
(WebKit::WebPluginScrollbarImpl::isAlphaLocked):
(WebKit):
(WebKit::WebPluginScrollbarImpl::setIsAlphaLocked):
* src/WebPluginScrollbarImpl.h:
(WebPluginScrollbarImpl):
* src/WebScrollbarThemeClientImpl.cpp:
(WebKit::WebScrollbarThemeClientImpl::isAlphaLocked):
(WebKit):
(WebKit::WebScrollbarThemeClientImpl::setIsAlphaLocked):
* src/WebScrollbarThemeClientImpl.h:
(WebScrollbarThemeClientImpl):
* tests/ScrollbarLayerChromiumTest.cpp:

Source/WebKit2:

Update exported symbols.

* win/WebKit2.def:
* win/WebKit2CFLite.def:

LayoutTests:

* fast/scrolling/scrollbar-tickmarks-hittest-expected.txt: Added.
* fast/scrolling/scrollbar-tickmarks-hittest.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@128963 268f45cc-cd09-0410-ab3c-d52691b4dbfc
34 files changed:
ChangeLog
LayoutTests/ChangeLog
LayoutTests/fast/scrolling/scrollbar-tickmarks-hittest-expected.txt [new file with mode: 0644]
LayoutTests/fast/scrolling/scrollbar-tickmarks-hittest.html [new file with mode: 0644]
Source/Platform/ChangeLog
Source/Platform/chromium/public/WebScrollbar.h
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/WebCore.order
Source/WebCore/page/Settings.cpp
Source/WebCore/page/Settings.h
Source/WebCore/platform/Scrollbar.cpp
Source/WebCore/platform/Scrollbar.h
Source/WebCore/platform/ScrollbarThemeClient.h
Source/WebCore/platform/chromium/ScrollbarThemeChromiumMac.mm
Source/WebCore/platform/chromium/support/WebScrollbarImpl.cpp
Source/WebCore/platform/chromium/support/WebScrollbarImpl.h
Source/WebCore/platform/graphics/chromium/cc/CCScrollbarLayerImpl.cpp
Source/WebCore/platform/graphics/chromium/cc/CCScrollbarLayerImpl.h
Source/WebCore/platform/mac/NSScrollerImpDetails.mm
Source/WebCore/platform/mac/ScrollAnimatorMac.mm
Source/WebCore/testing/InternalSettings.cpp
Source/WebCore/testing/InternalSettings.h
Source/WebCore/testing/InternalSettings.idl
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/WebPluginScrollbarImpl.cpp
Source/WebKit/chromium/src/WebPluginScrollbarImpl.h
Source/WebKit/chromium/src/WebScrollbarThemeClientImpl.cpp
Source/WebKit/chromium/src/WebScrollbarThemeClientImpl.h
Source/WebKit/chromium/tests/ScrollbarLayerChromiumTest.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/win/WebKit2.def
Source/WebKit2/win/WebKit2CFLite.def
Source/autotools/symbols.filter