W3C home > Mailing lists > Public > whatwg@whatwg.org > December 2005

[whatwg] Menus, fallback, and backwards compatibility: ideas wanted

From: Matthew Raymond <mattraymond@earthlink.net>
Date: Tue, 13 Dec 2005 08:23:30 -0500
Message-ID: <439ECB52.9020609@earthlink.net>
Ian Hickson wrote:
> In the case of <menulabel>, the presence or absence of the attribute 
> directly affects the immediate rendering of the other element, and any 
> reference to one element requires examining the other element. It's a much 
> closer relationship, and one that happens continually, not just at 
> specific points (e.g. on a click).

   Well, that doesn't have to be the case. We can use <menulabel> and
something like <menu type="popup"> together. The rendering is always the
same for the menu whether a <menulabel> is associated with it or not.

>>Also, you can still use implicit association.
> 
> I assume you mean containership?
> 
> The problem with
> 
>    <menulabel>
>      foo
>      <menu>...</menu>
>    </menulabel>
> 
> ...is that finding the actual string that corresponds to the title is 
> non-trivial. Imagine bidi elements or ruby being sprinkled into it, 
> consider the various error-handling cases, ponder what might happen if the 
> author sets 'display:block' on the menu explicitly, etc. None of these are 
> unsurmountable problems, but the lack of a very simple solution makes it 
> less attractive.

   I don't see how it's any more difficult than dealing with a <label>.
In that respect, isn't this problem already solved? We just copy the way
we handle <label>.

> There's also the whole conceptual problem (also present with <label>) of 
> having the menu be inside its label.

   Well, in most user interfaces, clicking on the label brings up the
menu, so there's sort of a child relationship already. It does introduce
a few minor inheritance issues in CSS, but those seem rather trivial to
me. To be honest, I don't see this as being much of an issue.

> My current thinking goes something like:
> 
>    <menu type="commands" label="Menulabel"/>
> 
> ...where type="commands" means "make a toolbar", and label="Menulabel" 
> means "the toolbar has only one button, its value is "Menulabel", and its 
> menu is this menu".
> 
> I'm not overly joyous about it, but it _is_ simple. :-)

   I don't think this is going to fly for menu buttons and the like. Web
authors are going to want to style the menu buttons. As for toolbars or
similar menus, just use |title|.

> Another option is:
> 
>    <button menu="foo"/>
>    <menu type="context" id="foo"/>
> 
> But as you point out in your mail, this has some of the <menulabel> 
> problems (at least when extended to <menu type="commands">-type scenarios 
> where you want to make a toolbar of these things).

   Actually, it's no different from this:

| <menulabel for="foo"/>
| <menu type="context" id="foo"/>

   You've simply changed the element and attribute names. Using <button>
may have fallback advantages, though. Also, I'm concerned that the name
"menu" for the attribute many not be specific enough, especially if we
allow both context menus and popup menus.

   The "context" type value seems to be like "popup". Difficult to say
what the best name for that is.

>>The XHTML2 model has significant styling problems, though.
> 
> Indeed.
> 
> In general, I think having the label be its own element (or attribute) 
> without anything inside it other than the label text is the most sensible 
> design (semantically), at least when compared to designs that put other 
> elements inside the label. But it's not perfect, as you say.
> 
> Note that in terms of styling, we shouldn't shy away from saying that CSS 
> should be fixed to handle our markup, if CSS sucks. The style should be 
> slave to the content, not vice versa.

   I suppose, but there's still the matter of the time it takes to
implement the spec, especially if we create dependencies on CSS, so we
can't ignore it entirely. Also, I like the idea of decoupling the label
from the target element. It allows for multiple labels to target the
same element.
Received on Tuesday, 13 December 2005 05:23:30 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:58:44 UTC