Last modified: 2008-12-07 22:10:50 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 T18582, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 16582 - display:none in headlines is not observed for TOC
display:none in headlines is not observed for TOC
Status: RESOLVED INVALID
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
http://de.wikipedia.org/wiki/Liste_de...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-12-07 18:01 UTC by Hk kng
Modified: 2008-12-07 22:10 UTC (History)
4 users (show)

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


Attachments

Description Hk kng 2008-12-07 18:01:58 UTC
If you have - through a template - some content in a minor headline that is hidden through a style="display:none", it will show up in the table of contents.

An example of this behavior is the country-with-flag template http://de.wikipedia.org/wiki/Vorlage:AUT which contains a sorting template http://de.wikipedia.org/wiki/Vorlage:SortKey aimed at geting the word "Österreich" to show up under "O" in sorted tables. However, the country template may also be used in headings like in the URL given above.
Comment 1 Danny B. 2008-12-07 18:55:05 UTC
Generating of TOC is based on HTML content. CSS is just presentational layer. The headline is still present even when it's "not visible" - search engines, bots, user agents with CSS off, DOM inspectors etc. still see it thus it's correct behavior to have it in TOC.

Marking as INVALID.
Comment 2 Aryeh Gregor (not reading bugmail, please e-mail directly) 2008-12-07 19:53:41 UTC
More to the point, this isn't realistically possible to fix.  We can't tell at parse time what styles might be applied to a given element.  You have to just not include the content if you want to use the template in headlines, display: none isn't going to work.  display: none is probably a bad choice anyway, since as Danny mentions, the content will still show up for search engines and so on.
Comment 3 Farino 2008-12-07 20:35:47 UTC
Although I do not want to support this bug too heavily I would like to add some information to clearify the source of this request. At least in DE-wp more and more templates add a "span style='display:none'" to support propper sorting in tables with the class="sortable" (be aware that we have a lot of theese grazy umlauts). Unfortunatelly thoose templates are sometimes also used in titles or other parsed tags. I understand that you cannot anticipate the CSS-selector that is finally applied to an element, but a hard-coded style would override all external styles anyway so it would technical be possible to remove at least spans with hard-coded "display:none".
Comment 4 Aryeh Gregor (not reading bugmail, please e-mail directly) 2008-12-07 20:53:59 UTC
1) A hardcoded style wouldn't override a stylesheet rule with !important.

2) If we parsed only hardcoded styles, we would be creating a very confusing situation, where inline CSS rules have magical functionality that stylesheet rules do not.

3) Using inline styles is bad practice, and so is display:none'ing things instead of removing them from the DOM to begin with, so we should avoid encouraging those if possible.

Do comments work, maybe?  If not, we could consider alternative solutions.  For instance, if we allowed HTML5-style custom attributes on all elements, we could make data-sortkey="foo" magically sort the column according to "foo" instead of the contents.  That would probably be easier to implement, too.
Comment 5 Farino 2008-12-07 21:08:03 UTC
Sorry, I haven't thought of !important. Your proposal comes close to the invention of sliced bread at it would reindroduce the semantics of what the data is. Is there a chance for such a change?
Comment 6 Aryeh Gregor (not reading bugmail, please e-mail directly) 2008-12-07 22:10:50 UTC
I dunno.  Not from me right now, I'm too busy with other things.  Try filing another bug on that issue, if none already exists.  We'd be deliberately ignoring XHTML compatibility if we did this, of course, but IMO we should probably move to HTML5 anyway.  :)

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


Navigation
Links