Title: [186829] trunk/Source/WebCore
Revision
186829
Author
[email protected]
Date
2015-07-14 21:16:27 -0700 (Tue, 14 Jul 2015)

Log Message

[EFL] Scrollbar is not drawn on MiniBrowser.
https://bugs.webkit.org/show_bug.cgi?id=143566

Patch by Hunseop Jeong <[email protected]> on 2015-07-14
Reviewed by Gyuyoung Kim.

Implement the ScrollbarThemeEfl to draw the scrollbar on EFL port.

* PlatformEfl.cmake: Removed the ScrollbarEfl.cpp.

* platform/Scrollbar.cpp: Removed the !PLATFORM(EFL) guard to use the createNativeScrollbar().

* platform/efl/DefaultTheme/CMakeLists.txt: Replaced the image files with new ones.

* platform/efl/DefaultTheme/widget/scrollbar/scrollbar.edc:
* platform/efl/DefaultTheme/widget/scrollbar/scrollbar_bg_horizontal.png: Added.
* platform/efl/DefaultTheme/widget/scrollbar/scrollbar_bg_vertical.png: Added.
* platform/efl/DefaultTheme/widget/scrollbar/scrollbar_h.png: Removed.
* platform/efl/DefaultTheme/widget/scrollbar/scrollbar_knob_h.png: Removed.
* platform/efl/DefaultTheme/widget/scrollbar/scrollbar_knob_v.png: Removed.
* platform/efl/DefaultTheme/widget/scrollbar/scrollbar_thumb_horizontal.png: Added.
* platform/efl/DefaultTheme/widget/scrollbar/scrollbar_thumb_vertical.png: Added.
* platform/efl/DefaultTheme/widget/scrollbar/scrollbar_v.png: Removed.
* platform/efl/RenderThemeEfl.cpp:
(WebCore::toEdjeGroup):
(WebCore::RenderThemeEfl::paintThemePart): Added the new function to draw the scrollbar
  using the RenderThemeEfl.

* platform/efl/RenderThemeEfl.h:
* platform/efl/ScrollbarEfl.cpp: Removed.
* platform/efl/ScrollbarEfl.h: Removed.
* platform/efl/ScrollbarThemeEfl.cpp: Implemented the default functions to draw the
  scrollbar.
(WebCore::scrollbarMap):
(WebCore::ScrollbarThemeEfl::~ScrollbarThemeEfl):
(WebCore::ScrollbarThemeEfl::scrollbarThickness):
(WebCore::ScrollbarThemeEfl::hasThumb):
(WebCore::ScrollbarThemeEfl::backButtonRect):
(WebCore::ScrollbarThemeEfl::forwardButtonRect):
(WebCore::ScrollbarThemeEfl::trackRect):
(WebCore::ScrollbarThemeEfl::minimumThumbLength):
(WebCore::ScrollbarThemeEfl::paintTrackBackground):
(WebCore::ScrollbarThemeEfl::paintThumb):
(WebCore::ScrollbarThemeEfl::registerScrollbar):
(WebCore::ScrollbarThemeEfl::unregisterScrollbar):
(WebCore::ScrollbarThemeEfl::loadThemeIfNeeded):
* platform/efl/ScrollbarThemeEfl.h:
(WebCore::ScrollbarThemeEfl::usesOverlayScrollbars):

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (186828 => 186829)


--- trunk/Source/WebCore/ChangeLog	2015-07-15 02:12:16 UTC (rev 186828)
+++ trunk/Source/WebCore/ChangeLog	2015-07-15 04:16:27 UTC (rev 186829)
@@ -1,3 +1,53 @@
+2015-07-14  Hunseop Jeong  <[email protected]>
+
+        [EFL] Scrollbar is not drawn on MiniBrowser.
+        https://bugs.webkit.org/show_bug.cgi?id=143566
+
+        Reviewed by Gyuyoung Kim.
+
+        Implement the ScrollbarThemeEfl to draw the scrollbar on EFL port.
+
+        * PlatformEfl.cmake: Removed the ScrollbarEfl.cpp.
+
+        * platform/Scrollbar.cpp: Removed the !PLATFORM(EFL) guard to use the createNativeScrollbar().
+
+        * platform/efl/DefaultTheme/CMakeLists.txt: Replaced the image files with new ones.
+
+        * platform/efl/DefaultTheme/widget/scrollbar/scrollbar.edc:
+        * platform/efl/DefaultTheme/widget/scrollbar/scrollbar_bg_horizontal.png: Added.
+        * platform/efl/DefaultTheme/widget/scrollbar/scrollbar_bg_vertical.png: Added.
+        * platform/efl/DefaultTheme/widget/scrollbar/scrollbar_h.png: Removed.
+        * platform/efl/DefaultTheme/widget/scrollbar/scrollbar_knob_h.png: Removed.
+        * platform/efl/DefaultTheme/widget/scrollbar/scrollbar_knob_v.png: Removed.
+        * platform/efl/DefaultTheme/widget/scrollbar/scrollbar_thumb_horizontal.png: Added.
+        * platform/efl/DefaultTheme/widget/scrollbar/scrollbar_thumb_vertical.png: Added.
+        * platform/efl/DefaultTheme/widget/scrollbar/scrollbar_v.png: Removed.
+        * platform/efl/RenderThemeEfl.cpp:
+        (WebCore::toEdjeGroup):
+        (WebCore::RenderThemeEfl::paintThemePart): Added the new function to draw the scrollbar
+          using the RenderThemeEfl.
+
+        * platform/efl/RenderThemeEfl.h:
+        * platform/efl/ScrollbarEfl.cpp: Removed.
+        * platform/efl/ScrollbarEfl.h: Removed.
+        * platform/efl/ScrollbarThemeEfl.cpp: Implemented the default functions to draw the
+          scrollbar.
+        (WebCore::scrollbarMap):
+        (WebCore::ScrollbarThemeEfl::~ScrollbarThemeEfl):
+        (WebCore::ScrollbarThemeEfl::scrollbarThickness):
+        (WebCore::ScrollbarThemeEfl::hasThumb):
+        (WebCore::ScrollbarThemeEfl::backButtonRect):
+        (WebCore::ScrollbarThemeEfl::forwardButtonRect):
+        (WebCore::ScrollbarThemeEfl::trackRect):
+        (WebCore::ScrollbarThemeEfl::minimumThumbLength):
+        (WebCore::ScrollbarThemeEfl::paintTrackBackground):
+        (WebCore::ScrollbarThemeEfl::paintThumb):
+        (WebCore::ScrollbarThemeEfl::registerScrollbar):
+        (WebCore::ScrollbarThemeEfl::unregisterScrollbar):
+        (WebCore::ScrollbarThemeEfl::loadThemeIfNeeded):
+        * platform/efl/ScrollbarThemeEfl.h:
+        (WebCore::ScrollbarThemeEfl::usesOverlayScrollbars):
+
 2015-07-14  Andreas Kling  <[email protected]>
 
         Don't persist history item tree for subframes across reloads.

Modified: trunk/Source/WebCore/PlatformEfl.cmake (186828 => 186829)


--- trunk/Source/WebCore/PlatformEfl.cmake	2015-07-15 02:12:16 UTC (rev 186828)
+++ trunk/Source/WebCore/PlatformEfl.cmake	2015-07-15 04:16:27 UTC (rev 186829)
@@ -97,7 +97,6 @@
     platform/efl/PlatformScreenEfl.cpp
     platform/efl/PlatformWheelEventEfl.cpp
     platform/efl/RenderThemeEfl.cpp
-    platform/efl/ScrollbarEfl.cpp
     platform/efl/ScrollbarThemeEfl.cpp
     platform/efl/SharedTimerEfl.cpp
     platform/efl/SoundEfl.cpp

Modified: trunk/Source/WebCore/platform/Scrollbar.cpp (186828 => 186829)


--- trunk/Source/WebCore/platform/Scrollbar.cpp	2015-07-15 02:12:16 UTC (rev 186828)
+++ trunk/Source/WebCore/platform/Scrollbar.cpp	2015-07-15 04:16:27 UTC (rev 186829)
@@ -43,12 +43,10 @@
 
 namespace WebCore {
 
-#if !PLATFORM(EFL)
 PassRefPtr<Scrollbar> Scrollbar::createNativeScrollbar(ScrollableArea& scrollableArea, ScrollbarOrientation orientation, ScrollbarControlSize size)
 {
     return adoptRef(new Scrollbar(scrollableArea, orientation, size));
 }
-#endif
 
 int Scrollbar::maxOverlapBetweenPages()
 {

Modified: trunk/Source/WebCore/platform/efl/DefaultTheme/CMakeLists.txt (186828 => 186829)


--- trunk/Source/WebCore/platform/efl/DefaultTheme/CMakeLists.txt	2015-07-15 02:12:16 UTC (rev 186828)
+++ trunk/Source/WebCore/platform/efl/DefaultTheme/CMakeLists.txt	2015-07-15 04:16:27 UTC (rev 186829)
@@ -52,10 +52,10 @@
             widget/radio/img_radio_on.png
             widget/radio/radio.edc
             widget/scrollbar/scrollbar.edc
-            widget/scrollbar/scrollbar_h.png
-            widget/scrollbar/scrollbar_knob_h.png
-            widget/scrollbar/scrollbar_knob_v.png
-            widget/scrollbar/scrollbar_v.png
+            widget/scrollbar/scrollbar_bg_horizontal.png
+            widget/scrollbar/scrollbar_bg_vertical.png
+            widget/scrollbar/scrollbar_thumb_horizontal.png
+            widget/scrollbar/scrollbar_thumb_vertical.png
             widget/search/cancel/cancel_normal_button2.png
             widget/search/cancel/cancel_normal_button.png
             widget/search/cancel/search_cancel.edc

Modified: trunk/Source/WebCore/platform/efl/DefaultTheme/widget/scrollbar/scrollbar.edc (186828 => 186829)


--- trunk/Source/WebCore/platform/efl/DefaultTheme/widget/scrollbar/scrollbar.edc	2015-07-15 02:12:16 UTC (rev 186828)
+++ trunk/Source/WebCore/platform/efl/DefaultTheme/widget/scrollbar/scrollbar.edc	2015-07-15 04:16:27 UTC (rev 186829)
@@ -1,5 +1,6 @@
 /*
     Copyright (C) 2008,2009 INdT - Instituto Nokia de Tecnologia
+    Copyright (C) 2015 Samsung Electronics. All rights reserved.
 
     This file is free software; you can redistribute it and/or
     modify it under the terms of the GNU Library General Public
@@ -17,245 +18,112 @@
     Boston, MA 02110-1301, USA.
 */
 
-group {
-    name: "scrollbar.vertical";
+   group {
+      name: "webkit/widget/scrollbar/vertical_thumb";
+      min: 0 0;  /* if > 0, this is the minimum size that will be allocated.
+                  * If wants to draw on top, just overflow using edje's rel1/rel2
+                  */
 
-    min: 0 0;  /* if > 0, this is the minimum size that will be allocated.
-                * If wants to draw on top, just overflow usign edje's rel1/rel2
-                */
+      images {
+         image: "widget/scrollbar/scrollbar_thumb_vertical.png" COMP;
+      }
 
-    images {
-        image: "widget/scrollbar/scrollbar_v.png" COMP;
-        image: "widget/scrollbar/scrollbar_knob_v.png" COMP;
-    }
-
-    script {
-        public hide_timer;
-
-        public hide_timer_cb(val) {
-            run_program(PROGRAM:"hide");
-            return 0;
-        }
-
-        public hide_timer_stop() {
-            new id = get_int(hide_timer);
-            if (id <= 0)
-                return;
-
-            cancel_timer(id);
-            set_int(hide_timer, 0);
-        }
-
-        public hide_timer_start() {
-            set_int(hide_timer, timer(1.0, "hide_timer_cb", 0));
-        }
-
-        public message(Msg_Type:type, id, ...) {
-            if ((id == 0) && (type == MSG_FLOAT_SET)) {
-                new Float:vy, Float:sy;
-
-                vy = getfarg(2);
-                sy = getfarg(3);
-
-                if (vy >= 0.0) {
-                    set_drag_size(PART:"img.knob", 1.0, sy);
-                    set_drag(PART:"img.knob", 0.0, vy);
-                    run_program(PROGRAM:"show");
-                } else
-                    run_program(PROGRAM:"hide");
-
-                hide_timer_stop();
-                hide_timer_start();
-            }
-        }
-
-        public update_drag_pos() {
-            new Float:x, Float:y;
-            get_drag(PART:"img.knob", x, y);
-            send_message(MSG_FLOAT, 1, y);
-        }
-    }
-
-    parts {
+      parts {
          part {
-            name: "rect.base";
+            name: "vertical.rect.base";
             type: RECT;
             description {
-               min: 10 0;
-               max: 10 999999;
-               align: 1.0 0.5;
                state: "default" 0.0;
+               min: 8 0;
+               max: 8 999999;
+               align: 1.0 0.5;
                color: 255 255 255 0;
             }
          }
 
          part {
-            name: "rect.clipper";
-            type: RECT;
+            name: "vertical.thumb";
+            type: IMAGE;
             description {
                state: "default" 0.0;
-               color: 255 255 255 255;
-               rel1.to: "rect.base";
-               rel2.to: "rect.base";
+               min: 8 2;
+               max: 8 999999;
+               align: 0.5 0.5;
+               rel1 {to: "vertical.thumb.area"; relative: 0 0;}
+               rel2 {to: "vertical.thumb.area"; relative: 1 1;}
+               image {
+                  normal: "widget/scrollbar/scrollbar_thumb_vertical.png";
+                  middle: SOLID;
+               }
             }
-            description {
-               state: "hidden" 0.0;
-               color: 255 255 255 64;
-               rel1.to: "rect.base";
-               rel2.to: "rect.base";
-            }
          }
 
          part {
-            name: "img.scrollbar";
-            type: IMAGE;
-            mouse_events: 0;
-            clip_to: "rect.clipper";
+            name: "vertical.thumb.area";
+            type: RECT;
             description {
                state: "default" 0.0;
-               min: 1 30;
-               max: 1 999999;
+               min: 8 2;
+               max: 8 999999;
                align: 0.5 0.5;
-               image {
-                  normal: "widget/scrollbar/scrollbar_v.png";
-                  border: 0 0 15 15;
-                  middle: SOLID;
-               }
-               rel1.to: "rect.base";
-               rel2.to: "rect.base";
+               color: 255 0 0 0;
             }
          }
+      }
+   }
 
+   group {
+      name: "webkit/widget/scrollbar/vertical_background";
+      min: 0 0;  /* if > 0, this is the minimum size that will be allocated.
+                  * If wants to draw on top, just overflow using edje's rel1/rel2
+                  */
+
+      images {
+         image: "widget/scrollbar/scrollbar_bg_vertical.png" COMP;
+      }
+
+      parts {
          part {
-            name: "rect.knobarea";
+            name: "vertical.rect.base";
             type: RECT;
             description {
                state: "default" 0.0;
+               min: 10 0;
+               max: 10 999999;
+               align: 1.0 0.5;
                color: 255 255 255 0;
-               min: 5 5;
-               max: 5 999999;
-               align: 0.5 0.5;
-               rel1.to: "rect.base";
-               rel2.to: "rect.base";
             }
          }
 
          part {
-            name: "img.knob";
+            name: "vertical.background";
             type: IMAGE;
-            mouse_events: 1;
-            clip_to: "rect.clipper";
-            dragable {
-                x: 0 0 0;
-                y: 1 1 0;
-                confine: "rect.knobarea";
-            }
             description {
                state: "default" 0.0;
-               min: 5 5;
-               max: 5 999999;
+               min: 10 0;
+               max: 10 999999;
                align: 0.5 0.5;
-               image {
-                  normal: "widget/scrollbar/scrollbar_knob_v.png";
-                  border: 3 3 3 3;
-                  middle: SOLID;
-               }
+               rel1 {to: "vertical.rect.base"; relative: 0 0;}
+               rel2 {to: "vertical.rect.base"; relative: 1 1;}
+               image.normal: "widget/scrollbar/scrollbar_bg_vertical.png";
             }
          }
-    }
-    programs {
-        program {
-           name: "load";
-           signal: "load";
-           action: STATE_SET "hidden" 0.0;
-           target: "rect.clipper";
-        }
-        program {
-           name: "hide";
-           action: STATE_SET "hidden" 0.0;
-           transition: ACCELERATE 0.5;
-           target: "rect.clipper";
-        }
+      }
+   }
 
-        program {
-           name: "show";
-           action: STATE_SET "default" 0.0;
-           target: "rect.clipper";
-        }
+   group {
+      name: "webkit/widget/scrollbar/horizontal_thumb";
+       min: 0 0;  /* if > 0, this is the minimum size that will be allocated.
+                   * If wants to draw on top, just overflow using edje's rel1/rel2
+                   */
 
-        program {
-           name: "dragged";
-           signal: "drag";
-           source: "img.knob";
-           script {
-              update_drag_pos();
-           }
-        }
-    }
-}
+      images {
+         image: "widget/scrollbar/scrollbar_thumb_horizontal.png" COMP;
+      }
 
-group {
-    name: "scrollbar.horizontal";
-
-    min: 0 0;  /* if > 0, this is the minimum size that will be allocated.
-                * If wants to draw on top, just overflow usign edje's rel1/rel2
-                */
-
-    images {
-        image: "widget/scrollbar/scrollbar_h.png" COMP;
-        image: "widget/scrollbar/scrollbar_knob_h.png" COMP;
-    }
-
-    script {
-        public hide_timer;
-
-        public hide_timer_cb(val) {
-            run_program(PROGRAM:"hide");
-            return 0;
-        }
-
-        public hide_timer_stop() {
-            new id = get_int(hide_timer);
-            if (id <= 0)
-                return;
-
-            cancel_timer(id);
-            set_int(hide_timer, 0);
-        }
-
-        public hide_timer_start() {
-            set_int(hide_timer, timer(1.0, "hide_timer_cb", 0));
-        }
-
-        public message(Msg_Type:type, id, ...) {
-            if ((id == 0) && (type == MSG_FLOAT_SET)) {
-                new Float:vx, Float:sx;
-
-                vx = getfarg(2);
-                sx = getfarg(3);
-
-                if (vx >= 0.0) {
-                    set_drag_size(PART:"img.knob", sx, 1.0);
-                    set_drag(PART:"img.knob", vx, 0.0);
-                    run_program(PROGRAM:"show");
-                } else
-                    run_program(PROGRAM:"hide");
-
-                hide_timer_stop();
-                hide_timer_start();
-            }
-        }
-
-        public update_drag_pos() {
-            new Float:x, Float:y;
-            get_drag(PART:"img.knob", x, y);
-            send_message(MSG_FLOAT, 1, x);
-        }
-    }
-
-    parts {
+      parts {
          part {
-            name: "rect.base";
+            name: "horizontal.rect.base";
             type: RECT;
             description {
                state: "default" 0.0;
@@ -267,106 +135,71 @@
          }
 
          part {
-            name: "rect.clipper";
-            type: RECT;
+            name: "horizontal.thumb";
+            type: IMAGE;
             description {
                state: "default" 0.0;
-               color: 255 255 255 255;
-               rel1.to: "rect.base";
-               rel2.to: "rect.base";
+               min: 2 8;
+               max: 999999 8;
+               align: 0.5 0.5;
+               rel1 {to: "horizontal.rect.base"; relative: 0 0;}
+               rel2 {to: "horizontal.rect.base"; relative: 1 1;}
+               image {
+                  normal: "widget/scrollbar/scrollbar_thumb_horizontal.png";
+                  middle: SOLID;
+               }
             }
-            description {
-               state: "hidden" 0.0;
-               color: 255 255 255 64;
-               rel1.to: "rect.base";
-               rel2.to: "rect.base";
-            }
          }
 
          part {
-            name: "img.scrollbar";
-            type: IMAGE;
-            mouse_events: 0;
-            clip_to: "rect.clipper";
+            name: "horizontal.thumb.area";
+            type: RECT;
             description {
                state: "default" 0.0;
-               min: 30 1;
-               max: 999999 1;
+               min: 2 8;
+               max: 999999 8;
                align: 0.5 0.5;
-               image {
-                  normal: "widget/scrollbar/scrollbar_h.png";
-                  border: 15 15 0 0;
-                  middle: SOLID;
-               }
-               rel1.to: "rect.base";
-               rel2.to: "rect.base";
-           }
+               color: 255 0 0 0;
+            }
          }
+      }
+   }
 
+   group {
+      name: "webkit/widget/scrollbar/horizontal_background";
+      min: 0 0;  /* if > 0, this is the minimum size that will be allocated.
+                  * If wants to draw on top, just overflow using edje's rel1/rel2
+                  */
 
+      images {
+         image: "widget/scrollbar/scrollbar_bg_horizontal.png" COMP;
+      }
+
+      parts {
          part {
-            name: "rect.knobarea";
+            name: "horizontal.rect.base";
             type: RECT;
             description {
                state: "default" 0.0;
+               min: 0 10;
+               max: 999999 10;
+               align: 0.5 1.0;
                color: 255 255 255 0;
-               min: 5 5;
-               max: 999999 5;
-               align: 0.5 0.5;
-               rel1.to: "rect.base";
-               rel2.to: "rect.base";
             }
          }
 
          part {
-            name: "img.knob";
+            name: "horizontal.background";
             type: IMAGE;
-            mouse_events: 1;
-            clip_to: "rect.clipper";
-            dragable {
-                x: 1 1 0;
-                y: 0 0 0;
-                confine: "rect.knobarea";
-            }
             description {
                state: "default" 0.0;
-               min: 5 5;
-               max: 999999 5;
-               image {
-                  normal: "widget/scrollbar/scrollbar_knob_h.png";
-                  border: 3 3 3 3;
-                  middle: SOLID;
-               }
+               min: 0 10;
+               max: 99999 10;
+               align: 0.5 0.5;
+               rel1 {to: "horizontal.rect.base"; relative: 0 0;}
+               rel2 {to: "horizontal.rect.base"; relative: 1 1;}
+               image.normal: "widget/scrollbar/scrollbar_bg_horizontal.png";
             }
          }
-    }
-    programs {
-        program {
-           name: "load";
-           signal: "load";
-           action: STATE_SET "hidden" 0.0;
-           target: "rect.clipper";
-        }
-        program {
-           name: "hide";
-           action: STATE_SET "hidden" 0.0;
-           transition: ACCELERATE 0.5;
-           target: "rect.clipper";
-        }
-
-        program {
-           name: "show";
-           action: STATE_SET "default" 0.0;
-           target: "rect.clipper";
-        }
-
-        program {
-           name: "dragged";
-           signal: "drag";
-           source: "img.knob";
-           script {
-              update_drag_pos();
-           }
-        }
-    }
-}
+      }
+   }

Added: trunk/Source/WebCore/platform/efl/DefaultTheme/widget/scrollbar/scrollbar_bg_horizontal.png


(Binary files differ)
Property changes on: trunk/Source/WebCore/platform/efl/DefaultTheme/widget/scrollbar/scrollbar_bg_horizontal.png ___________________________________________________________________

Added: svn:mime-type

Added: trunk/Source/WebCore/platform/efl/DefaultTheme/widget/scrollbar/scrollbar_bg_vertical.png


(Binary files differ)
Property changes on: trunk/Source/WebCore/platform/efl/DefaultTheme/widget/scrollbar/scrollbar_bg_vertical.png ___________________________________________________________________

Added: svn:mime-type

Deleted: trunk/Source/WebCore/platform/efl/DefaultTheme/widget/scrollbar/scrollbar_h.png (186828 => 186829)


--- trunk/Source/WebCore/platform/efl/DefaultTheme/widget/scrollbar/scrollbar_h.png	2015-07-15 02:12:16 UTC (rev 186828)
+++ trunk/Source/WebCore/platform/efl/DefaultTheme/widget/scrollbar/scrollbar_h.png	2015-07-15 04:16:27 UTC (rev 186829)
@@ -1,4 +0,0 @@
-\x89PNG
-
--IHDR\xFC\xFA\xA7àsBIT|d\x88XIDAT(\xCF\xED\xC111@\xE9<ojŸ\x8Ey\xA4g|zi\xBC˵\xD6\xE0\xB3\xF7VU\x89\xA4\xBA[$u\xCEII%UՃ\xEB\xBA\xFE\xAA\xBBL\xD2I\xC0I<\xC6pW\x95\x93\xB8\xBB=\xE74\x80\xEFG!-k\x9F\x88\xDD\xE6IEND\xAEB`\x82
\ No newline at end of file

Deleted: trunk/Source/WebCore/platform/efl/DefaultTheme/widget/scrollbar/scrollbar_knob_h.png (186828 => 186829)


--- trunk/Source/WebCore/platform/efl/DefaultTheme/widget/scrollbar/scrollbar_knob_h.png	2015-07-15 02:12:16 UTC (rev 186828)
+++ trunk/Source/WebCore/platform/efl/DefaultTheme/widget/scrollbar/scrollbar_knob_h.png	2015-07-15 04:16:27 UTC (rev 186829)
@@ -1,5 +0,0 @@
-\x89PNG
-
--IHDRd\xB3JI\xABsBIT|d\x88hIDAT8\xCB\xEDձ-\x800Cѳ\x93\x9AE؇\x92(hQDO\x91(هmș\x86\x80\xE2\xDE_\xB2\x8CRJgf\x93\xA4\x81do\xE1u\xEE~8̬fw\x9FSJ\x80(\xF3\x91gkk-\xC0I\xFE\xC0HI{\xA4\xF8I{&\xB9I\xBA\xE2C\xBE\xFF\x92\xF5\x98C'^\xB3\xE1\xE2IEND\xAEB`\x82
\ No newline at end of file

Deleted: trunk/Source/WebCore/platform/efl/DefaultTheme/widget/scrollbar/scrollbar_knob_v.png (186828 => 186829)


--- trunk/Source/WebCore/platform/efl/DefaultTheme/widget/scrollbar/scrollbar_knob_v.png	2015-07-15 02:12:16 UTC (rev 186828)
+++ trunk/Source/WebCore/platform/efl/DefaultTheme/widget/scrollbar/scrollbar_knob_v.png	2015-07-15 04:16:27 UTC (rev 186829)
@@ -1,6 +0,0 @@
-\x89PNG
-
--IHDRdN\xC7\xFAsBIT|d\x88lIDATH\xC7\xED֡\xC2@Dᙹ\xD34\x92~"\xA9\x81\xCDw- RCd\xFAI7\xDC\xB3\x8F\xD9'\xFF
-\xC7\xB7\x88x\x92\xBC\xDB>$\xBD:\x80Gkm÷\xCD\xF6[\xB6W\xA4l\xAF\x92\xB4d\x94\xB4?*,,,,,,\xFC3Fĕ!".\x91<3\x92<;\x80}\xCE\xD9\xD3\xEC5\x96'\xE4\xE3\xFA\xB0IEND\xAEB`\x82
\ No newline at end of file

Added: trunk/Source/WebCore/platform/efl/DefaultTheme/widget/scrollbar/scrollbar_thumb_horizontal.png


(Binary files differ)
Property changes on: trunk/Source/WebCore/platform/efl/DefaultTheme/widget/scrollbar/scrollbar_thumb_horizontal.png ___________________________________________________________________

Added: svn:mime-type

Added: trunk/Source/WebCore/platform/efl/DefaultTheme/widget/scrollbar/scrollbar_thumb_vertical.png


(Binary files differ)
Property changes on: trunk/Source/WebCore/platform/efl/DefaultTheme/widget/scrollbar/scrollbar_thumb_vertical.png ___________________________________________________________________

Added: svn:mime-type

Deleted: trunk/Source/WebCore/platform/efl/DefaultTheme/widget/scrollbar/scrollbar_v.png (186828 => 186829)


--- trunk/Source/WebCore/platform/efl/DefaultTheme/widget/scrollbar/scrollbar_v.png	2015-07-15 02:12:16 UTC (rev 186828)
+++ trunk/Source/WebCore/platform/efl/DefaultTheme/widget/scrollbar/scrollbar_v.png	2015-07-15 04:16:27 UTC (rev 186829)
@@ -1,5 +0,0 @@
-\x89PNG
-
--IHDR\xFC\xB6\xCENsBIT|d\x88\IDAT8\xCB\xEDDZ!ѯe\xA0\x92\xEB\xBF\xFAp\xA2
-\xF0 ]`\xB5\xE0\x8Cd\xE7\xAD\xD6ZI{\xEF	01\xB3ID\x94\xCE9%I\xA5̬:\x92tsss\xF3\xB7D\xC4I\x8E\x999\x99\xE9\xBF\xCDL\xA7\xB5VJ\xE1\x8C1I\x9F\x8C/`\xEF\xF5zIEND\xAEB`\x82
\ No newline at end of file

Modified: trunk/Source/WebCore/platform/efl/RenderThemeEfl.cpp (186828 => 186829)


--- trunk/Source/WebCore/platform/efl/RenderThemeEfl.cpp	2015-07-15 02:12:16 UTC (rev 186828)
+++ trunk/Source/WebCore/platform/efl/RenderThemeEfl.cpp	2015-07-15 04:16:27 UTC (rev 186829)
@@ -93,6 +93,10 @@
         "webkit/widget/checkbox",
         "webkit/widget/combo",
         "webkit/widget/progressbar",
+        "webkit/widget/scrollbar/horizontal_thumb",
+        "webkit/widget/scrollbar/horizontal_background",
+        "webkit/widget/scrollbar/vertical_thumb",
+        "webkit/widget/scrollbar/vertical_background",
         "webkit/widget/search/field",
         "webkit/widget/search/results_button",
         "webkit/widget/search/results_decoration",
@@ -371,6 +375,29 @@
     return false;
 }
 
+bool RenderThemeEfl::paintThemePart(const GraphicsContext& context, FormType type, const IntRect& rect)
+{
+    loadThemeIfNeeded();
+    _ASSERT_ON_RELEASE_RETURN_VAL(edje(), false, "Could not paint native HTML part due to missing theme.");
+
+    ThemePartCacheEntry* entry = getThemePartFromCache(type, rect.size());
+    ASSERT(entry);
+
+    edje_object_calc_force(entry->edje());
+    edje_object_message_signal_process(entry->edje());
+    evas_render(ecore_evas_get(entry->canvas()));
+
+    cairo_t* cairo = context.platformContext()->cr();
+    ASSERT(cairo);
+
+    cairo_save(cairo);
+    cairo_set_source_surface(cairo, entry->surface(), rect.x(), rect.y());
+    cairo_paint_with_alpha(cairo, 1.0);
+    cairo_restore(cairo);
+
+    return false;
+}
+
 PassRefPtr<RenderTheme> RenderThemeEfl::create(Page* page)
 {
     return adoptRef(new RenderThemeEfl(page));

Modified: trunk/Source/WebCore/platform/efl/RenderThemeEfl.h (186828 => 186829)


--- trunk/Source/WebCore/platform/efl/RenderThemeEfl.h	2015-07-15 02:12:16 UTC (rev 186828)
+++ trunk/Source/WebCore/platform/efl/RenderThemeEfl.h	2015-07-15 04:16:27 UTC (rev 186829)
@@ -45,6 +45,10 @@
     CheckBox,
     ComboBox,
     ProgressBar,
+    ScrollbarHorizontalThumb,
+    ScrollbarHorizontalTrackBackground,
+    ScrollbarVerticalThumb,
+    ScrollbarVerticalTrackBackground,
     SearchField,
     SearchFieldResultsButton,
     SearchFieldResultsDecoration,
@@ -176,6 +180,8 @@
     void setThemePath(const String&);
     String themePath() const;
 
+    bool paintThemePart(const GraphicsContext&, FormType, const IntRect&);
+
 protected:
     static float defaultFontSize;
 

Deleted: trunk/Source/WebCore/platform/efl/ScrollbarEfl.cpp (186828 => 186829)


--- trunk/Source/WebCore/platform/efl/ScrollbarEfl.cpp	2015-07-15 02:12:16 UTC (rev 186828)
+++ trunk/Source/WebCore/platform/efl/ScrollbarEfl.cpp	2015-07-15 04:16:27 UTC (rev 186829)
@@ -1,48 +0,0 @@
-/*
- *  Copyright (C) 2007 Holger Hans Peter Freyther [email protected]
- *            (C) 2009 Kenneth Rohde Christiansen
- *            (C) 2009 INdT, Instituto Nokia de Technologia
- *            (C) 2009-2010 ProFUSION embedded systems
- *            (C) 2009-2010 Samsung Electronics
- *
- *  This library is free software; you can redistribute it and/or
- *  modify it under the terms of the GNU Lesser General Public
- *  License as published by the Free Software Foundation; either
- *  version 2 of the License, or (at your option) any later version.
- *
- *  This library is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- *  Lesser General Public License for more details.
- *
- *  You should have received a copy of the GNU Lesser General Public
- *  License along with this library; if not, write to the Free Software
- *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
- */
-
-#include "config.h"
-#include "ScrollbarEfl.h"
-
-#include "IntRect.h"
-#include "Settings.h"
-
-namespace WebCore {
-
-PassRefPtr<Scrollbar> Scrollbar::createNativeScrollbar(ScrollableArea& scrollableArea, ScrollbarOrientation orientation, ScrollbarControlSize size)
-{
-    if (Settings::mockScrollbarsEnabled())
-        return adoptRef(new Scrollbar(scrollableArea, orientation, size));
-
-    return adoptRef(new ScrollbarEfl(scrollableArea, orientation, size));
-}
-ScrollbarEfl::ScrollbarEfl(ScrollableArea& scrollableArea, ScrollbarOrientation orientation, ScrollbarControlSize controlSize)
-
-    : Scrollbar(scrollableArea, orientation, controlSize)
-{
-}
-
-ScrollbarEfl::~ScrollbarEfl()
-{
-}
-
-}

Deleted: trunk/Source/WebCore/platform/efl/ScrollbarEfl.h (186828 => 186829)


--- trunk/Source/WebCore/platform/efl/ScrollbarEfl.h	2015-07-15 02:12:16 UTC (rev 186828)
+++ trunk/Source/WebCore/platform/efl/ScrollbarEfl.h	2015-07-15 04:16:27 UTC (rev 186829)
@@ -1,49 +0,0 @@
-/*
- * Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved.
- * Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia
- * Copyright (C) 2009-2010 ProFUSION embedded systems
- * Copyright (C) 2009-2010 Samsung Electronics
- *
- * 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. ``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
- * 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.
- */
-
-#ifndef ScrollbarEfl_h
-#define ScrollbarEfl_h
-
-#include "Scrollbar.h"
-#include <wtf/PassRefPtr.h>
-
-namespace WebCore {
-
-class ScrollbarEfl final : public Scrollbar {
-public:
-    friend class Scrollbar;
-    virtual ~ScrollbarEfl();
-
-protected:
-    ScrollbarEfl(ScrollableArea&, ScrollbarOrientation, ScrollbarControlSize);
-
-};
-
-}
-
-#endif // ScrollbarEfl_h

Modified: trunk/Source/WebCore/platform/efl/ScrollbarThemeEfl.cpp (186828 => 186829)


--- trunk/Source/WebCore/platform/efl/ScrollbarThemeEfl.cpp	2015-07-15 02:12:16 UTC (rev 186828)
+++ trunk/Source/WebCore/platform/efl/ScrollbarThemeEfl.cpp	2015-07-15 04:16:27 UTC (rev 186829)
@@ -29,6 +29,13 @@
 #include "config.h"
 #include "ScrollbarThemeEfl.h"
 
+#include "FrameView.h"
+#include "NotImplemented.h"
+#include "Page.h"
+#include "RenderThemeEfl.h"
+
+#include <wtf/NeverDestroyed.h>
+
 namespace WebCore {
 
 ScrollbarTheme* ScrollbarTheme::nativeTheme()
@@ -37,5 +44,93 @@
     return &theme;
 }
 
+static const int defaultThickness = 10;
+static const int scrollbarThumbMin = 2;
+
+typedef HashSet<Scrollbar*> ScrollbarMap;
+static ScrollbarMap& scrollbarMap()
+{
+    static NeverDestroyed<ScrollbarMap> map;
+    return map;
 }
 
+ScrollbarThemeEfl::~ScrollbarThemeEfl()
+{
+}
+
+int ScrollbarThemeEfl::scrollbarThickness(ScrollbarControlSize)
+{
+    return defaultThickness;
+}
+
+bool ScrollbarThemeEfl::hasThumb(Scrollbar& scrollbar)
+{
+    return thumbLength(scrollbar) > 0;
+}
+
+IntRect ScrollbarThemeEfl::backButtonRect(Scrollbar&, ScrollbarPart, bool)
+{
+    notImplemented();
+    return IntRect();
+}
+
+IntRect ScrollbarThemeEfl::forwardButtonRect(Scrollbar&, ScrollbarPart, bool)
+{
+    notImplemented();
+    return IntRect();
+}
+
+IntRect ScrollbarThemeEfl::trackRect(Scrollbar& scrollbar, bool)
+{
+    return scrollbar.frameRect();
+}
+
+int ScrollbarThemeEfl::minimumThumbLength(Scrollbar&)
+{
+    return scrollbarThumbMin;
+}
+
+void ScrollbarThemeEfl::paintTrackBackground(GraphicsContext& context, Scrollbar& scrollbar, const IntRect& rect)
+{
+    loadThemeIfNeeded(scrollbar);
+    m_theme->paintThemePart(context, (scrollbar.orientation() == HorizontalScrollbar) ? ScrollbarHorizontalTrackBackground : ScrollbarVerticalTrackBackground, rect);
+}
+
+void ScrollbarThemeEfl::paintThumb(GraphicsContext& context, Scrollbar& scrollbar, const IntRect& thumbRect)
+{
+    loadThemeIfNeeded(scrollbar);
+    m_theme->paintThemePart(context, (scrollbar.orientation() == HorizontalScrollbar) ? ScrollbarHorizontalThumb : ScrollbarVerticalThumb, thumbRect);
+}
+
+void ScrollbarThemeEfl::registerScrollbar(Scrollbar& scrollbar)
+{
+    scrollbar.setEnabled(true);
+    scrollbarMap().add(&scrollbar);
+}
+
+void ScrollbarThemeEfl::unregisterScrollbar(Scrollbar& scrollbar)
+{
+    scrollbarMap().remove(&scrollbar);
+}
+
+void ScrollbarThemeEfl::loadThemeIfNeeded(Scrollbar& scrollbar)
+{
+    if (m_theme)
+        return;
+
+    ScrollView* view = scrollbar.parent();
+    if (!view)
+        return;
+
+    if (!is<FrameView>(view))
+        return;
+
+    Page* page = downcast<FrameView>(view)->frame().page();
+    if (!page)
+        return;
+
+    m_theme = static_cast<RenderThemeEfl*>(&page->theme());
+}
+
+}
+

Modified: trunk/Source/WebCore/platform/efl/ScrollbarThemeEfl.h (186828 => 186829)


--- trunk/Source/WebCore/platform/efl/ScrollbarThemeEfl.h	2015-07-15 02:12:16 UTC (rev 186828)
+++ trunk/Source/WebCore/platform/efl/ScrollbarThemeEfl.h	2015-07-15 04:16:27 UTC (rev 186829)
@@ -29,19 +29,40 @@
 #ifndef ScrollbarThemeEfl_h
 #define ScrollbarThemeEfl_h
 
-#include "ScrollbarTheme.h"
+#include "ScrollbarThemeComposite.h"
 
 namespace WebCore {
 
-class ScrollbarThemeEfl final : public ScrollbarTheme {
+class RenderThemeEfl;
+
+class ScrollbarThemeEfl final : public ScrollbarThemeComposite {
 public:
-    ScrollbarThemeEfl() : m_scrollbarThickness(0) { }
+    ~ScrollbarThemeEfl();
+
+    virtual int scrollbarThickness(ScrollbarControlSize = RegularScrollbar) override;
     void setScrollbarThickness(int thickness) { m_scrollbarThickness = thickness; }
-    virtual int scrollbarThickness(ScrollbarControlSize = RegularScrollbar) override { return m_scrollbarThickness; }
 
-    virtual void registerScrollbar(Scrollbar&) override { }
-    virtual void unregisterScrollbar(Scrollbar&) override { }
+protected:
+    virtual bool usesOverlayScrollbars() const override { return true; }
+    virtual bool hasButtons(Scrollbar&) override { return false; }
+    virtual bool hasThumb(Scrollbar&) override;
+
+    virtual IntRect backButtonRect(Scrollbar&, ScrollbarPart, bool) override;
+    virtual IntRect forwardButtonRect(Scrollbar&, ScrollbarPart, bool) override;
+    virtual IntRect trackRect(Scrollbar&, bool) override;
+
+    virtual int minimumThumbLength(Scrollbar&) override;
+
+    virtual void paintTrackBackground(GraphicsContext&, Scrollbar&, const IntRect&) override;
+    virtual void paintThumb(GraphicsContext&, Scrollbar&, const IntRect&) override;
+
+    virtual void registerScrollbar(Scrollbar&) override;
+    virtual void unregisterScrollbar(Scrollbar&) override;
+
 private:
+    void loadThemeIfNeeded(Scrollbar&);
+
+    RefPtr<RenderThemeEfl> m_theme;
     int m_scrollbarThickness;
 };
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to