2008-07-13  Sam Weinig  <sam@webkit.org>

        Reviewed by Oliver Hunt and Dan Bernstein.

        Fix for <rdar://problem/5888127>
        https://bugs.webkit.org/show_bug.cgi?id=18699

        - Match Firefox in restricting the size of custom cursor to images to
          128x128 px.
        - Restrict custom cursor hotspots to values within the bounds of the
          cursor image.

        * manual-tests/cursor-max-size.html: Added.
        * page/EventHandler.cpp:
        (WebCore::EventHandler::selectCursor):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@35157 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/manual-tests/cursor-max-size.html b/WebCore/manual-tests/cursor-max-size.html
new file mode 100644
index 0000000..a112a70
--- /dev/null
+++ b/WebCore/manual-tests/cursor-max-size.html
@@ -0,0 +1,25 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Strict//EN">

+<html>

+<head>

+<style>

+html, body

+{

+    height: 100%; width: 100%; overflow: hidden; position: relative;

+    cursor: url("resources/apple.jpg"),                 /* bigger than 128px x 128px */

+            url("resources/helpCursor.tiff") -10 10,    /* negative x in hotspot */

+            url("resources/helpCursor.tiff") 10 -10,    /* negative y in hotspot */

+            url("resources/helpCursor.tiff") -10 -10,    /* negative x and y in hotspot */

+            url("resources/helpCursor.tiff") 20 10,     /* x hotspot outside image (image is 16px x 16px) */

+            url("resources/helpCursor.tiff") 10 20,     /* y hotspot outside image (image is 16px x 16px) */

+            url("resources/helpCursor.tiff") 20 20,     /* both x and y hotspot outside image (image is 16px x 16px) */

+            auto;

+}

+</style>

+</head>

+<body>

+    <p>

+        If there is a custom cursor, the test has failed. This tests that images larger than 128x128 cannot be used

+        as cursors and that hotspots cannot be outside of the cursors bounds box.

+    </p>

+</body>

+</html>