[whatwg] HTML 5 - comments on 5.6 Command APIs

Ian Hickson ian at hixie.ch
Tue Aug 19 16:24:53 PDT 2008


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.   `._.-(,_..'--(,_..'`-.;.'


More information about the whatwg mailing list