Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Engine/LibTxt/dart:ui impl of TextHeightBehavior #15087

Merged
merged 33 commits into from
Jan 27, 2020

Conversation

GaryQian
Copy link
Contributor

@GaryQian GaryQian commented Dec 30, 2019

Part of a series of changes to resolve flutter/flutter#47175

Paired with the Framework-side changes: flutter/flutter#48346

Adds HeightBehavior to allow for adjustment of how vertical line height is applied for the first and last lines.

@GaryQian
Copy link
Contributor Author

GaryQian commented Jan 2, 2020

This may be landed independently from the framework side changes as it is backwards compatible and non-breaking.

@GaryQian GaryQian removed the Work in progress (WIP) Not ready (yet) for review! label Jan 3, 2020
@GaryQian GaryQian changed the title [WIP] Engine/LibTxt/dart:ui support for boundary line height behavior Engine/LibTxt/dart:ui support for boundary line height behavior Jan 3, 2020
@GaryQian
Copy link
Contributor Author

GaryQian commented Jan 3, 2020

Bugfix portion of this is extracted out in standalone PR: #15106

@GaryQian GaryQian requested a review from Hixie January 7, 2020 18:13
@GaryQian
Copy link
Contributor Author

GaryQian commented Jan 7, 2020

cc @Hixie for API review. The framework side PR would add boundaryLineHeightBehavior property to Text and RichText

@GaryQian
Copy link
Contributor Author

GaryQian commented Jan 7, 2020

Framework side changes: flutter/flutter#48346

@GaryQian
Copy link
Contributor Author

GaryQian commented Jan 8, 2020

Will require a manual roll to pass build_and_test_linux_unopt_debug.

ParagraphStyle toString tests need to be updated with new property.

lib/ui/text.dart Outdated
@@ -443,6 +443,8 @@ class BoundaryLineHeightBehavior {
/// * last: When true, the [TextStyle.height] modifier will be applied to
/// to the descent of the last line. When false, the font's default descent
/// will be used.
///
/// All properties default to true (height modificaitons applied as normal).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(also the cases below)

lib/ui/text.dart Outdated
/// the [TextStyle.height] will have no effect on the ascent of the first line.
///
/// Defaults to true (height modificaitons applied as normal).
final bool first;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"first" is not a yes/no question. It would be more intuitive with a name like "padFirstLine" or something.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or "applyAscentToFirstLine" and "applyDescentToLastLine" maybe

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to applyHeightToFirstLineAscent A bit long but very descriptive.

lib/ui/text.dart Outdated
/// the [TextStyle.height] will have no effect on the descent of the last line.
///
/// Defaults to true (height modificaitons applied as normal).
final bool last;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

similar comment here

lib/ui/text.dart Outdated

@override
bool operator ==(dynamic other) {
if (identical(this, other))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

identical check shouldn't be necessary here

lib/ui/text.dart Outdated
String toString() {
return 'BoundaryLineHeightBehavior('
'first: $first, '
'last: $last, '
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when you write a test for the toString, you'll see you have a trailing comma. :-)

@@ -765,13 +844,14 @@ Int32List _encodeParagraphStyle(
String fontFamily,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the comment on this method is out of date

@@ -881,6 +965,7 @@ class ParagraphStyle {
String fontFamily,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docs on this constructor are out of date

@GaryQian
Copy link
Contributor Author

GaryQian commented Jan 27, 2020

Landing this will break engine->framework roller until flutter/flutter#48346 is also landed/manually rolled.

build_and_test_linux_unopt_debug will be red until framework PR is landed as well.

@GaryQian GaryQian merged commit cbf4536 into flutter:master Jan 27, 2020
dnfield added a commit to dnfield/engine that referenced this pull request Jan 28, 2020
@dnfield dnfield mentioned this pull request Jan 28, 2020
dnfield added a commit that referenced this pull request Jan 28, 2020
* Revert "Web PargraphStyle TextHeightBehavior integration (#16075)"

This reverts commit 86682a2.

* Revert "Engine/LibTxt/dart:ui impl of TextHeightBehavior (#15087)"

This reverts commit cbf4536.
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 28, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 28, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 28, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 29, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 29, 2020
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jan 29, 2020
engine-flutter-autoroll added a commit to flutter/flutter that referenced this pull request Jan 29, 2020
flutter/engine@c4229bf...ec32966

git log c4229bf..ec32966 --first-parent --oneline
2020-01-28 [email protected] Revert "Always make gpu thread different from platform thread regardless of platform view (#16068)" (flutter/engine#16161)
2020-01-28 [email protected] Roll fuchsia/sdk/core/mac-amd64 from gNitp... to 5fMtM... (flutter/engine#16153)
2020-01-28 [email protected] Revert "Disable setting a library tag handler." (flutter/engine#16157)
2020-01-28 [email protected] Always make gpu thread different from platform thread regardless of platform view (flutter/engine#16068)
2020-01-28 [email protected] Add test to ensure that concurrent message loops have at least one workers. (flutter/engine#16074)
2020-01-28 [email protected] Revert breaking PRs (flutter/engine#16148)
2020-01-28 [email protected] Roll fuchsia/sdk/core/linux-amd64 from 8Ns10... to 2rLoq... (flutter/engine#15971)
2020-01-28 [email protected] Gets the DPI for all awareness mode and older Windows versions (flutter/engine#15951)
2020-01-28 [email protected] Hold a mutex when updating all CanPostTaskToAllNativeThreads::Captures members. (flutter/engine#16085)
2020-01-28 [email protected] Disable setting a library tag handler. (flutter/engine#16086)
2020-01-28 [email protected] Web PargraphStyle TextHeightBehavior integration (flutter/engine#16075)
2020-01-28 [email protected] Fix flake by making thread ID tracking in CanPostTaskToAllNativeThreads thread safe. (flutter/engine#16081)
2020-01-28 [email protected] Remove buggy assertion in EmbedderTest::CanPostTaskToAllNativeThreads. (flutter/engine#16071)
2020-01-27 [email protected] Remove tonic/platform. (flutter/engine#16062)
2020-01-27 [email protected] Allow embedders to schedule a callback on all engine managed threads. (flutter/engine#15980)
2020-01-27 [email protected] Engine/LibTxt/dart:ui impl of TextHeightBehavior (flutter/engine#15087)
2020-01-27 [email protected] Roll src/third_party/skia f1b2b42613cb..9c1d30dd163e (8 commits) (flutter/engine#16060)
2020-01-27 [email protected] Remove stale recipe changelog. (flutter/engine#15985)


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] on the revert to ensure that a human
is aware of the problem.

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+/master/autoroll/README.md
stuartmorgan-g pushed a commit to stuartmorgan-g/engine that referenced this pull request Jan 30, 2020
NoamDev pushed a commit to NoamDev/engine that referenced this pull request Feb 27, 2020
NoamDev pushed a commit to NoamDev/engine that referenced this pull request Feb 27, 2020
* Revert "Web PargraphStyle TextHeightBehavior integration (flutter#16075)"

This reverts commit 86682a2.

* Revert "Engine/LibTxt/dart:ui impl of TextHeightBehavior (flutter#15087)"

This reverts commit cbf4536.
NoamDev pushed a commit to NoamDev/engine that referenced this pull request Feb 27, 2020
NoamDev added a commit to NoamDev/engine that referenced this pull request Feb 27, 2020
NoamDev added a commit to NoamDev/engine that referenced this pull request Feb 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Text] Allow for line height *between* lines on text.
5 participants