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,
},
});

View File

@@ -35,12 +35,6 @@ found in the LICENSE file. -->
<title>a11y_assessments</title>
<link rel="manifest" href="manifest.json">
<script>
// The value below is injected by flutter build, do not touch.
const serviceWorkerVersion = null;
</script>
<!-- This script adds the flutter initialization JS code -->
</head>
<body>
<script src="flutter_bootstrap.js" async></script>