Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
36a5a0f5
Unverified
Commit
36a5a0f5
authored
Sep 19, 2022
by
Dan Field
Committed by
GitHub
Sep 19, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid sending zero transform semantic nodes to the engine (#111843)
parent
70b19ff9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
1 deletion
+28
-1
object.dart
packages/flutter/lib/src/rendering/object.dart
+1
-1
semantics_test.dart
packages/flutter/test/widgets/semantics_test.dart
+27
-0
No files found.
packages/flutter/lib/src/rendering/object.dart
View file @
36a5a0f5
...
...
@@ -4433,7 +4433,7 @@ class _SemanticsGeometry {
/// by this object can be dropped from the semantics tree without losing
/// semantics information.
bool
get
dropFromTree
{
return
_rect
.
isEmpty
;
return
_rect
.
isEmpty
||
_transform
.
isZero
()
;
}
/// Whether the [SemanticsNode] annotated with the geometric information
...
...
packages/flutter/test/widgets/semantics_test.dart
View file @
36a5a0f5
...
...
@@ -1632,6 +1632,33 @@ void main() {
textDirection:
TextDirection
.
ltr
,
));
});
testWidgets
(
'Semantics with zero transform gets dropped'
,
(
WidgetTester
tester
)
async
{
// Regression test for https://github.com/flutter/flutter/issues/110671.
// Construct a widget tree that will end up with a fitted box that applies
// a zero transform because it does not actually draw its children.
// Assert that this subtree gets dropped (the root node has no children).
await
tester
.
pumpWidget
(
Column
(
children:
<
Widget
>[
SizedBox
(
height:
0
,
width:
500
,
child:
FittedBox
(
child:
SizedBox
(
height:
55
,
width:
266
,
child:
SingleChildScrollView
(
child:
Column
()),
),
),
),
],
));
final
SemanticsNode
node
=
RendererBinding
.
instance
.
renderView
.
debugSemantics
!;
expect
(
node
.
transform
,
null
);
// Make sure the zero transform didn't end up on the root somehow.
expect
(
node
.
childrenCount
,
0
);
});
}
class
CustomSortKey
extends
OrdinalSortKey
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment