[whatwg] Adding a src attribute to all elements

I would like to propose that a src attribute be added to the spec for
all HTML elements. The content of the file referenced in the src
attribute would then replace the contents of the element that contains
the src attribute. The src attribute would then be interpreted
differently, depending on the type of file referenced in that src
attribute.

For instance, if I create a level 1 header that looks like:
<h1 src="/example.png">This is a header</h1>
The text "This is a header" would be replaced with the image that's
located at /example.png. However, if /example.png returns a 404 error,
the text would be displayed instead.

If, however, I create a div that looks like:
<div src="/example.txt">This is some other text</div>
The text content of /example.txt would replace the text "This is some
other text" within the div that I created. Again, though,
if /example.txt returned a 404 error, then "This is some other text"
would show up inside the div instead.

The contents of the file referenced in the src attribute would need to
be parsed and rendered prior to replacing the initial content of the
element. For instance, if I reference a PHP file in the src attribute, I
would expect the PHP to be parsed before it shows up in my document.

I'm not sure if this is at all feasible, but I personally think it would
be a great addition to the spec. Thank you.


________________________________________________________________________

Curtiss Grymala
curtiss at ten-321.com

Received on Tuesday, 3 November 2009 18:05:26 UTC