<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, May 29, 2015 at 8:34 PM, Sam Weinig <span dir="ltr">&lt;<a href="mailto:weinig@apple.com" target="_blank">weinig@apple.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>Hi Yoav,</div><div><br></div>Can you give a concrete example of when this will be used?  I’m having trouble understanding when an author will want to change an images intrinsic size but not have control of the markup.</div></blockquote><div><br></div><div>It&#39;s not about control over markup, it&#39;s about control over style.</div><div><br></div><div>Let&#39;s say you&#39;re now given the following task: write a script that will go over all your server&#39;s HTML files and make your images responsive by adding a `srcset` attribute to all &lt;img&gt; tags. Since some of the images may change their display dimensions at different viewport sizes (i.e the <a href="https://dev.opera.com/articles/native-responsive-images/#variable-width-images">&quot;variable width&quot; use case</a>), you want to add multiple resources with `w` descriptors to each &lt;img&gt;. Each one of these resources will be pointed towards your shiny new image server, which has access to the original high-quality image as well as the currently displayed one (the &quot;src image&quot;).</div><div><br></div><div>But, since you don&#39;t know if all the images have their dimensions defined in CSS (and you suspect that a large chunk of them don&#39;t have CSS based dimensions), you want to make sure that the intrinsic dimensions of the displayed images remain the same even when you deliver images of varying &quot;physical&quot; dimensions. How can you achieve that?</div><div><br></div><div>Well, the answer is, you want to modify the intrinsic size of the delivered images to be the same as the &quot;src image&quot;&#39;s intrinsic dimensions. With Content-DPR, that&#39;s easy. You simply set it to the value that is the delivered image width divided by the &quot;src image&quot; width.</div><div>That way, the browser takes the Content-DPR into account, scales the delivered image and it ends up with the same intrinsic dimensions as the &quot;src image&quot;.</div><div><br></div><div>If you don&#39;t have markup control, the same exercise applies, but would require the full-fledged Client-Hints in order to actually deliver resized images.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><br><div><span class=""><blockquote type="cite"><div>On May 29, 2015, at 11:23 AM, Yoav Weiss &lt;<a href="mailto:yoav@yoav.ws" target="_blank">yoav@yoav.ws</a>&gt; wrote:</div><br><div><div dir="ltr"><div>As a first step towards the Client-Hints implementation, I submitted a <a href="https://bugs.webkit.org/show_bug.cgi?id=145380" target="_blank">patch</a> for <a href="http://igrigorik.github.io/http-client-hints/#confirming-selected-dpr" target="_blank">Content-DPR support</a>.<br></div><div>A discussion followed on the thread, so I&#39;d like to move it to the list, in order for it to get higher exposure.</div><div><br></div><div>Content-DPR is an HTTP response header that enables style-agnostic image resizing,</div></div></div></blockquote><div><br></div></span><div>What exactly does &quot;style-agnostic image resizing” mean? I am not familiar with that term </div></div></div></div></blockquote><div><br></div><div>It&#39;s not an official term. I meant to say that it enables you to perform image resizing without taking into account the style rules that control the way in which the resized image will be displayed.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div><div><br><blockquote type="cite"><div><span class=""><div dir="ltr"><div> by enabling the server to adapt the image&#39;s intrinsic size so that layout will not break, even if the image&#39;s dimensions are not defined in style.</div><div><br></div><div>Opinions welcome! :)</div></div></span>
_______________________________________________<br>webkit-dev mailing list<br><a href="mailto:webkit-dev@lists.webkit.org" target="_blank">webkit-dev@lists.webkit.org</a><br><a href="https://lists.webkit.org/mailman/listinfo/webkit-dev" target="_blank">https://lists.webkit.org/mailman/listinfo/webkit-dev</a><br></div></blockquote></div><br></div></div></blockquote></div><br></div></div>