[EFL] Support DataList for <input type="range">
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Aug 2012 12:53:18 +0000 (12:53 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 Aug 2012 12:53:18 +0000 (12:53 +0000)
https://bugs.webkit.org/show_bug.cgi?id=92634

Patch by KwangYong Choi <ky0.choi@samsung.com> on 2012-08-08
Reviewed by Kenneth Rohde Christiansen.

Source/WebCore:

DataList theme for EFL is implemented. DataList feature of
<input type="range"> is supported.

Test: fast/forms/datalist/input-list.html

* platform/efl/RenderThemeEfl.cpp:
(WebCore::RenderThemeEfl::paintSliderTrack):
(WebCore::RenderThemeEfl::sliderTickSize):
(WebCore::RenderThemeEfl::sliderTickOffsetFromTrackCenter):
(WebCore::RenderThemeEfl::supportsDataListUI):
(WebCore):
* platform/efl/RenderThemeEfl.h:
(RenderThemeEfl):

LayoutTests:

Update platform/efl/fast/forms/datalist/input-list-expected.txt because
range type of data list feature is passed.

* platform/efl/fast/forms/datalist/input-list-expected.txt:

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

LayoutTests/ChangeLog
LayoutTests/platform/efl/fast/forms/datalist/input-list-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/platform/efl/RenderThemeEfl.cpp
Source/WebCore/platform/efl/RenderThemeEfl.h

index 26e9e2a..9f2fc99 100644 (file)
@@ -1,3 +1,15 @@
+2012-08-08  KwangYong Choi  <ky0.choi@samsung.com>
+
+        [EFL] Support DataList for <input type="range">
+        https://bugs.webkit.org/show_bug.cgi?id=92634
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Update platform/efl/fast/forms/datalist/input-list-expected.txt because
+        range type of data list feature is passed.
+
+        * platform/efl/fast/forms/datalist/input-list-expected.txt:
+
 2012-08-08  Matt Arsenault  <arsenm2@gmail.com>
 
         Crash when inspecting an element with border-image
index 2c8a32d..8e9bf9f 100644 (file)
@@ -19,7 +19,7 @@ FAIL document.getElementById("week").list should be [object HTMLDataListElement]
 FAIL document.getElementById("time").list should be [object HTMLDataListElement]. Was null.
 FAIL document.getElementById("datetime-local").list should be [object HTMLDataListElement]. Was null.
 FAIL document.getElementById("number").list should be [object HTMLDataListElement]. Was null.
-FAIL document.getElementById("range").list should be [object HTMLDataListElement]. Was null.
+PASS document.getElementById("range").list is document.getElementById("dl1")
 FAIL document.getElementById("color").list should be [object HTMLDataListElement]. Was null.
 PASS document.getElementById("hidden").list is null
 PASS document.getElementById("password").list is null
index e034e6d..4ad974e 100644 (file)
@@ -1,3 +1,24 @@
+2012-08-08  KwangYong Choi  <ky0.choi@samsung.com>
+
+        [EFL] Support DataList for <input type="range">
+        https://bugs.webkit.org/show_bug.cgi?id=92634
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        DataList theme for EFL is implemented. DataList feature of
+        <input type="range"> is supported.
+
+        Test: fast/forms/datalist/input-list.html
+
+        * platform/efl/RenderThemeEfl.cpp:
+        (WebCore::RenderThemeEfl::paintSliderTrack):
+        (WebCore::RenderThemeEfl::sliderTickSize):
+        (WebCore::RenderThemeEfl::sliderTickOffsetFromTrackCenter):
+        (WebCore::RenderThemeEfl::supportsDataListUI):
+        (WebCore):
+        * platform/efl/RenderThemeEfl.h:
+        (RenderThemeEfl):
+
 2012-08-08  Sergey Rogulenko  <rogulenko@google.com>
 
         Web Inspector: renaming DOMNodeHighlighter to InspectorOverlay
index 856811a..8edc2aa 100644 (file)
@@ -29,6 +29,7 @@
 #include "CSSValueKeywords.h"
 #include "GraphicsContext.h"
 #include "HTMLInputElement.h"
+#include "InputType.h"
 #include "NotImplemented.h"
 #include "Page.h"
 #include "PaintInfo.h"
@@ -747,8 +748,15 @@ LayoutUnit RenderThemeEfl::baselinePosition(const RenderObject* object) const
 bool RenderThemeEfl::paintSliderTrack(RenderObject* object, const PaintInfo& info, const IntRect& rect)
 {
     if (object->style()->appearance() == SliderHorizontalPart)
-        return paintThemePart(object, SliderHorizontal, info, rect);
-    return paintThemePart(object, SliderVertical, info, rect);
+        paintThemePart(object, SliderHorizontal, info, rect);
+    else
+        paintThemePart(object, SliderVertical, info, rect);
+
+#if ENABLE(DATALIST_ELEMENT)
+    paintSliderTicks(object, info, rect);
+#endif
+
+    return false;
 }
 
 void RenderThemeEfl::adjustSliderTrackStyle(StyleResolver* styleResolver, RenderStyle* style, Element* element) const
@@ -792,17 +800,27 @@ void RenderThemeEfl::adjustSliderThumbSize(RenderStyle* style, Element*) const
 #if ENABLE(DATALIST_ELEMENT)
 IntSize RenderThemeEfl::sliderTickSize() const
 {
-    // FIXME: We need to set this to the size of one tick mark.
-    return IntSize(0, 0);
+    return IntSize(1, 6);
 }
 
 int RenderThemeEfl::sliderTickOffsetFromTrackCenter() const
 {
-    // FIXME: We need to set this to the position of the tick marks.
-    return 0;
+    static const int sliderTickOffset = -12;
+
+    return sliderTickOffset;
 }
 #endif
 
+bool RenderThemeEfl::supportsDataListUI(const AtomicString& type) const
+{
+#if ENABLE(DATALIST_ELEMENT)
+    // FIXME: We need to support other types.
+    return type == InputTypeNames::range();
+#else
+    return false;
+#endif
+}
+
 bool RenderThemeEfl::paintSliderThumb(RenderObject* object, const PaintInfo& info, const IntRect& rect)
 {
     // We've already painted it in paintSliderTrack(), no need to do anything here.
index 594377a..641e526 100644 (file)
@@ -166,6 +166,8 @@ public:
     virtual int sliderTickOffsetFromTrackCenter() const OVERRIDE;
 #endif
 
+    virtual bool supportsDataListUI(const AtomicString&) const OVERRIDE;
+
     virtual bool paintSliderThumb(RenderObject*, const PaintInfo&, const IntRect&);
 
     virtual void adjustInnerSpinButtonStyle(StyleResolver*, RenderStyle*, Element*) const;