haikuwebkit/LayoutTests/fast/events/mouse-cursor-image-set-expe...

83 lines
2.7 KiB
Plaintext
Raw Permalink Normal View History

CSS cursor property should support webkit-image-set https://bugs.webkit.org/show_bug.cgi?id=99493 Patch by Rick Byers <rbyers@chromium.org> on 2012-12-06 Reviewed by Beth Dakin. .: Add ENABLE_MOUSE_CURSOR_SCALE (disabled by default) * Source/cmake/WebKitFeatures.cmake: * Source/cmakeconfig.h.cmake: Source/JavaScriptCore: Add ENABLE_MOUSE_CURSOR_SCALE (disabled by default) * Configurations/FeatureDefines.xcconfig: Source/WebCore: Add support for image scale factors attached to custom mouse cursor images behind ENABLE(MOUSE_CURSOR_SCALE). This required refactoring CSSCursorImageValue to derive directly from CSSValue since it can contain either a CSSImageValue or a CSSImageSetValue. If it contains an image-set, then we can plumb directly through to the CSSImageSetValue. If it contains an image, then either we can plumb directly through to the CSSImageValue, or if the URL represents an SVG cursor we have to intercept the image loading in order to substitute the actual SVG image URL and do the appropriate lifetime management. Tests: fast/css/cursor-parsing-image-set.html fast/events/mouse-cursor-image-set.html * Configurations/FeatureDefines.xcconfig: Add ENABLE_MOUSE_CURSOR_SCALE - disabled * GNUmakefile.features.am: ditto * css/CSSCursorImageValue.cpp: Refactor to inherit directly from CSSValue and support image sets (WebCore::CSSCursorImageValue::CSSCursorImageValue): (WebCore::CSSCursorImageValue::~CSSCursorImageValue): (WebCore::CSSCursorImageValue::customCssText): (WebCore::CSSCursorImageValue::updateIfSVGCursorIsUsed): (WebCore::CSSCursorImageValue::cachedImage): (WebCore::CSSCursorImageValue::cachedOrPendingImage): (WebCore::CSSCursorImageValue::isSVGCursor): (WebCore::CSSCursorImageValue::cachedImageURL): (WebCore::CSSCursorImageValue::clearCachedImage): (WebCore::CSSCursorImageValue::reportDescendantMemoryUsage): * css/CSSCursorImageValue.h: Remove cursor-specific hacks (WebCore::CSSCursorImageValue::create): (CSSCursorImageValue): * css/CSSImageValue.cpp: (WebCore::CSSImageValue::cachedImage): * css/CSSImageValue.h: (CSSImageValue): * css/CSSParser.cpp: (WebCore::CSSParser::parseValue): Parse cursor(-webkit-image-set(...)) rules * css/CSSValue.h: (WebCore::CSSValue::isImageValue): * css/StyleBuilder.cpp: (WebCore::ApplyPropertyCursor::applyValue): * css/StyleResolver.cpp: Hook up new CSSCursorImageValue support since it can't be handled like other images any more. (WebCore::StyleResolver::styleImage): (WebCore::StyleResolver::cursorOrPendingFromValue): (WebCore::StyleResolver::loadPendingImage): * css/StyleResolver.h: (StyleResolver): * page/EventHandler.cpp: (WebCore::EventHandler::selectCursor): Handle StyleCachedImageSet images and plumb scale factor through * platform/Cursor.cpp: (WebCore::Cursor::Cursor): Add imageScaleFactor * platform/Cursor.h: Add imageScaleFactor (Cursor): (WebCore::Cursor::imageScaleFactor): * platform/chromium/CursorChromium.cpp: Add imageScaleFactor (WebCore::Cursor::Cursor): (WebCore::Cursor::operator=): * rendering/style/CursorData.h: Clarify hotspot units (CursorData): * rendering/style/StyleCachedImage.h: (StyleCachedImage::cachedImage): Override new virtual. * rendering/style/StyleCachedImageSet.h: (StyleCachedImageSet::cachedImage): Override new virtual. * rendering/style/StyleImage.h: (StyleImage::cachedImage): Add new virtual method to avoid lots of casts and typechecks. * rendering/style/StylePendingImage.h: Add CSSCursorImageValue support (WebCore::StylePendingImage::cssCursorImageValue): * testing/Internals.cpp: (WebCore::Internals::getCurrentCursorInfo): Print non-identity scale factors for testing Source/WebKit/chromium: Add ENABLE_MOUSE_CURSOR_SCALE and enable it on the chromium port. Plumb cursor image scale factor through to chromium API. * features.gypi: * public/WebCursorInfo.h: * src/WebCursorInfo.cpp: (WebKit::WebCursorInfo::WebCursorInfo): Source/WebKit/mac: Add ENABLE_MOUSE_CURSOR_SCALE - disabled by default. * Configurations/FeatureDefines.xcconfig: Source/WebKit2: Add ENABLE_MOUSE_CURSOR_SCALE - disabled by default. * Configurations/FeatureDefines.xcconfig: Tools: Add ENABLE_MOUSE_CURSOR_SCALE - disabled by default * Scripts/webkitperl/FeatureList.pm: * qmake/mkspecs/features/features.pri: WebKitLibraries: Add ENABLE_MOUSE_CURSOR_SCALE - disabled by default * win/tools/vsprops/FeatureDefines.vsprops: * win/tools/vsprops/FeatureDefinesCairo.vsprops: LayoutTests: Add tests for parser round-tripping of cursor rules with -webkit-image-set, and also end-to-end mouse cursor tests that validate the cursor details ultimately used at different device scales. Tests are disabled on ports other than chromium (require ENABLE(MOUSE_CURSOR_SCALE)) * fast/css/cursor-parsing-image-set-expected.txt: Added. * fast/css/cursor-parsing-image-set.html: Added. * fast/events/mouse-cursor-image-set-expected.txt: Added. * fast/events/mouse-cursor-image-set.html: Added. * fast/events/resources/greenbox200.png: Added. * fast/events/resources/greenbox30-hotspot28-3.cur: Added. * fast/events/resources/greenbox30.png: Added. * platform/efl/TestExpectations: * platform/gtk/TestExpectations: * platform/mac/TestExpectations: * platform/win/TestExpectations: Canonical link: https://commits.webkit.org/122494@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@136919 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-12-07 03:07:24 +00:00
Test that mouse cursors are applied correctly.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
Bug 99493
Checking cursors with device pixel ratio of 1
----------------------------------------------
TEST CASE: 25x25 image at 1x
Cursor Info: type=Custom hotSpot=0,0 image=25x25
TEST CASE: 25x25 image at 2x
Cursor Info: type=Custom hotSpot=0,0 image=25x25 scale=2
TEST CASE: 25x25 image at 1x, 30x30 image at 2x
Cursor Info: type=Custom hotSpot=0,0 image=25x25
TEST CASE: 25x25 image at 1.5x, 30x30 image at 5x
Cursor Info: type=Custom hotSpot=0,0 image=25x25 scale=1.5
TEST CASE: Invalid tiny scale with fallback to pointer
Cursor Info: type=Hand hotSpot=0,0
TEST CASE: Over-large image with fallback to pointer
Cursor Info: type=Hand hotSpot=0,0
TEST CASE: 200x200 image at 4x (not over-large in UI pixels)
Cursor Info: type=Custom hotSpot=0,0 image=200x200 scale=4
TEST CASE: Non-existent image in image-set with fallback to 25x25 image
Cursor Info: type=Custom hotSpot=0,0 image=25x25
TEST CASE: Explicit hotspot at (5,3) logical in 1x and 2x
Cursor Info: type=Custom hotSpot=5,3 image=25x25
TEST CASE: Explicit hotspot at (7,3) logical in 0.7x and 1.4x - should round to nearest integer
Cursor Info: type=Custom hotSpot=7,3 image=30x30 scale=1.4
CSS cursor property should support webkit-image-set https://bugs.webkit.org/show_bug.cgi?id=99493 Patch by Rick Byers <rbyers@chromium.org> on 2012-12-06 Reviewed by Beth Dakin. .: Add ENABLE_MOUSE_CURSOR_SCALE (disabled by default) * Source/cmake/WebKitFeatures.cmake: * Source/cmakeconfig.h.cmake: Source/JavaScriptCore: Add ENABLE_MOUSE_CURSOR_SCALE (disabled by default) * Configurations/FeatureDefines.xcconfig: Source/WebCore: Add support for image scale factors attached to custom mouse cursor images behind ENABLE(MOUSE_CURSOR_SCALE). This required refactoring CSSCursorImageValue to derive directly from CSSValue since it can contain either a CSSImageValue or a CSSImageSetValue. If it contains an image-set, then we can plumb directly through to the CSSImageSetValue. If it contains an image, then either we can plumb directly through to the CSSImageValue, or if the URL represents an SVG cursor we have to intercept the image loading in order to substitute the actual SVG image URL and do the appropriate lifetime management. Tests: fast/css/cursor-parsing-image-set.html fast/events/mouse-cursor-image-set.html * Configurations/FeatureDefines.xcconfig: Add ENABLE_MOUSE_CURSOR_SCALE - disabled * GNUmakefile.features.am: ditto * css/CSSCursorImageValue.cpp: Refactor to inherit directly from CSSValue and support image sets (WebCore::CSSCursorImageValue::CSSCursorImageValue): (WebCore::CSSCursorImageValue::~CSSCursorImageValue): (WebCore::CSSCursorImageValue::customCssText): (WebCore::CSSCursorImageValue::updateIfSVGCursorIsUsed): (WebCore::CSSCursorImageValue::cachedImage): (WebCore::CSSCursorImageValue::cachedOrPendingImage): (WebCore::CSSCursorImageValue::isSVGCursor): (WebCore::CSSCursorImageValue::cachedImageURL): (WebCore::CSSCursorImageValue::clearCachedImage): (WebCore::CSSCursorImageValue::reportDescendantMemoryUsage): * css/CSSCursorImageValue.h: Remove cursor-specific hacks (WebCore::CSSCursorImageValue::create): (CSSCursorImageValue): * css/CSSImageValue.cpp: (WebCore::CSSImageValue::cachedImage): * css/CSSImageValue.h: (CSSImageValue): * css/CSSParser.cpp: (WebCore::CSSParser::parseValue): Parse cursor(-webkit-image-set(...)) rules * css/CSSValue.h: (WebCore::CSSValue::isImageValue): * css/StyleBuilder.cpp: (WebCore::ApplyPropertyCursor::applyValue): * css/StyleResolver.cpp: Hook up new CSSCursorImageValue support since it can't be handled like other images any more. (WebCore::StyleResolver::styleImage): (WebCore::StyleResolver::cursorOrPendingFromValue): (WebCore::StyleResolver::loadPendingImage): * css/StyleResolver.h: (StyleResolver): * page/EventHandler.cpp: (WebCore::EventHandler::selectCursor): Handle StyleCachedImageSet images and plumb scale factor through * platform/Cursor.cpp: (WebCore::Cursor::Cursor): Add imageScaleFactor * platform/Cursor.h: Add imageScaleFactor (Cursor): (WebCore::Cursor::imageScaleFactor): * platform/chromium/CursorChromium.cpp: Add imageScaleFactor (WebCore::Cursor::Cursor): (WebCore::Cursor::operator=): * rendering/style/CursorData.h: Clarify hotspot units (CursorData): * rendering/style/StyleCachedImage.h: (StyleCachedImage::cachedImage): Override new virtual. * rendering/style/StyleCachedImageSet.h: (StyleCachedImageSet::cachedImage): Override new virtual. * rendering/style/StyleImage.h: (StyleImage::cachedImage): Add new virtual method to avoid lots of casts and typechecks. * rendering/style/StylePendingImage.h: Add CSSCursorImageValue support (WebCore::StylePendingImage::cssCursorImageValue): * testing/Internals.cpp: (WebCore::Internals::getCurrentCursorInfo): Print non-identity scale factors for testing Source/WebKit/chromium: Add ENABLE_MOUSE_CURSOR_SCALE and enable it on the chromium port. Plumb cursor image scale factor through to chromium API. * features.gypi: * public/WebCursorInfo.h: * src/WebCursorInfo.cpp: (WebKit::WebCursorInfo::WebCursorInfo): Source/WebKit/mac: Add ENABLE_MOUSE_CURSOR_SCALE - disabled by default. * Configurations/FeatureDefines.xcconfig: Source/WebKit2: Add ENABLE_MOUSE_CURSOR_SCALE - disabled by default. * Configurations/FeatureDefines.xcconfig: Tools: Add ENABLE_MOUSE_CURSOR_SCALE - disabled by default * Scripts/webkitperl/FeatureList.pm: * qmake/mkspecs/features/features.pri: WebKitLibraries: Add ENABLE_MOUSE_CURSOR_SCALE - disabled by default * win/tools/vsprops/FeatureDefines.vsprops: * win/tools/vsprops/FeatureDefinesCairo.vsprops: LayoutTests: Add tests for parser round-tripping of cursor rules with -webkit-image-set, and also end-to-end mouse cursor tests that validate the cursor details ultimately used at different device scales. Tests are disabled on ports other than chromium (require ENABLE(MOUSE_CURSOR_SCALE)) * fast/css/cursor-parsing-image-set-expected.txt: Added. * fast/css/cursor-parsing-image-set.html: Added. * fast/events/mouse-cursor-image-set-expected.txt: Added. * fast/events/mouse-cursor-image-set.html: Added. * fast/events/resources/greenbox200.png: Added. * fast/events/resources/greenbox30-hotspot28-3.cur: Added. * fast/events/resources/greenbox30.png: Added. * platform/efl/TestExpectations: * platform/gtk/TestExpectations: * platform/mac/TestExpectations: * platform/win/TestExpectations: Canonical link: https://commits.webkit.org/122494@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@136919 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-12-07 03:07:24 +00:00
TEST CASE: Implicit hot-spot at (5,4) physical for 1x and (28,3) physical for 2x
Cursor Info: type=Custom hotSpot=5,4 image=25x25
Checking cursors with device pixel ratio of 2
----------------------------------------------
TEST CASE: 25x25 image at 1x
Cursor Info: type=Custom hotSpot=0,0 image=25x25
TEST CASE: 25x25 image at 2x
Cursor Info: type=Custom hotSpot=0,0 image=25x25 scale=2
TEST CASE: 25x25 image at 1x, 30x30 image at 2x
Cursor Info: type=Custom hotSpot=0,0 image=30x30 scale=2
TEST CASE: 25x25 image at 1.5x, 30x30 image at 5x
Cursor Info: type=Custom hotSpot=0,0 image=30x30 scale=5
TEST CASE: Invalid tiny scale with fallback to pointer
Cursor Info: type=Hand hotSpot=0,0
TEST CASE: Over-large image with fallback to pointer
Cursor Info: type=Hand hotSpot=0,0
TEST CASE: 200x200 image at 4x (not over-large in UI pixels)
Cursor Info: type=Custom hotSpot=0,0 image=200x200 scale=4
TEST CASE: Non-existent image in image-set with fallback to 25x25 image
Cursor Info: type=Custom hotSpot=0,0 image=25x25
TEST CASE: Explicit hotspot at (5,3) logical in 1x and 2x
Cursor Info: type=Custom hotSpot=5,3 image=30x30 scale=2
CSS cursor property should support webkit-image-set https://bugs.webkit.org/show_bug.cgi?id=99493 Patch by Rick Byers <rbyers@chromium.org> on 2012-12-06 Reviewed by Beth Dakin. .: Add ENABLE_MOUSE_CURSOR_SCALE (disabled by default) * Source/cmake/WebKitFeatures.cmake: * Source/cmakeconfig.h.cmake: Source/JavaScriptCore: Add ENABLE_MOUSE_CURSOR_SCALE (disabled by default) * Configurations/FeatureDefines.xcconfig: Source/WebCore: Add support for image scale factors attached to custom mouse cursor images behind ENABLE(MOUSE_CURSOR_SCALE). This required refactoring CSSCursorImageValue to derive directly from CSSValue since it can contain either a CSSImageValue or a CSSImageSetValue. If it contains an image-set, then we can plumb directly through to the CSSImageSetValue. If it contains an image, then either we can plumb directly through to the CSSImageValue, or if the URL represents an SVG cursor we have to intercept the image loading in order to substitute the actual SVG image URL and do the appropriate lifetime management. Tests: fast/css/cursor-parsing-image-set.html fast/events/mouse-cursor-image-set.html * Configurations/FeatureDefines.xcconfig: Add ENABLE_MOUSE_CURSOR_SCALE - disabled * GNUmakefile.features.am: ditto * css/CSSCursorImageValue.cpp: Refactor to inherit directly from CSSValue and support image sets (WebCore::CSSCursorImageValue::CSSCursorImageValue): (WebCore::CSSCursorImageValue::~CSSCursorImageValue): (WebCore::CSSCursorImageValue::customCssText): (WebCore::CSSCursorImageValue::updateIfSVGCursorIsUsed): (WebCore::CSSCursorImageValue::cachedImage): (WebCore::CSSCursorImageValue::cachedOrPendingImage): (WebCore::CSSCursorImageValue::isSVGCursor): (WebCore::CSSCursorImageValue::cachedImageURL): (WebCore::CSSCursorImageValue::clearCachedImage): (WebCore::CSSCursorImageValue::reportDescendantMemoryUsage): * css/CSSCursorImageValue.h: Remove cursor-specific hacks (WebCore::CSSCursorImageValue::create): (CSSCursorImageValue): * css/CSSImageValue.cpp: (WebCore::CSSImageValue::cachedImage): * css/CSSImageValue.h: (CSSImageValue): * css/CSSParser.cpp: (WebCore::CSSParser::parseValue): Parse cursor(-webkit-image-set(...)) rules * css/CSSValue.h: (WebCore::CSSValue::isImageValue): * css/StyleBuilder.cpp: (WebCore::ApplyPropertyCursor::applyValue): * css/StyleResolver.cpp: Hook up new CSSCursorImageValue support since it can't be handled like other images any more. (WebCore::StyleResolver::styleImage): (WebCore::StyleResolver::cursorOrPendingFromValue): (WebCore::StyleResolver::loadPendingImage): * css/StyleResolver.h: (StyleResolver): * page/EventHandler.cpp: (WebCore::EventHandler::selectCursor): Handle StyleCachedImageSet images and plumb scale factor through * platform/Cursor.cpp: (WebCore::Cursor::Cursor): Add imageScaleFactor * platform/Cursor.h: Add imageScaleFactor (Cursor): (WebCore::Cursor::imageScaleFactor): * platform/chromium/CursorChromium.cpp: Add imageScaleFactor (WebCore::Cursor::Cursor): (WebCore::Cursor::operator=): * rendering/style/CursorData.h: Clarify hotspot units (CursorData): * rendering/style/StyleCachedImage.h: (StyleCachedImage::cachedImage): Override new virtual. * rendering/style/StyleCachedImageSet.h: (StyleCachedImageSet::cachedImage): Override new virtual. * rendering/style/StyleImage.h: (StyleImage::cachedImage): Add new virtual method to avoid lots of casts and typechecks. * rendering/style/StylePendingImage.h: Add CSSCursorImageValue support (WebCore::StylePendingImage::cssCursorImageValue): * testing/Internals.cpp: (WebCore::Internals::getCurrentCursorInfo): Print non-identity scale factors for testing Source/WebKit/chromium: Add ENABLE_MOUSE_CURSOR_SCALE and enable it on the chromium port. Plumb cursor image scale factor through to chromium API. * features.gypi: * public/WebCursorInfo.h: * src/WebCursorInfo.cpp: (WebKit::WebCursorInfo::WebCursorInfo): Source/WebKit/mac: Add ENABLE_MOUSE_CURSOR_SCALE - disabled by default. * Configurations/FeatureDefines.xcconfig: Source/WebKit2: Add ENABLE_MOUSE_CURSOR_SCALE - disabled by default. * Configurations/FeatureDefines.xcconfig: Tools: Add ENABLE_MOUSE_CURSOR_SCALE - disabled by default * Scripts/webkitperl/FeatureList.pm: * qmake/mkspecs/features/features.pri: WebKitLibraries: Add ENABLE_MOUSE_CURSOR_SCALE - disabled by default * win/tools/vsprops/FeatureDefines.vsprops: * win/tools/vsprops/FeatureDefinesCairo.vsprops: LayoutTests: Add tests for parser round-tripping of cursor rules with -webkit-image-set, and also end-to-end mouse cursor tests that validate the cursor details ultimately used at different device scales. Tests are disabled on ports other than chromium (require ENABLE(MOUSE_CURSOR_SCALE)) * fast/css/cursor-parsing-image-set-expected.txt: Added. * fast/css/cursor-parsing-image-set.html: Added. * fast/events/mouse-cursor-image-set-expected.txt: Added. * fast/events/mouse-cursor-image-set.html: Added. * fast/events/resources/greenbox200.png: Added. * fast/events/resources/greenbox30-hotspot28-3.cur: Added. * fast/events/resources/greenbox30.png: Added. * platform/efl/TestExpectations: * platform/gtk/TestExpectations: * platform/mac/TestExpectations: * platform/win/TestExpectations: Canonical link: https://commits.webkit.org/122494@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@136919 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-12-07 03:07:24 +00:00
TEST CASE: Explicit hotspot at (7,3) logical in 0.7x and 1.4x - should round to nearest integer
Cursor Info: type=Custom hotSpot=7,3 image=30x30 scale=1.4
CSS cursor property should support webkit-image-set https://bugs.webkit.org/show_bug.cgi?id=99493 Patch by Rick Byers <rbyers@chromium.org> on 2012-12-06 Reviewed by Beth Dakin. .: Add ENABLE_MOUSE_CURSOR_SCALE (disabled by default) * Source/cmake/WebKitFeatures.cmake: * Source/cmakeconfig.h.cmake: Source/JavaScriptCore: Add ENABLE_MOUSE_CURSOR_SCALE (disabled by default) * Configurations/FeatureDefines.xcconfig: Source/WebCore: Add support for image scale factors attached to custom mouse cursor images behind ENABLE(MOUSE_CURSOR_SCALE). This required refactoring CSSCursorImageValue to derive directly from CSSValue since it can contain either a CSSImageValue or a CSSImageSetValue. If it contains an image-set, then we can plumb directly through to the CSSImageSetValue. If it contains an image, then either we can plumb directly through to the CSSImageValue, or if the URL represents an SVG cursor we have to intercept the image loading in order to substitute the actual SVG image URL and do the appropriate lifetime management. Tests: fast/css/cursor-parsing-image-set.html fast/events/mouse-cursor-image-set.html * Configurations/FeatureDefines.xcconfig: Add ENABLE_MOUSE_CURSOR_SCALE - disabled * GNUmakefile.features.am: ditto * css/CSSCursorImageValue.cpp: Refactor to inherit directly from CSSValue and support image sets (WebCore::CSSCursorImageValue::CSSCursorImageValue): (WebCore::CSSCursorImageValue::~CSSCursorImageValue): (WebCore::CSSCursorImageValue::customCssText): (WebCore::CSSCursorImageValue::updateIfSVGCursorIsUsed): (WebCore::CSSCursorImageValue::cachedImage): (WebCore::CSSCursorImageValue::cachedOrPendingImage): (WebCore::CSSCursorImageValue::isSVGCursor): (WebCore::CSSCursorImageValue::cachedImageURL): (WebCore::CSSCursorImageValue::clearCachedImage): (WebCore::CSSCursorImageValue::reportDescendantMemoryUsage): * css/CSSCursorImageValue.h: Remove cursor-specific hacks (WebCore::CSSCursorImageValue::create): (CSSCursorImageValue): * css/CSSImageValue.cpp: (WebCore::CSSImageValue::cachedImage): * css/CSSImageValue.h: (CSSImageValue): * css/CSSParser.cpp: (WebCore::CSSParser::parseValue): Parse cursor(-webkit-image-set(...)) rules * css/CSSValue.h: (WebCore::CSSValue::isImageValue): * css/StyleBuilder.cpp: (WebCore::ApplyPropertyCursor::applyValue): * css/StyleResolver.cpp: Hook up new CSSCursorImageValue support since it can't be handled like other images any more. (WebCore::StyleResolver::styleImage): (WebCore::StyleResolver::cursorOrPendingFromValue): (WebCore::StyleResolver::loadPendingImage): * css/StyleResolver.h: (StyleResolver): * page/EventHandler.cpp: (WebCore::EventHandler::selectCursor): Handle StyleCachedImageSet images and plumb scale factor through * platform/Cursor.cpp: (WebCore::Cursor::Cursor): Add imageScaleFactor * platform/Cursor.h: Add imageScaleFactor (Cursor): (WebCore::Cursor::imageScaleFactor): * platform/chromium/CursorChromium.cpp: Add imageScaleFactor (WebCore::Cursor::Cursor): (WebCore::Cursor::operator=): * rendering/style/CursorData.h: Clarify hotspot units (CursorData): * rendering/style/StyleCachedImage.h: (StyleCachedImage::cachedImage): Override new virtual. * rendering/style/StyleCachedImageSet.h: (StyleCachedImageSet::cachedImage): Override new virtual. * rendering/style/StyleImage.h: (StyleImage::cachedImage): Add new virtual method to avoid lots of casts and typechecks. * rendering/style/StylePendingImage.h: Add CSSCursorImageValue support (WebCore::StylePendingImage::cssCursorImageValue): * testing/Internals.cpp: (WebCore::Internals::getCurrentCursorInfo): Print non-identity scale factors for testing Source/WebKit/chromium: Add ENABLE_MOUSE_CURSOR_SCALE and enable it on the chromium port. Plumb cursor image scale factor through to chromium API. * features.gypi: * public/WebCursorInfo.h: * src/WebCursorInfo.cpp: (WebKit::WebCursorInfo::WebCursorInfo): Source/WebKit/mac: Add ENABLE_MOUSE_CURSOR_SCALE - disabled by default. * Configurations/FeatureDefines.xcconfig: Source/WebKit2: Add ENABLE_MOUSE_CURSOR_SCALE - disabled by default. * Configurations/FeatureDefines.xcconfig: Tools: Add ENABLE_MOUSE_CURSOR_SCALE - disabled by default * Scripts/webkitperl/FeatureList.pm: * qmake/mkspecs/features/features.pri: WebKitLibraries: Add ENABLE_MOUSE_CURSOR_SCALE - disabled by default * win/tools/vsprops/FeatureDefines.vsprops: * win/tools/vsprops/FeatureDefinesCairo.vsprops: LayoutTests: Add tests for parser round-tripping of cursor rules with -webkit-image-set, and also end-to-end mouse cursor tests that validate the cursor details ultimately used at different device scales. Tests are disabled on ports other than chromium (require ENABLE(MOUSE_CURSOR_SCALE)) * fast/css/cursor-parsing-image-set-expected.txt: Added. * fast/css/cursor-parsing-image-set.html: Added. * fast/events/mouse-cursor-image-set-expected.txt: Added. * fast/events/mouse-cursor-image-set.html: Added. * fast/events/resources/greenbox200.png: Added. * fast/events/resources/greenbox30-hotspot28-3.cur: Added. * fast/events/resources/greenbox30.png: Added. * platform/efl/TestExpectations: * platform/gtk/TestExpectations: * platform/mac/TestExpectations: * platform/win/TestExpectations: Canonical link: https://commits.webkit.org/122494@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@136919 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-12-07 03:07:24 +00:00
TEST CASE: Implicit hot-spot at (5,4) physical for 1x and (28,3) physical for 2x
Cursor Info: type=Custom hotSpot=28,3 image=30x30 scale=2
PASS successfullyParsed is true
TEST COMPLETE