W3C home > Mailing lists > Public > whatwg@whatwg.org > August 2008

[whatwg] HTML 5 - comments on 5.6 Command APIs

From: Ian Hickson <ian@hixie.ch>
Date: Tue, 19 Aug 2008 23:24:53 +0000 (UTC)
Message-ID: <Pine.LNX.4.62.0808192251580.14795@hixie.dreamhostps.com>
On Tue, 11 Mar 2008, Krzysztof ?elechowski wrote:
> 
> Dnia 10-03-2008, Pn o godzinie 03:09 +0000, Tom Gilder pisze:
> 
> > 3) HTML 5 suggests queryCommandEnabled('Unlink') returns true with any  
> > selection:
> > 
> > 	"Enabled When: The document has a selection that is entirely within  
> > an editing host."
> > 		-- http://www.whatwg.org/specs/web-apps/current-work/#unlink
> > 
> > I see no point in returning true when there are no links to remove. IE  
> > and Opera currently only return true when the selection contains a  
> > link. WebKit follows the current HTML 5 wording.
> 
> "Unlink" means "Remove all links".  
> There is no point removing all links when there are none 
> but there is no harm either.
> Me thinks "Unlink" should be enabled in this case.
> 
> Which of the following use cases do you consider more common?
> 
> Case 1: remove all links (if there are any)
> Case 2: 
> remove all links, handle an exception if there are none?
> 
> Methinks, case 1 wins

I think the most common case will be a button that you would want disabled 
if there's no link.

Note that no exception is raised when the command is disabled, so it's 
not a problem really. It actually makes no difference whether it's 
enabled or not if there are no links.

I've made the spec do what IE does.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Tuesday, 19 August 2008 16:24:53 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:04 UTC