mozilla/pdf.js — pull request #2872 by sgtatham (2013-03-02 17:27:25+00:00)
Title: Fix handling of [page /XYZ null null null] destinations.

The PDF I linked to in issue #2835,
http://www.chiark.greenend.org.uk/%7Esgtatham/halibut/doc-1.0/halibut.pdf
uses the format [page /XYZ null null null] for all the destinations of its internal links (both hyperlinks between pages and links in the contents list), with the intention being to simply encode "go to that page" without specifying any particular position on the page or any change to the viewer's zoom setting.

pdf.js currently responds to this type of link by aligning the _bottom_ of the target page with the top of the window, so that you can't see any of the actual target page and instead you see a gutter followed by the page after the one targeted.

The patch in this pull request adjusts the default so that a null y-coordinate in an XYZ destination causes the top of the page rather than the bottom to be aligned with the top of the window, which seems more useful to me. x-coordinate handling is unchanged, so it should still default to the left (which seems as good a policy as any).