Skip to content

Commit

Permalink
Merge r190662 - [GTK] Progress bar is broken on recent GTK+
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
changseok.oh@collabora.com authored and carlosgcampos committed Feb 27, 2016
1 parent 47311e8 commit c75b11c
Show file tree
Hide file tree
Showing 8 changed files with 74 additions and 2 deletions.
13 changes: 13 additions & 0 deletions LayoutTests/ChangeLog
@@ -1,3 +1,16 @@
2015-10-07 ChangSeok Oh <changseok.oh@collabora.com>

[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.

2014-12-07 Youenn Fablet <youenn.fablet@crf.canon.fr>

[Soup][Curl] HTTP header values should be treated as latin1, not UTF-8
Expand Down
@@ -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>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -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
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -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
18 changes: 18 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,21 @@
2015-10-07 ChangSeok Oh <changseok.oh@collabora.com>

[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-04-15 Руслан Ижбулатов <lrn1986@gmail.com>

WebCore uses M_PI_2 instead of piOverTwoDouble
Expand Down
9 changes: 7 additions & 2 deletions Source/WebCore/platform/gtk/RenderThemeGtk3.cpp
Expand Up @@ -759,9 +759,14 @@ bool RenderThemeGtk::paintProgressBar(RenderObject* renderObject, const PaintInf
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;
}
Expand Down

0 comments on commit c75b11c

Please sign in to comment.