Fix link target and retina thumbnails for manual thumbnails. (Bug 45405.)
authorC. Scott Ananian <cscott@cscott.net>
Wed, 27 Feb 2013 00:12:12 +0000 (19:12 -0500)
committerC. Scott Ananian <cscott@cscott.net>
Fri, 29 Mar 2013 16:12:02 +0000 (12:12 -0400)
commit11adcad08b1818d79b18fe8185277bc9a7531431
treee6a33a09ad435da031fb084202b1a913c7aff149
parenta161e5f76843b5a17efbbf032492bfb7c8a03cc6
Fix link target and retina thumbnails for manual thumbnails. (Bug 45405.)

The output for [[Image:Bad.jpg|thumb=Foobar.jpg|Title]] used to be:

<div class="thumb tright"><div class="thumbinner" style="width:1943px;"><a
href="/wiki/File:Foobar.jpg" class="image"><img alt=""
src="http://example.com/images/3/3a/Foobar.jpg" width="1941" height="220"
class="thumbimage" srcset="http://example.com/images/0/09/Bad.jpg 1.5x,
http://example.com/images/0/09/Bad.jpg 2x" /></a>  <div
class="thumbcaption"><div class="magnify"><a href="/wiki/File:Bad.jpg"
class="internal" title="Enlarge"><img
src="/skins/common/images/magnify-clip.png" width="15" height="11" alt=""
/></a></div>Title</div></div></div>

Note that the target of the <a> is the thumb, not the original image,
and that the srcset is loading the full resolution version of Bad.jpg.

The attached patches fix the link target and srcset issues
(suppressing the srcset when a manual thumb is used).  It also adds a
new "Thumb.png" pseudo-file to the parserTests so that we can write
new tests documenting how manual thumbnails are expected to work,
and adds the 'php' option to the thumbnail tests (since the Parsoid
parser generates different output).

Change-Id: I5be80bfce855b85f9debf3ef1776b877d1f84b9f
includes/Linker.php
tests/parser/parserTest.inc
tests/parser/parserTests.txt
tests/phpunit/includes/parser/NewParserTest.php