- From: Hallvord Reiar Michaelsen Steen <hsteen@mozilla.com>
- Date: Thu, 4 Feb 2016 13:52:43 +0100
- To: Grisha Lyukshin <glyuk@microsoft.com>
- Cc: Gary Kacmarcik (Кошмарчик) <garykac@chromium.org>, WebApps WG <public-webapps@w3.org>
On Thu, Feb 4, 2016 at 2:43 AM, Grisha Lyukshin <glyuk@microsoft.com> wrote: > > Killing them doesn't sound like the right course of action. We would have to come up > with another API so we can have an alternative to what before cut/copy/paste do. True, it's a use case we should handle. Options: * automagically enable commands if there are corresponding event listeners (Opera Presto model) * Pros: "just works", no extra APIs, page authors don't need to learn nor do anything extra * Cons: registering event listeners is not "supposed to" have side effects, W3C specs are not "supposed to" go into UX territory, web apps may want to sometimes leave the commands disabled after all when it doesn't make sense to execute them * Add a new API method like document.setCommandEnabled('paste', false) * Pros: Simpler and more straightforward than the onbefore* event-based model, can be integrated with queryCommandEnabled(), gives web apps fine grained control of when to enable/disable stuff * Cons: I think the editing spec people are trying to move away from those legacy document.* commands and may not be celebrating the opportunity of adding a new one.. Also, we don't really want to let sites disable these commands at will - we want them to *enable* them when it makes sense but not *disable* them when the UA would otherwise enable them, to prevent nuisance and "copyright protection"-style abuse. Are there any other options? > Why can't we fire these events regardless of content editability and do actual editability > check during the execution of the execcommands? That's the plan :) - the spec requires the browser to fire a paste event if the user for example presses ctrl-v regardless of whether the context can handle a paste or not. However, the *menu* command state (and thus the user's actual ability to trigger the command any other way than by shortcut keys) would depend on the onbefore* handling or some equivalent API we'd have to invent. Or the magic solution ;) -Hallvord R
Received on Thursday, 4 February 2016 12:53:43 UTC