[Webkit-unassigned] [Bug 142673] [GTK] Add settings to set font size in points, and deprecate the pixel size settings

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Nov 3 05:19:07 PDT 2017


https://bugs.webkit.org/show_bug.cgi?id=142673

--- Comment #33 from Gabriel Ivașcu <givascu at igalia.com> ---
(In reply to Carlos Garcia Campos from comment #32)
> Comment on attachment 325469 [details]
> 
> > Source/WebKit/UIProcess/API/glib/WebKitSettings.cpp:83
> > +    gulong gtkXftDpiChangedHandlerID { 0 };
> 
> This is already set to 0 on allocation.

Hmmm Michael explicitly said that the fields in the private structure are not guaranteed to be zero-initialized.

> > Source/WebKit/UIProcess/API/glib/WebKitSettings.cpp:2234
> > +guint32 webkit_settings_get_default_font_size_pts(WebKitSettings* settings)
> > +{
> > +    g_return_val_if_fail(WEBKIT_IS_SETTINGS(settings), 0);
> > +
> > +    return convertPixelsToPoints(settings->priv->preferences->defaultFontSize(), settings->priv->screenDPI);
> 
> Since we are updating the same thing underneath, I wonder why we need new
> settings and deprecate the old ones. We could simply add these new functions
> to set/get the same setting but using points instead of pixels.

I think keeping the old properties in pixels and only adding font size setter/getter in points partially defeats the purpose of this bug. One of the goals was to make users not have to handle pixel values anymore, by getting rid of the pixel properties eventually in the future. (The other goal was to make the text scale automatically when the DPI changes.)

> > Tools/TestWebKitAPI/Tests/WebKitGLib/TestWebKitSettings.cpp:-152
> > -    g_assert_cmpuint(webkit_settings_get_minimum_font_size(settings), ==, 7);
> 
> I think you can leave this here and add another specific test case for
> checking the updates after the dpi change.

The minimum font size is not altered by the DPI change, it remains the same.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20171103/795ace5c/attachment-0001.html>


More information about the webkit-unassigned mailing list