From 46df95a46706f3768798869e2103026a1caacb5a Mon Sep 17 00:00:00 2001 From: Yegor Date: Tue, 6 Dec 2022 12:40:05 -0800 Subject: [PATCH] [web:canvaskit] test zero font size (flutter/engine#37916) * [web:canvaskit] test zero font size * Noop change to trigger golden uploads Co-authored-by: Mouad Debbar --- .../test/canvaskit/canvas_golden_test.dart | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/engine/src/flutter/lib/web_ui/test/canvaskit/canvas_golden_test.dart b/engine/src/flutter/lib/web_ui/test/canvaskit/canvas_golden_test.dart index c24f353a7d..d003f255d3 100644 --- a/engine/src/flutter/lib/web_ui/test/canvaskit/canvas_golden_test.dart +++ b/engine/src/flutter/lib/web_ui/test/canvaskit/canvas_golden_test.dart @@ -374,6 +374,22 @@ void testMain() { await testTextStyle('font size', fontSize: 24); }); + // A regression test for the special case when CanvasKit would default to + // a positive font size when Flutter specifies zero. + // + // See: https://github.com/flutter/flutter/issues/98248 + test('text styles - zero font size', () async { + // This only sets the inner text style, but not the paragraph style, so + // "Hello" should be visible, but "World!" should disappear. + await testTextStyle('zero font size', fontSize: 0); + + // This sets the paragraph font size to zero, but the inner text gets + // an explicit non-zero size that should override paragraph properties, + // so this time "Hello" should disappear, but "World!" should still be + // visible. + await testTextStyle('zero paragraph font size', paragraphFontSize: 0, fontSize: 14); + }); + test('text styles - letter spacing', () async { await testTextStyle('letter spacing', letterSpacing: 5); });