RESOLVED FIXED 80032
[GTK] Simplify the code to adjust font sizes depending on screen DPI
https://bugs.webkit.org/show_bug.cgi?id=80032
Summary [GTK] Simplify the code to adjust font sizes depending on screen DPI
Carlos Garcia Campos
Reported 2012-03-01 09:28:14 PST
So that it can be used by both WebKit1 and WebKit2
Attachments
Patch (7.53 KB, patch)
2012-03-01 09:33 PST, Carlos Garcia Campos
mrobinson: review+
Updated patch (6.17 KB, patch)
2012-03-01 10:15 PST, Carlos Garcia Campos
mrobinson: review+
Martin Robinson
Comment 1 2012-03-01 09:31:06 PST
I don't believe that WebKit2 needs to use this code.
Carlos Garcia Campos
Comment 2 2012-03-01 09:33:56 PST
WebKit Review Bot
Comment 3 2012-03-01 09:39:37 PST
Attachment 129715 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'ChangeLog', u'LayoutTests/ChangeLog', u'La..." exit_code: 1 WARNING: File exempt from style guide. Skipping: "Source/WebKit2/UIProcess/API/gtk/WebKitDefines.h" Source/WebKit2/WebProcess/gtk/WebProcessMainGtk.cpp:71: Use 0 instead of NULL. [readability/null] [5] Total errors found: 1 in 193 files If any of these errors are false positives, please file a bug against check-webkit-style.
Carlos Garcia Campos
Comment 4 2012-03-01 09:50:45 PST
Ok, I didn't know we didn't wat to use the screen dpi in wk2, the patch still makes the wk1 code a lot simpler and cleaner IMO.
Martin Robinson
Comment 5 2012-03-01 09:57:11 PST
Comment on attachment 129715 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=129715&action=review > Source/WebCore/platform/gtk/GtkUtilities.cpp:65 > + static const double kMillimetresPerInch = 25.4; > + double diagonalSizeInPixels = hypot(gdk_screen_get_width(screen), gdk_screen_get_height(screen)); > + double diagonalSizeInInches = hypot(gdk_screen_get_width_mm(screen), gdk_screen_get_height_mm(screen)) / kMillimetresPerInch; > + return diagonalSizeInPixels / diagonalSizeInInches; I like the way you're falling back here.
Carlos Garcia Campos
Comment 6 2012-03-01 10:15:49 PST
Created attachment 129723 [details] Updated patch Moved the code from web core back to webkit but leaving the cleaner code.
Carlos Garcia Campos
Comment 7 2012-03-01 23:33:48 PST
Note You need to log in before you can comment on or make changes to this bug.