Implement ColorSuggestionPicker page popup
authorkeishi@webkit.org <keishi@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Jul 2012 11:57:21 +0000 (11:57 +0000)
committerkeishi@webkit.org <keishi@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 Jul 2012 11:57:21 +0000 (11:57 +0000)
commit306d57a7846fbf975129bd95cfd1bd8903d4a211
tree3b3d5d7decaf7b702ddb84cab5c8dce22c19a55d
parent2d294c90bac676960583a204bd40d1d6aa51b456
Implement ColorSuggestionPicker page popup
https://bugs.webkit.org/show_bug.cgi?id=92109

Reviewed by Kent Tamura.

.:

* ManualTests/forms/color-suggestion-picker.html: Added. Tests colorSuggestionPicker.{js,css}

Source/WebCore:

Implements ColorSuggestionPicker page popup. This will be used in
certain ports as the datalist UI for <input type=color>.

No new tests because there is no way to open the popup yet.

* Resources/colorSuggestionPicker.css: Added.
(body):
(#main):
(.color-swatch):
(.color-swatch:hover):
(.color-swatch-container):
(.other-color):
* Resources/colorSuggestionPicker.js: Added.
(getScrollbarWidth):When there are more than 20 colors we need to
increase the window width to accommodate the scroll bar.
(createElement):
(handleMessage):
(initialize):
(handleArgumentsTimeout):
(validateArguments):
(submitValue): Calls setValueAndClosePopup with a numValue of 0.
(handleCancel): Calls setValueAndClosePopup with a numValue of -1.
(chooseOtherColor): Calls setValueAndClosePopup with a numValue of -2.
(ColorPicker):
(ColorPicker.prototype._layout): Lays out the color swatches in a 5x4
grid.
(ColorPicker.prototype._handleSwatchClick):
* WebCore.gyp/WebCore.gyp:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123606 268f45cc-cd09-0410-ab3c-d52691b4dbfc
ChangeLog
ManualTests/forms/color-suggestion-picker.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/Resources/colorSuggestionPicker.css [new file with mode: 0644]
Source/WebCore/Resources/colorSuggestionPicker.js [new file with mode: 0644]
Source/WebCore/WebCore.gyp/WebCore.gyp