Clear tags on SemanticsNode.reset() (#11903)

This commit is contained in:
Michael Goderbauer 2017-09-05 10:37:53 -07:00 committed by GitHub
parent 5f29abe2d2
commit 7ee0b6a574
2 changed files with 16 additions and 0 deletions

View file

@ -385,6 +385,7 @@ class SemanticsNode extends AbstractNode {
if (hadInheritedMergeAllDescendantsIntoThisNode) if (hadInheritedMergeAllDescendantsIntoThisNode)
_inheritedMergeAllDescendantsIntoThisNodeValue = true; _inheritedMergeAllDescendantsIntoThisNodeValue = true;
_label = ''; _label = '';
_tags.clear();
_markDirty(); _markDirty();
} }

View file

@ -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 {