Skip to content
This repository was archived by the owner on Sep 6, 2022. It is now read-only.

Commit 219679c

Browse files
committed
document saveData
1 parent 23ac273 commit 219679c

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

index.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,19 @@ <h3 class="hed-subsection">Picturefill function options</h3>
243243
</li>
244244
</ul>
245245

246+
<h3 class="hed-subsection">Picturefill source selection option</h3>
247+
248+
<p>By default Picturefill tries to mimic the resource selection algorithm of Chrome (except that Picturefill, unlike the browser, doesn't know which image files are already cached). Picturefill 3.0 also comes with a new image custom source selection algorithm unique to Picturefill called <code>saveData</code>. The <code>saveData</code> algorithm weights the resource selection algorithm towards smaller image candidates on
249+
very high dppx devices (3dppx +), to conserve bandwidth.</p>
250+
251+
<p>To use <code>saveData</code>, create a picturefillCFG array that runs before the main plugin:
252+
253+
<pre><code>//generating the config array
254+
window.picturefillCFG = window.picturefillCFG || [];
255+
picturefillCFG.push([ "algorithm", "saveData" ]);</pre></code>
256+
257+
<p>Developer feedback on this new algorithm is welcome, especially if you've got some hard data.
258+
246259
<h2 class="hed-section" id="support">Browser Support</h2>
247260
<p>Picturefill supports a broad range of browsers and devices, provided that you stick with the markup conventions documented above. </p>
248261

0 commit comments

Comments
 (0)