Unverified Commit beb62a66 authored by Alexander Brusher's avatar Alexander Brusher Committed by GitHub

Rolls isKeyboardKey engine change with fix (#79407)

* Adds a semantics node flag to identify sliders.

* [fuchsia] Fix roll of engine PR #25167

This changes fixes tests failing due to new isKeyboardKey semantics
flag.

* Fix typo
Co-authored-by: 's avatarZachary Anderson <zanderso@users.noreply.github.com>
parent 63ab46f5
dbcbf69a57b98ecc962224ae6958121e50462e35
70af54fa0b6081dbe7f9cec3a105ad2ea6ab6efb
......@@ -874,6 +874,9 @@ class RenderCustomPaint extends RenderProxyBox {
if (properties.slider != null) {
config.isSlider = properties.slider!;
}
if (properties.keyboardKey != null) {
config.isKeyboardKey = properties.keyboardKey!;
}
if (properties.readOnly != null) {
config.isReadOnly = properties.readOnly!;
}
......
......@@ -3705,6 +3705,7 @@ class RenderSemanticsAnnotations extends RenderProxyBox {
bool? selected,
bool? button,
bool? slider,
bool? keyboardKey,
bool? link,
bool? header,
bool? textField,
......@@ -3761,6 +3762,7 @@ class RenderSemanticsAnnotations extends RenderProxyBox {
_selected = selected,
_button = button,
_slider = slider,
_keyboardKey = keyboardKey,
_link = link,
_header = header,
_textField = textField,
......@@ -3920,6 +3922,17 @@ class RenderSemanticsAnnotations extends RenderProxyBox {
markNeedsSemanticsUpdate();
}
/// If non-null, sets the [SemanticsConfiguration.isKeyboardKey] semantic to the
/// given value.
bool? get keyboardKey => _keyboardKey;
bool? _keyboardKey;
set keyboardKey(bool? value) {
if (keyboardKey == value)
return;
_keyboardKey = value;
markNeedsSemanticsUpdate();
}
/// If non-null, sets the [SemanticsConfiguration.isLink] semantic to the
/// given value.
bool? get link => _link;
......@@ -4662,6 +4675,8 @@ class RenderSemanticsAnnotations extends RenderProxyBox {
config.isLink = link!;
if (slider != null)
config.isSlider = slider!;
if (keyboardKey != null)
config.isKeyboardKey = keyboardKey!;
if (header != null)
config.isHeader = header!;
if (textField != null)
......
......@@ -592,6 +592,7 @@ class SemanticsProperties extends DiagnosticableTree {
this.header,
this.textField,
this.slider,
this.keyboardKey,
this.readOnly,
this.focusable,
this.focused,
......@@ -698,6 +699,9 @@ class SemanticsProperties extends DiagnosticableTree {
/// slider is focused.
final bool? slider;
/// If non-null, indicates that this subtree represents a keyboard key.
final bool? keyboardKey;
/// If non-null, indicates that this subtree is read only.
///
/// Only applicable when [textField] is true.
......@@ -3694,6 +3698,13 @@ class SemanticsConfiguration {
_setFlag(SemanticsFlag.isSlider, value);
}
/// Whether the owning [RenderObject] is a keyboard key (true) or not
//(false).
bool get isKeyboardKey => _hasFlag(SemanticsFlag.isKeyboardKey);
set isKeyboardKey(bool value) {
_setFlag(SemanticsFlag.isKeyboardKey, value);
}
/// Whether the owning [RenderObject] is considered hidden.
///
/// Hidden elements are currently not visible on screen. They may be covered
......
......@@ -7160,6 +7160,7 @@ class Semantics extends SingleChildRenderObjectWidget {
bool? toggled,
bool? button,
bool? slider,
bool? keyboardKey,
bool? link,
bool? header,
bool? textField,
......@@ -7218,6 +7219,7 @@ class Semantics extends SingleChildRenderObjectWidget {
selected: selected,
button: button,
slider: slider,
keyboardKey: keyboardKey,
link: link,
header: header,
textField: textField,
......@@ -7335,6 +7337,7 @@ class Semantics extends SingleChildRenderObjectWidget {
selected: properties.selected,
button: properties.button,
slider: properties.slider,
keyboardKey: properties.keyboardKey,
link: properties.link,
header: properties.header,
textField: properties.textField,
......@@ -7409,6 +7412,7 @@ class Semantics extends SingleChildRenderObjectWidget {
..selected = properties.selected
..button = properties.button
..slider = properties.slider
..keyboardKey = properties.keyboardKey
..link = properties.link
..header = properties.header
..textField = properties.textField
......
......@@ -417,6 +417,7 @@ void _defineTests() {
hidden: true,
button: true,
slider: true,
keyboardKey: true,
link: true,
textField: true,
readOnly: true,
......@@ -468,6 +469,7 @@ void _defineTests() {
hidden: true,
button: true,
slider: true,
keyboardKey: true,
link: true,
textField: true,
readOnly: true,
......
......@@ -519,6 +519,7 @@ void main() {
selected: true,
button: true,
slider: true,
keyboardKey: true,
link: true,
textField: true,
readOnly: true,
......
......@@ -450,6 +450,7 @@ Matcher matchesSemantics({
bool isSelected = false,
bool isButton = false,
bool isSlider = false,
bool isKeyboardKey = false,
bool isLink = false,
bool isFocused = false,
bool isFocusable = false,
......@@ -503,6 +504,7 @@ Matcher matchesSemantics({
if (isSelected) SemanticsFlag.isSelected,
if (isButton) SemanticsFlag.isButton,
if (isSlider) SemanticsFlag.isSlider,
if (isKeyboardKey) SemanticsFlag.isKeyboardKey,
if (isLink) SemanticsFlag.isLink,
if (isTextField) SemanticsFlag.isTextField,
if (isReadOnly) SemanticsFlag.isReadOnly,
......
......@@ -574,6 +574,7 @@ void main() {
isSelected: true,
isButton: true,
isSlider: true,
isKeyboardKey: true,
isLink: true,
isTextField: true,
isReadOnly: true,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment