Visitar URL original
Reverts "Reapply "Add set semantics enabled API and wire iOS a11y bridge (#161… (#171198)" by auto-submit[bot] · Pull Request #174153 · flutter/flutter · GitHub
Skip to content
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
1 change: 0 additions & 1 deletion dev/integration_tests/ios_host_app/flutterapp/lib/main
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ const BasicMessageChannel<String> _kReloadChannel =
void main() {
// Ensures bindings are initialized before doing anything.
WidgetsFlutterBinding.ensureInitialized();
ui.PlatformDispatcher.instance.setSemanticsTreeEnabled(true);
// Start listening immediately for messages from the iOS side. ObjC calls
// will be made to let us know when we should be changing the app state.
_kReloadChannel.setMessageHandler(run);
Expand Down
1 change: 0 additions & 1 deletion engine/src/flutter/ci/licenses_golden/excluded_files
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,6 @@
../../../flutter/runtime/fixtures
../../../flutter/runtime/no_dart_plugin_registrant_unittests.cc
../../../flutter/runtime/platform_isolate_manager_unittests.cc
../../../flutter/runtime/runtime_controller_unittests.cc
../../../flutter/runtime/type_conversions_unittests.cc
../../../flutter/shell/common/animator_unittests.cc
../../../flutter/shell/common/base64_unittests.cc
Expand Down
2 changes: 0 additions & 2 deletions engine/src/flutter/ci/licenses_golden/licenses_flutter
Original file line number Diff line number Diff line change
Expand Up @@ -53508,7 +53508,6 @@ ORIGIN: ../../../flutter/shell/platform/darwin/ios/platform_message_handler_ios.
ORIGIN: ../../../flutter/shell/platform/darwin/ios/platform_message_handler_ios_test.mm + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/shell/platform/darwin/ios/platform_view_ios.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/shell/platform/darwin/ios/platform_view_ios.mm + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/shell/platform/darwin/ios/platform_view_ios_test.mm + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/shell/platform/darwin/ios/rendering_api_selection.h + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/shell/platform/darwin/ios/rendering_api_selection.mm + ../../../flutter/LICENSE
ORIGIN: ../../../flutter/shell/platform/darwin/macos/InternalFlutterSwift-Bridging-Header.h + ../../../flutter/LICENSE
Expand Down Expand Up @@ -56595,7 +56594,6 @@ FILE: ../../../flutter/shell/platform/darwin/ios/platform_message_handler_ios.mm
FILE: ../../../flutter/shell/platform/darwin/ios/platform_message_handler_ios_test.mm
FILE: ../../../flutter/shell/platform/darwin/ios/platform_view_ios.h
FILE: ../../../flutter/shell/platform/darwin/ios/platform_view_ios.mm
FILE: ../../../flutter/shell/platform/darwin/ios/platform_view_ios_test.mm
FILE: ../../../flutter/shell/platform/darwin/ios/rendering_api_selection.h
FILE: ../../../flutter/shell/platform/darwin/ios/rendering_api_selection.mm
FILE: ../../../flutter/shell/platform/darwin/macos/InternalFlutterSwift-Bridging-Header.h
Expand Down
1 change: 0 additions & 1 deletion engine/src/flutter/lib/ui/dart_ui.cc
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ typedef CanvasPath Path;
V(PlatformConfigurationNativeApi::UpdateSemantics) \
V(PlatformConfigurationNativeApi::SetNeedsReportTimings) \
V(PlatformConfigurationNativeApi::SetIsolateDebugName) \
V(PlatformConfigurationNativeApi::SetSemanticsTreeEnabled) \
V(PlatformConfigurationNativeApi::RequestDartPerformanceMode) \
V(PlatformConfigurationNativeApi::GetPersistentIsolateData) \
V(PlatformConfigurationNativeApi::ComputePlatformResolvedLocale) \
Expand Down
20 changes: 0 additions & 20 deletions engine/src/flutter/lib/ui/platform_dispatcher.dart
Original file line number Diff line number Diff line change
Expand Up @@ -716,26 +716,6 @@ class PlatformDispatcher {
@Native<Void Function(Int64)>(symbol: 'PlatformConfigurationNativeApi::RegisterBackgroundIsolate')
external static void __registerBackgroundIsolate(int rootIsolateId);

/// Informs the engine whether the framework is generating a semantics tree.
///
/// Only framework knows when semantics tree should be generated. It uses this
/// method to notify the engine whether the framework will generate a semantics tree.
///
/// In the case where platforms want to enable semantics, e.g. when
/// assistive technologies are enabled, it notifies framework through
/// [onSemanticsEnabledChanged].
///
/// After this has been set to true, platforms are expected to prepare for accepting
/// semantics update sent via [FlutterView.updateSemantics]. When this is set to false, platforms
/// may dispose any resources associated with processing semantics as no further
/// semantics updates will be sent via [FlutterView.updateSemantics].
///
/// One must call this method with true before sending update through [updateSemantics].
void setSemanticsTreeEnabled(bool enabled) => _setSemanticsTreeEnabled(enabled);

@Native<Void Function(Bool)>(symbol: 'PlatformConfigurationNativeApi::SetSemanticsTreeEnabled')
external static void _setSemanticsTreeEnabled(bool update);

/// Deprecated. Migrate to [ChannelBuffers.setListener] instead.
///
/// Called whenever this platform dispatcher receives a message from a
Expand Down
5 changes: 3 additions & 2 deletions engine/src/flutter/lib/ui/window.dart
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,9 @@ class FlutterView {

/// Change the retained semantics data about this [FlutterView].
///
/// [PlatformDispatcher.setSemanticsTreeEnabled] must be called with true
/// before sending update through this method.
/// If [PlatformDispatcher.semanticsEnabled] is true, the user has requested that this function
/// be called whenever the semantic content of this [FlutterView]
/// changes.
///
/// This function disposes the given update, which means the semantics update
/// cannot be used further.
Expand Down
8 changes: 0 additions & 8 deletions engine/src/flutter/lib/ui/window/platform_configuration.cc
Original file line number Diff line number Diff line change
Expand Up @@ -669,14 +669,6 @@ void PlatformConfigurationNativeApi::UpdateSemantics(int64_t view_id,
view_id, update);
}

void PlatformConfigurationNativeApi::SetSemanticsTreeEnabled(bool enabled) {
UIDartState::ThrowIfUIOperationsProhibited();
UIDartState::Current()
->platform_configuration()
->client()
->SetSemanticsTreeEnabled(enabled);
}

Dart_Handle PlatformConfigurationNativeApi::ComputePlatformResolvedLocale(
Dart_Handle supportedLocalesHandle) {
UIDartState::ThrowIfUIOperationsProhibited();
Expand Down
9 changes: 0 additions & 9 deletions engine/src/flutter/lib/ui/window/platform_configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,6 @@ class PlatformConfigurationClient {
///
virtual void UpdateSemantics(int64_t viewId, SemanticsUpdate* update) = 0;

//--------------------------------------------------------------------------
/// @brief Notifies whether Framework starts generating semantics tree.
///
/// @param[in] enabled True if Framework starts generating semantics tree.
///
virtual void SetSemanticsTreeEnabled(bool enabled) = 0;

//--------------------------------------------------------------------------
/// @brief When the Flutter application has a message to send to the
/// underlying platform, the message needs to be forwarded to
Expand Down Expand Up @@ -633,8 +626,6 @@ class PlatformConfigurationNativeApi {

static void UpdateSemantics(int64_t viewId, SemanticsUpdate* update);

static void SetSemanticsTreeEnabled(bool enabled);

static void SetNeedsReportTimings(bool value);

static Dart_Handle GetPersistentIsolateData();
Expand Down
2 changes: 0 additions & 2 deletions engine/src/flutter/lib/web_ui/lib/platform_dispatcher.dart
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ abstract class PlatformDispatcher {

void scheduleWarmUpFrame({required VoidCallback beginFrame, required VoidCallback drawFrame});

void setSemanticsTreeEnabled(bool enabled) {}

AccessibilityFeatures get accessibilityFeatures;

VoidCallback? get onAccessibilityFeaturesChanged;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -709,15 +709,6 @@ class EnginePlatformDispatcher extends ui.PlatformDispatcher {
FrameService.instance.scheduleWarmUpFrame(beginFrame: beginFrame, drawFrame: drawFrame);
}

@override
void setSemanticsTreeEnabled(bool enabled) {
if (!enabled) {
for (final EngineFlutterView view in views) {
view.semantics.reset();
}
}
}

/// Updates the application's rendering on the GPU with the newly provided
/// [Scene]. This function must be called within the scope of the
/// [onBeginFrame] or [onDrawFrame] callbacks being invoked. If this function
Expand Down
2 changes: 0 additions & 2 deletions engine/src/flutter/runtime/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ if (enable_unittests) {
"dart_service_isolate_unittests.cc",
"dart_vm_unittests.cc",
"platform_isolate_manager_unittests.cc",
"runtime_controller_unittests.cc",
"type_conversions_unittests.cc",
]

Expand All @@ -148,7 +147,6 @@ if (enable_unittests) {
"//flutter/common",
"//flutter/fml",
"//flutter/lib/snapshot",
"//flutter/shell/common:shell_test_fixture_sources",
"//flutter/skia",
"//flutter/testing",
"//flutter/testing:dart",
Expand Down
1 change: 0 additions & 1 deletion engine/src/flutter/runtime/dart_isolate_unittests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,6 @@ class FakePlatformConfigurationClient : public PlatformConfigurationClient {
double width,
double height) override {}
void UpdateSemantics(int64_t view_id, SemanticsUpdate* update) override {}
void SetSemanticsTreeEnabled(bool enabled) override {}
void HandlePlatformMessage(
std::unique_ptr<PlatformMessage> message) override {}
FontCollection& GetFontCollection() override {
Expand Down
101 changes: 0 additions & 101 deletions engine/src/flutter/runtime/fixtures/runtime_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

import 'dart:async';
import 'dart:isolate';
import 'dart:typed_data';
import 'dart:ui';

import 'split_lib_test.dart' deferred as splitlib;

Expand Down Expand Up @@ -221,102 +219,3 @@ Function createEntryPointForPlatIsoSendAndRecvTest() {
void mainForPlatformIsolatesThrowError() {
throw AssertionError('Error from platform isolate');
}

@pragma('vm:entry-point')
void sendSemanticsUpdate() {
final SemanticsUpdateBuilder builder = SemanticsUpdateBuilder();
const String identifier = 'identifier';
const String label = 'label';
final List<StringAttribute> labelAttributes = <StringAttribute>[
SpellOutStringAttribute(range: const TextRange(start: 1, end: 2)),
];

const String value = 'value';
final List<StringAttribute> valueAttributes = <StringAttribute>[
SpellOutStringAttribute(range: const TextRange(start: 2, end: 3)),
];

const String increasedValue = 'increasedValue';
final List<StringAttribute> increasedValueAttributes = <StringAttribute>[
SpellOutStringAttribute(range: const TextRange(start: 4, end: 5)),
];

const String decreasedValue = 'decreasedValue';
final List<StringAttribute> decreasedValueAttributes = <StringAttribute>[
SpellOutStringAttribute(range: const TextRange(start: 5, end: 6)),
];

const String hint = 'hint';
final List<StringAttribute> hintAttributes = <StringAttribute>[
LocaleStringAttribute(
locale: const Locale('en', 'MX'),
range: const TextRange(start: 0, end: 1),
),
];

const String tooltip = 'tooltip';

final Float64List transform = Float64List(16);
final Int32List childrenInTraversalOrder = Int32List(0);
final Int32List childrenInHitTestOrder = Int32List(0);
final Int32List additionalActions = Int32List(0);
transform[0] = 1;
transform[1] = 0;
transform[2] = 0;
transform[3] = 0;

transform[4] = 0;
transform[5] = 1;
transform[6] = 0;
transform[7] = 0;

transform[8] = 0;
transform[9] = 0;
transform[10] = 1;
transform[11] = 0;

transform[12] = 0;
transform[13] = 0;
transform[14] = 0;
transform[15] = 0;
builder.updateNode(
id: 0,
flags: SemanticsFlags(),
actions: 0,
maxValueLength: 0,
currentValueLength: 0,
textSelectionBase: -1,
textSelectionExtent: -1,
platformViewId: -1,
scrollChildren: 0,
scrollIndex: 0,
scrollPosition: 0,
scrollExtentMax: 0,
scrollExtentMin: 0,
rect: const Rect.fromLTRB(0, 0, 10, 10),
identifier: identifier,
label: label,
labelAttributes: labelAttributes,
value: value,
valueAttributes: valueAttributes,
increasedValue: increasedValue,
increasedValueAttributes: increasedValueAttributes,
decreasedValue: decreasedValue,
decreasedValueAttributes: decreasedValueAttributes,
hint: hint,
hintAttributes: hintAttributes,
tooltip: tooltip,
textDirection: TextDirection.ltr,
transform: transform,
childrenInTraversalOrder: childrenInTraversalOrder,
childrenInHitTestOrder: childrenInHitTestOrder,
additionalActions: additionalActions,
controlsNodes: null,
inputType: SemanticsInputType.none,
locale: null,
);
_semanticsUpdate(builder.build());
}

@pragma('vm:external-name', 'SemanticsUpdate')
external void _semanticsUpdate(SemanticsUpdate update);
10 changes: 4 additions & 6 deletions engine/src/flutter/runtime/runtime_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -441,12 +441,10 @@ void RuntimeController::CheckIfAllViewsRendered() {
// |PlatformConfigurationClient|
void RuntimeController::UpdateSemantics(int64_t view_id,
SemanticsUpdate* update) {
client_.UpdateSemantics(view_id, update->takeNodes(), update->takeActions());
}

// |PlatformConfigurationClient|
void RuntimeController::SetSemanticsTreeEnabled(bool enabled) {
client_.SetSemanticsTreeEnabled(enabled);
if (platform_data_.semantics_enabled) {
client_.UpdateSemantics(view_id, update->takeNodes(),
update->takeActions());
}
}

// |PlatformConfigurationClient|
Expand Down
9 changes: 3 additions & 6 deletions engine/src/flutter/runtime/runtime_controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -633,12 +633,6 @@ class RuntimeController : public PlatformConfigurationClient,
// |PlatformConfigurationClient|
std::shared_ptr<const fml::Mapping> GetPersistentIsolateData() override;

// |PlatformConfigurationClient|
void UpdateSemantics(int64_t view_id, SemanticsUpdate* update) override;

// |PlatformConfigurationClient|
void SetSemanticsTreeEnabled(bool enabled) override;

const fml::WeakPtr<IOManager>& GetIOManager() const {
return context_.io_manager;
}
Expand Down Expand Up @@ -766,6 +760,9 @@ class RuntimeController : public PlatformConfigurationClient,
double width,
double height) override;

// |PlatformConfigurationClient|
void UpdateSemantics(int64_t view_id, SemanticsUpdate* update) override;

// |PlatformConfigurationClient|
void HandlePlatformMessage(std::unique_ptr<PlatformMessage> message) override;

Expand Down
Loading