fix heading level absorption, diagnostics; add tests and an a11y use-case (#151421)

Multiple fixes related to heading levels:

* Fix heading level absorption. Heading level would get erased when a semantics config is absorbed into another. With this change the highest heading level wins.
* Add `headingLevel` to the diagnostics of `SemanticsNode`.
* Add unit-tests for heading levels.
* Add an a11y use-case for headings.

Improves https://github.com/flutter/flutter/issues/46789 and general accessibility of headings.
This commit is contained in:
Yegor
2024-07-09 22:11:38 -07:00
committed by GitHub
parent 72f83d3237
commit fe07fb4eba
7 changed files with 218 additions and 11 deletions

View File

@@ -0,0 +1,15 @@
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
{{flutter_js}}
{{flutter_build_config}}
_flutter.loader.load({
config: {
// Use the local CanvasKit bundle instead of the CDN to reduce test flakiness.
canvasKitBaseUrl: "/canvaskit/",
// Set this to `true` to make semantic DOM nodes visible on the UI. This is
// sometimes useful for debugging.
debugShowSemanticsNodes: false,
},
});