-
Notifications
You must be signed in to change notification settings - Fork 29.2k
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: typographyText rendering, possibly libtxtText rendering, possibly libtxte: web_htmlHTML rendering backend for WebHTML rendering backend for Webengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.platform-webWeb applications specificallyWeb applications specificallyteam-webOwned by Web platform teamOwned by Web platform teamtriaged-webTriaged by Web platform teamTriaged by Web platform team
Description
In Chrome versions 96 or newer the HTML renderer measures text slightly differently from other renderers. This bug requires a special case in cupertino/dialog_test.dart
.
To reproduce
Make sure you have Chrome 96 or newer (this was reproducible in Chrome 96 in LUCI, and in Chrome 98 locally).
Sync to Flutter revision 8f58af8.
Run the test below in these modes:
flutter test
flutter test --platform=chrome --web-renderer=canvaskit
flutter test --web-renderer=html
:
Test:
testWidgets('Off by 1px', (WidgetTester tester) async {
final ui.ParagraphBuilder b = ui.ParagraphBuilder(ui.ParagraphStyle(
textDirection: ui.TextDirection.ltr,
));
b.pushStyle(ui.TextStyle(
fontWeight: FontWeight.w600,
letterSpacing: -0.5,
fontSize: 51,
height: 1.3,
));
b.addText('The Title');
b.pop();
final ui.Paragraph p = b.build();
p.layout(const ui.ParagraphConstraints(width: double.infinity));
print('Height: ${p.height}');
});
Expected behavior
In all cases the printed value of p.height
should be exactly 66
.
Actual behavior
The VM and CanvasKit modes print 66
. However, the HTML renderer prints 66.296875
.
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: typographyText rendering, possibly libtxtText rendering, possibly libtxte: web_htmlHTML rendering backend for WebHTML rendering backend for Webengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.platform-webWeb applications specificallyWeb applications specificallyteam-webOwned by Web platform teamOwned by Web platform teamtriaged-webTriaged by Web platform teamTriaged by Web platform team