<progress> element and attributes vs. content

On Friday, August 14, 2009 6:07 AM, Smylers wrote:
> Ian Hickson writes:
> > On Fri, 7 Aug 2009, Adrian Bateman wrote:
> >
> > > Personally, I'd prefer to remove the element content parsing and
> > > always make the progress bar rendering depend on the attributes.
> >
> > I guess we could do that; what do other people think?
> When I gave a conference presention introducing HTML 5 the content
> parsing of <progress> was one of two points to get spontaneous applause
> from the audience (the other was the HTML 5 doctype).
> The audience were programmers, so I guess the notion of 'don't repeat
> yourself' appealed -- not having to specify the same thing in both the
> fallback text and the attributes, and risking one being updated without
> the other.

The comment attributed to me was actually written by Henri but I do agree with it.

Is the progress element intended to draw a control and also show the contained text? I presume not. We often see the Windows progress/activity bar annotated with a percentage shown as text and I suspect developers will want to achieve something similar on the web.

If the progress element doesn't draw the contained text then web developers may often want the value in mark-up after the element. They will then have to deal with the case when the browser doesn't support the progress element, is showing the contents as fall-back text, and they don't want the text to display twice. I'm also concerned about how fragile the content parsing rules may turn out to be in practice.

I agree with Henri - I would also prefer to remove the content parsing and have the display based only on the attributes. I think the notion of only updating the content is a nice idea but may actually make things more complex in practice. If the progress element only depends upon the attributes, web developers can decide whether the control is just providing extra information (where it doesn't require any fall-back text) or whether then need to include fall-back. They can also decide whether they want the fall-back text to update with the progress control.

For example:

<div><progress value="10" max="100"></progress> 10% complete</div>


<div><progress value="10" max="100">10%</progress></div>



Received on Friday, 14 August 2009 17:32:06 UTC