-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Cherry-pick 277537@main (51f2745). https://bugs.webkit.org/show_bug.c…
…gi?id=272676 [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 Canonical link: https://commits.webkit.org/274313.194@webkitglib/2.44
- Loading branch information
Showing
10 changed files
with
45 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<body style="font-size:96px;"> | ||
<hr style="width:1in;height:1in;"> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<body style="font-size:96px;"> | ||
<hr style="width:1em;height:1em;"> | ||
<!-- The box produced by this hr element should be identical in size | ||
to one with a width and height of 1in in CSS units, since 1em is | ||
defined as the nominal font size, which has been set to 96px. And | ||
that dimension 96px is in turn required by the CSS standard to equal | ||
1in. Also, the box should in either case measure exactly one inch on | ||
screen, but it's not clear to me how to test that in WebKit's testing | ||
framework. | ||
--> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters