Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

SemanticsUpdateBuilder migration: introduce identifier #48882

Merged
merged 2 commits into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/ui/fixtures/ui_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ external void _validateVertices(Vertices vertices);
@pragma('vm:entry-point')
void sendSemanticsUpdate() {
final SemanticsUpdateBuilder builder = SemanticsUpdateBuilder();
final String identifier = "identifier";
final String label = "label";
final List<StringAttribute> labelAttributes = <StringAttribute> [
SpellOutStringAttribute(range: TextRange(start: 1, end: 2)),
Expand Down Expand Up @@ -212,6 +213,7 @@ void sendSemanticsUpdate() {
rect: Rect.fromLTRB(0, 0, 10, 10),
elevation: 0,
thickness: 0,
identifier: identifier,
label: label,
labelAttributes: labelAttributes,
value: value,
Expand Down
9 changes: 3 additions & 6 deletions lib/ui/semantics.dart
Original file line number Diff line number Diff line change
Expand Up @@ -807,8 +807,7 @@ abstract class SemanticsUpdateBuilder {
required double elevation,
required double thickness,
required Rect rect,
// TODO(bartekpacia): Re-add once migration is complete
// String identifier,
required String identifier,
required String label,
required List<StringAttribute> labelAttributes,
required String value,
Expand Down Expand Up @@ -878,8 +877,7 @@ base class _NativeSemanticsUpdateBuilder extends NativeFieldWrapperClass1 implem
required double elevation,
required double thickness,
required Rect rect,
// TODO(bartekpacia): Re-add once migration is complete
// String identifier,
required String identifier,
required String label,
required List<StringAttribute> labelAttributes,
required String value,
Expand Down Expand Up @@ -918,8 +916,7 @@ base class _NativeSemanticsUpdateBuilder extends NativeFieldWrapperClass1 implem
rect.bottom,
elevation,
thickness,
// TODO(bartekpacia): Pass real identifier parameter once migration is complete
'',
identifier,
label,
labelAttributes,
value,
Expand Down
6 changes: 2 additions & 4 deletions lib/web_ui/lib/semantics.dart
Original file line number Diff line number Diff line change
Expand Up @@ -360,8 +360,7 @@ class SemanticsUpdateBuilder {
required double elevation,
required double thickness,
required Rect rect,
// TODO(bartekpacia): Re-add once migration is complete
// String identifier,
required String identifier,
required String label,
required List<StringAttribute> labelAttributes,
required String value,
Expand Down Expand Up @@ -396,8 +395,7 @@ class SemanticsUpdateBuilder {
scrollExtentMax: scrollExtentMax,
scrollExtentMin: scrollExtentMin,
rect: rect,
// TODO(bartekpacia): Pass real identifier parameter once migration is complete
identifier: '',
identifier: identifier,
label: label,
labelAttributes: labelAttributes,
value: value,
Expand Down
3 changes: 1 addition & 2 deletions lib/web_ui/test/engine/semantics/semantics_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3092,8 +3092,7 @@ void updateNode(
elevation: elevation,
thickness: thickness,
rect: rect,
// TODO(bartekpacia): Pass real identifier parameter once migration is complete
// identifier: '',
identifier: identifier,
label: label,
labelAttributes: labelAttributes,
hint: hint,
Expand Down
5 changes: 5 additions & 0 deletions shell/platform/embedder/fixtures/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ Future<void> a11y_main() async {
final SemanticsUpdateBuilder builder = SemanticsUpdateBuilder()
..updateNode(
id: 42,
identifier: '',
label: 'A: root',
labelAttributes: <StringAttribute>[],
rect: Rect.fromLTRB(0.0, 0.0, 10.0, 10.0),
Expand Down Expand Up @@ -170,6 +171,7 @@ Future<void> a11y_main() async {
)
..updateNode(
id: 84,
identifier: '',
label: 'B: leaf',
labelAttributes: <StringAttribute>[],
rect: Rect.fromLTRB(40.0, 40.0, 80.0, 80.0),
Expand Down Expand Up @@ -203,6 +205,7 @@ Future<void> a11y_main() async {
)
..updateNode(
id: 96,
identifier: '',
label: 'C: branch',
labelAttributes: <StringAttribute>[],
rect: Rect.fromLTRB(40.0, 40.0, 80.0, 80.0),
Expand Down Expand Up @@ -236,6 +239,7 @@ Future<void> a11y_main() async {
)
..updateNode(
id: 128,
identifier: '',
label: 'D: leaf',
labelAttributes: <StringAttribute>[],
rect: Rect.fromLTRB(40.0, 40.0, 80.0, 80.0),
Expand Down Expand Up @@ -301,6 +305,7 @@ Future<void> a11y_string_attributes() async {
final SemanticsUpdateBuilder builder = SemanticsUpdateBuilder()
..updateNode(
id: 42,
identifier: 'identifier',
label: 'What is the meaning of life?',
labelAttributes: <StringAttribute>[
LocaleStringAttribute(
Expand Down
2 changes: 2 additions & 0 deletions testing/scenario_app/lib/src/locale_initialization.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class LocaleInitialization extends Scenario {
// SemanticsAction.tap.
actions: 1,
rect: const Rect.fromLTRB(0.0, 0.0, 414.0, 48.0),
identifier: '',
label: view.platformDispatcher.locales.toString(),
labelAttributes: <StringAttribute>[],
textDirection: TextDirection.ltr,
Expand Down Expand Up @@ -107,6 +108,7 @@ class LocaleInitialization extends Scenario {
// SemanticsAction.tap.
actions: 1,
rect: const Rect.fromLTRB(0.0, 0.0, 414.0, 48.0),
identifier: '',
label: label,
labelAttributes: <StringAttribute>[],
textDirection: TextDirection.ltr,
Expand Down