Default mouse cursor behavior should be auto-hide for full screen video with custom...
authorjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Mar 2013 00:27:59 +0000 (00:27 +0000)
committerjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 7 Mar 2013 00:27:59 +0000 (00:27 +0000)
commit834fd9fbf9e6be504afb8bb4b5ef44b5fc940e76
treec02c48839b4767a09af26ddda034ebedb0f296ea
parentb246283de730f03b50e8caa7b215ced5171d59a5
Default mouse cursor behavior should be auto-hide for full screen video with custom controls
https://bugs.webkit.org/show_bug.cgi?id=107601

Reviewed by Beth Dakin.

Source/WebCore:

Test: fullscreen/video-cursor-auto-hide.html

To facilitate automatically hiding the mouse cursor after a certain amount of idle mouse
time, add a new CSS property '-webkit-cursor-visibility', and handle that value inside of
EventHandler. When that value is present, the EventHandler will start a timer which, when
fired, will set the view's cursor to the None cursor. Subsequent mouse moves will either
cancel the timer, or reset the auto-hide timer.

Add a new CSS property, '-webkit-cursor-visibility':
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue):
* css/CSSParser.cpp:
(WebCore::CSSParser::parseValue):
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator ECursorVisibility):
* css/CSSProperty.cpp:
(WebCore::CSSProperty::isInheritedProperty):
* css/CSSPropertyNames.in:
* css/CSSValueKeywords.in:
* css/StyleBuilder.cpp:
(WebCore::StyleBuilder::StyleBuilder):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::applyProperty):

Add a rule for video descendants of full screen elements to auto-hide the cursor on hover:
* css/fullscreen.css:
(:-webkit-full-screen video:hover):

Add a new timer, m_autoHideCursorTimer, to control resetting the view's cursor to None after
enough mouse idle time has passed.
* page/EventHandler.cpp:
(WebCore::EventHandler::EventHandler):
(WebCore::EventHandler::~EventHandler):
(WebCore::EventHandler::clear):
(WebCore::EventHandler::selectCursor):
(WebCore::EventHandler::startAutoHideCursorTimer):
(WebCore::EventHandler::cancelAutoHideCursorTimer):
(WebCore::EventHandler::autoHideCursorTimerFired):
* page/EventHandler.h:

Make FrameView::isActive() a public function (like it is in its superclass).
* page/FrameView.h:
(FrameView):

Move the definition for timeWithoutMouseMovementBeforeHidingControls from page->theme()
to page->settings() and allow that setting to be overridden in InternalSettings for
testing purposes:
* page/Settings.cpp:
(WebCore::Settings::Settings):
* page/Settings.h:
(WebCore::Settings::setTimeWithoutMouseMovementBeforeHidingControls):
(WebCore::Settings::timeWithoutMouseMovementBeforeHidingControls):
* rendering/RenderTheme.h:
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::InternalSettings::setTimeWithoutMouseMovementBeforeHidingControls):
* testing/InternalSettings.h:
(InternalSettings):
* testing/InternalSettings.idl:
* html/shadow/MediaControls.cpp:
(WebCore::MediaControls::startHideFullscreenControlsTimer):

Add support to FeatureObserver for CURSOR_VISIBILITY:
* page/FeatureObserver.h:

Enable the feature flag:
* Configurations/FeatureDefines.xcconfig:

Source/WebKit:

Enable the CURSOR_VISIBILITY feature.

* WebKit.vcxproj/FeatureDefines.props:

Source/WebKit/mac:

Enable the CURSOR_VISIBILITY feature.

* Configurations/FeatureDefines.xcconfig:

Source/WebKit2:

Enable the CURSOR_VISIBILITY feature.

* Configurations/FeatureDefines.xcconfig:

Source/WTF:

Enable the CURSOR_VISIBILITY feature.

* wtf/FeatureDefines.h:

LayoutTests:

* fullscreen/video-cursor-auto-hide-expected.txt: Added.
* fullscreen/video-cursor-auto-hide.html: Added.

Add an expected failing result in platforms which do not enable CURSOR_VISIBILITY.
* platform/chromium/TestExpectations:
* platform/efl/TestExpectations:
* platform/gtk/TestExpectations:
* platform/qt/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@145003 268f45cc-cd09-0410-ab3c-d52691b4dbfc
40 files changed:
LayoutTests/ChangeLog
LayoutTests/fullscreen/video-cursor-auto-hide-expected.txt [new file with mode: 0644]
LayoutTests/fullscreen/video-cursor-auto-hide.html [new file with mode: 0644]
LayoutTests/platform/chromium/TestExpectations
LayoutTests/platform/efl/TestExpectations
LayoutTests/platform/gtk/TestExpectations
LayoutTests/platform/qt/TestExpectations
Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig
Source/WTF/ChangeLog
Source/WTF/wtf/FeatureDefines.h
Source/WebCore/ChangeLog
Source/WebCore/Configurations/FeatureDefines.xcconfig
Source/WebCore/css/CSSComputedStyleDeclaration.cpp
Source/WebCore/css/CSSParser.cpp
Source/WebCore/css/CSSPrimitiveValueMappings.h
Source/WebCore/css/CSSProperty.cpp
Source/WebCore/css/CSSPropertyNames.in
Source/WebCore/css/CSSValueKeywords.in
Source/WebCore/css/StyleBuilder.cpp
Source/WebCore/css/StyleResolver.cpp
Source/WebCore/css/fullscreen.css
Source/WebCore/html/shadow/MediaControls.cpp
Source/WebCore/page/EventHandler.cpp
Source/WebCore/page/EventHandler.h
Source/WebCore/page/FeatureObserver.h
Source/WebCore/page/FrameView.h
Source/WebCore/page/Settings.cpp
Source/WebCore/page/Settings.h
Source/WebCore/rendering/RenderTheme.h
Source/WebCore/rendering/style/RenderStyle.h
Source/WebCore/rendering/style/RenderStyleConstants.h
Source/WebCore/testing/InternalSettings.cpp
Source/WebCore/testing/InternalSettings.h
Source/WebCore/testing/InternalSettings.idl
Source/WebKit/ChangeLog
Source/WebKit/WebKit.vcxproj/FeatureDefines.props
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/Configurations/FeatureDefines.xcconfig
Source/WebKit2/ChangeLog
Source/WebKit2/Configurations/FeatureDefines.xcconfig