Bug 221103 - font-stretch is not applied to system-ui
Summary: font-stretch is not applied to system-ui
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Myles C. Maxfield
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-01-28 14:25 PST by Myles C. Maxfield
Modified: 2021-02-04 19:01 PST (History)
6 users (show)

See Also:


Attachments
Patch (18.78 KB, patch)
2021-01-28 14:26 PST, Myles C. Maxfield
no flags Details | Formatted Diff | Diff
Patch (17.96 KB, patch)
2021-01-28 14:27 PST, Myles C. Maxfield
darin: review+
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch for committing (28.60 KB, patch)
2021-01-28 17:34 PST, Myles C. Maxfield
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch for committing (27.97 KB, patch)
2021-01-28 18:52 PST, Myles C. Maxfield
no flags Details | Formatted Diff | Diff
Patch for committing (27.98 KB, patch)
2021-01-28 19:45 PST, Myles C. Maxfield
ews-feeder: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Myles C. Maxfield 2021-01-28 14:25:27 PST
font-stretch is not applied to system-ui
Comment 1 Myles C. Maxfield 2021-01-28 14:26:21 PST
Created attachment 418668 [details]
Patch
Comment 2 Myles C. Maxfield 2021-01-28 14:26:24 PST
<rdar://problem/73719139>
Comment 3 Myles C. Maxfield 2021-01-28 14:27:44 PST
Created attachment 418669 [details]
Patch
Comment 4 Darin Adler 2021-01-28 14:34:03 PST
Comment on attachment 418668 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=418668&action=review

> Source/WTF/wtf/PlatformHave.h:855
> +#else
> +#define HAVE_LEVEL_1_SYSTEM_FONT_WIDTH_VALUES 1

This doesn’t seem right. It’s going to be set for non-Cocoa platforms? Maybe it should be #elif PLATFORM(COCOA)? Or omitted entirely. It seems we don’t use it.

> Source/WebCore/WebCore.xcodeproj/xcshareddata/xcschemes/WebCore.xcscheme:46
> +         FilePath = "/Users/mmaxfield/Build/Products/Debug/MiniBrowser.app">

Probably should not land this. Irritating that this is so easy to do by accident — I find this kind of thing in my patches regularly too.

> Source/WebCore/platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp:84
> +    // FIXME: Use createFontByApplyingWeightWidthItalicsAndFallbackBehavior() once <rdar://problem/33046041> is fixed.

The wording of this comment seems outdated. That bug was fixed in 2017.

> Source/WebCore/platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp:227
> +    for (size_t i = 0; i < WTF_ARRAY_LENGTH(piecewisePoints) - 1; ++i) {

Can use std::size instead of WTF_ARRAY_LENGTH.

> Source/WebCore/platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp:234
> +    return piecewisePoints[WTF_ARRAY_LENGTH(piecewisePoints) - 1].output;

Ditto.

> LayoutTests/ChangeLog:9
> +        * fast/text/system-font-width-expected-mismatch.html: Added.

With multiple tables of different weights and quite a bit of logic, seems unlikely that a single test covers enough to detect most mistakes. Further, a mismatch test is so susceptible to false negatives. I wish for a better testing strategy, without knowing what it would be.
Comment 5 Darin Adler 2021-01-28 14:34:53 PST
Comment on attachment 418669 [details]
Patch

My comments were on the previous version of the patch. I think they all still apply.
Comment 6 Myles C. Maxfield 2021-01-28 17:34:35 PST
Created attachment 418684 [details]
Patch for committing
Comment 7 Darin Adler 2021-01-28 17:54:59 PST
Comment on attachment 418684 [details]
Patch for committing

View in context: https://bugs.webkit.org/attachment.cgi?id=418684&action=review

> Source/WebCore/WebCore.xcodeproj/xcshareddata/xcschemes/WebCore.xcscheme:47
> +      <PathRunnable
> +         runnableDebuggingMode = "0"
> +         BundleIdentifier = "org.webkit.MiniBrowser"
> +         FilePath = "/Users/mmaxfield/Build/Products/Debug/MiniBrowser.app">
> +      </PathRunnable>

This is still in the patch!
Comment 8 Myles C. Maxfield 2021-01-28 18:52:54 PST
Created attachment 418691 [details]
Patch for committing
Comment 9 Myles C. Maxfield 2021-01-28 19:45:33 PST
Created attachment 418701 [details]
Patch for committing
Comment 10 Myles C. Maxfield 2021-01-29 12:20:09 PST
Committed r272073: <https://trac.webkit.org/changeset/272073>