From 1150b0b78abb429300acbd2ac081f20d85125e27 Mon Sep 17 00:00:00 2001 From: "commit-queue@webkit.org" Date: Wed, 25 Jul 2012 15:14:32 +0000 Subject: [PATCH] Unreviewed, rolling out r123606. http://trac.webkit.org/changeset/123606 https://bugs.webkit.org/show_bug.cgi?id=92247 broke Windows build of Chromium (Requested by tomhudson on #webkit). Patch by Sheriff Bot on 2012-07-25 .: * ManualTests/forms/color-suggestion-picker.html: Removed. Source/WebCore: * Resources/colorSuggestionPicker.css: Removed. * Resources/colorSuggestionPicker.js: Removed. * WebCore.gyp/WebCore.gyp: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@123621 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- ChangeLog | 11 ++ ManualTests/forms/color-suggestion-picker.html | 70 -------- Source/WebCore/ChangeLog | 13 ++ Source/WebCore/Resources/colorSuggestionPicker.css | 64 ------- Source/WebCore/Resources/colorSuggestionPicker.js | 192 --------------------- Source/WebCore/WebCore.gyp/WebCore.gyp | 20 --- 6 files changed, 24 insertions(+), 346 deletions(-) delete mode 100644 ManualTests/forms/color-suggestion-picker.html delete mode 100644 Source/WebCore/Resources/colorSuggestionPicker.css delete mode 100644 Source/WebCore/Resources/colorSuggestionPicker.js diff --git a/ChangeLog b/ChangeLog index e8ed8fe..38c20b7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2012-07-25 Sheriff Bot + + Unreviewed, rolling out r123606. + http://trac.webkit.org/changeset/123606 + https://bugs.webkit.org/show_bug.cgi?id=92247 + + broke Windows build of Chromium (Requested by tomhudson on + #webkit). + + * ManualTests/forms/color-suggestion-picker.html: Removed. + 2012-07-25 Keishi Hattori Implement ColorSuggestionPicker page popup diff --git a/ManualTests/forms/color-suggestion-picker.html b/ManualTests/forms/color-suggestion-picker.html deleted file mode 100644 index 6a25c74..0000000 --- a/ManualTests/forms/color-suggestion-picker.html +++ /dev/null @@ -1,70 +0,0 @@ - - - - -Color Suggestion Picker test - - - - -

This is a testbed for a color suggestion picker.

- -
- - -
    -
- - - - \ No newline at end of file diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index b5f6201..1c27642 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,16 @@ +2012-07-25 Sheriff Bot + + Unreviewed, rolling out r123606. + http://trac.webkit.org/changeset/123606 + https://bugs.webkit.org/show_bug.cgi?id=92247 + + broke Windows build of Chromium (Requested by tomhudson on + #webkit). + + * Resources/colorSuggestionPicker.css: Removed. + * Resources/colorSuggestionPicker.js: Removed. + * WebCore.gyp/WebCore.gyp: + 2012-07-25 Pavel Feldman Web Inspector: disabling property should remove "overriden" decoration from overriden UA shorthand. diff --git a/Source/WebCore/Resources/colorSuggestionPicker.css b/Source/WebCore/Resources/colorSuggestionPicker.css deleted file mode 100644 index 580dc9a..0000000 --- a/Source/WebCore/Resources/colorSuggestionPicker.css +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (C) 2012 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -body { - -webkit-user-select: none; - background-color: white; - font: -webkit-small-control; - margin: 0; - overflow: hidden; -} - -#main { - background-color: white; - border: solid 1px #8899aa; - box-shadow: inset 2px 2px 2px white, - inset -2px -2px 1px rgba(0,0,0,0.1); - padding: 6px; - float: left; -} - -.color-swatch { - float: left; - width: 20px; - height: 20px; - margin: 1px; - border: 1px solid #e0e0e0; -} - -.color-swatch:hover { - border: 1px solid #000000; - margin: 1px; -} - -.color-swatch-container { - width: 100%; - max-height: 104px; - overflow: auto; -} - -.other-color { - width: 100%; - margin: 4px 0 0 0; -} diff --git a/Source/WebCore/Resources/colorSuggestionPicker.js b/Source/WebCore/Resources/colorSuggestionPicker.js deleted file mode 100644 index be20484..0000000 --- a/Source/WebCore/Resources/colorSuggestionPicker.js +++ /dev/null @@ -1,192 +0,0 @@ -"use strict"; -/* - * Copyright (C) 2012 Google Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -var global = { - argumentsReceived: false, - scrollbarWidth: null -}; - -/** - * @param {!string} id - */ -function $(id) { - return document.getElementById(id); -} - -function bind(func, context) { - return function() { - return func.apply(context, arguments); - }; -} - -function getScrollbarWidth() { - if (gloabal.scrollbarWidth === null) { - var scrollDiv = document.createElement("div"); - scrollDiv.style.opacity = "0"; - scrollDiv.style.overflow = "scroll"; - scrollDiv.style.width = "50px"; - scrollDiv.style.height = "50px"; - document.body.appendChild(scrollDiv); - gloabal.scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth; - scrollDiv.parentNode.removeChild(scrollDiv); - } - return gloabal.scrollbarWidth; -} - -/** - * @param {!string} tagName - * @param {string=} opt_class - * @param {string=} opt_text - * @return {!Element} - */ -function createElement(tagName, opt_class, opt_text) { - var element = document.createElement(tagName); - if (opt_class) - element.setAttribute("class", opt_class); - if (opt_text) - element.appendChild(document.createTextNode(opt_text)); - return element; -} - -/** - * @param {Event} event - */ -function handleMessage(event) { - initialize(JSON.parse(event.data)); - global.argumentsReceived = true; -} - -/** - * @param {!Object} args - */ -function initialize(args) { - var main = $("main"); - main.innerHTML = ""; - var errorString = validateArguments(args); - if (errorString) - main.textContent = "Internal error: " + errorString; - else - new ColorPicker(main, args); -} - -// The DefaultColorPalette is used when the list of values are empty. -var DefaultColorPalette = ["#000000", "#404040", "#808080", "#c0c0c0", - "#ffffff", "#980000", "#ff0000", "#ff9900", "#ffff00", "#00ff00", "#00ffff", - "#4a86e8", "#0000ff", "#9900ff", "#ff00ff"]; - -function handleArgumentsTimeout() { - if (global.argumentsReceived) - return; - var args = { - values : DefaultColorPalette, - otherColorLabel: "Other..." - }; - initialize(args); -} - -/** - * @param {!Object} args - * @return {?string} An error message, or null if the argument has no errors. - */ -function validateArguments(args) { - if (!args.values) - return "No values."; - if (!args.otherColorLabel) - return "No otherColorLabel."; - return null; -} - -var Actions = { - ChooseOtherColor: -2, - Cancel: -1, - SetValue: 0 -}; - -/** - * @param {string} value - */ -function submitValue(value) { - window.pagePopupController.setValueAndClosePopup(Actions.SetValue, value); -} - -function handleCancel() { - window.pagePopupController.setValueAndClosePopup(Actions.Cancel, ""); -} - -function chooseOtherColor() { - window.pagePopupController.setValueAndClosePopup(Actions.ChooseOtherColor, ""); -} - -function ColorPicker(element, config) { - this._element = element; - this._config = config; - if (this._config.values.length === 0) - this._config.values = DefaultColorPalette; - this._layout(); -} - -var SwatchBorderBoxWidth = 24; // keep in sync with CSS -var SwatchBorderBoxHeight = 24; // keep in sync with CSS -var SwatchesPerRow = 5; -var SwatchesMaxRow = 4; - -ColorPicker.prototype._layout = function() { - var container = createElement("div", "color-swatch-container"); - container.addEventListener("click", bind(this._handleSwatchClick, this), false); - for (var i = 0; i < this._config.values.length; ++i) { - var swatch = createElement("div", "color-swatch"); - swatch.dataset.value = this._config.values[i]; - swatch.title = this._config.values[i]; - swatch.style.backgroundColor = this._config.values[i]; - container.appendChild(swatch); - } - var containerWidth = SwatchBorderBoxWidth * SwatchesPerRow; - if (this._config.values.length > SwatchesPerRow * SwatchesMaxRow) - containerWidth += getScrollbarWidth(); - container.style.width = containerWidth + "px"; - container.style.maxHeight = (SwatchBorderBoxHeight * SwatchesMaxRow) + "px"; - this._element.appendChild(container); - var otherButton = createElement("button", "other-color", this._config.otherColorLabel); - otherButton.addEventListener("click", chooseOtherColor, false); - this._element.appendChild(otherButton); - if (window.frameElement) { - window.frameElement.style.width = this._element.offsetWidth + "px"; - window.frameElement.style.height = this._element.offsetHeight + "px"; - } else { - window.resizeTo(this._element.offsetWidth, this._element.offsetHeight); - } -}; - -ColorPicker.prototype._handleSwatchClick = function(event) { - if (event.target.classList.contains("color-swatch")) - submitValue(event.target.dataset.value); -}; - -if (window.dialogArguments) { - initialize(dialogArguments); -} else { - window.addEventListener("message", handleMessage, false); - window.setTimeout(handleArgumentsTimeout, 1000); -} diff --git a/Source/WebCore/WebCore.gyp/WebCore.gyp b/Source/WebCore/WebCore.gyp/WebCore.gyp index 6ba058e..dfb9ffa 100644 --- a/Source/WebCore/WebCore.gyp/WebCore.gyp +++ b/Source/WebCore/WebCore.gyp/WebCore.gyp @@ -937,25 +937,6 @@ ], }, { - 'action_name': 'ColorSuggestionPicker', - 'inputs': [ - '../Resources/colorSuggestionPicker.css', - '../Resources/colorSuggestionPicker.js', - ], - 'outputs': [ - '<(SHARED_INTERMEDIATE_DIR)/webkit/ColorSuggestionPicker.h', - '<(SHARED_INTERMEDIATE_DIR)/webkit/ColorSuggestionPicker.cpp', - ], - 'action': [ - 'python', - '../make-file-arrays.py', - '--condition=ENABLE(INPUT_TYPE_COLOR) && ENABLE(DATALIST_ELEMENT) && ENABLE(PAGE_POPUP)', - '--out-h=<(SHARED_INTERMEDIATE_DIR)/webkit/ColorSuggestionPicker.h', - '--out-cpp=<(SHARED_INTERMEDIATE_DIR)/webkit/ColorSuggestionPicker.cpp', - '<@(_inputs)', - ], - }, - { 'action_name': 'XLinkNames', 'inputs': [ '../dom/make_names.pl', @@ -1203,7 +1184,6 @@ '<(SHARED_INTERMEDIATE_DIR)/webkit/HTMLElementFactory.cpp', '<(SHARED_INTERMEDIATE_DIR)/webkit/HTMLNames.cpp', '<(SHARED_INTERMEDIATE_DIR)/webkit/CalendarPicker.cpp', - '<(SHARED_INTERMEDIATE_DIR)/webkit/ColorSuggestionPicker.cpp', '<(SHARED_INTERMEDIATE_DIR)/webkit/EventFactory.cpp', '<(SHARED_INTERMEDIATE_DIR)/webkit/EventHeaders.h', '<(SHARED_INTERMEDIATE_DIR)/webkit/EventInterfaces.h', -- 1.8.3.1