mirror of
https://github.com/flutter/flutter
synced 2024-10-14 04:02:56 +00:00
Clear tags on SemanticsNode.reset() (#11903)
This commit is contained in:
parent
5f29abe2d2
commit
7ee0b6a574
|
@ -385,6 +385,7 @@ class SemanticsNode extends AbstractNode {
|
||||||
if (hadInheritedMergeAllDescendantsIntoThisNode)
|
if (hadInheritedMergeAllDescendantsIntoThisNode)
|
||||||
_inheritedMergeAllDescendantsIntoThisNodeValue = true;
|
_inheritedMergeAllDescendantsIntoThisNodeValue = true;
|
||||||
_label = '';
|
_label = '';
|
||||||
|
_tags.clear();
|
||||||
_markDirty();
|
_markDirty();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -110,6 +110,21 @@ void main() {
|
||||||
' └SemanticsNode(6; Rect.fromLTRB(0.0, 0.0, 0.0, 0.0))\n'
|
' └SemanticsNode(6; Rect.fromLTRB(0.0, 0.0, 0.0, 0.0))\n'
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('reset clears tags', () {
|
||||||
|
const SemanticsTag tag = const SemanticsTag('tag for testing');
|
||||||
|
final SemanticsNode node = new SemanticsNode();
|
||||||
|
|
||||||
|
expect(node.hasTag(tag), isFalse);
|
||||||
|
|
||||||
|
node.addTag(tag);
|
||||||
|
|
||||||
|
expect(node.hasTag(tag), isTrue);
|
||||||
|
|
||||||
|
node.reset();
|
||||||
|
|
||||||
|
expect(node.hasTag(tag), isFalse);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
class TestRender extends RenderProxyBox {
|
class TestRender extends RenderProxyBox {
|
||||||
|
|
Loading…
Reference in a new issue