From 5205405385397782b5288b429f49c9d8c97ac6c6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bartosz=20Dziewo=C5=84ski?= Date: Tue, 17 Mar 2015 22:59:13 +0100 Subject: [PATCH] Emergency remove .mw-headline-anchor MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Follows-up 6c7480e5f0, d2a6a73d2. The should stop the § character from being indexed by Google et al. Bug: T18691 Bug: T93000 Change-Id: Ie9e334e973e3ded270f1897a2c3816d9df739fc0 --- includes/Linker.php | 11 - resources/Resources.php | 10 +- .../src/mediawiki/mediawiki.sectionAnchor.css | 58 +--- .../mediawiki.sectionAnchor.hide.css | 4 - tests/parser/parserTests.txt | 264 +++++++++--------- 5 files changed, 135 insertions(+), 212 deletions(-) delete mode 100644 resources/src/mediawiki/mediawiki.sectionAnchor.hide.css diff --git a/includes/Linker.php b/includes/Linker.php index a9c26c6451..b58dabab9d 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -1752,17 +1752,6 @@ class Linker { $link, $legacyAnchor = false ) { $ret = " '#' . $anchor, - 'class' => 'mw-headline-anchor', - // Hide from screen readers, as it is inside a heading (the programs use headings to - // navigate, so the symbol is being read during navigation). Pending T13555 being fixed. - 'aria-hidden' => 'true', - 'title' => wfMessage( 'headline-anchor-title' )->text() - ), - wfMessage( 'section-symbol' )->text() - ) . "$html" . $link . ""; diff --git a/resources/Resources.php b/resources/Resources.php index a158af7adb..e90b24e9f2 100644 --- a/resources/Resources.php +++ b/resources/Resources.php @@ -966,14 +966,8 @@ return array( ), ), 'mediawiki.sectionAnchor' => array( - 'skinStyles' => array( - 'default' => array( - 'resources/src/mediawiki/mediawiki.sectionAnchor.css' => - array( 'media' => 'screen'), - 'resources/src/mediawiki/mediawiki.sectionAnchor.hide.css' => - array( 'media' => 'print' ), - ), - ), + // Back-compat to hide it on cached pages (T18691; Ie9e334e973; 2015-03-17) + 'styles' => 'resources/src/mediawiki/mediawiki.sectionAnchor.css', 'targets' => array( 'desktop', 'mobile' ), ), 'mediawiki.Title' => array( diff --git a/resources/src/mediawiki/mediawiki.sectionAnchor.css b/resources/src/mediawiki/mediawiki.sectionAnchor.css index c2a6f3a136..f8f002218d 100644 --- a/resources/src/mediawiki/mediawiki.sectionAnchor.css +++ b/resources/src/mediawiki/mediawiki.sectionAnchor.css @@ -1,59 +1,3 @@ -/* Anchors for section headings */ .mw-headline-anchor { - font-weight: normal; - margin-left: -14px; - width: 14px; - filter: alpha(opacity=0); - opacity: 0; - position: absolute; - text-align: center; - text-decoration: none; - -moz-user-select: none; - -webkit-user-select: none; - user-select: none; -} - -/* @noflip */ -.mw-content-ltr .mw-headline-anchor, -.mw-content-rtl .mw-content-ltr .mw-headline-anchor { - margin-left: -14px; - margin-right: 0; -} - -/* @noflip */ -.mw-content-rtl .mw-headline-anchor, -.mw-content-ltr .mw-content-rtl .mw-headline-anchor { - margin-left: 0; - margin-right: -14px; -} - -.mw-headline-anchor, -.mw-headline-anchor:visited { - color: #888; -} - -.mw-headline-anchor:hover, -.mw-headline-anchor:focus { - color: #555; - text-decoration: none; -} - -.mw-headline-anchor:active { - color: #000; -} - -.mw-body h1:hover .mw-headline-anchor, -.mw-body h2:hover .mw-headline-anchor, -.mw-body h3:hover .mw-headline-anchor, -.mw-body h4:hover .mw-headline-anchor, -.mw-body h5:hover .mw-headline-anchor, -.mw-body h6:hover .mw-headline-anchor, -.mw-body h1:focus .mw-headline-anchor, -.mw-body h2:focus .mw-headline-anchor, -.mw-body h3:focus .mw-headline-anchor, -.mw-body h4:focus .mw-headline-anchor, -.mw-body h5:focus .mw-headline-anchor, -.mw-body h6:focus .mw-headline-anchor { - filter: alpha(opacity=100); - opacity: 1; + display: none; } diff --git a/resources/src/mediawiki/mediawiki.sectionAnchor.hide.css b/resources/src/mediawiki/mediawiki.sectionAnchor.hide.css deleted file mode 100644 index 33443c9bed..0000000000 --- a/resources/src/mediawiki/mediawiki.sectionAnchor.hide.css +++ /dev/null @@ -1,4 +0,0 @@ -/* Hide section anchor from print media */ -.mw-headline-anchor { - display: none; -} diff --git a/tests/parser/parserTests.txt b/tests/parser/parserTests.txt index 36a78722c0..c65e8d7ba5 100644 --- a/tests/parser/parserTests.txt +++ b/tests/parser/parserTests.txt @@ -451,11 +451,11 @@ a

a


-

b[edit]

+

b[edit]

a


-

b[edit]

+

b[edit]

!! end @@ -468,7 +468,7 @@ Extra newlines between heading and content are swallowed [[a]] !! html -

b[edit]

+

b[edit]

a

!! end @@ -8242,7 +8242,7 @@ List interrupted by empty line or heading !! html -

A heading[edit]

+

A heading[edit]

!!end @@ -9984,8 +9984,8 @@ Bug 6563: Edit link generation for section shown by !! wikitext {{includeonly section}} !! html -

Includeonly section[edit]

-

Section T-1[edit]

+

Includeonly section[edit]

+

Section T-1[edit]

!! end @@ -10011,7 +10011,7 @@ Bug 6563: Edit link generation for section suppressed by ==Section 1== !! html -

Section 1[edit]

+

Section 1[edit]

!! end @@ -10048,12 +10048,12 @@ some can have stuff=== here === !! html/php -

hu

+

hu

some

  • stuff
  • here
-

here

+

here

!! html/parsoid

hu

@@ -13503,13 +13503,13 @@ More ===Smaller headline=== Blah blah !! html -

Headline 1[edit]

+

Headline 1[edit]

Some text

-

Headline 2[edit]

+

Headline 2[edit]

More

-

Smaller headline[edit]

+

Smaller headline[edit]

Blah blah

!! end @@ -13549,14 +13549,14 @@ Some text -

Headline 1[edit]

-

Subheadline 1[edit]

-
Skipping a level[edit]
-
Skipping a level[edit]
-

Headline 2[edit]

+

Headline 1[edit]

+

Subheadline 1[edit]

+
Skipping a level[edit]
+
Skipping a level[edit]
+

Headline 2[edit]

Some text

-

Another headline[edit]

+

Another headline[edit]

!! end @@ -13578,10 +13578,10 @@ __FORCETOC__ -

Headline 2[edit]

-

Headline[edit]

-

Headline 2[edit]

-

Headline[edit]

+

Headline 2[edit]

+

Headline[edit]

+

Headline 2[edit]

+

Headline[edit]

!! end @@ -13630,16 +13630,16 @@ Handling of sections up to level 6 and beyond -

Level 1 Heading[edit]

-

Level 2 Heading[edit]

-

Level 3 Heading[edit]

-

Level 4 Heading[edit]

-
Level 5 Heading[edit]
-
Level 6 Heading[edit]
-
= Level 7 Heading=[edit]
-
== Level 8 Heading==[edit]
-
=== Level 9 Heading===[edit]
-
==== Level 10 Heading====[edit]
+

Level 1 Heading[edit]

+

Level 2 Heading[edit]

+

Level 3 Heading[edit]

+

Level 4 Heading[edit]

+
Level 5 Heading[edit]
+
Level 6 Heading[edit]
+
= Level 7 Heading=[edit]
+
== Level 8 Heading==[edit]
+
=== Level 9 Heading===[edit]
+
==== Level 10 Heading====[edit]
!! end @@ -13673,12 +13673,12 @@ TOC regression (T11764) -

title 1[edit]

-

title 1.1[edit]

-

title 1.1.1[edit]

-

title 1.2[edit]

-

title 2[edit]

-

title 2.1[edit]

+

title 1[edit]

+

title 1.1[edit]

+

title 1.1.1[edit]

+

title 1.2[edit]

+

title 2[edit]

+

title 2.1[edit]

!! end @@ -13710,12 +13710,12 @@ wgMaxTocLevel=3 -

title 1[edit]

-

title 1.1[edit]

-

title 1.1.1[edit]

-

title 1.2[edit]

-

title 2[edit]

-

title 2.1[edit]

+

title 1[edit]

+

title 1.1[edit]

+

title 1.1.1[edit]

+

title 1.2[edit]

+

title 2[edit]

+

title 2.1[edit]

!! end @@ -13741,11 +13741,11 @@ wgMaxTocLevel=3 -

Section 1[edit]

-

Section 1.1[edit]

-

Section 1.1.1[edit]

-

Section 1.1.1.1[edit]

-

Section 2[edit]

+

Section 1[edit]

+

Section 1.1[edit]

+

Section 1.1.1[edit]

+

Section 1.1.1.1[edit]

+

Section 2[edit]

!! end @@ -13756,8 +13756,8 @@ Resolving duplicate section names == Foo bar == == Foo bar == !! html -

Foo bar[edit]

-

Foo bar[edit]

+

Foo bar[edit]

+

Foo bar[edit]

!! end @@ -13767,8 +13767,8 @@ Resolving duplicate section names with differing case (bug 10721) == Foo bar == == Foo Bar == !! html -

Foo bar[edit]

-

Foo Bar[edit]

+

Foo bar[edit]

+

Foo Bar[edit]

!! end @@ -13787,10 +13787,10 @@ __NOTOC__ {{sections}} ==Section 4== !! html -

Section 0[edit]

-

Section 1[edit]

-

Section 2[edit]

-

Section 4[edit]

+

Section 0[edit]

+

Section 1[edit]

+

Section 2[edit]

+

Section 4[edit]

!! end @@ -13801,8 +13801,8 @@ __NOEDITSECTION__ ==Section 1== ==Section 2== !! html -

Section 1

-

Section 2

+

Section 1

+

Section 2

!! end @@ -13811,7 +13811,7 @@ Link inside a section heading !! wikitext ==Section with a [[Main Page|link]] in it== !! html -

Section with a link in it[edit]

+

Section with a link in it[edit]

!! end @@ -13834,9 +13834,9 @@ __TOC__ -

title 1[edit]

-

title 1.1[edit]

-

title 2[edit]

+

title 1[edit]

+

title 1.1[edit]

+

title 2[edit]

!! end @@ -13860,10 +13860,10 @@ The line above must have a trailing space! --> But just in case it doesn't... !! html -

=[edit]

+

=[edit]

The line above must have a trailing space!

-

=[edit]

+

=[edit]

But just in case it doesn't...

!! end @@ -13900,19 +13900,19 @@ section 5 -

text > text[edit]

+

text > text[edit]

section 1

-

text < text[edit]

+

text < text[edit]

section 2

-

text & text[edit]

+

text & text[edit]

section 3

-

text ' text[edit]

+

text ' text[edit]

section 4

-

text " text[edit]

+

text " text[edit]

section 5

!! end @@ -13960,22 +13960,22 @@ section 6 -

Space between Text[edit]

+

Space between Text[edit]

section 1

-

Space-Entity between Text[edit]

+

Space-Entity between Text[edit]

section 2

-

Plus+between+Text[edit]

+

Plus+between+Text[edit]

section 3

-

Plus-Entity+between+Text[edit]

+

Plus-Entity+between+Text[edit]

section 4

-

Underscore_between_Text[edit]

+

Underscore_between_Text[edit]

section 5

-

Underscore-Entity_between_Text[edit]

+

Underscore-Entity_between_Text[edit]

section 6

#Space between Text #Space-Entity between Text @@ -14004,10 +14004,10 @@ Headers with excess '=' characters -

foo=[edit]

-

=foo[edit]

-

italic heading=[edit]

-

=italic heading[edit]

+

foo=[edit]

+

=foo[edit]

+

italic heading=[edit]

+

=italic heading[edit]

!! end @@ -14042,12 +14042,12 @@ __NOEDITSECTION__ -

Header 1

-

Header 1.1

-

Header 1.2

-

Header 2

-

Header 2.1

-

Header 2.2

+

Header 1

+

Header 1.1

+

Header 1.2

+

Header 2

+

Header 2.1

+

Header 2.2

!! end @@ -14062,9 +14062,9 @@ parsoid=wt2html,wt2wt c2 c3--> !! html -

foo

-

bar

-

baz

+

foo

+

bar

+

baz

!! end @@ -15646,7 +15646,7 @@ Fuzz testing: Parser14 == onmouseover= == http://__TOC__ !! html -

onmouseover=[edit]

+

onmouseover=[edit]

http://

Contents

  • 1 onmouseover=
  • @@ -15655,7 +15655,7 @@ http://

    Contents

    !! html+tidy -

    onmouseover=[edit]

    +

    onmouseover=[edit]

    http://

    @@ -15674,13 +15674,13 @@ Fuzz testing: Parser14-table ==a== {| STYLE=__TOC__ !! html -

    a[edit]

    +

    a[edit]

    !! html+tidy -

    a[edit]

    +

    a[edit]

    @@ -17689,7 +17689,7 @@ Inclusion of !userCanEdit() content !! wikitext {{MediaWiki:Fake}} !! html -

    header[edit]

    +

    header[edit]

    !! end @@ -17721,12 +17721,12 @@ Out-of-order TOC heading levels -

    2[edit]

    -
    6[edit]
    -

    3[edit]

    -

    1[edit]

    -
    5[edit]
    -

    2[edit]

    +

    2[edit]

    +
    6[edit]
    +

    3[edit]

    +

    1[edit]

    +
    5[edit]
    +

    2[edit]

    !! end @@ -17833,7 +17833,7 @@ anchorencode encodes like the TOC generator: (bug 18431) {{anchorencode: _ +:.3A%3A&&]] }} __NOEDITSECTION__ !! html -

    _ +:.3A%3A&&]]

    +

    _ +:.3A%3A&&]]

    .2B:.3A.253A.26.26.5D.5D

    !! end @@ -18083,7 +18083,7 @@ language=sr variant=sr-ec !! wikitext == -{Naslov}- == !! html -

    Naslov[уреди]

    +

    Naslov[уреди]

    !! end @@ -18473,7 +18473,7 @@ Morwen/13: Unclosed link followed by heading !! html

    [[link

    -

    heading[edit]

    +

    heading[edit]

    !! end @@ -18485,7 +18485,7 @@ HHP2.1: Heuristics for headings in preprocessor parenthetical structures !! html

    {{foo|

    -

    heading

    +

    heading

    !! end @@ -18497,7 +18497,7 @@ HHP2.2: Heuristics for headings in preprocessor parenthetical structures !! html

    {{foo|

    -

    heading[edit]

    +

    heading[edit]

    !! end @@ -19381,7 +19381,7 @@ __TOC__ -

    Lost episodes[edit]

    +

    Lost episodes[edit]

    !! end @@ -19399,7 +19399,7 @@ __TOC__ -

    should be bold then normal text[edit]

    +

    should be bold then normal text[edit]

    !! end @@ -19417,7 +19417,7 @@ __TOC__ -

    Image Foobar.jpg[edit]

    +

    Image Foobar.jpg[edit]

    !! end @@ -19435,7 +19435,7 @@ __TOC__ -

    Quote
    [edit]

    +

    Quote
    [edit]

    !! html+tidy

    @@ -19448,7 +19448,7 @@ __TOC__

    -

    +

    Quote

    @@ -19471,7 +19471,7 @@ QED -

    Proof: 2 < 3[edit]

    +

    Proof: 2 < 3[edit]

    Hanc marginis exiguitas non caperet. QED

    @@ -19492,8 +19492,8 @@ __TOC__ -

    Foo Bar[edit]

    -

    Foo
    Bar
    [edit]

    +

    Foo Bar[edit]

    +

    Foo
    Bar
    [edit]

    !! html+tidy

    @@ -19507,8 +19507,8 @@ __TOC__

    -

    Foo Bar[edit]

    -

    Foo

    +

    Foo Bar[edit]

    +

    Foo

    Bar

    @@ -19530,8 +19530,8 @@ __TOC__ -

    Hello[edit]

    -

    b">Evilbye[edit]

    +

    Hello[edit]

    +

    b">Evilbye[edit]

    !! end @@ -19559,11 +19559,11 @@ __TOC__ -

    C++[edit]

    -

    זבנג![edit]

    -

    The attributes on these span tags must be deleted from the TOC[edit]

    -

    All attributes on these span tags must be deleted from the TOC[edit]

    -

    Attributes after dir on these span tags must be deleted from the TOC[edit]

    +

    C++[edit]

    +

    זבנג![edit]

    +

    The attributes on these span tags must be deleted from the TOC[edit]

    +

    All attributes on these span tags must be deleted from the TOC[edit]

    +

    Attributes after dir on these span tags must be deleted from the TOC[edit]

    !! end @@ -19579,7 +19579,7 @@ __TOC__ -

    test[edit]

    +

    test[edit]

    !! end @@ -19598,7 +19598,7 @@ __TOC__ -

    x[edit]

    +

    x[edit]

    !! html+tidy

    @@ -19611,7 +19611,7 @@ __TOC__

    -

    x[edit]

    +

    x[edit]

    !! end !! article @@ -19627,7 +19627,7 @@ title=[[Main Page]] !! wikitext {{int:Bug32057}} !! html -

    Headline text[edit]

    +

    Headline text[edit]

    !! end @@ -19742,7 +19742,7 @@ nowiki inside link inside heading (bug 18295) !! wikitext ==[[foo|xyz]]== !! html -

    xyz[edit]

    +

    xyz[edit]

    !! end @@ -19927,11 +19927,11 @@ Lead

    Lead

    -

    Section 1[edit]

    -

    Section 2[edit]

    -

    Section 3[edit]

    -

    Section 4[edit]

    -

    Section 5[edit]

    +

    Section 1[edit]

    +

    Section 2[edit]

    +

    Section 3[edit]

    +

    Section 4[edit]

    +

    Section 5[edit]

    !! end -- 2.20.1