Commit f35aeeb0 authored by Hwanseung Lee's avatar Hwanseung Lee Committed by Commit Bot

Support grab and grabbing values for cursor property

unprefixed versions of the "grab" and "grabbing" CSS cursors
were not supported at blink.

Bug: 708197
Change-Id: I4d4b7e61884bc565526fb92374e40c9dc7ec36a6
Reviewed-on: https://chromium-review.googlesource.com/1012047
Commit-Queue: Eric Willigers <ericwilligers@chromium.org>
Reviewed-by: default avatarDavid Bokan <bokan@chromium.org>
Reviewed-by: default avatarEric Willigers <ericwilligers@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553791}
parent 7c13f644
This is a testharness.js-based test.
PASS Can set 'cursor' to CSS-wide keywords
PASS Can set 'cursor' to var() references
PASS Can set 'cursor' to the 'auto' keyword
PASS Can set 'cursor' to the 'default' keyword
PASS Can set 'cursor' to the 'none' keyword
PASS Can set 'cursor' to the 'context-menu' keyword
PASS Can set 'cursor' to the 'help' keyword
PASS Can set 'cursor' to the 'pointer' keyword
PASS Can set 'cursor' to the 'progress' keyword
PASS Can set 'cursor' to the 'wait' keyword
PASS Can set 'cursor' to the 'cell' keyword
PASS Can set 'cursor' to the 'crosshair' keyword
PASS Can set 'cursor' to the 'text' keyword
PASS Can set 'cursor' to the 'vertical-text' keyword
PASS Can set 'cursor' to the 'alias' keyword
PASS Can set 'cursor' to the 'copy' keyword
PASS Can set 'cursor' to the 'move' keyword
PASS Can set 'cursor' to the 'no-drop' keyword
PASS Can set 'cursor' to the 'not-allowed' keyword
FAIL Can set 'cursor' to the 'grab' keyword Failed to execute 'set' on 'StylePropertyMap': Invalid type for property
FAIL Can set 'cursor' to the 'grabbing' keyword Failed to execute 'set' on 'StylePropertyMap': Invalid type for property
PASS Can set 'cursor' to the 'e-resize' keyword
PASS Can set 'cursor' to the 'n-resize' keyword
PASS Can set 'cursor' to the 'ne-resize' keyword
PASS Can set 'cursor' to the 'nw-resize' keyword
PASS Can set 'cursor' to the 's-resize' keyword
PASS Can set 'cursor' to the 'se-resize' keyword
PASS Can set 'cursor' to the 'sw-resize' keyword
PASS Can set 'cursor' to the 'w-resize' keyword
PASS Can set 'cursor' to the 'ew-resize' keyword
PASS Can set 'cursor' to the 'ns-resize' keyword
PASS Can set 'cursor' to the 'nesw-resize' keyword
PASS Can set 'cursor' to the 'nwse-resize' keyword
PASS Can set 'cursor' to the 'col-resize' keyword
PASS Can set 'cursor' to the 'row-resize' keyword
PASS Can set 'cursor' to the 'all-scroll' keyword
PASS Can set 'cursor' to the 'zoom-in' keyword
PASS Can set 'cursor' to the 'zoom-out' keyword
PASS Setting 'cursor' to a length throws TypeError
PASS Setting 'cursor' to a percent throws TypeError
PASS Setting 'cursor' to a time throws TypeError
PASS Setting 'cursor' to an angle throws TypeError
PASS Setting 'cursor' to a flexible length throws TypeError
PASS Setting 'cursor' to a number throws TypeError
PASS Setting 'cursor' to a position throws TypeError
PASS Setting 'cursor' to a URL throws TypeError
PASS Setting 'cursor' to a transform throws TypeError
PASS 'cursor' does not supported 'url(hand.cur), pointer'
PASS 'cursor' does not supported 'url(cursor1.png) 4 12, auto'
Harness: the test ran to completion.
......@@ -9,6 +9,9 @@ PASS roundtripCssRule(`cursor: none;`) is "cursor: none;"
PASS roundtripCssRule(`cursor: copy;`) is "cursor: copy;"
PASS roundtripCssRule(`cursor: zoom-in;`) is "cursor: zoom-in;"
PASS roundtripCssRule(`cursor: zoom-out;`) is "cursor: zoom-out;"
PASS roundtripCssRule(`cursor: grab;`) is "cursor: grab;"
PASS roundtripCssRule(`cursor: grabbing;`) is "cursor: grabbing;"
PASS roundtripCssRule(`cursor: -webkit-grab;`) is "cursor: -webkit-grab;"
PASS roundtripCssRule(`cursor: -webkit-grabbing;`) is "cursor: -webkit-grabbing;"
PASS roundtripCssRule(`cursor: -webkit-zoom-in;`) is "cursor: -webkit-zoom-in;"
PASS roundtripCssRule(`cursor: -webkit-zoom-out;`) is "cursor: -webkit-zoom-out;"
......
......@@ -45,6 +45,9 @@ testCursorRule('none');
testCursorRule('copy');
testCursorRule('zoom-in');
testCursorRule('zoom-out');
testCursorRule('grab');
testCursorRule('grabbing');
testCursorRule('-webkit-grab');
testCursorRule('-webkit-grabbing');
testCursorRule('-webkit-zoom-in');
testCursorRule('-webkit-zoom-out');
......
......@@ -21,6 +21,15 @@ Cursor Info: type=None hotSpot=0,0
TEST CASE: Pointer
Cursor Info: type=Hand hotSpot=0,0
TEST CASE: grab
Cursor Info: type=Grab hotSpot=0,0
TEST CASE: grabbing
Cursor Info: type=Grabbing hotSpot=0,0
TEST CASE: -webkit-grab
Cursor Info: type=Grab hotSpot=0,0
TEST CASE: -webkit-grabbing
Cursor Info: type=Grabbing hotSpot=0,0
......
......@@ -21,6 +21,9 @@
<div style='cursor: auto'>Explicit auto</div>
<div style='cursor: none'>No cursor</div>
<div style='cursor: pointer'>Pointer</div>
<div style='cursor: grab'>grab</div>
<div style='cursor: grabbing'>grabbing</div>
<div style='cursor: -webkit-grab'>-webkit-grab</div>
<div style='cursor: -webkit-grabbing'>-webkit-grabbing</div>
<div style='cursor: url(resources/greenbox.png), hand'>Existing 25x25 image</div>
<div style='cursor: url(doesntexist_FAIL.png), pointer'>Invalid URL with fallback to pointer</div>
......
......@@ -1398,7 +1398,7 @@
"n-resize", "ne-resize", "nw-resize", "s-resize", "se-resize",
"sw-resize", "w-resize", "ew-resize", "ns-resize", "nesw-resize",
"nwse-resize", "col-resize", "row-resize", "all-scroll", "zoom-in",
"zoom-out", "-webkit-grab", "-webkit-grabbing"
"zoom-out", "grab", "grabbing"
],
default_value: "auto",
custom_apply_functions_all: true,
......
......@@ -412,6 +412,8 @@
"wait",
"help",
"all-scroll",
"grab",
"grabbing",
"-webkit-grab",
"-webkit-grabbing",
"-webkit-zoom-in",
......
......@@ -107,6 +107,10 @@ inline ECursor CssValueIDToPlatformEnum(CSSValueID v) {
return ECursor::kZoomIn;
if (v == CSSValueWebkitZoomOut)
return ECursor::kZoomOut;
if (v == CSSValueWebkitGrab)
return ECursor::kGrab;
if (v == CSSValueWebkitGrabbing)
return ECursor::kGrabbing;
return detail::cssValueIDToPlatformEnumGenerated<ECursor>(v);
}
......
......@@ -544,9 +544,9 @@ EventHandler::OptionalCursor EventHandler::SelectCursor(
return ZoomInCursor();
case ECursor::kZoomOut:
return ZoomOutCursor();
case ECursor::kWebkitGrab:
case ECursor::kGrab:
return GrabCursor();
case ECursor::kWebkitGrabbing:
case ECursor::kGrabbing:
return GrabbingCursor();
}
return PointerCursor();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment