Skip to content

Constrain _RenderScaledInlineWidget child size in computeDryLayout #131765

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Aug 7, 2023

Conversation

tgucio
Copy link
Contributor

@tgucio tgucio commented Aug 2, 2023

This PR constrains child size in _RenderScaledInlineWidget.computeDryLayout.

I found by accident that the test added in #130648 didn't really work i.e. didn't fail when reverting the change when run locally. It did fail with the values from #130588. Then this also showed the additional failing assertion:

00:01 +8: Inline widgets' scaled sizes are constrained                                                                                                                                                        
══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞═════════════════════════════════════════════════════════
The following assertion was thrown during performLayout():
The size given to the _RenderScaledInlineWidget class differs from the size computed by
computeDryLayout.
The size computed in performLayout is Size(502.5, 0.0), which is different from Size(502.5, 0.0),
which was computed by computeDryLayout.
The constraints used were BoxConstraints(0.0<=w<=502.5, 0.0<=h<=Infinity).
If you are not writing your own RenderBox subclass, then this is not
your fault. Contact support: https://github.com/flutter/flutter/issues/new?template=2_bug.yml

When the exception was thrown, this was the stack:
#0      RenderBox.debugAssertDoesMeetConstraints.<anonymous closure> (package:flutter/src/rendering/box.dart:2329:11)
#1      RenderBox.debugAssertDoesMeetConstraints (package:flutter/src/rendering/box.dart:2346:6)
#2      RenderBox.size=.<anonymous closure> (package:flutter/src/rendering/box.dart:2030:7)
#3      RenderBox.size= (package:flutter/src/rendering/box.dart:2032:6)
#4      _RenderScaledInlineWidget.performLayout (package:flutter/src/widgets/widget_span.dart:401:5)
#5      RenderObject.layout (package:flutter/src/rendering/object.dart:2548:7)
#6      RenderBox.layout (package:flutter/src/rendering/box.dart:2382:11)
#7      RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:104:21)
#8      RenderObject.layout (package:flutter/src/rendering/object.dart:2548:7)
#9      RenderBox.layout (package:flutter/src/rendering/box.dart:2382:11)
#10     ChildLayoutHelper.layoutChild (package:flutter/src/rendering/layout_helper.dart:52:11)
#11     RenderInlineChildrenContainerDefaults._layoutChild (package:flutter/src/rendering/paragraph.dart:124:28)
#12     RenderInlineChildrenContainerDefaults.layoutInlineChildren (package:flutter/src/rendering/paragraph.dart:155:9)

Pre-launch Checklist

  • I read the [Contributor Guide] and followed the process outlined there for submitting PRs.
  • I read the [Tree Hygiene] wiki page, which explains my responsibilities.
  • I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement].
  • I signed the [CLA].
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is [test-exempt].
  • All existing and new tests are passing.

@tgucio tgucio requested a review from LongCatIsLooong August 2, 2023 12:20
@github-actions github-actions bot added a: text input Entering text in a text field or keyboard related problems framework flutter/packages/flutter repository. See also f: labels. labels Aug 2, 2023
@tgucio tgucio requested a review from chunhtai August 3, 2023 16:18
Copy link
Contributor

@LongCatIsLooong LongCatIsLooong left a comment

Choose a reason for hiding this comment

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

LGTM.

@@ -273,8 +273,8 @@ void main() {
textDirection: TextDirection.ltr,
child: Center(
child: SizedBox(
width: 100.3,
Copy link
Contributor

Choose a reason for hiding this comment

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

Ah I think I meant to put 100 here.

@tgucio tgucio merged commit 55044a6 into flutter:master Aug 7, 2023
@tgucio tgucio deleted the inline-widget-test branch August 7, 2023 08:28
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Aug 7, 2023
tarrinneal pushed a commit to flutter/packages that referenced this pull request Aug 7, 2023
flutter/flutter@2ba9f7b...ad0aa8d

2023-08-07 engine-flutter-autoroll@skia.org Roll Flutter Engine from
b10891e0d8d8 to 5b47c0577060 (1 revision) (flutter/flutter#132040)
2023-08-07 engine-flutter-autoroll@skia.org Roll Flutter Engine from
4304d6180264 to b10891e0d8d8 (1 revision) (flutter/flutter#132037)
2023-08-07 engine-flutter-autoroll@skia.org Roll Flutter Engine from
eb91441398a1 to 4304d6180264 (1 revision) (flutter/flutter#132031)
2023-08-07 72562119+tgucio@users.noreply.github.com Constrain
_RenderScaledInlineWidget child size in computeDryLayout
(flutter/flutter#131765)
2023-08-07 engine-flutter-autoroll@skia.org Roll Flutter Engine from
15b5707af406 to eb91441398a1 (1 revision) (flutter/flutter#132025)
2023-08-07 engine-flutter-autoroll@skia.org Roll Flutter Engine from
a1d513f78bbb to 15b5707af406 (2 revisions) (flutter/flutter#132020)
2023-08-06 engine-flutter-autoroll@skia.org Roll Flutter Engine from
c9bd380ccbb0 to a1d513f78bbb (1 revision) (flutter/flutter#132015)
2023-08-06 engine-flutter-autoroll@skia.org Roll Flutter Engine from
060c95f94364 to c9bd380ccbb0 (1 revision) (flutter/flutter#132008)
2023-08-06 engine-flutter-autoroll@skia.org Roll Flutter Engine from
af7aaae2f1f9 to 060c95f94364 (1 revision) (flutter/flutter#132006)
2023-08-06 engine-flutter-autoroll@skia.org Roll Flutter Engine from
cdafc05a7217 to af7aaae2f1f9 (2 revisions) (flutter/flutter#132004)
2023-08-05 engine-flutter-autoroll@skia.org Roll Flutter Engine from
b512df490c94 to cdafc05a7217 (1 revision) (flutter/flutter#131996)
2023-08-05 72562119+tgucio@users.noreply.github.com Take paint offset
into account for inline children hit test in Editable
(flutter/flutter#131675)
2023-08-05 engine-flutter-autoroll@skia.org Roll Flutter Engine from
d26b8c8fb60c to b512df490c94 (1 revision) (flutter/flutter#131987)
2023-08-05 engine-flutter-autoroll@skia.org Roll Flutter Engine from
2ce2913acbe4 to d26b8c8fb60c (1 revision) (flutter/flutter#131986)
2023-08-05 engine-flutter-autoroll@skia.org Roll Flutter Engine from
628b086265f2 to 2ce2913acbe4 (1 revision) (flutter/flutter#131983)
2023-08-05 engine-flutter-autoroll@skia.org Roll Flutter Engine from
7302a678e58e to 628b086265f2 (1 revision) (flutter/flutter#131976)
2023-08-05 engine-flutter-autoroll@skia.org Roll Flutter Engine from
138a1ea9a692 to 7302a678e58e (2 revisions) (flutter/flutter#131975)
2023-08-05 engine-flutter-autoroll@skia.org Roll Flutter Engine from
a0d650e37f5d to 138a1ea9a692 (2 revisions) (flutter/flutter#131972)
2023-08-05 polinach@google.com Add TODO to refactor error handling.
(flutter/flutter#131878)
2023-08-05 engine-flutter-autoroll@skia.org Manual roll Flutter Engine
from 4f4734cd48da to a0d650e37f5d (3 revisions) (flutter/flutter#131967)
2023-08-05 32242716+ricardoamador@users.noreply.github.com Mark the
ci_yaml roller task so that it is not backfilled.
(flutter/flutter#131966)
2023-08-05 christopherfujino@gmail.com mark linux packages_autoroller
flaky because of token issue (flutter/flutter#131970)
2023-08-04 30870216+gaaclarke@users.noreply.github.com Sped up the time
to find macrobenchmarks. (flutter/flutter#131959)
2023-08-04 engine-flutter-autoroll@skia.org Roll Flutter Engine from
c254deb8fbda to 4f4734cd48da (2 revisions) (flutter/flutter#131955)
2023-08-04 engine-flutter-autoroll@skia.org Roll Flutter Engine from
a7bea8621f4b to c254deb8fbda (3 revisions) (flutter/flutter#131950)
2023-08-04 jmccandless@google.com Predictive back support for root
routes (flutter/flutter#120385)
2023-08-04 engine-flutter-autoroll@skia.org Roll Flutter Engine from
e9f80bff0703 to a7bea8621f4b (3 revisions) (flutter/flutter#131948)
2023-08-04 engine-flutter-autoroll@skia.org Roll Flutter Engine from
badca1f7f8c9 to e9f80bff0703 (6 revisions) (flutter/flutter#131943)
2023-08-04 tessertaha@gmail.com Mention `showTimePicker` function be can
be used to show dialog with the time picker in the `TimePickerDialog`
docs (flutter/flutter#131932)
2023-08-04 15619084+vashworth@users.noreply.github.com Check for
simulator runtime in flutter doctor (flutter/flutter#131795)
2023-08-04 engine-flutter-autoroll@skia.org Roll Packages from
d00c1f9 to ce53da1 (3 revisions) (flutter/flutter#131935)

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
rmistry@google.com,stuartmorgan@google.com,tarrinneal@google.com 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://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
LongCatIsLooong pushed a commit to LongCatIsLooong/flutter that referenced this pull request Aug 7, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: text input Entering text in a text field or keyboard related problems framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants