W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2014

Re: [editing] CommandQuery Object and Event

From: Ryosuke Niwa <rniwa@apple.com>
Date: Thu, 05 Jun 2014 00:12:37 -0700
Cc: "public-webapps@w3.org" <public-webapps@w3.org>
Message-id: <72C98D16-2412-495C-A4A6-35D3E1401DBE@apple.com>
To: Ben Peters <Ben.Peters@microsoft.com>
Can this be an attribute on elements instead?  Otherwise, browsers would have to repeatedly call these functions to update edit menu, etc...

Also, we should talk with people working on Indie UI (http://www.w3.org/WAI/IndieUI/).  The problem we're solving here is very similar to the one they're trying to solve.

On Jun 4, 2014, at 11:31 AM, Ben Peters <Ben.Peters@microsoft.com> wrote:

> There has been some conversation about browser UI for Commands with ContentEdtiable=minimal. Some people seem to believe that UI should not be displayed because it may not be relevant. One way to solve this is to have an event that would allow script to tell the browser what is relevant. Today, there are several ways to ask the browser if a given command is enabled/relevant. This includes queryCommandEnabled, queryCommandSupported, and QueryCommandValue. However, the site is not able to influence the return value of these events. In order to give more power to browsers, frameworks, and sites, it seems to make sense to allow these values to be modified. Therefore I propose a new method:
> 
> document.queryCommand(<commandName>)
> 
> which returns a new read-only object (called CommandQuery for now):
> 
> CommandQuery
> {
> 	Boolean isSupportedByUA;
> 	Boolean isSupported;
> 	Boolean isEnabled;
> 	Object currentValue;
> }
> 
> By default, this object will match the browser's support for this command in the current context. However, before it returns, a CommandQuery event will fire with a read/write CommandQuery object. If a framework or site wishes to indicate different values for the command state, it can do so in that event.
> 
> CommandQueryEvent: Event {
> {
> 	CommandQuery commandQuery;
> }
> 
> In this way, a framework can enable commands that a browser does not natively support. Further, a browser could fire CommandQueryEvents to determine the correct toolbar buttons to display. Thoughts?
> 
> Ben
> 
Received on Thursday, 5 June 2014 07:13:07 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:14:24 UTC