This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Commit 076688d
authored
[web:a11y] make header a <header> when non-empty and heading when empty (#55996)
This relands the [reverted](#55993) [original PR](#55747) with one important adjustment: if the header is empty and has a label, it is rendered as a heading (`<h1>`, `<h2>`, etc) instead of a `<header>`. This is to be consistent with mobile, where headers are frequently used as headings, and screen readers do indeed read it as "heading". Changing all headers to the `<header>` tag turned to out to be too disruptive to existing usages of `SemanticsProperties.header`.
Long-term, when flutter/flutter#155928 is implemented, we could migrate the framework to use `SemanticsProperties.headingLevel` to communicate that something is a heading, and encourage our users to move from `header` to `headingLevel` as well. After that migration is done, we could make all headers proper `<header>` tags, and not special-case empty headers.
Fixes flutter/flutter#1522681 parent 2be456e commit 076688d
File tree
7 files changed
+133
-28
lines changed- ci/licenses_golden
- lib/web_ui
- lib/src
- engine
- semantics
- test/engine/semantics
7 files changed
+133
-28
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43885 | 43885 | | |
43886 | 43886 | | |
43887 | 43887 | | |
| 43888 | + | |
43888 | 43889 | | |
43889 | 43890 | | |
43890 | 43891 | | |
| |||
46752 | 46753 | | |
46753 | 46754 | | |
46754 | 46755 | | |
| 46756 | + | |
46755 | 46757 | | |
46756 | 46758 | | |
46757 | 46759 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
| 150 | + | |
150 | 151 | | |
151 | 152 | | |
152 | 153 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
396 | 397 | | |
397 | 398 | | |
398 | 399 | | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
399 | 406 | | |
400 | 407 | | |
401 | 408 | | |
402 | 409 | | |
403 | 410 | | |
404 | | - | |
405 | | - | |
406 | | - | |
407 | 411 | | |
408 | 412 | | |
409 | 413 | | |
| |||
688 | 692 | | |
689 | 693 | | |
690 | 694 | | |
691 | | - | |
| 695 | + | |
692 | 696 | | |
693 | 697 | | |
694 | 698 | | |
695 | 699 | | |
696 | | - | |
697 | | - | |
698 | 700 | | |
699 | 701 | | |
700 | 702 | | |
701 | 703 | | |
702 | 704 | | |
703 | 705 | | |
704 | 706 | | |
705 | | - | |
706 | | - | |
707 | | - | |
708 | 707 | | |
709 | 708 | | |
710 | 709 | | |
| |||
1123 | 1122 | | |
1124 | 1123 | | |
1125 | 1124 | | |
1126 | | - | |
1127 | | - | |
| 1125 | + | |
| 1126 | + | |
1128 | 1127 | | |
1129 | 1128 | | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
1130 | 1143 | | |
1131 | 1144 | | |
1132 | 1145 | | |
| |||
1136 | 1149 | | |
1137 | 1150 | | |
1138 | 1151 | | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
1139 | 1182 | | |
1140 | 1183 | | |
1141 | 1184 | | |
| |||
1271 | 1314 | | |
1272 | 1315 | | |
1273 | 1316 | | |
1274 | | - | |
1275 | | - | |
1276 | | - | |
1277 | | - | |
| 1317 | + | |
1278 | 1318 | | |
1279 | 1319 | | |
1280 | 1320 | | |
| |||
1673 | 1713 | | |
1674 | 1714 | | |
1675 | 1715 | | |
| 1716 | + | |
| 1717 | + | |
1676 | 1718 | | |
1677 | 1719 | | |
1678 | 1720 | | |
| |||
1690 | 1732 | | |
1691 | 1733 | | |
1692 | 1734 | | |
| 1735 | + | |
| 1736 | + | |
1693 | 1737 | | |
1694 | 1738 | | |
1695 | 1739 | | |
| |||
1707 | 1751 | | |
1708 | 1752 | | |
1709 | 1753 | | |
| 1754 | + | |
1710 | 1755 | | |
1711 | 1756 | | |
1712 | 1757 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
742 | 742 | | |
743 | 743 | | |
744 | 744 | | |
745 | | - | |
| 745 | + | |
746 | 746 | | |
747 | 747 | | |
748 | 748 | | |
| |||
757 | 757 | | |
758 | 758 | | |
759 | 759 | | |
760 | | - | |
761 | | - | |
762 | | - | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
763 | 781 | | |
764 | 782 | | |
765 | 783 | | |
766 | 784 | | |
767 | | - | |
768 | | - | |
769 | | - | |
770 | | - | |
771 | | - | |
772 | | - | |
773 | | - | |
| 785 | + | |
774 | 786 | | |
775 | 787 | | |
776 | 788 | | |
| |||
794 | 806 | | |
795 | 807 | | |
796 | 808 | | |
797 | | - | |
| 809 | + | |
798 | 810 | | |
799 | 811 | | |
800 | 812 | | |
| |||
0 commit comments