[webkit-changes] [WebKit/WebKit] 51f274: [GTK] Rename screenDPI() to fontDPI() where used f...
Glen Whitney
noreply at github.com
Tue Apr 16 02:50:32 PDT 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 51f27458d0d4eed34bcca196cdf4fe2252fc0340
https://github.com/WebKit/WebKit/commit/51f27458d0d4eed34bcca196cdf4fe2252fc0340
Author: Glen Whitney <glen at studioinfinity.org>
Date: 2024-04-16 (Tue, 16 Apr 2024)
Changed paths:
A LayoutTests/fast/box-sizing/247980-expected.html
A LayoutTests/fast/box-sizing/247980.html
M Source/WebCore/accessibility/atspi/AccessibilityObjectTextAtspi.cpp
M Source/WebCore/platform/PlatformScreen.h
M Source/WebCore/platform/ScreenProperties.h
M Source/WebCore/platform/graphics/gtk/SystemFontDatabaseGTK.cpp
M Source/WebCore/platform/gtk/PlatformScreenGtk.cpp
M Source/WebCore/platform/wpe/PlatformScreenWPE.cpp
M Source/WebKit/UIProcess/API/glib/WebKitProtocolHandler.cpp
M Source/WebKit/UIProcess/API/glib/WebKitSettings.cpp
Log Message:
-----------
[GTK] Rename screenDPI() to fontDPI() where used for font scaling.
https://bugs.webkit.org/show_bug.cgi?id=272676
Reviewed by Carlos Garcia Campos.
This commit lays the groundwork for addressing DPI scaling issues under
GTK, as described in the related bugzilla bug 247980, which seems to
have arisen by virtue of confusion between the physical DPI of the display
devices that WebKit is rendering on, and the GTK font scaling DPI that sets
the desired font sizes. Hence, in line with the concerns raised in the
references bug 272676, this commit renames WebCore::screenDPI() to
WebCore::fontDPI() to clarify its semantics and hopefully avoid future
similar confusions. For cases in which the underlying display density is
needed, it adds a new WebCore::screenDPI(PlatformDisplayID) function
to access that information, on a per-display basis.
This commit also creates a reftest that probes the status of the referenced
bug. Namely, the test compares a 1em box in a text size of 96px, with a
1in box. Note the test passes as the code stands, even though when I view
247980.html and 247980-expected.html in the minibrowser on my machine, the
two boxes are clearly very different in size, which is one key aspect of the
bug. Presumably, this pass occurs because the tests are run in an environment
insulated from my actual display resolution and GTK setup. Moreover, another
aspect of the bug is that when the two DPI measures referenced above agree,
both boxes should measure 1 physical inch on the screen, which they currently
do not (unless the display happens to have exactly 96 pixels per inch, low by
today's typical specs, and unlikely to happen to be the case even when device
scaling is employed). But I have no idea how such a condition could
practically be tested in the WebKit test framework.
* LayoutTests/fast/box-sizing/247980-expected.html: Added.
* LayoutTests/fast/box-sizing/247980.html: Added.
* Source/WebCore/accessibility/atspi/AccessibilityObjectTextAtspi.cpp:
(WebCore::AccessibilityObjectAtspi::textAttributes const):
* Source/WebCore/platform/PlatformScreen.h:
* Source/WebCore/platform/ScreenProperties.h:
* Source/WebCore/platform/graphics/gtk/SystemFontDatabaseGTK.cpp:
(WebCore::SystemFontDatabase::platformSystemFontShorthandInfo):
* Source/WebCore/platform/gtk/PlatformScreenGtk.cpp:
(WebCore::fontDPI):
(WebCore::screenDPI):
* Source/WebCore/platform/wpe/PlatformScreenWPE.cpp:
(WebCore::fontDPI):
(WebCore::screenDPI):
* Source/WebKit/UIProcess/API/glib/WebKitProtocolHandler.cpp:
(WebKit::WebKitProtocolHandler::handleGPU):
* Source/WebKit/UIProcess/API/glib/WebKitSettings.cpp:
(webkit_settings_font_size_to_points):
(webkit_settings_font_size_to_pixels):
Canonical link: https://commits.webkit.org/277537@main
To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications
More information about the webkit-changes
mailing list