- From: Leif Halvard Silli <xn--mlform-iua@xn--mlform-iua.no>
- Date: Mon, 30 Nov 2009 03:48:13 +0100
- To: "Tab Atkins Jr." <jackalmage@gmail.com>
- Cc: Maciej Stachowiak <mjs@apple.com>, Jeroen van der Gun <noreplytopreventspam@blijbol.nl>, public-html <public-html@w3.org>
On Mon, 30 Nov 2009 03:07:21 +0100, Leif Halvard Silli wrote:
> On Fri, 27 Nov 2009 22:46:46 -0600, Tab Atkins Jr.:
>> On Fri, Nov 27, 2009 at 10:13 PM, Maciej Stachowiak:
>>> This does seem to mitigate the concern. I'm not sure whether it completely
>>> eliminates it. Is <figure> any trickier to use correctly than other new
>>> HTML5 elements, with this technique?
>>
>> Marginally trickier. The js hack used for the other elements is
>> conceptually simpler, but this hack doesn't depend on js being
>> available, which is a plus. I don't think the difference in
>> trickiness is significant.
> Second, if we can accept wrapping the element in a <div>, then HTML 4
> already has <object>. (IE6 and 7 requires that <div> - otherwise it is
> not required.) <object> already creates a new outline context - as
> <figure> is supposed to do (it is bound to take a long time before it
> happens).
A IE6/IE7 safe version could look like this [1]:
<figure>
<p>Caption inside the element your prefer, even h1-h6</p>
<object>
<div> <!-- div for best compatibility with IE6/7 -->
<img src="image" alt="text">
<p>figure content goes here</p>
</div>
</object>
</figure>
Another option than the <div> inside <object> a <span> around the
<object> [2]. This depends only depends on how we define the <figure>
element - it is perfectly valid HTML 4 to have a span around the
<object>, and it is IE6/7 compatible as well. But it is perhaps
simplest to define the <figure> as an element with OBJECT element with
an optional captioning element.
The purpose of the <object> element is to instantiate a new outline
context and to separate the figure content from the figure caption.
Object already has that feature.
The above can work without whether document.createElement("figure"); or
the <span>/<div> wrappers. But of course, for best CSS control,
wrapping is needed in IE6/IE7, if you don't want to use javscript.
I think this proposal has the advantage of making <figure> more like
<article>, <section> etc: A semantic wrapper around features that HTML
4 already have.
Another advantage is that it solves the outline issue, since the
outline context is created by <object> rather than by <figure>. That
way, the author can himself/herself decide whether the caption of the
figure content (the object) is supposed to become part of the general
document structure (if you use a h1-h6 element) or just a local caption
(if you use another element.)
[1] Demo using span:
http://software.hixie.ch/utilities/js/live-dom-viewer/saved/321
[2] Demo using div:
http://software.hixie.ch/utilities/js/live-dom-viewer/saved/322
--
leif halvard silli
Received on Monday, 30 November 2009 02:48:53 UTC