Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add STAT table to CanvasTest.ttf, to ensure macOS uses OS_2 sTypo ascent&descent #17474

Merged

Conversation

squelart
Copy link
Contributor

@squelart squelart commented Sep 6, 2023

50cfb6a

Add STAT table to CanvasTest.ttf, to ensure macOS uses OS_2 sTypo ascent&descent
https://bugs.webkit.org/show_bug.cgi?id=261871
rdar://115148836

Reviewed by Myles C. Maxfield.

CoreText uses metrics from the font's hhea table by default.
However if there is a STAT table, CT will respect the USE_TYPO_METRICS flag (already set) and used the
OS/2 sTypo metrics instead, which have the ascent&descent that WPT tests expect.

This fixes a lot of canvas "text" tests on macOS. And related platform-specific "-expected" files are
now redundant.

* LayoutTests/imported/w3c/fonts/CanvasTest-ascent256.ttf:
* LayoutTests/imported/w3c/fonts/CanvasTest-descent0.ttf:
* LayoutTests/imported/w3c/fonts/CanvasTest.ttf:
* LayoutTests/imported/w3c/web-platform-tests/fonts/CanvasTest-ascent256.ttf:
* LayoutTests/imported/w3c/web-platform-tests/fonts/CanvasTest-descent0.ttf:
* LayoutTests/imported/w3c/web-platform-tests/fonts/CanvasTest.ttf:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.draw.baseline.bottom-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.draw.baseline.ideographic-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.draw.baseline.middle-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.draw.baseline.top-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.measure.baselines-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.measure.emHeights-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.measure.emHeights-low-ascent-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.measure.emHeights-zero-descent-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.measure.fontBoundingBox-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.measure.fontBoundingBox-reduced-ascent-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.measure.fontBoundingBox-zero-descent-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.draw.baseline.bottom-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.draw.baseline.bottom.worker-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.draw.baseline.ideographic-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.draw.baseline.ideographic.worker-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.draw.baseline.middle-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.draw.baseline.middle.worker-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.draw.baseline.top-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.draw.baseline.top.worker-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.baselines-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.baselines.worker-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.emHeights-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.emHeights-low-ascent-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.emHeights-low-ascent.worker-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.emHeights-zero-descent-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.emHeights-zero-descent.worker-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.emHeights.worker-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-reduced-ascent-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-reduced-ascent.worker-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-zero-descent-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-zero-descent.worker-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox.worker-expected.txt:
* LayoutTests/platform/glib/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.draw.baseline.ideographic-expected.txt: Removed.
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.draw.baseline.bottom-expected.txt: Removed.
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.draw.baseline.middle-expected.txt: Removed.
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.draw.baseline.top-expected.txt: Removed.
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.measure.baselines-expected.txt: Removed.
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.measure.emHeights-expected.txt: Removed.
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.measure.emHeights-low-ascent-expected.txt: Removed.
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.measure.emHeights-zero-descent-expected.txt: Removed.
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.measure.fontBoundingBox-expected.txt: Removed.
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.measure.fontBoundingBox-reduced-ascent-expected.txt: Removed.
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.measure.fontBoundingBox-zero-descent-expected.txt: Removed.
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.draw.baseline.bottom-expected.txt: Removed.
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.draw.baseline.bottom.worker-expected.txt: Removed.
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.draw.baseline.ideographic-expected.txt: Removed.
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.draw.baseline.ideographic.worker-expected.txt: Removed.
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.draw.baseline.middle-expected.txt: Removed.
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.draw.baseline.middle.worker-expected.txt: Removed.
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.draw.baseline.top-expected.txt: Removed.
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.draw.baseline.top.worker-expected.txt: Removed.
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.baselines-expected.txt: Removed.
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.baselines.worker-expected.txt: Removed.
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.emHeights-expected.txt: Removed.
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.emHeights-low-ascent-expected.txt: Removed.
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.emHeights-low-ascent.worker-expected.txt: Removed.
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.emHeights-zero-descent-expected.txt: Removed.
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.emHeights-zero-descent.worker-expected.txt: Removed.
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.emHeights.worker-expected.txt: Removed.
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-expected.txt: Removed.
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-reduced-ascent-expected.txt: Removed.
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-reduced-ascent.worker-expected.txt: Removed.
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-zero-descent-expected.txt: Removed.
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-zero-descent.worker-expected.txt: Removed.
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox.worker-expected.txt: Removed.
* LayoutTests/platform/ios/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.draw.baseline.ideographic-expected.txt: Removed.
* LayoutTests/platform/ios/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.measure.baselines-expected.txt: Removed.
* LayoutTests/platform/ios/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.measure.emHeights-expected.txt: Removed.
* LayoutTests/platform/ios/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.measure.emHeights-low-ascent-expected.txt: Removed.
* LayoutTests/platform/ios/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.measure.emHeights-zero-descent-expected.txt: Removed.
* LayoutTests/platform/ios/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.measure.fontBoundingBox-expected.txt: Removed.
* LayoutTests/platform/ios/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.measure.fontBoundingBox-reduced-ascent-expected.txt: Removed.
* LayoutTests/platform/ios/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.measure.fontBoundingBox-zero-descent-expected.txt: Removed.
* LayoutTests/platform/ios/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.draw.baseline.ideographic-expected.txt: Removed.
* LayoutTests/platform/ios/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.draw.baseline.ideographic.worker-expected.txt: Removed.
* LayoutTests/platform/ios/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.baselines-expected.txt: Removed.
* LayoutTests/platform/ios/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.baselines.worker-expected.txt: Removed.
* LayoutTests/platform/ios/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.emHeights-expected.txt: Removed.
* LayoutTests/platform/ios/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.emHeights-low-ascent-expected.txt: Removed.
* LayoutTests/platform/ios/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.emHeights-low-ascent.worker-expected.txt: Removed.
* LayoutTests/platform/ios/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.emHeights-zero-descent-expected.txt: Removed.
* LayoutTests/platform/ios/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.emHeights-zero-descent.worker-expected.txt: Removed.
* LayoutTests/platform/ios/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.emHeights.worker-expected.txt: Removed.
* LayoutTests/platform/ios/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-expected.txt: Removed.
* LayoutTests/platform/ios/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-reduced-ascent-expected.txt: Removed.
* LayoutTests/platform/ios/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-reduced-ascent.worker-expected.txt: Removed.
* LayoutTests/platform/ios/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-zero-descent-expected.txt: Removed.
* LayoutTests/platform/ios/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-zero-descent.worker-expected.txt: Removed.
* LayoutTests/platform/ios/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox.worker-expected.txt: Removed.
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.draw.baseline.bottom-expected.txt: Removed.
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.draw.baseline.middle-expected.txt: Removed.
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.draw.baseline.top-expected.txt: Removed.
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.measure.baselines-expected.txt: Removed.
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.measure.emHeights-expected.txt: Removed.
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.measure.emHeights-low-ascent-expected.txt: Removed.
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.measure.emHeights-zero-descent-expected.txt: Removed.
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.measure.fontBoundingBox-expected.txt: Removed.
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.measure.fontBoundingBox-reduced-ascent-expected.txt: Removed.
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.measure.fontBoundingBox-zero-descent-expected.txt: Removed.
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.draw.baseline.bottom-expected.txt: Removed.
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.draw.baseline.bottom.worker-expected.txt: Removed.
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.draw.baseline.ideographic-expected.txt: Removed.
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.draw.baseline.middle-expected.txt: Removed.
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.draw.baseline.middle.worker-expected.txt: Removed.
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.draw.baseline.top-expected.txt: Removed.
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.draw.baseline.top.worker-expected.txt: Removed.
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.baselines-expected.txt: Removed.
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.baselines.worker-expected.txt: Removed.
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.emHeights-expected.txt: Removed.
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.emHeights-low-ascent-expected.txt: Removed.
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.emHeights-low-ascent.worker-expected.txt: Removed.
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.emHeights-zero-descent-expected.txt: Removed.
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.emHeights-zero-descent.worker-expected.txt: Removed.
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.emHeights.worker-expected.txt: Removed.
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-expected.txt: Removed.
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-reduced-ascent-expected.txt: Removed.
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-reduced-ascent.worker-expected.txt: Removed.
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-zero-descent-expected.txt: Removed.
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-zero-descent.worker-expected.txt: Removed.
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox.worker-expected.txt: Removed.

Canonical link: https://commits.webkit.org/268275@main

4a6c744

Misc iOS, tvOS & watchOS macOS Linux Windows
βœ… πŸ§ͺ style βœ… πŸ›  ios βœ… πŸ›  mac βœ… πŸ›  wpe βœ… πŸ›  wincairo
βœ… πŸ›  ios-sim βœ… πŸ›  mac-AS-debug βœ… πŸ§ͺ wpe-wk2
βœ… πŸ§ͺ webkitperl βœ… πŸ§ͺ ios-wk2 βœ… πŸ§ͺ api-mac βœ… πŸ›  gtk
βœ… πŸ§ͺ ios-wk2-wpt βœ… πŸ§ͺ mac-wk1 βœ… πŸ§ͺ gtk-wk2
βœ… πŸ§ͺ api-ios βœ… πŸ§ͺ mac-wk2 βœ… πŸ§ͺ api-gtk
βœ… πŸ›  tv βœ… πŸ§ͺ mac-AS-debug-wk2
βœ… πŸ›  tv-sim
βœ… πŸ›  πŸ§ͺ merge βœ… πŸ›  watch
βœ… πŸ›  watch-sim

@squelart squelart self-assigned this Sep 6, 2023
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Sep 6, 2023
@squelart squelart removed the merging-blocked Applied to prevent a change from being merged label Sep 7, 2023
@squelart squelart force-pushed the eng/canvastests-ttf-with-stat-table branch from dd937e9 to 7a84978 Compare September 7, 2023 06:00
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Sep 7, 2023
@squelart squelart removed the merging-blocked Applied to prevent a change from being merged label Sep 7, 2023
@squelart squelart force-pushed the eng/canvastests-ttf-with-stat-table branch from 7a84978 to cf47771 Compare September 7, 2023 11:38
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Sep 7, 2023
@squelart squelart removed the merging-blocked Applied to prevent a change from being merged label Sep 7, 2023
@squelart squelart force-pushed the eng/canvastests-ttf-with-stat-table branch from cf47771 to 85f76cf Compare September 7, 2023 23:49
@squelart squelart force-pushed the eng/canvastests-ttf-with-stat-table branch from 85f76cf to 735d06b Compare September 8, 2023 00:47
@squelart squelart force-pushed the eng/canvastests-ttf-with-stat-table branch from 735d06b to f69f61a Compare September 8, 2023 02:14
@squelart squelart marked this pull request as ready for review September 8, 2023 02:15
@squelart squelart force-pushed the eng/canvastests-ttf-with-stat-table branch from f69f61a to f3df480 Compare September 20, 2023 21:12
@squelart squelart force-pushed the eng/canvastests-ttf-with-stat-table branch from f3df480 to 4a6c744 Compare September 21, 2023 11:12
@squelart squelart added the Canvas Bugs related to the canvas element. label Sep 21, 2023
…ent&descent

https://bugs.webkit.org/show_bug.cgi?id=261871
rdar://115148836

Reviewed by Myles C. Maxfield.

CoreText uses metrics from the font's hhea table by default.
However if there is a STAT table, CT will respect the USE_TYPO_METRICS flag (already set) and used the
OS/2 sTypo metrics instead, which have the ascent&descent that WPT tests expect.

This fixes a lot of canvas "text" tests on macOS. And related platform-specific "-expected" files are
now redundant.

* LayoutTests/imported/w3c/fonts/CanvasTest-ascent256.ttf:
* LayoutTests/imported/w3c/fonts/CanvasTest-descent0.ttf:
* LayoutTests/imported/w3c/fonts/CanvasTest.ttf:
* LayoutTests/imported/w3c/web-platform-tests/fonts/CanvasTest-ascent256.ttf:
* LayoutTests/imported/w3c/web-platform-tests/fonts/CanvasTest-descent0.ttf:
* LayoutTests/imported/w3c/web-platform-tests/fonts/CanvasTest.ttf:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.draw.baseline.bottom-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.draw.baseline.ideographic-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.draw.baseline.middle-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.draw.baseline.top-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.measure.baselines-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.measure.emHeights-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.measure.emHeights-low-ascent-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.measure.emHeights-zero-descent-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.measure.fontBoundingBox-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.measure.fontBoundingBox-reduced-ascent-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.measure.fontBoundingBox-zero-descent-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.draw.baseline.bottom-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.draw.baseline.bottom.worker-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.draw.baseline.ideographic-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.draw.baseline.ideographic.worker-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.draw.baseline.middle-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.draw.baseline.middle.worker-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.draw.baseline.top-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.draw.baseline.top.worker-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.baselines-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.baselines.worker-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.emHeights-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.emHeights-low-ascent-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.emHeights-low-ascent.worker-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.emHeights-zero-descent-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.emHeights-zero-descent.worker-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.emHeights.worker-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-reduced-ascent-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-reduced-ascent.worker-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-zero-descent-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-zero-descent.worker-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox.worker-expected.txt:
* LayoutTests/platform/glib/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.draw.baseline.ideographic-expected.txt: Removed.
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.draw.baseline.bottom-expected.txt: Removed.
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.draw.baseline.middle-expected.txt: Removed.
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.draw.baseline.top-expected.txt: Removed.
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.measure.baselines-expected.txt: Removed.
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.measure.emHeights-expected.txt: Removed.
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.measure.emHeights-low-ascent-expected.txt: Removed.
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.measure.emHeights-zero-descent-expected.txt: Removed.
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.measure.fontBoundingBox-expected.txt: Removed.
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.measure.fontBoundingBox-reduced-ascent-expected.txt: Removed.
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.measure.fontBoundingBox-zero-descent-expected.txt: Removed.
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.draw.baseline.bottom-expected.txt: Removed.
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.draw.baseline.bottom.worker-expected.txt: Removed.
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.draw.baseline.ideographic-expected.txt: Removed.
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.draw.baseline.ideographic.worker-expected.txt: Removed.
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.draw.baseline.middle-expected.txt: Removed.
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.draw.baseline.middle.worker-expected.txt: Removed.
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.draw.baseline.top-expected.txt: Removed.
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.draw.baseline.top.worker-expected.txt: Removed.
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.baselines-expected.txt: Removed.
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.baselines.worker-expected.txt: Removed.
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.emHeights-expected.txt: Removed.
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.emHeights-low-ascent-expected.txt: Removed.
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.emHeights-low-ascent.worker-expected.txt: Removed.
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.emHeights-zero-descent-expected.txt: Removed.
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.emHeights-zero-descent.worker-expected.txt: Removed.
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.emHeights.worker-expected.txt: Removed.
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-expected.txt: Removed.
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-reduced-ascent-expected.txt: Removed.
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-reduced-ascent.worker-expected.txt: Removed.
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-zero-descent-expected.txt: Removed.
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-zero-descent.worker-expected.txt: Removed.
* LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox.worker-expected.txt: Removed.
* LayoutTests/platform/ios/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.draw.baseline.ideographic-expected.txt: Removed.
* LayoutTests/platform/ios/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.measure.baselines-expected.txt: Removed.
* LayoutTests/platform/ios/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.measure.emHeights-expected.txt: Removed.
* LayoutTests/platform/ios/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.measure.emHeights-low-ascent-expected.txt: Removed.
* LayoutTests/platform/ios/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.measure.emHeights-zero-descent-expected.txt: Removed.
* LayoutTests/platform/ios/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.measure.fontBoundingBox-expected.txt: Removed.
* LayoutTests/platform/ios/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.measure.fontBoundingBox-reduced-ascent-expected.txt: Removed.
* LayoutTests/platform/ios/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.measure.fontBoundingBox-zero-descent-expected.txt: Removed.
* LayoutTests/platform/ios/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.draw.baseline.ideographic-expected.txt: Removed.
* LayoutTests/platform/ios/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.draw.baseline.ideographic.worker-expected.txt: Removed.
* LayoutTests/platform/ios/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.baselines-expected.txt: Removed.
* LayoutTests/platform/ios/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.baselines.worker-expected.txt: Removed.
* LayoutTests/platform/ios/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.emHeights-expected.txt: Removed.
* LayoutTests/platform/ios/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.emHeights-low-ascent-expected.txt: Removed.
* LayoutTests/platform/ios/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.emHeights-low-ascent.worker-expected.txt: Removed.
* LayoutTests/platform/ios/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.emHeights-zero-descent-expected.txt: Removed.
* LayoutTests/platform/ios/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.emHeights-zero-descent.worker-expected.txt: Removed.
* LayoutTests/platform/ios/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.emHeights.worker-expected.txt: Removed.
* LayoutTests/platform/ios/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-expected.txt: Removed.
* LayoutTests/platform/ios/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-reduced-ascent-expected.txt: Removed.
* LayoutTests/platform/ios/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-reduced-ascent.worker-expected.txt: Removed.
* LayoutTests/platform/ios/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-zero-descent-expected.txt: Removed.
* LayoutTests/platform/ios/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-zero-descent.worker-expected.txt: Removed.
* LayoutTests/platform/ios/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox.worker-expected.txt: Removed.
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.draw.baseline.bottom-expected.txt: Removed.
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.draw.baseline.middle-expected.txt: Removed.
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.draw.baseline.top-expected.txt: Removed.
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.measure.baselines-expected.txt: Removed.
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.measure.emHeights-expected.txt: Removed.
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.measure.emHeights-low-ascent-expected.txt: Removed.
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.measure.emHeights-zero-descent-expected.txt: Removed.
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.measure.fontBoundingBox-expected.txt: Removed.
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.measure.fontBoundingBox-reduced-ascent-expected.txt: Removed.
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/canvas/element/text/2d.text.measure.fontBoundingBox-zero-descent-expected.txt: Removed.
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.draw.baseline.bottom-expected.txt: Removed.
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.draw.baseline.bottom.worker-expected.txt: Removed.
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.draw.baseline.ideographic-expected.txt: Removed.
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.draw.baseline.middle-expected.txt: Removed.
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.draw.baseline.middle.worker-expected.txt: Removed.
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.draw.baseline.top-expected.txt: Removed.
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.draw.baseline.top.worker-expected.txt: Removed.
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.baselines-expected.txt: Removed.
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.baselines.worker-expected.txt: Removed.
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.emHeights-expected.txt: Removed.
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.emHeights-low-ascent-expected.txt: Removed.
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.emHeights-low-ascent.worker-expected.txt: Removed.
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.emHeights-zero-descent-expected.txt: Removed.
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.emHeights-zero-descent.worker-expected.txt: Removed.
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.emHeights.worker-expected.txt: Removed.
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-expected.txt: Removed.
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-reduced-ascent-expected.txt: Removed.
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-reduced-ascent.worker-expected.txt: Removed.
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-zero-descent-expected.txt: Removed.
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-zero-descent.worker-expected.txt: Removed.
* LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox.worker-expected.txt: Removed.

Canonical link: https://commits.webkit.org/268275@main
@webkit-commit-queue webkit-commit-queue merged commit 50cfb6a into WebKit:main Sep 21, 2023
@webkit-commit-queue
Copy link
Collaborator

Committed 268275@main (50cfb6a): https://commits.webkit.org/268275@main

Reviewed commits have been landed. Closing PR #17474 and removing active labels.

@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label Sep 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Canvas Bugs related to the canvas element.
Projects
None yet
5 participants