Provide $.bracketedDevicePixelRatio convenience function
authorBrion Vibber <brion@pobox.com>
Mon, 4 May 2015 21:31:23 +0000 (14:31 -0700)
committerPrateek Saxena <prtksxna@gmail.com>
Mon, 7 Sep 2015 10:45:32 +0000 (16:15 +0530)
commit58f8f519bae5315c1ef440770af6608f30e45a63
tree29452ffd49d78e92fb6bc7882396096ec097f2e4
parent410984bdc79f9e45e865d6bb61079b45f4d7562d
Provide $.bracketedDevicePixelRatio convenience function

Brackets the detected value from $.devicePixelRatio() to
one of the values [1, 1.5, 2] that we use for generating
images in default srcset attribute.

This is convenient for runtime fetching of images that match
our standard rendering sizes on devices/browsers that are
slightly off normal, to avoid creating extra thumbs and slowing
the fetching.

Bug: T97935
Change-Id: Ic9cb16543edee629543fa362f569414567756d79
resources/src/jquery/jquery.hidpi.js
tests/qunit/suites/resources/jquery/jquery.hidpi.test.js