Title: [190662] trunk
Revision
190662
Author
[email protected]
Date
2015-10-07 00:32:14 -0700 (Wed, 07 Oct 2015)

Log Message

[GTK] Progress bar is broken on recent GTK+
https://bugs.webkit.org/show_bug.cgi?id=149831

Reviewed by Carlos Garcia Campos.

Source/WebCore:

The gtk progress bar has been broken after bumping up to Gtk+-3.16. This is because
the way of rendering progress bar changed after gtk+-3.13.7. See more
https://mail.gnome.org/archives/commits-list/2014-August/msg03865.html
gtk_render_activity is no longer valid to paint a progress bar on a newer gtk+.
It should be done with gtk_render_background and gtk_render_frame.

Test: fast/dom/HTMLProgressElement/native-progress-bar.html

* rendering/RenderThemeGtk.cpp:
(WebCore::RenderThemeGtk::paintProgressBar):

LayoutTests:

* fast/dom/HTMLProgressElement/native-progress-bar.html: Added.
* platform/gtk/fast/dom/HTMLProgressElement/native-progress-bar-expected.png: Added.
* platform/gtk/fast/dom/HTMLProgressElement/native-progress-bar-expected.txt: Added.
* platform/mac/fast/dom/HTMLProgressElement/native-progress-bar-expected.png: Added.
* platform/mac/fast/dom/HTMLProgressElement/native-progress-bar-expected.txt: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (190661 => 190662)


--- trunk/LayoutTests/ChangeLog	2015-10-07 07:11:08 UTC (rev 190661)
+++ trunk/LayoutTests/ChangeLog	2015-10-07 07:32:14 UTC (rev 190662)
@@ -1,3 +1,16 @@
+2015-10-07  ChangSeok Oh  <[email protected]>
+
+        [GTK] Progress bar is broken on recent GTK+
+        https://bugs.webkit.org/show_bug.cgi?id=149831
+
+        Reviewed by Carlos Garcia Campos.
+
+        * fast/dom/HTMLProgressElement/native-progress-bar.html: Added.
+        * platform/gtk/fast/dom/HTMLProgressElement/native-progress-bar-expected.png: Added.
+        * platform/gtk/fast/dom/HTMLProgressElement/native-progress-bar-expected.txt: Added.
+        * platform/mac/fast/dom/HTMLProgressElement/native-progress-bar-expected.png: Added.
+        * platform/mac/fast/dom/HTMLProgressElement/native-progress-bar-expected.txt: Added.
+
 2015-10-06  Jon Honeycutt  <[email protected]>
 
         Unreviewed iOS test gardening after r190629.

Added: trunk/LayoutTests/fast/dom/HTMLProgressElement/native-progress-bar.html (0 => 190662)


--- trunk/LayoutTests/fast/dom/HTMLProgressElement/native-progress-bar.html	                        (rev 0)
+++ trunk/LayoutTests/fast/dom/HTMLProgressElement/native-progress-bar.html	2015-10-07 07:32:14 UTC (rev 190662)
@@ -0,0 +1,4 @@
+<!DOCTYPE html>
+<p>Test passes if following bars are filled 30% with a color.<p>
+<progress value="30" max="100"></progress><br>
+<progress value="30" max="100" style="-webkit-appearance:none;"></progress>

Added: trunk/LayoutTests/platform/gtk/fast/dom/HTMLProgressElement/native-progress-bar-expected.png


(Binary files differ)
Property changes on: trunk/LayoutTests/platform/gtk/fast/dom/HTMLProgressElement/native-progress-bar-expected.png ___________________________________________________________________

Added: svn:mime-type

Added: trunk/LayoutTests/platform/gtk/fast/dom/HTMLProgressElement/native-progress-bar-expected.txt (0 => 190662)


--- trunk/LayoutTests/platform/gtk/fast/dom/HTMLProgressElement/native-progress-bar-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/gtk/fast/dom/HTMLProgressElement/native-progress-bar-expected.txt	2015-10-07 07:32:14 UTC (rev 190662)
@@ -0,0 +1,16 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x99
+  RenderBlock {HTML} at (0,0) size 800x99
+    RenderBody {BODY} at (8,16) size 784x67
+      RenderBlock {P} at (0,0) size 784x17
+        RenderText {#text} at (0,0) size 354x17
+          text run at (0,0) width 354: "Test passes if following bars are filled 30% with a color."
+      RenderBlock {P} at (0,33) size 784x34
+        RenderProgress {PROGRESS} at (0,1) size 160x17
+        RenderBR {BR} at (160,0) size 0x17
+        RenderBlock {PROGRESS} at (0,18) size 160x17
+          RenderProgress {DIV} at (0,0) size 160x16
+            RenderBlock {DIV} at (0,0) size 160x16 [bgcolor=#808080]
+              RenderBlock {DIV} at (0,0) size 48x16 [bgcolor=#008000]
+        RenderText {#text} at (0,0) size 0x0

Added: trunk/LayoutTests/platform/mac/fast/dom/HTMLProgressElement/native-progress-bar-expected.png


(Binary files differ)
Property changes on: trunk/LayoutTests/platform/mac/fast/dom/HTMLProgressElement/native-progress-bar-expected.png ___________________________________________________________________

Added: svn:mime-type

Added: trunk/LayoutTests/platform/mac/fast/dom/HTMLProgressElement/native-progress-bar-expected.txt (0 => 190662)


--- trunk/LayoutTests/platform/mac/fast/dom/HTMLProgressElement/native-progress-bar-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/fast/dom/HTMLProgressElement/native-progress-bar-expected.txt	2015-10-07 07:32:14 UTC (rev 190662)
@@ -0,0 +1,16 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x105
+  RenderBlock {HTML} at (0,0) size 800x105
+    RenderBody {BODY} at (8,16) size 784x73
+      RenderBlock {P} at (0,0) size 784x18
+        RenderText {#text} at (0,0) size 360x18
+          text run at (0,0) width 360: "Test passes if following bars are filled 30% with a color."
+      RenderBlock {P} at (0,34) size 784x39
+        RenderProgress {PROGRESS} at (0,-1) size 160x22
+        RenderBR {BR} at (160,3) size 0x18
+        RenderBlock {PROGRESS} at (0,22) size 160x17
+          RenderProgress {DIV} at (0,0) size 160x16
+            RenderBlock {DIV} at (0,0) size 160x16 [bgcolor=#808080]
+              RenderBlock {DIV} at (0,0) size 48x16 [bgcolor=#008000]
+        RenderText {#text} at (0,0) size 0x0

Modified: trunk/Source/WebCore/ChangeLog (190661 => 190662)


--- trunk/Source/WebCore/ChangeLog	2015-10-07 07:11:08 UTC (rev 190661)
+++ trunk/Source/WebCore/ChangeLog	2015-10-07 07:32:14 UTC (rev 190662)
@@ -1,3 +1,21 @@
+2015-10-07  ChangSeok Oh  <[email protected]>
+
+        [GTK] Progress bar is broken on recent GTK+
+        https://bugs.webkit.org/show_bug.cgi?id=149831
+
+        Reviewed by Carlos Garcia Campos.
+
+        The gtk progress bar has been broken after bumping up to Gtk+-3.16. This is because
+        the way of rendering progress bar changed after gtk+-3.13.7. See more
+        https://mail.gnome.org/archives/commits-list/2014-August/msg03865.html
+        gtk_render_activity is no longer valid to paint a progress bar on a newer gtk+.
+        It should be done with gtk_render_background and gtk_render_frame.
+
+        Test: fast/dom/HTMLProgressElement/native-progress-bar.html
+
+        * rendering/RenderThemeGtk.cpp:
+        (WebCore::RenderThemeGtk::paintProgressBar):
+
 2015-10-06  Michael Catanzaro  <[email protected]>
 
         [GTK] Add autocleanups

Modified: trunk/Source/WebCore/rendering/RenderThemeGtk.cpp (190661 => 190662)


--- trunk/Source/WebCore/rendering/RenderThemeGtk.cpp	2015-10-07 07:11:08 UTC (rev 190661)
+++ trunk/Source/WebCore/rendering/RenderThemeGtk.cpp	2015-10-07 07:32:14 UTC (rev 190662)
@@ -1192,8 +1192,14 @@
         rect.height() - (padding.top + padding.bottom));
     progressRect = RenderThemeGtk::calculateProgressRect(renderObject, progressRect);
 
-    if (!progressRect.isEmpty())
+    if (!progressRect.isEmpty()) {
+#if GTK_CHECK_VERSION(3, 13, 7)
+        gtk_render_background(context, paintInfo.context().platformContext()->cr(), progressRect.x(), progressRect.y(), progressRect.width(), progressRect.height());
+        gtk_render_frame(context, paintInfo.context().platformContext()->cr(), progressRect.x(), progressRect.y(), progressRect.width(), progressRect.height());
+#else
         gtk_render_activity(context, paintInfo.context().platformContext()->cr(), progressRect.x(), progressRect.y(), progressRect.width(), progressRect.height());
+#endif
+    }
 
     gtk_style_context_restore(context);
     return false;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to