Skip to content

Commit 3a3fba3

Browse files
authored
Sync Flutter 3.41.4 source code (flutter-tizen#161)
1 parent 4a1a76c commit 3a3fba3

File tree

17 files changed

+70
-33
lines changed

17 files changed

+70
-33
lines changed

DEPS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ deps = {
77
'src/third_party/libcxx': 'https://llvm.googlesource.com/llvm-project/libcxx@bd557f6f764d1e40b62528a13b124ce740624f8f',
88
'src/third_party/libcxxabi': 'https://llvm.googlesource.com/llvm-project/libcxxabi@a4dda1589d37a7e4b4f7a81ebad01b1083f2e726',
99
'src/third_party/googletest': 'https://github.com/google/googletest@7f036c5563af7d0329f20e8bb42effb04629f0c0',
10-
'src/third_party/dart': 'https://dart.googlesource.com/sdk.git@2da4111d8d0cbf2a83c0662251508f017000da8a',
10+
'src/third_party/dart': 'https://dart.googlesource.com/sdk.git@e927f58e327ae13d056a16bb2ebf618e071c20a7',
1111
'src/third_party/clang': {
1212
'packages': [
1313
{

flutter/shell/platform/common/accessibility_bridge.cc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,13 @@ void AccessibilityBridge::SetStringListAttributesFromFlutterUpdate(
524524
}
525525
}
526526

527+
void AccessibilityBridge::SetIdentifierFromFlutterUpdate(
528+
ui::AXNodeData& node_data,
529+
const SemanticsNode& node) {
530+
node_data.AddStringAttribute(ax::mojom::StringAttribute::kIdentifier,
531+
node.identifier);
532+
}
533+
527534
void AccessibilityBridge::SetNameFromFlutterUpdate(ui::AXNodeData& node_data,
528535
const SemanticsNode& node) {
529536
node_data.SetName(node.label);
@@ -635,6 +642,9 @@ AccessibilityBridge::FromFlutterSemanticsNode(
635642
flutter_node.custom_accessibility_actions +
636643
flutter_node.custom_accessibility_actions_count);
637644
}
645+
if (flutter_node.identifier) {
646+
result.identifier = std::string(flutter_node.identifier);
647+
}
638648
return result;
639649
}
640650

flutter/shell/platform/common/accessibility_bridge.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ class AccessibilityBridge
182182
std::vector<int32_t> children_in_traversal_order;
183183
std::vector<int32_t> custom_accessibility_actions;
184184
int32_t heading_level;
185+
std::string identifier;
185186
} SemanticsNode;
186187

187188
// See FlutterSemanticsCustomAction in embedder.h
@@ -226,6 +227,8 @@ class AccessibilityBridge
226227
const SemanticsNode& node);
227228
void SetStringListAttributesFromFlutterUpdate(ui::AXNodeData& node_data,
228229
const SemanticsNode& node);
230+
void SetIdentifierFromFlutterUpdate(ui::AXNodeData& node_data,
231+
const SemanticsNode& node);
229232
void SetNameFromFlutterUpdate(ui::AXNodeData& node_data,
230233
const SemanticsNode& node);
231234
void SetValueFromFlutterUpdate(ui::AXNodeData& node_data,

flutter/shell/platform/common/client_wrapper/include/flutter/encodable_value.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <cassert>
1010
#include <cstdint>
1111
#include <map>
12+
#include <optional>
1213
#include <string>
1314
#include <utility>
1415
#include <variant>
@@ -216,6 +217,23 @@ class EncodableValue : public internal::EncodableValueVariant {
216217
return std::get<int64_t>(*this);
217218
}
218219

220+
// Convenience method to simplify handling objects received from Flutter
221+
// where the values may be larger than 32-bit, since they have the same type
222+
// on the Dart side, but will be either 32-bit or 64-bit here depending on
223+
// the value.
224+
//
225+
// Calling this method if the value doesn't contain either an int32_t or an
226+
// int64_t will return std::nullopt.
227+
std::optional<int64_t> TryGetLongValue() const {
228+
if (std::holds_alternative<int32_t>(*this)) {
229+
return std::get<int32_t>(*this);
230+
}
231+
if (std::holds_alternative<int64_t>(*this)) {
232+
return std::get<int64_t>(*this);
233+
}
234+
return std::nullopt;
235+
}
236+
219237
// The C++ Standard Library implementations can get into issues with recursive
220238
// constraint satisfaction when (among other things) objects of this type (which
221239
// is an `std::variant` subclass) are put into containers like `std::vector`.

flutter/shell/platform/common/windowing.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@
88
namespace flutter {
99

1010
// Types of windows.
11-
// The value must match value from WindowType in the Dart code
12-
// in packages/flutter/lib/src/widgets/window.dart
1311
enum class WindowArchetype {
1412
// Regular top-level window.
1513
kRegular,
14+
15+
// Dialog window.
16+
kDialog,
1617
};
1718

1819
} // namespace flutter

flutter/shell/platform/embedder/embedder.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,8 @@ typedef struct {
352352
bool is_slider;
353353
/// Whether the semantics node represents a keyboard key.
354354
bool is_keyboard_key;
355+
/// Whether to block a11y focus for the semantics node.
356+
bool is_accessibility_focus_blocked;
355357
} FlutterSemanticsFlags;
356358

357359
typedef enum {
@@ -1742,6 +1744,11 @@ typedef struct {
17421744
/// heading; higher values (1, 2, …) indicate the heading rank, with lower
17431745
/// numbers being higher-level headings.
17441746
int32_t heading_level;
1747+
/// An identifier for the semantics node in native accessibility hierarchy.
1748+
/// This value should not be exposed to the users of the app.
1749+
/// This is usually used for UI testing with tools that work by querying the
1750+
/// native accessibility, like UI Automator, XCUITest, or Appium.
1751+
const char* identifier;
17451752
} FlutterSemanticsNode2;
17461753

17471754
/// `FlutterSemanticsCustomAction` ID used as a sentinel to signal the end of a

flutter/third_party/accessibility/ax/ax_active_popup.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#ifndef UI_ACCESSIBILITY_AX_ACTIVE_POPUP_H_
66
#define UI_ACCESSIBILITY_AX_ACTIVE_POPUP_H_
77

8-
#include <cstdint>
98
#include <optional>
109

1110
#include "ax/ax_export.h"

flutter/third_party/accessibility/ax/ax_constants.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5+
#ifndef UI_ACCESSIBILITY_AX_CONSTANTS_H_
6+
#define UI_ACCESSIBILITY_AX_CONSTANTS_H_
7+
58
#include <cstdint>
69

710
namespace ax {
@@ -19,3 +22,5 @@ const int32_t kUnknownAriaColumnOrRowCount = -1;
1922
} // namespace mojom
2023

2124
} // namespace ax
25+
26+
#endif // UI_ACCESSIBILITY_AX_CONSTANTS_H_

flutter/third_party/accessibility/ax/ax_enum_util.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1433,6 +1433,8 @@ const char* ToString(ax::mojom::StringAttribute string_attribute) {
14331433
return "fontFamily";
14341434
case ax::mojom::StringAttribute::kHtmlTag:
14351435
return "htmlTag";
1436+
case ax::mojom::StringAttribute::kIdentifier:
1437+
return "identifier";
14361438
case ax::mojom::StringAttribute::kImageAnnotation:
14371439
return "imageAnnotation";
14381440
case ax::mojom::StringAttribute::kImageDataUrl:
@@ -1493,6 +1495,8 @@ ax::mojom::StringAttribute ParseStringAttribute(const char* string_attribute) {
14931495
return ax::mojom::StringAttribute::kFontFamily;
14941496
if (0 == strcmp(string_attribute, "htmlTag"))
14951497
return ax::mojom::StringAttribute::kHtmlTag;
1498+
if (0 == strcmp(string_attribute, "identifier"))
1499+
return ax::mojom::StringAttribute::kIdentifier;
14961500
if (0 == strcmp(string_attribute, "imageAnnotation"))
14971501
return ax::mojom::StringAttribute::kImageAnnotation;
14981502
if (0 == strcmp(string_attribute, "imageDataUrl"))

flutter/third_party/accessibility/ax/ax_enums.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,7 @@ enum class StringAttribute {
533533
// Only present when different from parent.
534534
kFontFamily,
535535
kHtmlTag,
536+
kIdentifier,
536537
// Stores an automatic image annotation if one is available. Only valid on
537538
// ax::mojom::Role::kImage. See kImageAnnotationStatus, too.
538539
kImageAnnotation,

0 commit comments

Comments
 (0)