This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Allow unsetting TextStyle.height #52940
Merged
auto-submit[bot] merged 11 commits intoflutter:mainfrom May 24, 2024
Merged
Conversation
7adb07a to
092a8be
Compare
092a8be to
7d2406e
Compare
47d6148 to
19267ba
Compare
19267ba to
e4188c6
Compare
eb26d3c to
e8e51ac
Compare
mdebbar
approved these changes
May 23, 2024
Contributor
mdebbar
left a comment
There was a problem hiding this comment.
cc @eyebrowsoffire for skwasm.
The web bits look good to me.
eyebrowsoffire
suggested changes
May 23, 2024
| expect(await matchImage(tabImage, tofuImage), isFalse); | ||
| }); | ||
|
|
||
| test('kTextHeightNone unsets the height multiplier', () { |
Contributor
There was a problem hiding this comment.
Can you move these tests into one of the text tests under flutter/lib/web_ui/test/ui so that it runs on all the renderers instead of just CanvasKit? As-is, these unit tests are not testing skwasm.
jason-simmons
approved these changes
May 23, 2024
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
May 24, 2024
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
May 24, 2024
auto-submit bot
pushed a commit
to flutter/flutter
that referenced
this pull request
May 24, 2024
flutter/engine@768c90e...d78f667 2024-05-24 [email protected] Roll Skia from 2ef772706cda to f2053e772e6f (1 revision) (flutter/engine#53009) 2024-05-24 [email protected] Roll Dart SDK from 7809d6e332ff to 9d7324ea563a (7 revisions) (flutter/engine#53008) 2024-05-24 [email protected] Allow unsetting `TextStyle.height` (flutter/engine#52940) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: 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
9 tasks
auto-submit bot
pushed a commit
to flutter/flutter
that referenced
this pull request
May 29, 2024
Fixes: #58765 The rationale for the choice of the sentinel value: flutter/engine#52940 The exact value of `kTextHeightNone` should be kept as an implementation detail. It's unfortunate that the current value `0` is dangerously close to `TextStyle.height`'s valid domain. If we ever allow `TextStyle.height == 0` (which totally makes sense) then it shouldn't be difficult to change the const.
victorsanni
pushed a commit
to victorsanni/flutter
that referenced
this pull request
May 31, 2024
…9011) flutter/engine@768c90e...d78f667 2024-05-24 [email protected] Roll Skia from 2ef772706cda to f2053e772e6f (1 revision) (flutter/engine#53009) 2024-05-24 [email protected] Roll Dart SDK from 7809d6e332ff to 9d7324ea563a (7 revisions) (flutter/engine#53008) 2024-05-24 [email protected] Allow unsetting `TextStyle.height` (flutter/engine#52940) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: 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
victorsanni
pushed a commit
to victorsanni/flutter
that referenced
this pull request
May 31, 2024
Fixes: flutter#58765 The rationale for the choice of the sentinel value: flutter/engine#52940 The exact value of `kTextHeightNone` should be kept as an implementation detail. It's unfortunate that the current value `0` is dangerously close to `TextStyle.height`'s valid domain. If we ever allow `TextStyle.height == 0` (which totally makes sense) then it shouldn't be difficult to change the const.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduces a sentinel value
kTextHeightNoneforui.TextStyle.heightwhich can be used to "unset" the currentTextStyle.height(and for consistency, it applies toStructStyle.heightandParagraphStyle.heighttoo). Documentation ofTextStyle.heightcan be found here (the one frompaintinglibrary notdart:ui).part of flutter/flutter#58765: currently
TextStyle.heightusesnullas the sentinel value for "no height multiplier specified, use the font height", which has conflicting semantics: it means the height multiplier is not set (so the span height is determined by font metrics) but in reality it also means the height should inherit from its parent span (or incopyWithcontext, it means do not override the height).The new sentinel value
kTextHeightNoneis currently set to0.0. This is because skparagraph internally uses 0 for "no height multiplier", so using 0 should minimize the behavior change:https://github.com/google/skia/blob/62f369c759947272dfdd2d8f060afadbcc361e79/modules/skparagraph/src/Run.cpp#L65-L67
This MAY still change the current behavior: for consistency setting
StructStyle.height/ParagraphStyle.heightto the sentinel value also unsets the height multiplier which may not be the current behavior.Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.