Bug 38896 - [GTK] Theme does not render when printing
Summary: [GTK] Theme does not render when printing
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-11 03:56 PDT by Alejandro G. Castro
Modified: 2010-05-13 02:40 PDT (History)
1 user (show)

See Also:


Attachments
Proposed patch (5.36 KB, patch)
2010-05-12 03:03 PDT, Alejandro G. Castro
no flags Details | Formatted Diff | Diff
Proposed patch (3.50 KB, patch)
2010-05-12 03:13 PDT, Alejandro G. Castro
no flags Details | Formatted Diff | Diff
Patch (2.98 KB, patch)
2010-05-13 01:02 PDT, Alejandro G. Castro
xan.lopez: review+
xan.lopez: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alejandro G. Castro 2010-05-11 03:56:56 PDT
The theme rendering is using the gdkdrawable from the expose event, when printing there is no expose event rendering, the result is the theme (buttons, combos, etc.) are not printed.

WebCore/platform/gtk/RenderThemeGtk.cpp:
...
     if (!i.context->gdkDrawable())
        return true;
...
Comment 1 Alejandro G. Castro 2010-05-12 03:03:02 PDT
Created attachment 55822 [details]
Proposed patch
Comment 2 WebKit Review Bot 2010-05-12 03:05:26 PDT
Attachment 55822 [details] did not pass style-queue:

Failed to run "['WebKitTools/Scripts/check-webkit-style', '--no-squash']" exit_code: 1
WebCore/platform/gtk/RenderThemeGtk.cpp:288:  Declaration has space between type name and * in GdkDrawable *pixmap  [whitespace/declaration] [3]
WebCore/platform/gtk/RenderThemeGtk.cpp:293:  Use 0 instead of NULL.  [readability/null] [5]
WebCore/platform/gtk/RenderThemeGtk.cpp:330:  Declaration has space between type name and * in cairo_t *cr  [whitespace/declaration] [3]
WebCore/platform/gtk/RenderThemeGtk.cpp:322:  An else statement can be removed when the prior "if" concludes with a return, break, continue or goto statement.  [readability/control_flow] [4]
Total errors found: 4 in 2 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Alejandro G. Castro 2010-05-12 03:13:20 PDT
Created attachment 55825 [details]
Proposed patch
Comment 4 Xan Lopez 2010-05-12 05:13:57 PDT
Comment on attachment 55825 [details]
Proposed patch

We can use GRefPtr for the pixmap, so r- to do that.

It also seems when there's no expose event and printing is disabled we'll create a pixmap just to immediately destroy it, which seems a bit pointless.
Comment 5 Alejandro G. Castro 2010-05-13 01:02:45 PDT
Created attachment 55955 [details]
Patch
Comment 6 Xan Lopez 2010-05-13 01:19:58 PDT
Comment on attachment 55955 [details]
Patch

Looks good to me.
Comment 7 Alejandro G. Castro 2010-05-13 02:40:35 PDT
Landed on commit 59356.