mozumder / HTML6

An HTML6 proposal for single-page apps without Javascript.
85 stars 7 forks source link

Images in view layer #9

Open AndySky21 opened 9 years ago

AndySky21 commented 9 years ago

The section regarding images should be completely revised. The proposed model: attribute values take into no account backward compatibility, and they will require JS polyfill in order to provide basic page integrity. However, this is not the worst thing. How does your proposal deal with modern scenarios of responsive images? I mean, both in @srcset viewport responsivity and in <picture>/<source> art direction. There could be several different URI for an image, based on resolution and/or size. How would controller tell model the correct resource to be downloaded and shown in view layer? You should find an alternative to hardcoded image URIs without forcing authors to use specific names for files (there's a number of reasons why this idea would fail). Also consider that file selection cannot rely upon requests made by control layer, as the layout can vary and therefore images are requred to "respond" to viewport/ events (such as browser window resize, portable devices re-orientation, zooming etc.)

mozumder commented 9 years ago

Yes I got rid of the model: URI. They weren't backwards compatible.

For responsive images, the APIs should provide the data as is, to be filled into SRCSET or PICTURE elements. A more advanced author could use Javascript to build these SRCSET or PICTURE elements from basic models if they wish.

AndySky21 commented 9 years ago

A more advanced author could use Javascript to build these SRCSET or PICTURE elements from basic models if they wish.

I hope authors will not have to use JS where they can currently avoid it! :smile: However, I just want you to think about the complexity of adaptive images. You could have several <source> elements, each with its own @srcset, then followed by <img> again specified with srcset attribute or even with sizes. Navigating the model will have to update all elements properly (or even a subset in case not all images have the same requirements). The API should interface this structure properly.