{"id":244,"date":"2012-05-16T13:22:52","date_gmt":"2012-05-16T13:22:52","guid":{"rendered":"http:\/\/www.w3.org\/community\/respimg\/?p=244"},"modified":"2012-05-16T13:22:52","modified_gmt":"2012-05-16T13:22:52","slug":"shouldnt-we-be-defining-content-not-context","status":"publish","type":"post","link":"https:\/\/www.w3.org\/community\/respimg\/2012\/05\/16\/shouldnt-we-be-defining-content-not-context\/","title":{"rendered":"Shouldn&#8217;t we be defining content, not context?"},"content":{"rendered":"<p>One of the points that I have seen raised against Matt&#8217;s most recent suggestion involving templates has stuck a major chord with me: indirection.<\/p>\n<p><strong>A Warning<\/strong><\/p>\n<p>What I&#8217;m about to suggest seems quite &#8220;off the wall&#8221; in relation to what has been discussed prior to now. I believe some of this has already been talked about, but I&#8217;m not sure if it&#8217;s been looked at in this particular way. Regardless, I&#8217;ve warn my flame retardant pants today, so feel free to call me crazy.<\/p>\n<p><strong>A Short Description:<\/strong><\/p>\n<p>Indirection causes a lot of problems when we think about how users will interact with any of the suggested solutions. Either the indirection is as simple and obvious as Matt Wilcox&#8217;s template variables, or as systemic and obtuse as every suggested solutions requirement on basing the image size on the browser size. I believe at one point srcset was planned the way I am about to propose, but I could be wrong.<\/p>\n<p><strong>The Problem:<\/strong><\/p>\n<p>By relying on things outside of the content to define the content (either head parameters, or browser size, or anything of that nature) we break the ability for that content to be portable, and put a large burdon on future friendliness of the content.<\/p>\n<p>Shouldn&#8217;t the content be free of having to know layout implementations?<\/p>\n<p><strong>A Solution:<\/strong><\/p>\n<p>We should describe which image to use based on the space available for the image to fill. Perhaps this is done with new media queries (container-width, max-container-width, min-container-width), or perhaps it&#8217;s done with just making srcset&#8217;s dimension controls focus on the containing box instead of the browser&#8217;s box. Maybe we work this into a new structure altogether.<\/p>\n<p><strong>Arguments for:<\/strong><\/p>\n<p>The breakpoints you&#8217;ve built for your image today, will still be valid three years from now.<\/p>\n<p><strong>Arguments against:<\/strong><\/p>\n<p>As far as I can tell, the only argument against this is that we would have to wait for CSS to be processed in order to load content images. To that end: so what?<\/p>\n<p>So what if it takes a little longer to load the content images. It will encourage better\/faster css processors. It will encourage leaner CSS. It will encourage compression and concatenation.<\/p>\n<p><strong>Implementation:<\/strong><\/p>\n<p>What if this worked into a mixture of picture and srcset? Cherry-picking the best of each, so to speak.<\/p>\n<pre>&lt;picture alt=\"description\"&gt;\r\n  &lt;source src=\"\/images\/large-1x\/picture.jpg\" min-width=\"800px\"&gt;\r\n  &lt;source src=\"\/images\/large-2x\/picture.jpg\" min-width=\"800px\" resolution=\"2dppi\"&gt;\r\n  &lt;source src=\"\/images\/medium-1x\/picture.jpg\" min-width=\"400px\" max-width=\"800px\"&gt;\r\n  &lt;source src=\"\/images\/medium-2x\/picture.jpg\" min-width=\"400px\" max-width=\"800px\" resolution=\"2dppi\"&gt;\r\n\u00a0 &lt;source src=\"\/images\/small-1x\/picture.jpg\"&gt;\r\n  &lt;source src=\"\/images\/small-2x\/picture.jpg\" resolution=\"2dppi\"&gt;\r\n&lt;\/picture&gt;<\/pre>\n<p>I&#8217;m not married to this sort of markup, and I know it looks\u00a0repetitive, but there are a couple reasons I can think to argue for it:<\/p>\n<ol>\n<li>The intent behind the markup is clearly understandable. I could go with shortening things in some ways, but the point is to make sure it&#8217;s understandable what is going on. The less trouble people have adopting (and remembering) something, the better.<\/li>\n<li>It makes sense out of context, because we&#8217;re only describing the content.<\/li>\n<\/ol>\n<p>One of the things I have heard from the srcset proposal is browsers being unsure of what to do (picture proposal wise) when presented with an image without dimensions and sans resolution information. I think giving them the dppi resolves this concern.<\/p>\n<p>There are other concerns I&#8217;m not addressing in here that I&#8217;m sure will be pointed out, and I apologize ahead of time for that. I think it&#8217;s easier if we have a discussion to resolve those than for me alone to try and think them through in this post.<\/p>\n<p><strong>Thanks!<\/strong><\/p>\n<p>I know, it&#8217;s a shift from what I believe has been discussed. I know I may be crazy. This is what had been nibbling at the back of my mind all along though, and I figured it couldn&#8217;t hurt to share. Especially with my flame-retardant pants.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>One of the points that I have seen raised against Matt&#8217;s most recent suggestion involving templates has stuck a major chord with me: indirection. A Warning What I&#8217;m about to suggest seems quite &#8220;off the wall&#8221; in relation to what &hellip; <a href=\"https:\/\/www.w3.org\/community\/respimg\/2012\/05\/16\/shouldnt-we-be-defining-content-not-context\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1800,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_s2mail":"yes","footnotes":""},"categories":[4],"tags":[],"class_list":["post-244","post","type-post","status-publish","format-standard","hentry","category-responsive-web-design"],"_links":{"self":[{"href":"https:\/\/www.w3.org\/community\/respimg\/wp-json\/wp\/v2\/posts\/244","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.w3.org\/community\/respimg\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.w3.org\/community\/respimg\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.w3.org\/community\/respimg\/wp-json\/wp\/v2\/users\/1800"}],"replies":[{"embeddable":true,"href":"https:\/\/www.w3.org\/community\/respimg\/wp-json\/wp\/v2\/comments?post=244"}],"version-history":[{"count":2,"href":"https:\/\/www.w3.org\/community\/respimg\/wp-json\/wp\/v2\/posts\/244\/revisions"}],"predecessor-version":[{"id":246,"href":"https:\/\/www.w3.org\/community\/respimg\/wp-json\/wp\/v2\/posts\/244\/revisions\/246"}],"wp:attachment":[{"href":"https:\/\/www.w3.org\/community\/respimg\/wp-json\/wp\/v2\/media?parent=244"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.w3.org\/community\/respimg\/wp-json\/wp\/v2\/categories?post=244"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.w3.org\/community\/respimg\/wp-json\/wp\/v2\/tags?post=244"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}