Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Testing this commit, will explain later
  • Loading branch information
a-wallen committed Oct 28, 2022
commit fbf61277d56a77bf1d6753b89ab47e50043e9a02
21 changes: 0 additions & 21 deletions lib/ui/platform_dispatcher.dart
Original file line number Diff line number Diff line change
Expand Up @@ -750,27 +750,6 @@ class PlatformDispatcher {
_invoke(onAccessibilityFeaturesChanged, _onAccessibilityFeaturesChangedZone,);
}

/// Change the retained semantics data about this platform dispatcher.
///
/// If [semanticsEnabled] is true, the user has requested that this function
/// be called whenever the semantic content of this platform dispatcher
/// changes.
///
/// In either case, this function disposes the given update, which means the
/// semantics update cannot be used further.
@Deprecated('''
In a multi-view world, the platform dispatcher can no longer provide apis
to update semantics since each view will host its own semantics tree.

Semantics updates must be passed to an individual [FlutterView]. To update
semantics, use PlatformDispatcher.instance.views to get a [FlutterView] and
call `updateSemantics`.
''')
void updateSemantics(SemanticsUpdate update) => _updateSemantics(update);

@FfiNative<Void Function(Pointer<Void>)>('PlatformConfigurationNativeApi::UpdateSemantics')
external static void _updateSemantics(SemanticsUpdate update);

/// The system-reported default locale of the device.
///
/// This establishes the language and formatting conventions that application
Expand Down
21 changes: 0 additions & 21 deletions lib/ui/window.dart
Original file line number Diff line number Diff line change
Expand Up @@ -734,27 +734,6 @@ class SingletonFlutterWindow extends FlutterWindow {
platformDispatcher.onAccessibilityFeaturesChanged = callback;
}

<<<<<<< HEAD
=======
/// Change the retained semantics data about this window.
///
/// {@macro dart.ui.window.functionForwardWarning}
///
/// If [semanticsEnabled] is true, the user has requested that this function
/// be called whenever the semantic content of this window changes.
///
/// In either case, this function disposes the given update, which means the
/// semantics update cannot be used further.
@override
@Deprecated('''
A singleton flutter window no longer manages semantics trees. In a multi-view
world, each flutter view must manage its own semantics tree.

Call updateSemantics() from FlutterView instead.
''')
void updateSemantics(SemanticsUpdate update) => platformDispatcher.updateSemantics(update);

>>>>>>> ccc5c13a67 (Deprecate `platform_dispatcher` apis in favor of updateSemantics in FlutterView)
/// Sends a message to a platform-specific plugin.
///
/// {@macro dart.ui.window.functionForwardWarning}
Expand Down
10 changes: 1 addition & 9 deletions lib/web_ui/lib/platform_dispatcher.dart
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,7 @@ abstract class PlatformDispatcher {
VoidCallback? get onAccessibilityFeaturesChanged;
set onAccessibilityFeaturesChanged(VoidCallback? callback);

@Deprecated('''
In a multi-view world, the platform dispatcher can no longer provide apis
to update semantics since each view will host its own semantics tree.

Semantics updates must be passed to an individual [FlutterView]. To update
semantics, use PlatformDispatcher.instance.views to get a [FlutterView] and
call `updateSemantics`.
''')
void updateSemantics(SemanticsUpdate update);
void updateSemantics(SemanticsUpdate update, [FlutterView view]);

Locale get locale;

Expand Down
4 changes: 4 additions & 0 deletions lib/web_ui/lib/src/engine/platform_dispatcher.dart
Original file line number Diff line number Diff line change
Expand Up @@ -698,6 +698,7 @@ class EnginePlatformDispatcher extends ui.PlatformDispatcher {
/// In either case, this function disposes the given update, which means the
/// semantics update cannot be used further.
@override
<<<<<<< HEAD
@Deprecated('''
<<<<<<< HEAD
In a multi-view world, the platform dispatcher can no longer provide apis
Expand All @@ -716,6 +717,9 @@ class EnginePlatformDispatcher extends ui.PlatformDispatcher {
>>>>>>> ccc5c13a67 (Deprecate `platform_dispatcher` apis in favor of updateSemantics in FlutterView)
''')
void updateSemantics(ui.SemanticsUpdate update) {
=======
void updateSemantics(ui.SemanticsUpdate update, [ui.FlutterView? view]) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the base class, it was typed FlutterView instead of FlutterView? - why the difference?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, why do we add the view parameter here? It appears to be unused? In the future (once the web engine is actually multi-view enabled) we will likely have to add it, but since EnginePlatformDispatcher is private API we can just do that when we need it without a breaking change?

>>>>>>> 58037d36e1 (Testing this commit, will explain later)
EngineSemanticsOwner.instance.updateSemantics(update);
}

Expand Down
5 changes: 4 additions & 1 deletion lib/web_ui/lib/window.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ abstract class FlutterView {
WindowPadding get padding => viewConfiguration.padding;
List<DisplayFeature> get displayFeatures => viewConfiguration.displayFeatures;
void render(Scene scene) => platformDispatcher.render(scene, this);
void updateSemantics(SemanticsUpdate update) => platformDispatcher.updateSemantics(update);
void updateSemantics(SemanticsUpdate update) => platformDispatcher.updateSemantics(update, this);
}

abstract class FlutterWindow extends FlutterView {
Expand Down Expand Up @@ -131,6 +131,9 @@ abstract class SingletonFlutterWindow extends FlutterWindow {
platformDispatcher.onAccessibilityFeaturesChanged = callback;
}

@override
void updateSemantics(SemanticsUpdate update) => platformDispatcher.updateSemantics(update, this);

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this exactly the implementation it inherits from FlutterView?

void sendPlatformMessage(
String name,
ByteData? data,
Expand Down