Skip to content

Instantly share code, notes, and snippets.

Adaptive Image Element

Author:

Mat Marquis

Status of this Document

This is an unofficial draft spec, not formally endorsed by the WHATWG. It is suitable only for reviewing the details of the proposed element.

Table of Contents

Rationale

This is a proposal for the WHATWG for ongoing consideration, and the HTML WG for consideration as part of HTML.next.

This proposal makes it easier for developers to create apps that optimize the user's experience of images across diverse displays and various bandwidths. It addresses these issues through a markup-based means of delivering alternate content image sources, based on device capabilities.

This proposal is based on Florian Rivoal’s original proposal to the WHATWG.

Thank you for your consideration.

Mat Marquis

@Wilto
Wilto / hide-and-tel.js
Created July 3, 2012 16:43
Hide and Tel
(function() {
var links = document.getElementsByTagName( "a" );
for ( var i = 0, a = links.length; i < a; i++ ) {
if( links[ i ].href.indexOf( "tel" ) > -1 ) {
var el = links[ i ],
parent = el.parentNode,
num = document.createTextNode( el.innerHTML );
if( el.className.indexOf( "tel" ) === -1 || !parent.className.indexOf( "tel" ) === -1 ) {
@Wilto
Wilto / demo.html
Created July 3, 2012 21:06
Hide and Tel
<!DOCTYPE html>
<!--[if lt IE 7 ]> <html lang="en" class="ie ie6"> <![endif]-->
<!--[if IE 7 ]> <html lang="en" class="ie ie7"> <![endif]-->
<!--[if IE 8 ]> <html lang="en" class="ie ie8"> <![endif]-->
<!--[if IE 9 ]> <html lang="en" class="ie ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
@Wilto
Wilto / randos.php
Created August 14, 2012 15:08
Nothin’ to see here.
<?php
$stack = array( "user1", "user2", "user3", "user4", "user5", "user6" );
$output = array();
shuffle( $stack );
for ($i = 0; $i <= 2; $i++) {
$output[] = array_pop( $stack );
}
print( "<pre>" );
@Wilto
Wilto / ios-selectzoom.js
Created October 30, 2012 21:05
Prevents zoom when interacting with `select`/text inputs on iOS, from jQM. Tested in iOS 6 and below.
(function( $ ) {
var meta = $( "meta[name=viewport]" ),
initialContent = meta.attr( "content" ),
disabledZoom = initialContent + ",maximum-scale=1, user-scalable=no",
enabledZoom = initialContent + ",maximum-scale=10, user-scalable=yes",
disabledInitially = /(user-scalable[\s]*=[\s]*no)|(maximum-scale[\s]*=[\s]*1)[$,\s]/.test( initialContent );
$.zoom = {
enabled: !disabledInitially,
locked: false,

First, double-tap the more info button. Second, turn VoiceOver off, and then tap the screen one time. (You can do this anywhere, as long as you tap the screen once.) Third, turn VoiceOver on and tap the upper right side of the phone near the earpiece--my friend says that it is "the top right corner." VoiceOver should indicate that you tapped the action button, which at that point should work for you. When you double tap the action button, tap once on the screen--regretably, flicking does not work. After you tap once, you should hear VoiceOver announce one of the options specific to the action screen. When one of these options is announced, simply flick left and right to move through each one.

http://www.applevis.com/applevis-forum/ios-ios-app-discussion/saving-photos-text-messages

This is the process for interacting with an image inside a text message in VoiceOver, thanks to a particularly nasty iOS 6 bug. The bug leaves you on a “blank” screen, after tapping into the image. No “back” button read aloud—n

@Wilto
Wilto / blockquote.md
Created December 20, 2012 15:35
Of Blockquotes and Outlines
@Wilto
Wilto / 3d-test.js
Last active December 10, 2015 14:28
Workin’ on the jQM test for 3D transforms.
function transform3dTest() {
var fakeBody,
doc = document,
de = doc.documentElement,
bodEl = doc.body || (function() {
fakeBody = true;
return de.insertBefore( doc.createElement( "body" ), de.firstElementChild || de.firstChild );
}()),
el = doc.createElement( "div" ),
transforms = {
@Wilto
Wilto / gist:4494171
Created January 9, 2013 15:47
My Irssi settings.
servers = (
{ address = "eu.irc6.net"; chatnet = "IRCnet"; port = "6667"; },
{ address = "open.ircnet.net"; chatnet = "IRCnet"; port = "6667"; },
{ address = "irc.efnet.org"; chatnet = "EFNet"; port = "6667"; },
{
address = "irc.undernet.org";
chatnet = "Undernet";
port = "6667";
},
{ address = "irc.dal.net"; chatnet = "DALnet"; port = "6667"; },