This repository contains experiments in adding the <picture>
element to
WebKit's WebCore library.
It is based on Chromium's WebKit from 17/10/12.
Note: This is a work in progress. It does not (yet) represent a full
implementation of the <picture>
element specification. Please file any
inconsistency with the specification as an issue.
- Build Chromium like you normally would on Linux or [OSX] (http://code.google.com/p/chromium/wiki/MacBuildInstructions)
- If your time is precious, use Ninja
- Download the patch from here to your /tmp directory
- Apply the patch using
(cd third_party/WebKit/Source/WebCore && patch -p0 < /tmp/picture_patch.txt)
- Ubuntu 64bit & OSX binaries can be found here
Once you got your new binary, you can see <picture>
in action [here] (http://demos.responsiveimages.org/)
<picture><source src></picture>
should work. The first source should be fetched by the PreloadScanner and then displayed when the element is parsed.<picture src></picture>
prefetches and displays the resource. It overrides inner<source>
tags if present.- The
media
attribute should be working as expected for both the PreloadScanner and the actual parser.
- The
srcset
attribute is not yet supported in either the PreloadScanner or the actual parser. - The
type
attribute is not yet supported in either the PreloadScanner or the actual parser.