Assert TextStyle height is not NaN#186617
Conversation
There was a problem hiding this comment.
Code Review
This pull request adds assertions to the TextStyle constructor and getParagraphStyle method to ensure the height parameter is not NaN, and includes unit tests to verify this behavior. Feedback recommends defining the error message as a private static constant to avoid duplication and improve maintainability, adhering to the repository's style guide.
53bf3d1 to
b9307bf
Compare
b9307bf to
f9923ae
Compare
|
Addressed the review nit in f9923ae by removing the redundant |
Renzo-Olivares
left a comment
There was a problem hiding this comment.
LGTM, thank you for the contribution!
|
This is approved and all visible checks are green, but it does not have the |
|
auto label is removed for flutter/flutter/186617, Failed to enqueue flutter/flutter/186617 with HTTP 400: Pull request Required status check "Merge Queue Guard" is expected.. |
|
Looks like the autosubmit attempt hit |
a416a28 to
bbbd5a4
Compare
flutter/flutter@dc2a870...f7b66f3 2026-07-10 [email protected] [iOS][test] Fix VSyncClient display link deallocation test on iOS 27 (flutter/flutter#188627) 2026-07-10 [email protected] Fix broken listener code in WindowScope (flutter/flutter#189208) 2026-07-10 [email protected] [web] Preserve text field focus across tab switches (flutter/flutter#188738) 2026-07-10 [email protected] [Impeller] Recycle HostBuffer arena entries only after GPU completion (flutter/flutter#188965) 2026-07-10 [email protected] Assert TextStyle height is not NaN (flutter/flutter#186617) 2026-07-10 [email protected] Roll Fuchsia Test Scripts from dFkTCiDxEtPxYK5Nn... to wLST_A-xfOeGT_5mj... (flutter/flutter#189259) 2026-07-10 [email protected] Roll Dart SDK from a11fb7ed40a5 to 0fc1668c4af4 (5 revisions) (flutter/flutter#189257) 2026-07-10 [email protected] Adds a missing `await` to a `FutureOr` (flutter/flutter#189198) 2026-07-10 [email protected] [web] Repair RenderCanvas CSS size drift (flutter/flutter#188797) 2026-07-10 [email protected] Roll Fuchsia Test Scripts from s5_gZFJ8De9AJalTw... to dFkTCiDxEtPxYK5Nn... (flutter/flutter#189215) 2026-07-10 [email protected] Roll Fuchsia Linux SDK from QcRFUtvCw2EobfJ8s... to czpzDg9ABY2oKLAOY... (flutter/flutter#189222) 2026-07-10 [email protected] Update Depdencies Used By `flutter_engine_group_performance` (flutter/flutter#189229) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Fixes #175248
Prevents
TextStyle(height: double.nan)andgetParagraphStyle(height: double.nan)from passing NaN line heights down to dart:ui in debug mode. This produces a clear assertion before platform-specific text layout failures.Tests:
./bin/dart format --output=none --set-exit-if-changed packages/flutter/lib/src/painting/text_style.dart packages/flutter/test/painting/text_style_test.dart./bin/flutter test packages/flutter/test/painting/text_style_test.dart./bin/flutter analyze packages/flutter/lib/src/painting/text_style.dart packages/flutter/test/painting/text_style_test.dartgit diff --check