Last modified: 2014-07-07 11:40:56 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T50256, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 48256 - Make brackets in section edit links accessible to CSS
Make brackets in section edit links accessible to CSS
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Page editing (Other open bugs)
1.22.0
All All
: Low enhancement (vote)
: 1.22.0 release
Assigned To: Bartosz Dziewoński
: accessibility
Depends on:
Blocks: editlinks 57818
  Show dependency treegraph
 
Reported: 2013-05-08 12:55 UTC by Scott Martin (http://enwp.org/user:scott)
Modified: 2014-07-07 11:40 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Demonstration of CSS pseudo-element generated brackets wrapping an edit link. (392 bytes, text/html)
2013-05-08 12:55 UTC, Scott Martin (http://enwp.org/user:scott)
Details

Description Scott Martin (http://enwp.org/user:scott) 2013-05-08 12:55:16 UTC
Created attachment 12275 [details]
Demonstration of CSS pseudo-element generated brackets wrapping an edit link.

At present section edit links are wrapped by brackets in the HTML content, like so:

<span class="mw-editsection">[<a href="/w/index.php?title=Talk:Example&amp;action=edit&amp;section=1" title="Edit section: Example">edit</a>]</span>

This makes the links difficult to restyle effectively (for example, I have several links in the interface appearing as buttons) because the end result will always be cluttered by the brackets.

I propose replacing the brackets in HTML with brackets generated by CSS pseudo-elements, as in the attached demonstration. This would allow stylesheet authors to remove them if desired. It could also allow a new preference setting for users to hide the brackets if they don't like them.

Considerations:
- Accessibility: screen readers don't, to my knowledge, understand generated content. As a result, this change would actually improve the accessibility of MediaWiki to visually-impaired users by eliminating the problem described at http://blind.wikia.com/wiki/Mediawiki_and_Accessibility#Section_title_and_edit_link of hearing "left bracket edit right bracket link".
- Browser support: generally very good. http://caniuse.com/#feat=css-gencontent However, versions of IE prior to 8 do not support generated content. I don't know what our policy is regarding supporting older versions of Internet Explorer.
Comment 1 Scott Martin (http://enwp.org/user:scott) 2013-05-08 13:23:54 UTC
As is the way of these things, I naturally found a workaround immediately after filing this bug. The existing brackets can be hidden using CSS, as follows:

 .mw-editsection {
    visibility: hidden;
 }
 
 .mw-editsection a {
    visibility: visible;
 }

However, this is something of a kludge, and I still think it would be better to specify them in CSS as outlined above.
Comment 2 Bartosz Dziewoński 2013-05-11 15:22:04 UTC
(In reply to comment #0)
> - Browser support: generally very good.
> http://caniuse.com/#feat=css-gencontent
> However, versions of IE prior to 8 do not support generated content. I don't
> know what our policy is regarding supporting older versions of Internet
> Explorer.

Per https://www.mediawiki.org/wiki/Compatibility#Browser we still kind of support IE6 and 7. Making it not work on them would certainly cause various en.wp dinosaurs to shout at me, so I didn't do that.
Comment 3 Scott Martin (http://enwp.org/user:scott) 2013-05-15 12:00:03 UTC
Thanks Bartosz - I thought that was probably the case. I guess a better question for me to ask would be, do we do any conditional comment stuff to serve up specific stylesheets to older versions of IE? That doesn't directly impact upon this suggestion, I guess, but it will be useful for me to bear in mind when filing future bugs.
Comment 4 Bartosz Dziewoński 2013-05-15 15:02:30 UTC
(In reply to comment #3)
> do we do any conditional comment stuff to
> serve up specific stylesheets to older versions of IE?

Monobook includes conditional stylesheets for IE6 and IE7, Vector and other skins don't (they do use some pure CSS hacks, though).

I was wondering if it would be viable to wrap each bracket itself in <span class=mw-editsection-bracket />?
Comment 5 Bartosz Dziewoński 2013-05-17 17:49:40 UTC
Changing the summary to "Make brackets in section edit links accessible to CSS", as due to IE6 issues mentioned above, as well as CSS-less accessibility, I believe pseudoelement selectors are not the best way to do this. I'll implement my suggestion above shortly.
Comment 6 Gerrit Notification Bot 2013-05-17 19:27:38 UTC
Related URL: https://gerrit.wikimedia.org/r/64365 (Gerrit Change Id27555c6dee250eafeefa97ae8927438fd65b8d7)
Comment 7 Scott Martin (http://enwp.org/user:scott) 2013-05-22 18:39:15 UTC
Thanks Bartosz. If IE6/7 ever become such an antique that we stop supporting them (we can dream can't we?) then I'll come back to this to suggest going the pseudoelement route.
Comment 8 Liangent 2013-05-23 05:06:48 UTC
(In reply to comment #7)
> Thanks Bartosz. If IE6/7 ever become such an antique that we stop supporting
> them (we can dream can't we?) then I'll come back to this to suggest going
> the
> pseudoelement route.

I wonder whether we can stop supporting older IE with JavaScript disabled?

In this way we can just bundle stuff like https://code.google.com/p/ie7-js/ and use whatever we like.
Comment 9 Gerrit Notification Bot 2013-07-02 22:48:22 UTC
Change 64365 merged by jenkins-bot:
Make brackets in section edit links accessible to CSS

https://gerrit.wikimedia.org/r/64365
Comment 10 Bartosz Dziewoński 2013-07-02 23:35:22 UTC
Yay, merged. Scott, after 1.22 is released (or already right now if you use the bleeding edge version) you can just use `.mw-editsection-bracket { display: none; }` to hide the brackets entirely and be able to style the section edit links on your own.

I'm pretty sure replacing those with CSS pseudoelements will have to wait a few more years ;)

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links