Page MenuHomePhabricator

Reference inside display:none is displayed in reference list
Open, Needs TriagePublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Save the following wikitext on a page:
<span class="summary" style="display:none"><ref >Content of reference</ref></span>
<span class="summary" style="display:none"><ref group="lower-alpha">Content of note</ref></span>
==References==
<references/>
==Notes==
{{notelist}}

What happens?:
The reference footnote numbers/letters are not displayed, but the reference and the note are displayed. This happens in both the legacy parser and in Parsoid.

The ^ markers that point to #cite_ref-1 and #cite_ref-2 have no target on the page.

What should have happened instead?:
Neither the reference nor the note should be displayed, since they are wrapped in "display:none".

Software version (on Special:Version page; skip for WMF-hosted wikis like Wikipedia):

Other information (browser name/version, screenshots, etc.):
There is a test page with the above code at https://en.wikipedia.org/w/index.php?title=User:Jonesey95/sandbox&oldid=1373436375

Event Timeline

I think this and other tasks were marked as duplicates in error.

This is not feasible. First, the

style="display:none"

might be at a level further out - potentially at the level of a page-enclosing div element. Second, a reader might have a personal custom style sheet that includes the rule

span.summary { display: none; }

How is the MediaWiki software to know when one of these situations applies without parsing the whole page as if it were a user agent?

What's the purpose of doing that?

I broadly agree with Redrose64 that, at best, we could get an extremely limited version of this working that only reacted to inline styles defined inside the article text.