From: Fomafix Date: Thu, 8 Jun 2017 07:56:36 +0000 (+0200) Subject: Remove id selector for toctitle X-Git-Tag: 1.31.0-rc.0~3021^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22statistiques_visites%22%2C%22%22%29%20.%20%22?a=commitdiff_plain;h=fbf939cdda77bdeb6335fe0cec6b2a9cb6b0e5e2;p=lhc%2Fweb%2Fwiklou.git Remove id selector for toctitle In 1bf5a652 the id selector was changed to a class selector for toctitle. The cached HTML has been expired now and the id selector is not necessary anymore. Also remove the id selector #toc.tochidden for print style. This is not necessary because the tochidden gets only added to .toc and not to #toc. Change-Id: I43cfffdb0807e8ed8f6b7b8732ba857b709bee80 --- diff --git a/includes/Linker.php b/includes/Linker.php index bed9957f00..b133ecdbbe 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -1561,7 +1561,7 @@ class Linker { $title = wfMessage( 'toc' )->inLanguage( $lang )->escaped(); return '
' - . '

' . $title . "

\n" + . '

' . $title . "

\n" . $toc . "\n
\n"; } diff --git a/resources/src/mediawiki/mediawiki.toc.js b/resources/src/mediawiki/mediawiki.toc.js index 9ef6c4384a..53e8d93b3c 100644 --- a/resources/src/mediawiki/mediawiki.toc.js +++ b/resources/src/mediawiki/mediawiki.toc.js @@ -6,9 +6,7 @@ $content.find( '.toc' ).addBack( '.toc' ).each( function () { var hideToc, $this = $( this ), - // .toctitle is new so may not exist in HTML caches for a few weeks, - // so keep checking for #toctitle for now - $tocTitle = $this.find( '.toctitle, #toctitle' ), + $tocTitle = $this.find( '.toctitle' ), $tocToggleLink = $this.find( '.togglelink' ), $tocList = $this.find( 'ul' ).eq( 0 ); diff --git a/resources/src/mediawiki/mediawiki.toc.print.css b/resources/src/mediawiki/mediawiki.toc.print.css index 5f6eb2586d..69e944021f 100644 --- a/resources/src/mediawiki/mediawiki.toc.print.css +++ b/resources/src/mediawiki/mediawiki.toc.print.css @@ -1,4 +1,3 @@ -#toc.tochidden, .toc.tochidden, .toctoggle { display: none; diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index 69fee303ec..812769558f 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -15937,7 +15937,7 @@ Section headings with TOC Some text ===Another headline=== !! html -

Contents

+

Contents

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

      Contents

      +

      Contents

      • 1 Headline 2
      • 2 Headline
      • @@ -16011,7 +16011,7 @@ Handling of sections up to level 6 and beyond ========= Level 9 Heading========= ========== Level 10 Heading========== !! html -

        Contents

        +

        Contents

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

            Contents

            +

            Contents

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

                Contents

                +

                Contents

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

                Contents

                +

                Contents

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

                    Contents

                    +

                    Contents

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

                        Contents

                        +

                        Contents

                        • 1 title 1
                            @@ -16317,7 +16317,7 @@ section 5 !! html

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

                            -

                            Contents

                            +

                            Contents

                            • 1 text > text
                            • 2 text < text
                            • @@ -16376,7 +16376,7 @@ section 6 !! html

                              Id should not contain + for spaces

                              -

                              Contents

                              +

                              Contents

                              • 1 Space between Text
                              • 2 Space-Entity between Text
                              • @@ -16422,7 +16422,7 @@ Headers with excess '=' characters =''italic'' heading== ==''italic'' heading= !! html -

                                Contents

                                +

                                Contents

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

                                  Contents

                                  +

                                  Contents

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

                                      onmouseover=[edit]

                                      -http://

                                      Contents

                                      +http://

                                      Contents

                                      @@ -18251,7 +18251,7 @@ http://

                                      Content

                                      onmouseover=[edit]

                                      http://

                                      -
                                      +

                                      Contents

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

                                        Contents

                                        +

                                        Contents

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

                                            Contents

                                            +

                                            Contents

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

                                            Contents

                                            +

                                            Contents

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

                                            Contents

                                            +

                                            Contents

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

                                            Contents

                                            +

                                            Contents

                                            @@ -22827,7 +22827,7 @@ __TOC__ !! html/php+tidy

                                            -
                                            +

                                            Contents

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

                                              Contents

                                              +

                                              Contents

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

                                              Contents

                                              +

                                              Contents

                                              • 1 Foo Bar
                                              • 2 Foo Bar
                                              • @@ -22893,7 +22893,7 @@ __TOC__ !! html/php+tidy

                                                -
                                                +

                                                Contents

                                                  @@ -22926,7 +22926,7 @@ __TOC__ == Evilbye == !! html/php -

                                                  Contents

                                                  +

                                                  Contents

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

                                                    Contents

                                                    +

                                                    Contents

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

                                                      Contents

                                                      +

                                                      Contents

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

                                                      Contents

                                                      +

                                                      Contents

                                                      @@ -23029,7 +23029,7 @@ Empty

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

                                                      Contents

                                                      +

                                                      Contents

                                                      @@ -23040,7 +23040,7 @@ __TOC__ !! html/php+tidy

                                                      -
                                                      +

                                                      Contents

                                                        diff --git a/tests/qunit/suites/resources/mediawiki/mediawiki.toc.test.js b/tests/qunit/suites/resources/mediawiki/mediawiki.toc.test.js index 8786993869..477550bd4b 100644 --- a/tests/qunit/suites/resources/mediawiki/mediawiki.toc.test.js +++ b/tests/qunit/suites/resources/mediawiki/mediawiki.toc.test.js @@ -12,7 +12,7 @@ assert.strictEqual( $( '.toc' ).length, 0, 'There is no table of contents on the page at the beginning' ); tocHtml = '
                                                        ' + - '
                                                        ' + + '
                                                        ' + '

                                                        Contents

                                                        ' + '
                                                        ' + '
                                                        ' +