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 { ...@@ -874,6 +874,9 @@ class RenderCustomPaint extends RenderProxyBox {
if (properties.slider != null) { if (properties.slider != null) {
config.isSlider = properties.slider!; config.isSlider = properties.slider!;
} }
if (properties.keyboardKey != null) {
config.isKeyboardKey = properties.keyboardKey!;
}
if (properties.readOnly != null) { if (properties.readOnly != null) {
config.isReadOnly = properties.readOnly!; config.isReadOnly = properties.readOnly!;
} }
......
...@@ -3705,6 +3705,7 @@ class RenderSemanticsAnnotations extends RenderProxyBox { ...@@ -3705,6 +3705,7 @@ class RenderSemanticsAnnotations extends RenderProxyBox {
bool? selected, bool? selected,
bool? button, bool? button,
bool? slider, bool? slider,
bool? keyboardKey,
bool? link, bool? link,
bool? header, bool? header,
bool? textField, bool? textField,
...@@ -3761,6 +3762,7 @@ class RenderSemanticsAnnotations extends RenderProxyBox { ...@@ -3761,6 +3762,7 @@ class RenderSemanticsAnnotations extends RenderProxyBox {
_selected = selected, _selected = selected,
_button = button, _button = button,
_slider = slider, _slider = slider,
_keyboardKey = keyboardKey,
_link = link, _link = link,
_header = header, _header = header,
_textField = textField, _textField = textField,
...@@ -3920,6 +3922,17 @@ class RenderSemanticsAnnotations extends RenderProxyBox { ...@@ -3920,6 +3922,17 @@ class RenderSemanticsAnnotations extends RenderProxyBox {
markNeedsSemanticsUpdate(); 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 /// If non-null, sets the [SemanticsConfiguration.isLink] semantic to the
/// given value. /// given value.
bool? get link => _link; bool? get link => _link;
...@@ -4662,6 +4675,8 @@ class RenderSemanticsAnnotations extends RenderProxyBox { ...@@ -4662,6 +4675,8 @@ class RenderSemanticsAnnotations extends RenderProxyBox {
config.isLink = link!; config.isLink = link!;
if (slider != null) if (slider != null)
config.isSlider = slider!; config.isSlider = slider!;
if (keyboardKey != null)
config.isKeyboardKey = keyboardKey!;
if (header != null) if (header != null)
config.isHeader = header!; config.isHeader = header!;
if (textField != null) if (textField != null)
......
...@@ -592,6 +592,7 @@ class SemanticsProperties extends DiagnosticableTree { ...@@ -592,6 +592,7 @@ class SemanticsProperties extends DiagnosticableTree {
this.header, this.header,
this.textField, this.textField,
this.slider, this.slider,
this.keyboardKey,
this.readOnly, this.readOnly,
this.focusable, this.focusable,
this.focused, this.focused,
...@@ -698,6 +699,9 @@ class SemanticsProperties extends DiagnosticableTree { ...@@ -698,6 +699,9 @@ class SemanticsProperties extends DiagnosticableTree {
/// slider is focused. /// slider is focused.
final bool? slider; 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. /// If non-null, indicates that this subtree is read only.
/// ///
/// Only applicable when [textField] is true. /// Only applicable when [textField] is true.
...@@ -3694,6 +3698,13 @@ class SemanticsConfiguration { ...@@ -3694,6 +3698,13 @@ class SemanticsConfiguration {
_setFlag(SemanticsFlag.isSlider, value); _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. /// Whether the owning [RenderObject] is considered hidden.
/// ///
/// Hidden elements are currently not visible on screen. They may be covered /// Hidden elements are currently not visible on screen. They may be covered
......
...@@ -7160,6 +7160,7 @@ class Semantics extends SingleChildRenderObjectWidget { ...@@ -7160,6 +7160,7 @@ class Semantics extends SingleChildRenderObjectWidget {
bool? toggled, bool? toggled,
bool? button, bool? button,
bool? slider, bool? slider,
bool? keyboardKey,
bool? link, bool? link,
bool? header, bool? header,
bool? textField, bool? textField,
...@@ -7218,6 +7219,7 @@ class Semantics extends SingleChildRenderObjectWidget { ...@@ -7218,6 +7219,7 @@ class Semantics extends SingleChildRenderObjectWidget {
selected: selected, selected: selected,
button: button, button: button,
slider: slider, slider: slider,
keyboardKey: keyboardKey,
link: link, link: link,
header: header, header: header,
textField: textField, textField: textField,
...@@ -7335,6 +7337,7 @@ class Semantics extends SingleChildRenderObjectWidget { ...@@ -7335,6 +7337,7 @@ class Semantics extends SingleChildRenderObjectWidget {
selected: properties.selected, selected: properties.selected,
button: properties.button, button: properties.button,
slider: properties.slider, slider: properties.slider,
keyboardKey: properties.keyboardKey,
link: properties.link, link: properties.link,
header: properties.header, header: properties.header,
textField: properties.textField, textField: properties.textField,
...@@ -7409,6 +7412,7 @@ class Semantics extends SingleChildRenderObjectWidget { ...@@ -7409,6 +7412,7 @@ class Semantics extends SingleChildRenderObjectWidget {
..selected = properties.selected ..selected = properties.selected
..button = properties.button ..button = properties.button
..slider = properties.slider ..slider = properties.slider
..keyboardKey = properties.keyboardKey
..link = properties.link ..link = properties.link
..header = properties.header ..header = properties.header
..textField = properties.textField ..textField = properties.textField
......
...@@ -417,6 +417,7 @@ void _defineTests() { ...@@ -417,6 +417,7 @@ void _defineTests() {
hidden: true, hidden: true,
button: true, button: true,
slider: true, slider: true,
keyboardKey: true,
link: true, link: true,
textField: true, textField: true,
readOnly: true, readOnly: true,
...@@ -468,6 +469,7 @@ void _defineTests() { ...@@ -468,6 +469,7 @@ void _defineTests() {
hidden: true, hidden: true,
button: true, button: true,
slider: true, slider: true,
keyboardKey: true,
link: true, link: true,
textField: true, textField: true,
readOnly: true, readOnly: true,
......
...@@ -519,6 +519,7 @@ void main() { ...@@ -519,6 +519,7 @@ void main() {
selected: true, selected: true,
button: true, button: true,
slider: true, slider: true,
keyboardKey: true,
link: true, link: true,
textField: true, textField: true,
readOnly: true, readOnly: true,
......
...@@ -450,6 +450,7 @@ Matcher matchesSemantics({ ...@@ -450,6 +450,7 @@ Matcher matchesSemantics({
bool isSelected = false, bool isSelected = false,
bool isButton = false, bool isButton = false,
bool isSlider = false, bool isSlider = false,
bool isKeyboardKey = false,
bool isLink = false, bool isLink = false,
bool isFocused = false, bool isFocused = false,
bool isFocusable = false, bool isFocusable = false,
...@@ -503,6 +504,7 @@ Matcher matchesSemantics({ ...@@ -503,6 +504,7 @@ Matcher matchesSemantics({
if (isSelected) SemanticsFlag.isSelected, if (isSelected) SemanticsFlag.isSelected,
if (isButton) SemanticsFlag.isButton, if (isButton) SemanticsFlag.isButton,
if (isSlider) SemanticsFlag.isSlider, if (isSlider) SemanticsFlag.isSlider,
if (isKeyboardKey) SemanticsFlag.isKeyboardKey,
if (isLink) SemanticsFlag.isLink, if (isLink) SemanticsFlag.isLink,
if (isTextField) SemanticsFlag.isTextField, if (isTextField) SemanticsFlag.isTextField,
if (isReadOnly) SemanticsFlag.isReadOnly, if (isReadOnly) SemanticsFlag.isReadOnly,
......
...@@ -574,6 +574,7 @@ void main() { ...@@ -574,6 +574,7 @@ void main() {
isSelected: true, isSelected: true,
isButton: true, isButton: true,
isSlider: true, isSlider: true,
isKeyboardKey: true,
isLink: true, isLink: true,
isTextField: true, isTextField: true,
isReadOnly: 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