@@ -480,6 +480,10 @@ abstract class PrimaryRoleManager {
480480 ..overflow = 'visible' ;
481481 element.setAttribute ('id' , 'flt-semantic-node-${semanticsObject .id }' );
482482
483+ if (semanticsObject.hasIdentifier) {
484+ element.setAttribute ('semantic-identifier' , semanticsObject.identifier! );
485+ }
486+
483487 // The root node has some properties that other nodes do not.
484488 if (semanticsObject.id == 0 && ! configuration.debugShowSemanticsNodes) {
485489 // Make all semantics transparent. Use `filter` instead of `opacity`
@@ -1097,6 +1101,21 @@ class SemanticsObject {
10971101 _dirtyFields | = _platformViewIdIndex;
10981102 }
10991103
1104+ /// See [ui.SemanticsUpdateBuilder.updateNode] .
1105+ String ? get identifier => _identifier;
1106+ String ? _identifier;
1107+
1108+ bool get hasIdentifier => _identifier != null && _identifier! .isNotEmpty;
1109+
1110+ static const int _identifierIndex = 1 << 24 ;
1111+
1112+ /// Whether the [identifier] field has been updated but has not been
1113+ /// applied to the DOM yet.
1114+ bool get isIdentifierDirty => _isDirty (_identifierIndex);
1115+ void _markIdentifierDirty () {
1116+ _dirtyFields | = _identifierIndex;
1117+ }
1118+
11001119 /// A unique permanent identifier of the semantics node in the tree.
11011120 final int id;
11021121
@@ -1253,6 +1272,11 @@ class SemanticsObject {
12531272 _markFlagsDirty ();
12541273 }
12551274
1275+ if (_identifier != update.identifier) {
1276+ _identifier = update.identifier;
1277+ _markIdentifierDirty ();
1278+ }
1279+
12561280 if (_value != update.value) {
12571281 _value = update.value;
12581282 _markValueDirty ();
0 commit comments