From 6e09d07b20590e418fb80520c33ad2c23fe93667 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bartosz=20Dziewo=C5=84ski?= Date: Mon, 16 Jul 2018 18:30:55 +0200 Subject: [PATCH] Set role=button on TOC show/hide checkbox This should give more intuitive hints in assistive technology, identical (or similar) to the hints for the JavaScript-generated button we had before 68527cf47935a0350d3f0a153bd06cbb98062ec8. See results of testing with Windows Narrator/VoiceOver: T195053#4428563. Bug: T195053 Change-Id: I9358b29f56ac1e43e9c5ed00d30ce6ffdf903299 --- includes/Linker.php | 1 + tests/parser/parserTests.txt | 62 ++++++++++++++++++------------------ 2 files changed, 32 insertions(+), 31 deletions(-) diff --git a/includes/Linker.php b/includes/Linker.php index 3f0ecf6fb6..f160fd67fa 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -1564,6 +1564,7 @@ class Linker { return '
' . Html::element( 'input', [ 'type' => 'checkbox', + 'role' => 'button', 'id' => 'toctogglecheckbox', 'class' => 'toctogglecheckbox', 'style' => 'display:none', diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index d9a21eeceb..32542711aa 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -16666,7 +16666,7 @@ Section headings with TOC Some text ===Another headline=== !! html -

Contents

+

Contents

  • 1 Headline 1
      @@ -16709,7 +16709,7 @@ __FORCETOC__ ==Headline 2== ==Headline== !! html/php -

      Contents

      +

      Contents

      • 1 Headline 2
      • 2 Headline
      • @@ -16743,7 +16743,7 @@ parsoid=wt2html =========Level 9 Heading========= ==========Level 10 Heading========== !! html/php -

        Contents

        +

        Contents

        • 1 Level 1 Heading
            @@ -16807,7 +16807,7 @@ TOC regression (T11764) ==title 2== ===title 2.1=== !! html -

            Contents

            +

            Contents

            • 1 title 1
                @@ -16842,7 +16842,7 @@ TOC for heading containing (T96153) __FORCETOC__ ==New title== !! html/php -

                Contents

                +

                Contents

                @@ -16864,7 +16864,7 @@ wgMaxTocLevel=3 ==title 2== ===title 2.1=== !! html -

                Contents

                +

                Contents

                • 1 title 1
                    @@ -16900,7 +16900,7 @@ wgMaxTocLevel=3 ====Section 1.1.1.1==== ==Section 2== !! html -

                    Contents

                    +

                    Contents

                    • 1 Section 1
                        @@ -16993,7 +16993,7 @@ __TOC__ ===title 1.1=== ==title 2== !! html -

                        Contents

                        +

                        Contents

                        • 1 title 1
                            @@ -17069,7 +17069,7 @@ section 5 !! html/php

                            The tooltips shall not show entities to the user (ie. be double escaped)

                            -

                            Contents

                            +

                            Contents

                            • 1 text > text
                            • 2 text < text
                            • @@ -17145,7 +17145,7 @@ section 6 !! html/php

                              Id should not contain + for spaces

                              -

                              Contents

                              +

                              Contents

                              • 1 Space between Text
                              • 2 Space-Entity between Text
                              • @@ -17221,7 +17221,7 @@ parsoid=wt2html,wt2wt,html2html =''italic'' heading== ==''italic'' heading= !! html/php -

                                Contents

                                +

                                Contents

                                • 1 foo=
                                • 2 =foo
                                • @@ -17256,7 +17256,7 @@ HTML headers vs TOC (T25393) ==Header 2.2== __NOEDITSECTION__ !! html/php -

                                  Contents

                                  +

                                  Contents

                                  • 1 Header 1
                                      @@ -19182,7 +19182,7 @@ Fuzz testing: Parser14 http://__TOC__ !! html/php

                                      onmouseover=[edit]

                                      -http://

                                      Contents

                                      +http://

                                      Contents

                                      @@ -19191,7 +19191,7 @@ http://
                                      onmouseover=[edit]

                                      -http://

                                      Contents

                                      +http://

                                      Contents

                                      @@ -21763,7 +21763,7 @@ Out-of-order TOC heading levels =====5===== ==2== !! html -

                                      Contents

                                      +

                                      Contents

                                      • 1 2
                                          @@ -24433,7 +24433,7 @@ title=[[Main Page]] __TOC__ ==''Lost'' episodes== !! html/php -

                                          Contents

                                          +

                                          Contents

                                          @@ -24454,7 +24454,7 @@ title=[[Main Page]] __TOC__ =='''should be bold''' then normal text== !! html/php -

                                          Contents

                                          +

                                          Contents

                                          @@ -24475,7 +24475,7 @@ title=[[Main Page]] __TOC__ ==Image [[Image:foobar.jpg]]== !! html/php -

                                          Contents

                                          +

                                          Contents

                                          @@ -24496,7 +24496,7 @@ title=[[Main Page]] __TOC__ ==
                                          Quote
                                          == !! html/php -

                                          Contents

                                          +

                                          Contents

                                          @@ -24505,7 +24505,7 @@ __TOC__

                                          Quote
                                          [edit]

                                          !! html/php+tidy -

                                          Contents

                                          +

                                          Contents

                                          @@ -24529,7 +24529,7 @@ __TOC__ Hanc marginis exiguitas non caperet. QED !! html/php -

                                          Contents

                                          +

                                          Contents

                                          @@ -24554,7 +24554,7 @@ __TOC__ ==Foo
                                          Bar
                                          == !! html/php -

                                          Contents

                                          +

                                          Contents

                                          • 1 Foo Bar
                                          • 2 Foo Bar
                                          • @@ -24565,7 +24565,7 @@ __TOC__

                                            Foo
                                            Bar
                                            [edit]

                                            !! html/php+tidy -

                                            Contents

                                            +

                                            Contents

                                            • 1 Foo Bar
                                            • 2 Foo Bar
                                            • @@ -24593,7 +24593,7 @@ __TOC__ ==Evilbye== !! html/php -

                                              Contents

                                              +

                                              Contents

                                              • 1 Hello
                                              • 2 b">Evilbye
                                              • @@ -24624,7 +24624,7 @@ __TOC__ ==Attributes after dir on these span tags must be deleted from the TOC== !! html/php -

                                                Contents

                                                +

                                                Contents

                                                • 1 C++
                                                • 2 זבנג!
                                                • @@ -24655,7 +24655,7 @@ T74884: bdi element in ToC __TOC__ ==test== !! html/php -

                                                  Contents

                                                  +

                                                  Contents

                                                  @@ -24674,7 +24674,7 @@ T35715: s/strike element in ToC __TOC__ ==test test test== !! html/php -

                                                  Contents

                                                  +

                                                  Contents

                                                  @@ -24693,7 +24693,7 @@ Empty

                                                  tag in TOC, removed by Sanitizer (T92892) __TOC__ ==x== !! html/php -

                                                  Contents

                                                  +

                                                  Contents

                                                  @@ -30615,7 +30615,7 @@ wgFragmentMode=[ 'html5', 'legacy' ] [[#啤酒]] [[#%E5%95%A4%E9%85%92]] !! html/php -

                                                  Contents

                                                  +

                                                  Contents

                                                  • 1 Foo bar
                                                  • 2 foo Bar
                                                  • @@ -30681,7 +30681,7 @@ wgFragmentMode=[ 'legacy', 'html5' ] [[#啤酒]] [[#%E5%95%A4%E9%85%92]] !! html/php -

                                                    Contents

                                                    +

                                                    Contents