Chrome::setSelectedColorInColorChooser shouldn't be called when color chooser sets...
authorkeishi@webkit.org <keishi@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 22 Aug 2011 11:53:19 +0000 (11:53 +0000)
committerkeishi@webkit.org <keishi@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 22 Aug 2011 11:53:19 +0000 (11:53 +0000)
https://bugs.webkit.org/show_bug.cgi?id=66658

Reviewed by Kent Tamura.

* html/ColorInputType.cpp:
(WebCore::ColorInputType::colorSelected): Call setValueFromRenderer instead of setValue.
* html/ColorInputType.h:

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

Source/WebCore/ChangeLog
Source/WebCore/html/ColorInputType.cpp
Source/WebCore/html/ColorInputType.h

index ea815ef..687dd0f 100755 (executable)
@@ -1,3 +1,14 @@
+2011-08-22  Keishi Hattori  <keishi@webkit.org>
+
+        Chrome::setSelectedColorInColorChooser shouldn't be called when color chooser sets a new color
+        https://bugs.webkit.org/show_bug.cgi?id=66658
+
+        Reviewed by Kent Tamura.
+
+        * html/ColorInputType.cpp:
+        (WebCore::ColorInputType::colorSelected): Call setValueFromRenderer instead of setValue.
+        * html/ColorInputType.h:
+
 2011-08-18  Pavel Podivilov  <podivilov@chromium.org>
 
         Web Inspector: extract breakpoint management code to a separate class and add tests.
index a5920b7..8dad2c3 100644 (file)
@@ -105,11 +105,6 @@ Color ColorInputType::valueAsColor() const
     return Color(element()->value());
 }
 
-void ColorInputType::setValueAsColor(const Color& color) const
-{
-    element()->setValue(color.serialized(), true);
-}
-
 void ColorInputType::createShadowSubtree()
 {
     Document* document = element()->document();
@@ -174,7 +169,8 @@ void ColorInputType::colorSelected(const Color& color)
 {
     if (element()->disabled() || element()->readOnly())
         return;
-    setValueAsColor(color);
+    element()->setValueFromRenderer(color.serialized());
+    updateColorSwatch();
 }
 
 bool ColorInputType::isColorInputType() const
index 3888cb5..928ef86 100644 (file)
@@ -53,7 +53,6 @@ private:
     virtual String fallbackValue();
     virtual String sanitizeValue(const String&);
     virtual Color valueAsColor() const;
-    virtual void setValueAsColor(const Color&) const;
     virtual void createShadowSubtree();
     virtual void valueChanged();
     virtual void handleClickEvent(MouseEvent*);