CSS cursor property should support webkit-image-set
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 7 Dec 2012 03:07:24 +0000 (03:07 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 7 Dec 2012 03:07:24 +0000 (03:07 +0000)
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:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@136919 268f45cc-cd09-0410-ab3c-d52691b4dbfc

52 files changed:
ChangeLog
LayoutTests/ChangeLog
LayoutTests/fast/css/cursor-parsing-image-set-expected.txt [new file with mode: 0644]
LayoutTests/fast/css/cursor-parsing-image-set.html [new file with mode: 0644]
LayoutTests/fast/events/mouse-cursor-image-set-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/mouse-cursor-image-set.html [new file with mode: 0644]
LayoutTests/fast/events/resources/greenbox200.png [new file with mode: 0644]
LayoutTests/fast/events/resources/greenbox30-hotspot28-3.cur [new file with mode: 0644]
LayoutTests/fast/events/resources/greenbox30.png [new file with mode: 0644]
LayoutTests/platform/efl/TestExpectations
LayoutTests/platform/gtk/TestExpectations
LayoutTests/platform/mac/TestExpectations
LayoutTests/platform/win/TestExpectations
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig
Source/WebCore/ChangeLog
Source/WebCore/Configurations/FeatureDefines.xcconfig
Source/WebCore/GNUmakefile.features.am
Source/WebCore/css/CSSCursorImageValue.cpp
Source/WebCore/css/CSSCursorImageValue.h
Source/WebCore/css/CSSImageValue.cpp
Source/WebCore/css/CSSImageValue.h
Source/WebCore/css/CSSParser.cpp
Source/WebCore/css/CSSValue.h
Source/WebCore/css/StyleBuilder.cpp
Source/WebCore/css/StyleResolver.cpp
Source/WebCore/css/StyleResolver.h
Source/WebCore/page/EventHandler.cpp
Source/WebCore/platform/Cursor.cpp
Source/WebCore/platform/Cursor.h
Source/WebCore/platform/chromium/CursorChromium.cpp
Source/WebCore/rendering/style/CursorData.h
Source/WebCore/rendering/style/StyleCachedImage.h
Source/WebCore/rendering/style/StyleCachedImageSet.h
Source/WebCore/rendering/style/StyleImage.h
Source/WebCore/rendering/style/StylePendingImage.h
Source/WebCore/testing/Internals.cpp
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/features.gypi
Source/WebKit/chromium/src/WebCursorInfo.cpp
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/Configurations/FeatureDefines.xcconfig
Source/WebKit2/ChangeLog
Source/WebKit2/Configurations/FeatureDefines.xcconfig
Source/cmake/WebKitFeatures.cmake
Source/cmakeconfig.h.cmake
Tools/ChangeLog
Tools/Scripts/webkitperl/FeatureList.pm
Tools/qmake/mkspecs/features/features.pri
WebKitLibraries/ChangeLog
WebKitLibraries/win/tools/vsprops/FeatureDefines.vsprops
WebKitLibraries/win/tools/vsprops/FeatureDefinesCairo.vsprops

index 5756fbf..116cf05 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2012-12-06  Rick Byers  <rbyers@chromium.org>
+
+        CSS cursor property should support webkit-image-set
+        https://bugs.webkit.org/show_bug.cgi?id=99493
+
+        Reviewed by Beth Dakin.
+
+        Add ENABLE_MOUSE_CURSOR_SCALE (disabled by default)
+
+        * Source/cmake/WebKitFeatures.cmake:
+        * Source/cmakeconfig.h.cmake:
+
 2012-12-06  Laszlo Gombos  <l.gombos@samsung.com>
 
         [EFL] Remove ENABLE_GLIB_SUPPORT CMake variable
index e3d6352..2332296 100644 (file)
@@ -1,3 +1,28 @@
+2012-12-06  Rick Byers  <rbyers@chromium.org>
+
+        CSS cursor property should support webkit-image-set
+        https://bugs.webkit.org/show_bug.cgi?id=99493
+
+        Reviewed by Beth Dakin.
+
+        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:
+
 2012-12-06  Hayato Ito  <hayato@chromium.org>
 
         Event's relatedTarget re-targeting does not occur for manually fired mouse events created by event.initMouseEvent().
diff --git a/LayoutTests/fast/css/cursor-parsing-image-set-expected.txt b/LayoutTests/fast/css/cursor-parsing-image-set-expected.txt
new file mode 100644 (file)
index 0000000..72643c6
--- /dev/null
@@ -0,0 +1,16 @@
+Test the parsing of the cursor property when used with -webkit-image-set.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Bug 99493
+
+Test a bunch of cursor rules which should round-trip exactly.
+PASS roundtripCssRule("cursor: -webkit-image-set(url(file:///foo.png) 1x), auto;") is "cursor: -webkit-image-set(url(file:///foo.png) 1x), auto;"
+PASS roundtripCssRule("cursor: -webkit-image-set(url(file:///foo.png) 1x, url(file:///foo2x.png) 2x), auto;") is "cursor: -webkit-image-set(url(file:///foo.png) 1x, url(file:///foo2x.png) 2x), auto;"
+PASS roundtripCssRule("cursor: -webkit-image-set(url(file:///foo.png) 1x, url(file:///foo2x.png) 2x) 2 3, auto;") is "cursor: -webkit-image-set(url(file:///foo.png) 1x, url(file:///foo2x.png) 2x) 2 3, auto;"
+PASS roundtripCssRule("cursor: -webkit-image-set(url(file:///foo03.png) 0.3x, url(file:///foo5x.png) 5x) 6 5, url(file:///foo.png) 12 3, pointer;") is "cursor: -webkit-image-set(url(file:///foo03.png) 0.3x, url(file:///foo5x.png) 5x) 6 5, url(file:///foo.png) 12 3, pointer;"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/css/cursor-parsing-image-set.html b/LayoutTests/fast/css/cursor-parsing-image-set.html
new file mode 100644 (file)
index 0000000..f2da84f
--- /dev/null
@@ -0,0 +1,48 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src="../js/resources/js-test-pre.js"></script>
+</head>
+<body>
+<p id="description"></p>
+<p><a href=https://bugs.webkit.org/show_bug.cgi?id=99493>Bug 99493</a></p>
+<div id="console"></div>
+<script>
+description("Test the parsing of the cursor property when used with -webkit-image-set.");
+
+function makeCursorRule(rule)
+{
+    return "cursor: " + rule + ";";
+}
+
+function testCursorRule(rule)
+{
+    var cssText = makeCursorRule(rule);
+    shouldBeEqualToString('roundtripCssRule("' + cssText + '")', cssText);
+}
+
+function roundtripCssRule(cssText)
+{
+    var div = document.createElement("div");
+    div.setAttribute("style", cssText);
+    document.body.appendChild(div);
+    var result = div.style.cssText;
+    document.body.removeChild(div);
+    return result;
+}
+
+// Note that any absolute URL will suffice for these tests (can't use relative URLs
+// since they'll be converted to absolute form in the output).  I chose file URLs just
+// to avoid triggering any network activity.
+
+debug('Test a bunch of cursor rules which should round-trip exactly.');
+testCursorRule('-webkit-image-set(url(file:///foo.png) 1x), auto');
+testCursorRule('-webkit-image-set(url(file:///foo.png) 1x, url(file:///foo2x.png) 2x), auto');
+testCursorRule('-webkit-image-set(url(file:///foo.png) 1x, url(file:///foo2x.png) 2x) 2 3, auto');
+testCursorRule('-webkit-image-set(url(file:///foo03.png) 0.3x, url(file:///foo5x.png) 5x) 6 5, url(file:///foo.png) 12 3, pointer');
+
+successfullyParsed = true;
+</script>
+<script src="../js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/events/mouse-cursor-image-set-expected.txt b/LayoutTests/fast/events/mouse-cursor-image-set-expected.txt
new file mode 100644 (file)
index 0000000..24fe376
--- /dev/null
@@ -0,0 +1,82 @@
+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=10,4 image=30x30 scale=1.4
+
+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=10,6 image=30x30 scale=2
+
+TEST CASE: Explicit hotspot at (7,3) logical in 0.7x and 1.4x - should round to nearest integer
+Cursor Info: type=Custom hotSpot=10,4 image=30x30 scale=1.4
+
+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
+
diff --git a/LayoutTests/fast/events/mouse-cursor-image-set.html b/LayoutTests/fast/events/mouse-cursor-image-set.html
new file mode 100644 (file)
index 0000000..1c916a4
--- /dev/null
@@ -0,0 +1,124 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../js/resources/js-test-pre.js"></script>
+<style type="text/css">
+</style>
+</head>
+<body>
+<p id="description"></p>
+<p><a href=https://bugs.webkit.org/show_bug.cgi?id=99493>Bug 99493</a></p>
+<div id="test-container">
+  <div style='cursor: -webkit-image-set(url(resources/greenbox.png) 1x), pointer'>25x25 image at 1x</div>
+  <div style='cursor: -webkit-image-set(url(resources/greenbox.png) 2x), pointer'>25x25 image at 2x</div>
+  <div style='cursor: -webkit-image-set(url(resources/greenbox.png) 1x, url(resources/greenbox30.png) 2x), pointer'>25x25 image at 1x, 30x30 image at 2x</div>
+  <div style='cursor: -webkit-image-set(url(resources/greenbox.png) 1.5x, url(resources/greenbox30.png) 5x), pointer'>25x25 image at 1.5x, 30x30 image at 5x</div>
+  <div style='cursor: -webkit-image-set(url(resources/greenbox.png) 0.0001x), pointer'>Invalid tiny scale with fallback to pointer</div>
+  <div style='cursor: -webkit-image-set(url(resources/greenbox200.png) 1x), pointer'>Over-large image with fallback to pointer</div>
+  <div style='cursor: -webkit-image-set(url(resources/greenbox200.png) 4x), pointer'>200x200 image at 4x (not over-large in UI pixels)</div>
+  <div style='cursor: -webkit-image-set(url(doesntexist.png) 1x), url(resources/greenbox.png), pointer'>Non-existent image in image-set with fallback to 25x25 image</div>
+  <div style='cursor: -webkit-image-set(url(resources/greenbox.png) 1x, url(resources/greenbox30.png) 2x) 5 3, pointer'>Explicit hotspot at (5,3) logical in 1x and 2x</div>
+  <div style='cursor: -webkit-image-set(url(resources/greenbox.png) 0.7x, url(resources/greenbox30.png) 1.4x) 7 3, pointer'>Explicit hotspot at (7,3) logical in 0.7x and 1.4x - should round to nearest integer</div>
+  <div style='cursor: -webkit-image-set(url(resources/greenbox-hotspot5-4.cur) 1x, url(resources/greenbox30-hotspot28-3.cur) 2x), pointer'>Implicit hot-spot at (5,4) physical for 1x and (28,3) physical for 2x</div>
+</div>
+<br/>
+<div id="console"></div>
+<script>
+var imagesLeftToLoad = 0;
+
+function onImageLoad(success, ondone, e) {
+
+    // This debug output is non-deterministic and contains absolute URLs - only show when
+    // not running in DRT
+    if (!window.testRunner)
+        debug( 'Event "' + e.type + '": ' + e.target.src);
+
+    if (!success)
+        testFailed('Got unexpected \'' + e.type + '\' event for image: ' + e.target.src); 
+
+    imagesLeftToLoad--;
+    
+    if (imagesLeftToLoad < 0)
+        testFailed('Got more load/error callback than expected.');
+    
+    if (imagesLeftToLoad == 0)
+        ondone();
+}
+
+function checkCursors() {
+    debug('Checking cursors with device pixel ratio of ' + window.devicePixelRatio);  
+    debug('----------------------------------------------');
+       
+    var nodesToTest = document.querySelectorAll('#test-container > div');
+    for (var i = 0; i < nodesToTest.length; i++) {
+        var node = nodesToTest[i];
+        debug('TEST CASE: ' + node.textContent);
+        // Make sure the node is visible and move the mouse over top of it.
+        document.body.scrollTop = node.offsetTop - 50;
+        eventSender.mouseMoveTo(node.offsetLeft + 3, node.offsetTop - document.body.scrollTop + 3);
+
+        // Get details of the current mouse cursor.
+        // Note that we could return structured data which we then validate, but that's a lot more
+        // work and is redundant with relying on the expected output anyway.  Better to just dump
+        // it and inspect that it matches the description.
+        debug('Cursor Info: ' + window.internals.getCurrentCursorInfo(document));
+        debug('');
+    }
+}
+
+function runTests() {
+    if (window.eventSender) {
+        checkCursors();
+        // Repeat in high-dpi mode
+        testRunner.setBackingScaleFactor(2, function() {
+            // Failed images are apparently reset on scale factor change. 
+            ensureImagesLoaded([{ url: 'doesntexist.png', error: true }], function() {
+                checkCursors();
+                document.getElementById('test-container').style.display = 'none';
+                finishJSTest();
+            });
+       });     
+    } else {
+        finishJSTest();
+    }
+}
+
+function ensureImagesLoaded(imagesToLoad, callback)
+{
+    imagesLeftToLoad = imagesToLoad.length;
+    for (var i = 0; i < imagesToLoad.length; i++) {
+        var img = new Image();
+        var expectError = imagesToLoad[i].error; 
+        img.addEventListener('load', onImageLoad.bind(undefined, !expectError, callback));
+        img.addEventListener('error', onImageLoad.bind(undefined, expectError, callback));
+        img.src = imagesToLoad[i].url;
+    }
+}
+
+description("Test that mouse cursors are applied correctly.");
+
+if (!window.eventSender) {
+    testFailed('This test requires DumpRenderTree');
+}
+
+if (window.testRunner) {
+    testRunner.dumpAsText();
+    testRunner.waitUntilDone();
+    window.jsTestIsAsync = true;
+}
+
+// Now wait for each image to load or fail to load before starting tests.
+// Without this we can get null images in the cursors - eg. no known size.
+var imagesToLoad = [
+ { url: 'resources/greenbox.png' },
+ { url: 'resources/greenbox30.png' },
+ { url: 'resources/greenbox200.png' },
+ { url: 'resources/greenbox-hotspot35-4.cur' },
+ { url: 'resources/greenbox30-hotspot28-3.cur' },
+ { url: 'doesntexist.png', error: true } ];
+ensureImagesLoaded(imagesToLoad, runTests);
+
+</script>
+<script src="../../fast/js/resources/js-test-post.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/fast/events/resources/greenbox200.png b/LayoutTests/fast/events/resources/greenbox200.png
new file mode 100644 (file)
index 0000000..eacb0da
Binary files /dev/null and b/LayoutTests/fast/events/resources/greenbox200.png differ
diff --git a/LayoutTests/fast/events/resources/greenbox30-hotspot28-3.cur b/LayoutTests/fast/events/resources/greenbox30-hotspot28-3.cur
new file mode 100644 (file)
index 0000000..127b491
Binary files /dev/null and b/LayoutTests/fast/events/resources/greenbox30-hotspot28-3.cur differ
diff --git a/LayoutTests/fast/events/resources/greenbox30.png b/LayoutTests/fast/events/resources/greenbox30.png
new file mode 100644 (file)
index 0000000..ba11057
Binary files /dev/null and b/LayoutTests/fast/events/resources/greenbox30.png differ
index 5d3f66f..d1b4773 100644 (file)
@@ -57,6 +57,10 @@ http/tests/cache/subresource-fragment-identifier.html
 fast/dom/Window/slow-unload-handler.html
 fast/dom/Window/slow-unload-handler-only-frame-is-stopped.html
 
+# Need ENABLE(MOUSE_CURSOR_SCALE)
+fast/css/cursor-parsing-image-set.html
+fast/events/mouse-cursor-image-set.html
+
 # ----------------------------------------
 # Tests which also fail in other platforms
 # ----------------------------------------
index 22dda03..9498407 100644 (file)
@@ -289,6 +289,8 @@ webkit.org/b/99026 css3/filters [ Skip ]
 webkit.org/b/99027 fast/css/image-set-parsing.html [ Failure ]
 webkit.org/b/99027 fast/css/image-set-parsing-invalid.html [ Pass ]
 webkit.org/b/99027 fast/css/image-set-setting.html [ Failure ]
+webkit.org/b/99027 fast/css/cursor-parsing-image-set.html [ Failure ]
+webkit.org/b/99027 fast/events/mouse-cursor-image-set.html [ Failure ]
 
 # For now, Web Audio API is disabled
 webkit.org/b/67187 webaudio [ Skip ]
index 68adbcb..f009736 100644 (file)
@@ -1236,4 +1236,8 @@ webkit.org/b/67434 [ Debug ] fast/block/float/overhanging-tall-block.html [ Skip
 # Mountain Lion and prior do not support custom media data loading
 Bug(jernoble) [ MountainLion Lion SnowLeopard ] media/video-src-blob.html
 
+# Needs ENABLE(MOUSE_CURSOR_SCALE)
+webkit.org/b/102579 fast/css/cursor-parsing-image-set.html [ Fail ]
+webkit.org/b/102579 fast/events/mouse-cursor-image-set.html [ Fail ]
+
 webkit.org/b/104104 fast/overflow/scrollbar-click-retains-focus.html [ Failure ]
index c1df70d..4d05098 100644 (file)
@@ -51,6 +51,8 @@ css3/masking/clip-path-circle-relative-overflow.html
 # CSS image-set support not yet enabled (needs ENABLE_CSS_IMAGE_SET).
 fast/css/image-set-parsing.html
 fast/css/image-set-parsing-invalid.html
+fast/css/cursor-parsing-image-set.html
+fast/events/mouse-cursor-image-set.html
 
 # CSS3 Background is not yet enabled (needs ENABLE_CSS3_BACKGROUND).
 webkit.org/b/37514 fast/backgrounds/background-position-parsing-2.html [ Text ]
index 51ac017..3f9bc48 100644 (file)
@@ -1,3 +1,14 @@
+2012-12-06  Rick Byers  <rbyers@chromium.org>
+
+        CSS cursor property should support webkit-image-set
+        https://bugs.webkit.org/show_bug.cgi?id=99493
+
+        Reviewed by Beth Dakin.
+
+        Add ENABLE_MOUSE_CURSOR_SCALE (disabled by default)
+
+        * Configurations/FeatureDefines.xcconfig:
+
 2012-12-06  Laszlo Gombos  <l.gombos@samsung.com>
 
         [CMake] Consolidate list of files to build for JavaScriptCore
index db27927..631f51f 100644 (file)
@@ -115,6 +115,7 @@ ENABLE_MEDIA_STATISTICS = ;
 ENABLE_METER_ELEMENT = ENABLE_METER_ELEMENT;
 ENABLE_MHTML = ;
 ENABLE_MICRODATA = ;
+ENABLE_MOUSE_CURSOR_SCALE = ;
 ENABLE_MUTATION_OBSERVERS = ENABLE_MUTATION_OBSERVERS;
 ENABLE_NAVIGATOR_CONTENT_UTILS = ;
 ENABLE_NOTIFICATIONS = $(ENABLE_NOTIFICATIONS_$(PLATFORM_NAME));
@@ -159,5 +160,5 @@ ENABLE_WORKERS = ENABLE_WORKERS;
 ENABLE_XHR_TIMEOUT = ENABLE_XHR_TIMEOUT;
 ENABLE_XSLT = ENABLE_XSLT;
 
-FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ANIMATION_API) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_EXCLUSIONS) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SHADERS) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_STICKY_POSITION) $(ENABLE_CSS_VARIABLES) $(ENABLE_CSS3_CONDITIONAL_RULES) $(ENABLE_CSS3_BACKGROUND) $(ENABLE_CSS3_TEXT) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIALOG_ELEMENT) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DRAGGABLE_REGION) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_FILE_SYSTEM) $(ENABLE_FILTERS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING) $(ENABLE_HIGH_DPI_CANVAS) $(ENABLE_ICONDATABASE) $(ENABLE_IFRAME_SEAMLESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LEGACY_VENDOR_PREFIXES) $(ENABLE_LEGACY_WEB_AUDIO) $(ENABLE_LINK_PREFETCH) $(ENABLE_LINK_PRERENDER) $(ENABLE_MATHML) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MICRODATA) $(ENABLE_MUTATION_OBSERVERS) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAGE_VISIBILITY_API) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_PROGRESS_ELEMENT) $(ENABLE_PROXIMITY_EVENTS) $(ENABLE_QUOTA) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_SCRIPTED_SPEECH) $(ENABLE_SHADOW_DOM) $(ENABLE_SHARED_WORKERS) $(ENABLE_SQL_DATABASE) $(ENABLE_STYLE_SCOPED) $(ENABLE_SUBPIXEL_LAYOUT) $(ENABLE_SVG) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_TEMPLATE_ELEMENT) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TEXT_NOTIFICATIONS_ONLY) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_USERSELECT_ALL) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WORKERS) $(ENABLE_XHR_TIMEOUT) $(ENABLE_XSLT);
+FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ANIMATION_API) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_EXCLUSIONS) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SHADERS) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_STICKY_POSITION) $(ENABLE_CSS_VARIABLES) $(ENABLE_CSS3_CONDITIONAL_RULES) $(ENABLE_CSS3_BACKGROUND) $(ENABLE_CSS3_TEXT) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIALOG_ELEMENT) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DRAGGABLE_REGION) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_FILE_SYSTEM) $(ENABLE_FILTERS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING) $(ENABLE_HIGH_DPI_CANVAS) $(ENABLE_ICONDATABASE) $(ENABLE_IFRAME_SEAMLESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LEGACY_VENDOR_PREFIXES) $(ENABLE_LEGACY_WEB_AUDIO) $(ENABLE_LINK_PREFETCH) $(ENABLE_LINK_PRERENDER) $(ENABLE_MATHML) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MICRODATA) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_MUTATION_OBSERVERS) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAGE_VISIBILITY_API) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_PROGRESS_ELEMENT) $(ENABLE_PROXIMITY_EVENTS) $(ENABLE_QUOTA) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_SCRIPTED_SPEECH) $(ENABLE_SHADOW_DOM) $(ENABLE_SHARED_WORKERS) $(ENABLE_SQL_DATABASE) $(ENABLE_STYLE_SCOPED) $(ENABLE_SUBPIXEL_LAYOUT) $(ENABLE_SVG) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_TEMPLATE_ELEMENT) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TEXT_NOTIFICATIONS_ONLY) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_USERSELECT_ALL) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WORKERS) $(ENABLE_XHR_TIMEOUT) $(ENABLE_XSLT);
 
index 5bed102..c7757b2 100644 (file)
@@ -1,3 +1,79 @@
+2012-12-06  Rick Byers  <rbyers@chromium.org>
+
+        CSS cursor property should support webkit-image-set
+        https://bugs.webkit.org/show_bug.cgi?id=99493
+
+        Reviewed by Beth Dakin.
+
+        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
+
 2012-12-06  Hayato Ito  <hayato@chromium.org>
 
         Event's relatedTarget re-targeting does not occur for manually fired mouse events created by event.initMouseEvent().
index db27927..631f51f 100644 (file)
@@ -115,6 +115,7 @@ ENABLE_MEDIA_STATISTICS = ;
 ENABLE_METER_ELEMENT = ENABLE_METER_ELEMENT;
 ENABLE_MHTML = ;
 ENABLE_MICRODATA = ;
+ENABLE_MOUSE_CURSOR_SCALE = ;
 ENABLE_MUTATION_OBSERVERS = ENABLE_MUTATION_OBSERVERS;
 ENABLE_NAVIGATOR_CONTENT_UTILS = ;
 ENABLE_NOTIFICATIONS = $(ENABLE_NOTIFICATIONS_$(PLATFORM_NAME));
@@ -159,5 +160,5 @@ ENABLE_WORKERS = ENABLE_WORKERS;
 ENABLE_XHR_TIMEOUT = ENABLE_XHR_TIMEOUT;
 ENABLE_XSLT = ENABLE_XSLT;
 
-FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ANIMATION_API) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_EXCLUSIONS) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SHADERS) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_STICKY_POSITION) $(ENABLE_CSS_VARIABLES) $(ENABLE_CSS3_CONDITIONAL_RULES) $(ENABLE_CSS3_BACKGROUND) $(ENABLE_CSS3_TEXT) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIALOG_ELEMENT) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DRAGGABLE_REGION) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_FILE_SYSTEM) $(ENABLE_FILTERS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING) $(ENABLE_HIGH_DPI_CANVAS) $(ENABLE_ICONDATABASE) $(ENABLE_IFRAME_SEAMLESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LEGACY_VENDOR_PREFIXES) $(ENABLE_LEGACY_WEB_AUDIO) $(ENABLE_LINK_PREFETCH) $(ENABLE_LINK_PRERENDER) $(ENABLE_MATHML) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MICRODATA) $(ENABLE_MUTATION_OBSERVERS) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAGE_VISIBILITY_API) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_PROGRESS_ELEMENT) $(ENABLE_PROXIMITY_EVENTS) $(ENABLE_QUOTA) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_SCRIPTED_SPEECH) $(ENABLE_SHADOW_DOM) $(ENABLE_SHARED_WORKERS) $(ENABLE_SQL_DATABASE) $(ENABLE_STYLE_SCOPED) $(ENABLE_SUBPIXEL_LAYOUT) $(ENABLE_SVG) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_TEMPLATE_ELEMENT) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TEXT_NOTIFICATIONS_ONLY) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_USERSELECT_ALL) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WORKERS) $(ENABLE_XHR_TIMEOUT) $(ENABLE_XSLT);
+FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ANIMATION_API) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_EXCLUSIONS) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SHADERS) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_STICKY_POSITION) $(ENABLE_CSS_VARIABLES) $(ENABLE_CSS3_CONDITIONAL_RULES) $(ENABLE_CSS3_BACKGROUND) $(ENABLE_CSS3_TEXT) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIALOG_ELEMENT) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DRAGGABLE_REGION) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_FILE_SYSTEM) $(ENABLE_FILTERS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING) $(ENABLE_HIGH_DPI_CANVAS) $(ENABLE_ICONDATABASE) $(ENABLE_IFRAME_SEAMLESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LEGACY_VENDOR_PREFIXES) $(ENABLE_LEGACY_WEB_AUDIO) $(ENABLE_LINK_PREFETCH) $(ENABLE_LINK_PRERENDER) $(ENABLE_MATHML) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MICRODATA) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_MUTATION_OBSERVERS) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAGE_VISIBILITY_API) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_PROGRESS_ELEMENT) $(ENABLE_PROXIMITY_EVENTS) $(ENABLE_QUOTA) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_SCRIPTED_SPEECH) $(ENABLE_SHADOW_DOM) $(ENABLE_SHARED_WORKERS) $(ENABLE_SQL_DATABASE) $(ENABLE_STYLE_SCOPED) $(ENABLE_SUBPIXEL_LAYOUT) $(ENABLE_SVG) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_TEMPLATE_ELEMENT) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TEXT_NOTIFICATIONS_ONLY) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_USERSELECT_ALL) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WORKERS) $(ENABLE_XHR_TIMEOUT) $(ENABLE_XSLT);
 
index e85ad5a..1f0d1c0 100644 (file)
@@ -63,6 +63,7 @@ feature_defines_defaults += \
        ENABLE_METER_ELEMENT=1 \
        ENABLE_MHTML=1 \
        ENABLE_MICRODATA=1 \
+       ENABLE_MOUSE_CURSOR_SCALE=0 \
        ENABLE_MUTATION_OBSERVERS=1 \
        ENABLE_NAVIGATOR_CONTENT_UTILS=0 \
        ENABLE_NETSCAPE_PLUGIN_API=1 \
index 0faa813..32670ed 100644 (file)
 #include "config.h"
 #include "CSSCursorImageValue.h"
 
+#include "CSSImageValue.h"
+#include "CachedImage.h"
 #include "CachedResourceLoader.h"
+#include "StyleCachedImage.h"
+#include "StyleImage.h"
+#include "StylePendingImage.h"
 #include "TreeScope.h"
 #include "WebCoreMemoryInstrumentation.h"
 #include <wtf/MathExtras.h>
 #include "SVGURIReference.h"
 #endif
 
+#if ENABLE(CSS_IMAGE_SET)
+#include "CSSImageSetValue.h"
+#include "StyleCachedImageSet.h"
+#endif
+
 namespace WebCore {
 
 #if ENABLE(SVG)
-static inline bool isSVGCursorIdentifier(const String& url)
-{
-    KURL kurl(ParsedURLString, url);
-    return kurl.hasFragmentIdentifier();
-}
-
 static inline SVGCursorElement* resourceReferencedByCursorElement(const String& url, Document* document)
 {
     Element* element = SVGURIReference::targetElementFromIRIString(url, document);
@@ -56,26 +60,29 @@ static inline SVGCursorElement* resourceReferencedByCursorElement(const String&
 }
 #endif
 
-CSSCursorImageValue::CSSCursorImageValue(const String& url, bool hasHotSpot, const IntPoint& hotSpot)
-    : CSSImageValue(CursorImageClass, url)
+CSSCursorImageValue::CSSCursorImageValue(PassRefPtr<CSSValue> imageValue, bool hasHotSpot, const IntPoint& hotSpot)
+    : CSSValue(CursorImageClass)
+    , m_imageValue(imageValue)
     , m_hasHotSpot(hasHotSpot)
     , m_hotSpot(hotSpot)
+    , m_accessedImage(false)
 {
 }
 
 CSSCursorImageValue::~CSSCursorImageValue()
 {
 #if ENABLE(SVG)
-    if (!isSVGCursorIdentifier(url()))
+    if (!isSVGCursor())
         return;
 
     HashSet<SVGElement*>::const_iterator it = m_referencedElements.begin();
     HashSet<SVGElement*>::const_iterator end = m_referencedElements.end();
+    String url = static_cast<CSSImageValue*>(m_imageValue.get())->url();
 
     for (; it != end; ++it) {
         SVGElement* referencedElement = *it;
         referencedElement->cursorImageValueRemoved();
-        if (SVGCursorElement* cursorElement = resourceReferencedByCursorElement(url(), referencedElement->document()))
+        if (SVGCursorElement* cursorElement = resourceReferencedByCursorElement(url, referencedElement->document()))
             cursorElement->removeClient(referencedElement);
     }
 #endif
@@ -84,7 +91,7 @@ CSSCursorImageValue::~CSSCursorImageValue()
 String CSSCursorImageValue::customCssText() const
 {
     StringBuilder result;
-    result.append(CSSImageValue::customCssText());
+    result.append(m_imageValue->cssText());
     if (m_hasHotSpot) {
         result.append(' ');
         result.appendNumber(m_hotSpot.x());
@@ -102,10 +109,11 @@ bool CSSCursorImageValue::updateIfSVGCursorIsUsed(Element* element)
     if (!element || !element->isSVGElement())
         return false;
 
-    if (!isSVGCursorIdentifier(url()))
+    if (!isSVGCursor())
         return false;
 
-    if (SVGCursorElement* cursorElement = resourceReferencedByCursorElement(url(), element->document())) {
+    String url = static_cast<CSSImageValue*>(m_imageValue.get())->url();
+    if (SVGCursorElement* cursorElement = resourceReferencedByCursorElement(url, element->document())) {
         // FIXME: This will override hot spot specified in CSS, which is probably incorrect.
         SVGLengthContext lengthContext(0);
         m_hasHotSpot = true;
@@ -129,20 +137,80 @@ bool CSSCursorImageValue::updateIfSVGCursorIsUsed(Element* element)
     return false;
 }
 
-StyleCachedImage* CSSCursorImageValue::cachedImage(CachedResourceLoader* loader)
+StyleImage* CSSCursorImageValue::cachedImage(CachedResourceLoader* loader)
 {
+#if ENABLE(CSS_IMAGE_SET)
+    if (m_imageValue->isImageSetValue())
+        return static_cast<CSSImageSetValue*>(m_imageValue.get())->cachedImageSet(loader);
+#endif
+
+    if (!m_accessedImage) {
+        m_accessedImage = true;
+
 #if ENABLE(SVG)
-    if (isSVGCursorIdentifier(url()) && loader && loader->document()) {
-        // FIXME: This will fail if the <cursor> element is in a shadow DOM (bug 59827)
-        if (SVGCursorElement* cursorElement = resourceReferencedByCursorElement(url(), loader->document()))
-            return CSSImageValue::cachedImage(loader, cursorElement->href());
+        // For SVG images we need to lazily substitute in the correct URL. Rather than attempt
+        // to change the URL of the CSSImageValue (which would then change behavior like cssText),
+        // we create an alternate CSSImageValue to use.
+        if (isSVGCursor() && loader && loader->document()) {
+            RefPtr<CSSImageValue> imageValue = static_cast<CSSImageValue*>(m_imageValue.get());
+            // FIXME: This will fail if the <cursor> element is in a shadow DOM (bug 59827)
+            if (SVGCursorElement* cursorElement = resourceReferencedByCursorElement(imageValue->url(), loader->document())) {
+                RefPtr<CSSImageValue> svgImageValue = CSSImageValue::create(cursorElement->href());
+                StyleCachedImage* cachedImage = svgImageValue->cachedImage(loader);
+                m_image = cachedImage;
+                return cachedImage;
+            }
+        }
+#endif
+
+        if (m_imageValue->isImageValue())
+            m_image = static_cast<CSSImageValue*>(m_imageValue.get())->cachedImage(loader);
     }
+
+    if (m_image && m_image->isCachedImage())
+        return static_cast<StyleCachedImage*>(m_image.get());
+
+    return 0;
+}
+
+StyleImage* CSSCursorImageValue::cachedOrPendingImage(Document* document)
+{
+#if ENABLE(CSS_IMAGE_SET)
+    // Need to delegate completely so that changes in device scale factor can be handled appropriately.
+    if (m_imageValue->isImageSetValue())
+        return static_cast<CSSImageSetValue*>(m_imageValue.get())->cachedOrPendingImageSet(document);
 #endif
 
-    return CSSImageValue::cachedImage(loader, url());
+    if (!m_image)
+        m_image = StylePendingImage::create(this);
+
+    return m_image.get();
 }
 
 #if ENABLE(SVG)
+bool CSSCursorImageValue::isSVGCursor() const
+{
+    if (m_imageValue->isImageValue()) {
+        RefPtr<CSSImageValue> imageValue = static_cast<CSSImageValue*>(m_imageValue.get());
+        KURL kurl(ParsedURLString, imageValue->url());
+        return kurl.hasFragmentIdentifier();
+    }
+    return false;
+}
+
+String CSSCursorImageValue::cachedImageURL()
+{
+    if (!m_image || !m_image->isCachedImage())
+        return String();
+    return static_cast<StyleCachedImage*>(m_image.get())->cachedImage()->url();
+}
+
+void CSSCursorImageValue::clearCachedImage()
+{
+    m_image = 0;
+    m_accessedImage = false;
+}
+
 void CSSCursorImageValue::removeReferencedElement(SVGElement* element)
 {
     m_referencedElements.remove(element);
@@ -152,7 +220,8 @@ void CSSCursorImageValue::removeReferencedElement(SVGElement* element)
 void CSSCursorImageValue::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
 {
     MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS);
-    CSSImageValue::reportDescendantMemoryUsage(memoryObjectInfo);
+    m_imageValue->reportMemoryUsage(memoryObjectInfo);
+    // No need to report m_image as it is counted as part of RenderArena.
 #if ENABLE(SVG)
     info.addMember(m_referencedElements);
 #endif
index 80d3f15..cfc78ec 100644 (file)
 
 namespace WebCore {
 
+class Document;
 class Element;
 class SVGElement;
 
-class CSSCursorImageValue : public CSSImageValue {
+class CSSCursorImageValue : public CSSValue {
 public:
-    static PassRefPtr<CSSCursorImageValue> create(const String& url, bool hasHotSpot, const IntPoint& hotSpot)
+    static PassRefPtr<CSSCursorImageValue> create(PassRefPtr<CSSValue> imageValue, bool hasHotSpot, const IntPoint& hotSpot)
     {
-        return adoptRef(new CSSCursorImageValue(url, hasHotSpot, hotSpot));
+        return adoptRef(new CSSCursorImageValue(imageValue, hasHotSpot, hotSpot));
     }
 
     ~CSSCursorImageValue();
@@ -51,7 +52,8 @@ public:
     String customCssText() const;
 
     bool updateIfSVGCursorIsUsed(Element*);
-    StyleCachedImage* cachedImage(CachedResourceLoader*);
+    StyleImage* cachedImage(CachedResourceLoader*);
+    StyleImage* cachedOrPendingImage(Document*);
 
 #if ENABLE(SVG)
     void removeReferencedElement(SVGElement*);
@@ -60,10 +62,20 @@ public:
     void reportDescendantMemoryUsage(MemoryObjectInfo*) const;
 
 private:
-    CSSCursorImageValue(const String& url, bool hasHotSpot, const IntPoint& hotSpot);
+    CSSCursorImageValue(PassRefPtr<CSSValue> imageValue, bool hasHotSpot, const IntPoint& hotSpot);
+
+#if ENABLE(SVG)
+    bool isSVGCursor() const;
+    String cachedImageURL();
+    void clearCachedImage();
+#endif
+
+    RefPtr<CSSValue> m_imageValue;
 
     bool m_hasHotSpot;
     IntPoint m_hotSpot;
+    RefPtr<StyleImage> m_image;
+    bool m_accessedImage;
 
 #if ENABLE(SVG)
     HashSet<SVGElement*> m_referencedElements;
index b5867bf..7b12e6f 100644 (file)
 
 namespace WebCore {
 
-CSSImageValue::CSSImageValue(ClassType classType, const String& url)
-    : CSSValue(classType)
-    , m_url(url)
-    , m_accessedImage(false)
-{
-}
-
 CSSImageValue::CSSImageValue(const String& url)
     : CSSValue(ImageClass)
     , m_url(url)
@@ -73,19 +66,12 @@ StyleImage* CSSImageValue::cachedOrPendingImage()
 
 StyleCachedImage* CSSImageValue::cachedImage(CachedResourceLoader* loader)
 {
-    if (isCursorImageValue())
-        return static_cast<CSSCursorImageValue*>(this)->cachedImage(loader);
-    return cachedImage(loader, m_url);
-}
-
-StyleCachedImage* CSSImageValue::cachedImage(CachedResourceLoader* loader, const String& url)
-{
     ASSERT(loader);
 
     if (!m_accessedImage) {
         m_accessedImage = true;
 
-        CachedResourceRequest request(ResourceRequest(loader->document()->completeURL(url)));
+        CachedResourceRequest request(ResourceRequest(loader->document()->completeURL(m_url)));
         if (m_initiatorName.isEmpty())
             request.setInitiator(cachedResourceRequestInitiators().css);
         else
@@ -97,19 +83,6 @@ StyleCachedImage* CSSImageValue::cachedImage(CachedResourceLoader* loader, const
     return (m_image && m_image->isCachedImage()) ? static_cast<StyleCachedImage*>(m_image.get()) : 0;
 }
 
-String CSSImageValue::cachedImageURL()
-{
-    if (!m_image || !m_image->isCachedImage())
-        return String();
-    return static_cast<StyleCachedImage*>(m_image.get())->cachedImage()->url();
-}
-
-void CSSImageValue::clearCachedImage()
-{
-    m_image = 0;
-    m_accessedImage = false;
-}
-
 bool CSSImageValue::hasFailedOrCanceledSubresources() const
 {
     if (!m_image || !m_image->isCachedImage())
index a1963f7..e219642 100644 (file)
@@ -56,13 +56,6 @@ public:
 
     void setInitiator(const AtomicString& name) { m_initiatorName = name; }
 
-protected:
-    CSSImageValue(ClassType, const String& url);
-
-    StyleCachedImage* cachedImage(CachedResourceLoader*, const String& url);
-    String cachedImageURL();
-    void clearCachedImage();
-
 private:
     explicit CSSImageValue(const String& url);
     CSSImageValue(const String& url, StyleImage*);
index 82affd8..756f195 100644 (file)
@@ -1904,16 +1904,29 @@ bool CSSParser::parseValue(CSSPropertyID propId, bool important)
         break;
 
     case CSSPropertyCursor: {
-        // [<uri>,]*  [ auto | crosshair | default | pointer | progress | move | e-resize | ne-resize |
+        // Grammar defined by CSS3 UI and modified by CSS4 images:
+        // [ [<image> [<x> <y>]?,]*
+        // [ auto | crosshair | default | pointer | progress | move | e-resize | ne-resize |
         // nw-resize | n-resize | se-resize | sw-resize | s-resize | w-resize | ew-resize |
         // ns-resize | nesw-resize | nwse-resize | col-resize | row-resize | text | wait | help |
         // vertical-text | cell | context-menu | alias | copy | no-drop | not-allowed | -webkit-zoom-in
         // -webkit-zoom-out | all-scroll | -webkit-grab | -webkit-grabbing ] ] | inherit
         RefPtr<CSSValueList> list;
-        while (value && value->unit == CSSPrimitiveValue::CSS_URI) {
-            if (!list)
-                list = CSSValueList::createCommaSeparated();
-            String uri = value->string;
+        while (value) {
+            RefPtr<CSSValue> image = 0;
+            if (value->unit == CSSPrimitiveValue::CSS_URI) {
+                String uri = value->string;
+                if (!uri.isNull())
+                    image = CSSImageValue::create(completeURL(uri));
+#if ENABLE(CSS_IMAGE_SET)
+            } else if (value->unit == CSSParserValue::Function && equalIgnoringCase(value->function->name, "-webkit-image-set(")) {
+                image = parseImageSet(m_valueList.get());
+                if (!image)
+                    break;
+#endif
+            } else
+                break;
+
             Vector<int> coords;
             value = m_valueList->next();
             while (value && value->unit == CSSPrimitiveValue::CSS_NUMBER) {
@@ -1930,8 +1943,11 @@ bool CSSParser::parseValue(CSSPropertyID propId, bool important)
                 hotSpot = IntPoint(coords[0], coords[1]);
             }
 
-            if (!uri.isNull())
-                list->append(CSSCursorImageValue::create(completeURL(uri), hasHotSpot, hotSpot));
+            if (!list)
+                list = CSSValueList::createCommaSeparated();
+
+            if (image)
+                list->append(CSSCursorImageValue::create(image, hasHotSpot, hotSpot));
 
             if ((inStrictMode() && !value) || (value && !(value->unit == CSSParserValue::Operator && value->iValue == ',')))
                 return false;
index b2a531a..220f0a1 100644 (file)
@@ -79,7 +79,7 @@ public:
 #if ENABLE(CSS_IMAGE_SET)
     bool isImageSetValue() const { return m_classType == ImageSetClass; }
 #endif
-    bool isImageValue() const { return m_classType == ImageClass || m_classType == CursorImageClass; }
+    bool isImageValue() const { return m_classType == ImageClass; }
     bool isImplicitInitialValue() const;
     bool isInheritedValue() const { return m_classType == InheritedClass; }
     bool isInitialValue() const { return m_classType == InitialClass; }
index 846f474..c4dd74e 100644 (file)
@@ -1092,7 +1092,7 @@ public:
                     CSSCursorImageValue* image = static_cast<CSSCursorImageValue*>(item);
                     if (image->updateIfSVGCursorIsUsed(styleResolver->element())) // Elements with SVG cursors are not allowed to share style.
                         styleResolver->style()->setUnique();
-                    styleResolver->style()->addCursor(styleResolver->cachedOrPendingFromValue(CSSPropertyCursor, image), image->hotSpot());
+                    styleResolver->style()->addCursor(styleResolver->styleImage(CSSPropertyCursor, image), image->hotSpot());
                 } else if (item->isPrimitiveValue()) {
                     CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(item);
                     if (primitiveValue->isIdent())
index 7263323..615647f 100644 (file)
@@ -3985,6 +3985,9 @@ PassRefPtr<StyleImage> StyleResolver::styleImage(CSSPropertyID property, CSSValu
         return setOrPendingFromValue(property, static_cast<CSSImageSetValue*>(value));
 #endif
 
+    if (value->isCursorImageValue())
+        return cursorOrPendingFromValue(property, static_cast<CSSCursorImageValue*>(value));
+
     return 0;
 }
 
@@ -4015,6 +4018,14 @@ PassRefPtr<StyleImage> StyleResolver::setOrPendingFromValue(CSSPropertyID proper
 }
 #endif
 
+PassRefPtr<StyleImage> StyleResolver::cursorOrPendingFromValue(CSSPropertyID property, CSSCursorImageValue* value)
+{
+    RefPtr<StyleImage> image = value->cachedOrPendingImage(document());
+    if (image && image->isPendingImage())
+        m_pendingImageProperties.set(property, value);
+    return image.release();
+}
+
 void StyleResolver::checkForTextSizeAdjust()
 {
     if (m_style->textSizeAdjust())
@@ -5123,6 +5134,11 @@ PassRefPtr<StyleImage> StyleResolver::loadPendingImage(StylePendingImage* pendin
         return StyleGeneratedImage::create(imageGeneratorValue);
     }
 
+    if (pendingImage->cssCursorImageValue()) {
+        CSSCursorImageValue* cursorImageValue = pendingImage->cssCursorImageValue();
+        return cursorImageValue->cachedImage(cachedResourceLoader);
+    }
+
 #if ENABLE(CSS_IMAGE_SET)
     if (pendingImage->cssImageSetValue()) {
         CSSImageSetValue* imageSetValue = pendingImage->cssImageSetValue();
index ceeb741..dc7ac8a 100644 (file)
@@ -45,16 +45,17 @@ namespace WebCore {
 
 enum ESmartMinimumForFontSize { DoNotUseSmartMinimumForFontSize, UseSmartMinimumForFontFize };
 
+class CSSCursorImageValue;
 class CSSFontSelector;
-class CSSPageRule;
-class CSSPrimitiveValue;
-class CSSProperty;
-class CSSRuleList;
 class CSSFontFace;
 class CSSFontFaceRule;
 class CSSImageGeneratorValue;
 class CSSImageSetValue;
 class CSSImageValue;
+class CSSPageRule;
+class CSSPrimitiveValue;
+class CSSProperty;
+class CSSRuleList;
 class CSSSelector;
 class CSSStyleRule;
 class CSSStyleSheet;
@@ -414,6 +415,7 @@ public:
 #if ENABLE(CSS_IMAGE_SET)
     PassRefPtr<StyleImage> setOrPendingFromValue(CSSPropertyID, CSSImageSetValue*);
 #endif
+    PassRefPtr<StyleImage> cursorOrPendingFromValue(CSSPropertyID, CSSCursorImageValue*);
 
     bool applyPropertyToRegularStyle() const { return m_applyPropertyToRegularStyle; }
     bool applyPropertyToVisitedLinkStyle() const { return m_applyPropertyToVisitedLinkStyle; }
index 89462b8..63a143b 100644 (file)
 #include "TouchList.h"
 #endif
 
+#if ENABLE(CSS_IMAGE_SET)
+#include "StyleCachedImageSet.h"
+#endif
+
 namespace WebCore {
 
 using namespace HTMLNames;
@@ -148,6 +152,14 @@ const double fakeMouseMoveRunningAverageCount = 10;
 const double fakeMouseMoveIntervalReductionLimit = 0.5;
 const double fakeMouseMoveIntervalReductionFraction = 0.75;
 
+const int maximumCursorSize = 128;
+#if ENABLE(MOUSE_CURSOR_SCALE)
+// It's pretty unlikely that a scale of less than one would ever be used. But all we really
+// need to ensure here is that the scale isn't so small that integer overflow can occur when
+// dividing cursor sizes (limited above) by the scale.
+const double minimumCursorScale = 0.001;
+#endif
+
 enum NoCursorChangeType { NoCursorChange };
 
 class OptionalCursor {
@@ -1450,19 +1462,35 @@ OptionalCursor EventHandler::selectCursor(const MouseEventWithHitTestResults& ev
     if (style && style->cursors()) {
         const CursorList* cursors = style->cursors();
         for (unsigned i = 0; i < cursors->size(); ++i) {
-            CachedImage* cimage = 0;
-            StyleImage* image = (*cursors)[i].image();
-            if (image && image->isCachedImage())
-                cimage = static_cast<StyleCachedImage*>(image)->cachedImage();
-            if (!cimage)
+            StyleImage* styleImage = (*cursors)[i].image();
+            if (!styleImage)
+                continue;
+            CachedImage* cachedImage = styleImage->cachedImage();
+            if (!cachedImage)
                 continue;
+            float scale = styleImage->imageScaleFactor();
+            // Get hotspot and convert from logical pixels to physical pixels.
             IntPoint hotSpot = (*cursors)[i].hotSpot();
-            // Limit the size of cursors so that they cannot be used to cover UI elements in chrome.
-            IntSize size = cimage->imageForRenderer(renderer)->size();
-            if (size.width() > 128 || size.height() > 128)
+            hotSpot.scale(scale, scale);
+            IntSize size = cachedImage->imageForRenderer(renderer)->size();
+            if (cachedImage->errorOccurred())
                 continue;
-            if (!cimage->errorOccurred())
-                return Cursor(cimage->imageForRenderer(renderer), hotSpot);
+            // Limit the size of cursors (in UI pixels) so that they cannot be
+            // used to cover UI elements in chrome.
+            size.scale(1 / scale);
+            if (size.width() > maximumCursorSize || size.height() > maximumCursorSize)
+                continue;
+
+            Image* image = cachedImage->imageForRenderer(renderer);
+#if ENABLE(MOUSE_CURSOR_SCALE)
+            // Ensure no overflow possible in calculations above.
+            if (scale < minimumCursorScale)
+                continue;
+            return Cursor(image, hotSpot, scale);
+#else
+            ASSERT(scale == 1);
+            return Cursor(image, hotSpot);
+#endif // ENABLE(MOUSE_CURSOR_SCALE)
         }
     }
 
index 6c796cd..0da9afd 100644 (file)
@@ -27,6 +27,7 @@
 #include "Cursor.h"
 
 #include "Image.h"
+#include <wtf/Assertions.h>
 
 namespace WebCore {
 
@@ -150,12 +151,29 @@ Cursor::Cursor(Image* image, const IntPoint& hotSpot)
     : m_type(Custom)
     , m_image(image)
     , m_hotSpot(determineHotSpot(image, hotSpot))
+#if ENABLE(MOUSE_CURSOR_SCALE)
+    , m_imageScaleFactor(1)
+#endif
+    , m_platformCursor(0)
+{
+}
+
+#if ENABLE(MOUSE_CURSOR_SCALE)
+Cursor::Cursor(Image* image, const IntPoint& hotSpot, float scale)
+    : m_type(Custom)
+    , m_image(image)
+    , m_hotSpot(determineHotSpot(image, hotSpot))
+    , m_imageScaleFactor(scale)
     , m_platformCursor(0)
 {
 }
+#endif
 
 Cursor::Cursor(Type type)
     : m_type(type)
+#if ENABLE(MOUSE_CURSOR_SCALE)
+    , m_imageScaleFactor(1)
+#endif
     , m_platformCursor(0)
 {
 }
index a545606..6551252 100644 (file)
@@ -164,6 +164,12 @@ namespace WebCore {
 #if !PLATFORM(IOS)
         Cursor(Image*, const IntPoint& hotSpot);
         Cursor(const Cursor&);
+
+#if ENABLE(MOUSE_CURSOR_SCALE)
+        // Hot spot is in image pixels.
+        Cursor(Image*, const IntPoint& hotSpot, float imageScaleFactor);
+#endif
+
         ~Cursor();
         Cursor& operator=(const Cursor&);
 
@@ -176,6 +182,10 @@ namespace WebCore {
         }
         Image* image() const { return m_image.get(); }
         const IntPoint& hotSpot() const { return m_hotSpot; }
+#if ENABLE(MOUSE_CURSOR_SCALE)
+        // Image scale in image pixels per logical (UI) pixel.
+        float imageScaleFactor() const { return m_imageScaleFactor; }
+#endif
         PlatformCursor platformCursor() const;
 #else
         explicit Cursor(PlatformCursor);
@@ -189,6 +199,9 @@ namespace WebCore {
         Type m_type;
         RefPtr<Image> m_image;
         IntPoint m_hotSpot;
+#if ENABLE(MOUSE_CURSOR_SCALE)
+        float m_imageScaleFactor;
+#endif
 #endif
 
 #if !PLATFORM(MAC)
index 9df7f23..e57ccb2 100644 (file)
@@ -39,6 +39,7 @@ Cursor::Cursor(const Cursor& other)
     : m_type(other.m_type)
     , m_image(other.m_image)
     , m_hotSpot(other.m_hotSpot)
+    , m_imageScaleFactor(other.m_imageScaleFactor)
     , m_platformCursor(other.m_platformCursor)
 {
 }
@@ -48,6 +49,7 @@ Cursor& Cursor::operator=(const Cursor& other)
     m_type = other.m_type;
     m_image = other.m_image;
     m_hotSpot = other.m_hotSpot;
+    m_imageScaleFactor = other.m_imageScaleFactor;
     m_platformCursor = other.m_platformCursor;
     return *this;
 }
index 6d0a273..f8f779a 100644 (file)
@@ -51,6 +51,7 @@ public:
     StyleImage* image() const { return m_image.get(); }    
     void setImage(PassRefPtr<StyleImage> image) { m_image = image; }    
 
+    // Hot spot in the image in logical pixels.
     const IntPoint& hotSpot() const { return m_hotSpot; }
     
 private:
index f6c4fda..7fdfca0 100644 (file)
@@ -42,8 +42,6 @@ public:
 
     virtual PassRefPtr<CSSValue> cssValue() const;
     
-    CachedImage* cachedImage() const { return m_image.get(); }
-
     virtual bool canRender(const RenderObject*, float multiplier) const;
     virtual bool isLoaded() const;
     virtual bool errorOccurred() const;
@@ -57,6 +55,7 @@ public:
     virtual void removeClient(RenderObject*);
     virtual PassRefPtr<Image> image(RenderObject*, const IntSize&) const;
     virtual bool hasAlpha(const RenderObject*) const OVERRIDE;
+    virtual CachedImage* cachedImage() const OVERRIDE { return m_image.get(); }
     
 private:
     explicit StyleCachedImage(CachedImage*);
index e888818..d113837 100644 (file)
@@ -56,8 +56,6 @@ public:
     // meaningful enough or not.
     virtual WrappedImagePtr data() const { return m_bestFitImage.get(); }
 
-    CachedImage* cachedImage() const { return m_bestFitImage.get(); }
-
     void clearImageSetValue() { m_imageSetValue = 0; }
 
     virtual bool canRender(const RenderObject*, float multiplier) const;
@@ -74,6 +72,7 @@ public:
     virtual PassRefPtr<Image> image(RenderObject*, const IntSize&) const;
     virtual float imageScaleFactor() const { return m_imageScaleFactor; }
     virtual bool hasAlpha(const RenderObject*) const OVERRIDE;
+    virtual CachedImage* cachedImage() const OVERRIDE { return m_bestFitImage.get(); }
     
 private:
     StyleCachedImageSet(CachedImage*, float imageScaleFactor, CSSImageSetValue*);
index 486ec3d..7b1b668 100644 (file)
@@ -34,6 +34,7 @@
 
 namespace WebCore {
 
+class CachedImage;
 class CSSValue;
 class RenderObject;
 
@@ -65,6 +66,7 @@ public:
     virtual WrappedImagePtr data() const = 0;
     virtual float imageScaleFactor() const { return 1; }
     virtual bool hasAlpha(const RenderObject*) const = 0;
+    virtual CachedImage* cachedImage() const { return 0; }
 
     ALWAYS_INLINE bool isCachedImage() const { return m_isCachedImage; }
     ALWAYS_INLINE bool isPendingImage() const { return m_isPendingImage; }
index 192063b..4cea0f9 100644 (file)
@@ -26,6 +26,7 @@
 #ifndef StylePendingImage_h
 #define StylePendingImage_h
 
+#include "CSSCursorImageValue.h"
 #include "CSSImageGeneratorValue.h"
 #if ENABLE(CSS_IMAGE_SET)
 #include "CSSImageSetValue.h"
@@ -49,6 +50,7 @@ public:
     virtual PassRefPtr<CSSValue> cssValue() const { return m_value; }
     CSSImageValue* cssImageValue() const { return m_value->isImageValue() ? static_cast<CSSImageValue*>(m_value) : 0; }
     CSSImageGeneratorValue* cssImageGeneratorValue() const { return m_value->isImageGeneratorValue() ? static_cast<CSSImageGeneratorValue*>(m_value) : 0; }
+    CSSCursorImageValue* cssCursorImageValue() const { return m_value->isCursorImageValue() ? static_cast<CSSCursorImageValue*>(m_value) : 0; }
 #if ENABLE(CSS_IMAGE_SET)
     CSSImageSetValue* cssImageSetValue() const { return m_value->isImageSetValue() ? static_cast<CSSImageSetValue*>(m_value) : 0; }
 #endif
index 766a0e2..ff8289a 100644 (file)
@@ -84,7 +84,6 @@
 #include "ViewportArguments.h"
 #include <wtf/text/StringBuffer.h>
 
-
 #if ENABLE(INPUT_TYPE_COLOR)
 #include "ColorChooser.h"
 #endif
 #include "WebKitPoint.h"
 #endif
 
+#if ENABLE(MOUSE_CURSOR_SCALE)
+#include <wtf/dtoa.h>
+#endif
+
 #if PLATFORM(CHROMIUM)
 #include "FilterOperation.h"
 #include "FilterOperations.h"
@@ -1714,6 +1717,13 @@ String Internals::getCurrentCursorInfo(Document* document, ExceptionCode& ec)
         result.append("x");
         result.appendNumber(size.height());
     }
+#if ENABLE(MOUSE_CURSOR_SCALE)
+    if (cursor.imageScaleFactor() != 1) {
+        result.append(" scale=");
+        NumberToStringBuffer buffer;
+        result.append(numberToFixedPrecisionString(cursor.imageScaleFactor(), 8, buffer, true));
+    }
+#endif
     return result.toString();
 #else
     return "FAIL: Cursor details not available on this platform.";
index b0c4b87..c9ecaf5 100644 (file)
@@ -1,3 +1,18 @@
+2012-12-06  Rick Byers  <rbyers@chromium.org>
+
+        CSS cursor property should support webkit-image-set
+        https://bugs.webkit.org/show_bug.cgi?id=99493
+
+        Reviewed by Beth Dakin.
+
+        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):
+
 2012-12-06  James Simonsen  <simonjam@chromium.org>
 
         [Chromium] Enable Resource Timing and User Timing
index 9f8ff3b..473aeef 100644 (file)
@@ -90,6 +90,7 @@
       'ENABLE_METER_ELEMENT=1',
       'ENABLE_MHTML=1',
       'ENABLE_MICRODATA=0',
+      'ENABLE_MOUSE_CURSOR_SCALE=1',
       'ENABLE_MUTATION_OBSERVERS=<(enable_mutation_observers)',
       'ENABLE_NAVIGATOR_CONTENT_UTILS=1',
       'ENABLE_PAGE_VISIBILITY_API=1',
index 0981e46..402f430 100644 (file)
@@ -40,7 +40,7 @@ namespace WebKit {
 WebCursorInfo::WebCursorInfo(const Cursor& cursor)
     : type(static_cast<Type>(cursor.type()))
     , hotSpot(cursor.hotSpot())
-    , imageScaleFactor(1)
+    , imageScaleFactor(cursor.imageScaleFactor())
     , customImage(cursor.image())
 #ifdef WIN32
     , externalHandle(0)
index f53521e..6bfea66 100644 (file)
@@ -1,3 +1,14 @@
+2012-12-06  Rick Byers  <rbyers@chromium.org>
+
+        CSS cursor property should support webkit-image-set
+        https://bugs.webkit.org/show_bug.cgi?id=99493
+
+        Reviewed by Beth Dakin.
+
+        Add ENABLE_MOUSE_CURSOR_SCALE - disabled by default.
+
+        * Configurations/FeatureDefines.xcconfig:
+
 2012-12-03  Yury Semikhatsky  <yurys@chromium.org>
 
         Unreviewed. Fix Mac compilation after r136448.
index 231153b..dd6186d 100644 (file)
@@ -115,6 +115,7 @@ ENABLE_MEDIA_STATISTICS = ;
 ENABLE_METER_ELEMENT = ENABLE_METER_ELEMENT;
 ENABLE_MHTML = ;
 ENABLE_MICRODATA = ;
+ENABLE_MOUSE_CURSOR_SCALE = ;
 ENABLE_MUTATION_OBSERVERS = ENABLE_MUTATION_OBSERVERS;
 ENABLE_NAVIGATOR_CONTENT_UTILS = ;
 ENABLE_NOTIFICATIONS = $(ENABLE_NOTIFICATIONS_$(PLATFORM_NAME));
@@ -159,4 +160,4 @@ ENABLE_WORKERS = ENABLE_WORKERS;
 ENABLE_XHR_TIMEOUT = ENABLE_XHR_TIMEOUT;
 ENABLE_XSLT = ENABLE_XSLT;
 
-FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ANIMATION_API) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_EXCLUSIONS) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SHADERS) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_STICKY_POSITION) $(ENABLE_CSS_VARIABLES) $(ENABLE_CSS3_CONDITIONAL_RULES) $(ENABLE_CSS3_BACKGROUND) $(ENABLE_CSS3_TEXT) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIALOG_ELEMENT) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DRAGGABLE_REGION) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_FILE_SYSTEM) $(ENABLE_FILTERS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING) $(ENABLE_HIGH_DPI_CANVAS) $(ENABLE_ICONDATABASE) $(ENABLE_IFRAME_SEAMLESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LEGACY_VENDOR_PREFIXES) $(ENABLE_LEGACY_WEB_AUDIO) $(ENABLE_LINK_PREFETCH) $(ENABLE_LINK_PRERENDER) $(ENABLE_MATHML) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MICRODATA) $(ENABLE_MUTATION_OBSERVERS) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAGE_VISIBILITY_API) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_PROGRESS_ELEMENT) $(ENABLE_PROXIMITY_EVENTS) $(ENABLE_QUOTA) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_SCRIPTED_SPEECH) $(ENABLE_SHADOW_DOM) $(ENABLE_SHARED_WORKERS) $(ENABLE_SQL_DATABASE) $(ENABLE_STYLE_SCOPED) $(ENABLE_SUBPIXEL_LAYOUT) $(ENABLE_SVG) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TEXT_NOTIFICATIONS_ONLY) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_USERSELECT_ALL) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WORKERS) $(ENABLE_XHR_TIMEOUT) $(ENABLE_XSLT);
+FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ANIMATION_API) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_EXCLUSIONS) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SHADERS) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_STICKY_POSITION) $(ENABLE_CSS_VARIABLES) $(ENABLE_CSS3_CONDITIONAL_RULES) $(ENABLE_CSS3_BACKGROUND) $(ENABLE_CSS3_TEXT) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIALOG_ELEMENT) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DRAGGABLE_REGION) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_FILE_SYSTEM) $(ENABLE_FILTERS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING) $(ENABLE_HIGH_DPI_CANVAS) $(ENABLE_ICONDATABASE) $(ENABLE_IFRAME_SEAMLESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LEGACY_VENDOR_PREFIXES) $(ENABLE_LEGACY_WEB_AUDIO) $(ENABLE_LINK_PREFETCH) $(ENABLE_LINK_PRERENDER) $(ENABLE_MATHML) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MICRODATA) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_MUTATION_OBSERVERS) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAGE_VISIBILITY_API) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_PROGRESS_ELEMENT) $(ENABLE_PROXIMITY_EVENTS) $(ENABLE_QUOTA) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_SCRIPTED_SPEECH) $(ENABLE_SHADOW_DOM) $(ENABLE_SHARED_WORKERS) $(ENABLE_SQL_DATABASE) $(ENABLE_STYLE_SCOPED) $(ENABLE_SUBPIXEL_LAYOUT) $(ENABLE_SVG) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TEXT_NOTIFICATIONS_ONLY) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_USERSELECT_ALL) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WORKERS) $(ENABLE_XHR_TIMEOUT) $(ENABLE_XSLT);
index a0e1f2c..1f3380b 100644 (file)
@@ -1,3 +1,14 @@
+2012-12-06  Rick Byers  <rbyers@chromium.org>
+
+        CSS cursor property should support webkit-image-set
+        https://bugs.webkit.org/show_bug.cgi?id=99493
+
+        Reviewed by Beth Dakin.
+
+        Add ENABLE_MOUSE_CURSOR_SCALE - disabled by default.
+
+        * Configurations/FeatureDefines.xcconfig:
+
 2012-12-06  Jae Hyun Park  <jae.park@company100.net>
 
         Coordinated Graphics: Rename WebLayerTreeInfo to CoordinatedLayerInfo
index 231153b..dd6186d 100644 (file)
@@ -115,6 +115,7 @@ ENABLE_MEDIA_STATISTICS = ;
 ENABLE_METER_ELEMENT = ENABLE_METER_ELEMENT;
 ENABLE_MHTML = ;
 ENABLE_MICRODATA = ;
+ENABLE_MOUSE_CURSOR_SCALE = ;
 ENABLE_MUTATION_OBSERVERS = ENABLE_MUTATION_OBSERVERS;
 ENABLE_NAVIGATOR_CONTENT_UTILS = ;
 ENABLE_NOTIFICATIONS = $(ENABLE_NOTIFICATIONS_$(PLATFORM_NAME));
@@ -159,4 +160,4 @@ ENABLE_WORKERS = ENABLE_WORKERS;
 ENABLE_XHR_TIMEOUT = ENABLE_XHR_TIMEOUT;
 ENABLE_XSLT = ENABLE_XSLT;
 
-FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ANIMATION_API) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_EXCLUSIONS) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SHADERS) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_STICKY_POSITION) $(ENABLE_CSS_VARIABLES) $(ENABLE_CSS3_CONDITIONAL_RULES) $(ENABLE_CSS3_BACKGROUND) $(ENABLE_CSS3_TEXT) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIALOG_ELEMENT) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DRAGGABLE_REGION) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_FILE_SYSTEM) $(ENABLE_FILTERS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING) $(ENABLE_HIGH_DPI_CANVAS) $(ENABLE_ICONDATABASE) $(ENABLE_IFRAME_SEAMLESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LEGACY_VENDOR_PREFIXES) $(ENABLE_LEGACY_WEB_AUDIO) $(ENABLE_LINK_PREFETCH) $(ENABLE_LINK_PRERENDER) $(ENABLE_MATHML) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MICRODATA) $(ENABLE_MUTATION_OBSERVERS) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAGE_VISIBILITY_API) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_PROGRESS_ELEMENT) $(ENABLE_PROXIMITY_EVENTS) $(ENABLE_QUOTA) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_SCRIPTED_SPEECH) $(ENABLE_SHADOW_DOM) $(ENABLE_SHARED_WORKERS) $(ENABLE_SQL_DATABASE) $(ENABLE_STYLE_SCOPED) $(ENABLE_SUBPIXEL_LAYOUT) $(ENABLE_SVG) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TEXT_NOTIFICATIONS_ONLY) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_USERSELECT_ALL) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WORKERS) $(ENABLE_XHR_TIMEOUT) $(ENABLE_XSLT);
+FEATURE_DEFINES = $(ENABLE_3D_RENDERING) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ANIMATION_API) $(ENABLE_BLOB) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CSP_NEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_DEVICE_ADAPTATION) $(ENABLE_CSS_EXCLUSIONS) $(ENABLE_CSS_FILTERS) $(ENABLE_CSS_IMAGE_ORIENTATION) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_REGIONS) $(ENABLE_CSS_SHADERS) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_STICKY_POSITION) $(ENABLE_CSS_VARIABLES) $(ENABLE_CSS3_CONDITIONAL_RULES) $(ENABLE_CSS3_BACKGROUND) $(ENABLE_CSS3_TEXT) $(ENABLE_CUSTOM_SCHEME_HANDLER) $(ENABLE_DASHBOARD_SUPPORT) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_TRANSFER_ITEMS) $(ENABLE_DETAILS_ELEMENT) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DIALOG_ELEMENT) $(ENABLE_DIRECTORY_UPLOAD) $(ENABLE_DRAGGABLE_REGION) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_FILE_SYSTEM) $(ENABLE_FILTERS) $(ENABLE_FULLSCREEN_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_HIDDEN_PAGE_DOM_TIMER_THROTTLING) $(ENABLE_HIGH_DPI_CANVAS) $(ENABLE_ICONDATABASE) $(ENABLE_IFRAME_SEAMLESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INPUT_SPEECH) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIME) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_JAVASCRIPT_DEBUGGER) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_NOTIFICATIONS) $(ENABLE_LEGACY_VENDOR_PREFIXES) $(ENABLE_LEGACY_WEB_AUDIO) $(ENABLE_LINK_PREFETCH) $(ENABLE_LINK_PRERENDER) $(ENABLE_MATHML) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MICRODATA) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_MUTATION_OBSERVERS) $(ENABLE_NAVIGATOR_CONTENT_UTILS) $(ENABLE_NOTIFICATIONS) $(ENABLE_PAGE_VISIBILITY_API) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_PROGRESS_ELEMENT) $(ENABLE_PROXIMITY_EVENTS) $(ENABLE_QUOTA) $(ENABLE_REQUEST_ANIMATION_FRAME) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_SCRIPTED_SPEECH) $(ENABLE_SHADOW_DOM) $(ENABLE_SHARED_WORKERS) $(ENABLE_SQL_DATABASE) $(ENABLE_STYLE_SCOPED) $(ENABLE_SUBPIXEL_LAYOUT) $(ENABLE_SVG) $(ENABLE_SVG_DOM_OBJC_BINDINGS) $(ENABLE_SVG_FONTS) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TEXT_NOTIFICATIONS_ONLY) $(ENABLE_TOUCH_ICON_LOADING) $(ENABLE_USERSELECT_ALL) $(ENABLE_VIDEO) $(ENABLE_VIDEO_TRACK) $(ENABLE_WEBGL) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_SOCKETS) $(ENABLE_WEB_TIMING) $(ENABLE_WORKERS) $(ENABLE_XHR_TIMEOUT) $(ENABLE_XSLT);
index fd2ac49..094c983 100644 (file)
@@ -84,6 +84,7 @@ macro(WEBKIT_OPTION_BEGIN)
     WEBKIT_OPTION_DEFINE(ENABLE_METER_ELEMENT "Toggle Meter Tag support" ON)
     WEBKIT_OPTION_DEFINE(ENABLE_MHTML "Toggle MHTML support" OFF)
     WEBKIT_OPTION_DEFINE(ENABLE_MICRODATA "Toggle Microdata support" OFF)
+    WEBKIT_OPTION_DEFINE(ENABLE_ENABLE_MOUSE_CURSOR_SCALE "Toggle Scaled mouse cursor support" OFF)
     WEBKIT_OPTION_DEFINE(ENABLE_MUTATION_OBSERVERS "Toggle DOM mutation observer support" ON)
     WEBKIT_OPTION_DEFINE(ENABLE_NAVIGATOR_CONTENT_UTILS "Toggle Navigator Content Utils support" OFF)
     WEBKIT_OPTION_DEFINE(ENABLE_NETSCAPE_PLUGIN_API "Toggle Netscape Plugin support" ON)
index c456350..f17416f 100644 (file)
@@ -78,6 +78,7 @@
 #cmakedefine01 ENABLE_METER_ELEMENT
 #cmakedefine01 ENABLE_MHTML
 #cmakedefine01 ENABLE_MICRODATA
+#cmakedefine01 ENABLE_MOUSE_CURSOR_SCALE
 #cmakedefine01 ENABLE_MUTATION_OBSERVERS
 #cmakedefine01 ENABLE_NAVIGATOR_CONTENT_UTILS
 #cmakedefine01 ENABLE_NETSCAPE_PLUGIN_API
index 7e768c5..abaaf46 100644 (file)
@@ -1,3 +1,15 @@
+2012-12-06  Rick Byers  <rbyers@chromium.org>
+
+        CSS cursor property should support webkit-image-set
+        https://bugs.webkit.org/show_bug.cgi?id=99493
+
+        Reviewed by Beth Dakin.
+
+        Add ENABLE_MOUSE_CURSOR_SCALE - disabled by default
+
+        * Scripts/webkitperl/FeatureList.pm:
+        * qmake/mkspecs/features/features.pri:
+
 2012-12-06  Vivek Galatage  <vivek.vg@samsung.com>
 
         Unreviewed. Fixing the email address order to work correctly with bugzilla.
index 5e9552b..0fd07b3 100644 (file)
@@ -105,6 +105,7 @@ my (
     $meterTagSupport,
     $mhtmlSupport,
     $microdataSupport,
+    $mouseCursorScaleSupport,
     $mutationObserversSupport,
     $netscapePluginAPISupport,
     $networkInfoSupport,
@@ -331,6 +332,9 @@ my @features = (
     { option => "microdata", desc => "Toggle Microdata support",
       define => "ENABLE_MICRODATA", default => (isEfl() || isBlackBerry()), value => \$microdataSupport },
 
+    { option => "mouse-cursor-scale", desc => "Toggle Scaled mouse cursor support",
+      define => "ENABLE_MOUSE_CURSOR_SCALE", default => 0, value => \$mouseCursorScaleSupport },
+
     { option => "mutation-observers", desc => "Toggle Mutation Observers support",
       define => "ENABLE_MUTATION_OBSERVERS", default => 1, value => \$mutationObserversSupport },
 
index faf7b99..254dbcf 100644 (file)
@@ -80,6 +80,7 @@ FEATURE_DEFAULTS = \
     ENABLE_METER_ELEMENT=1 \
     ENABLE_MHTML=1 \
     ENABLE_MICRODATA=0 \
+    ENABLE_MOUSE_CURSOR_SCALE=0 \
     ENABLE_MUTATION_OBSERVERS=1 \
     ENABLE_NAVIGATOR_CONTENT_UTILS=0 \
     ENABLE_NETSCAPE_PLUGIN_API=0 \
index bc81960..00d2896 100644 (file)
@@ -1,3 +1,15 @@
+2012-12-06  Rick Byers  <rbyers@chromium.org>
+
+        CSS cursor property should support webkit-image-set
+        https://bugs.webkit.org/show_bug.cgi?id=99493
+
+        Reviewed by Beth Dakin.
+
+        Add ENABLE_MOUSE_CURSOR_SCALE - disabled by default
+
+        * win/tools/vsprops/FeatureDefines.vsprops:
+        * win/tools/vsprops/FeatureDefinesCairo.vsprops:
+
 2012-11-26  Roger Fong  <roger_fong@apple.com>
 
         Unreviewed. ENABLE_ACCELERATED_OVERFLOW_SCROLLING not enabled on Windows.
index 53220b8..3fd999c 100644 (file)
                PerformEnvironmentSet="true"
        />
   <UserMacro
+        Name="ENABLE_MOUSE_CURSOR_SCALE"
+        Value=""
+        PerformEnvironmentSet="true"
+    />
+  <UserMacro
                Name="ENABLE_MUTATION_OBSERVERS"
                Value="ENABLE_MUTATION_OBSERVERS"
                PerformEnvironmentSet="true"
index d8029aa..8843ba2 100644 (file)
                PerformEnvironmentSet="true"
        />
   <UserMacro
+        Name="ENABLE_MOUSE_CURSOR_SCALE"
+        Value=""
+        PerformEnvironmentSet="true"
+    />
+  <UserMacro
                Name="ENABLE_MUTATION_OBSERVERS"
                Value="ENABLE_MUTATION_OBSERVERS"
                PerformEnvironmentSet="true"