So that it can be used by both WebKit1 and WebKit2
I don't believe that WebKit2 needs to use this code.
Created attachment 129715 [details]
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] 
Total errors found: 1 in 193 files
If any of these errors are false positives, please file a bug against check-webkit-style.
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.
Comment on attachment 129715 [details]
View in context: https://bugs.webkit.org/attachment.cgi?id=129715&action=review
> + 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.
Created attachment 129723 [details]
Moved the code from web core back to webkit but leaving the cleaner code.
Committed r109517: <http://trac.webkit.org/changeset/109517>