On 23/03/20 9:50, Masayuki Nakano wrote:
Additionally, I'll land new Gecko specific editing command for
enabling the new compatible behavior even before shipping it and for
making it can check whether it's the version of Firefox supports the
new behavior. (Note that the command cannot disable the new compatible
behavior if it's enabled by the pref, thus, I plan to remove the
legacy behavior as soon as possible after shipping it due to the
maintenance cost.)
About the new command, I post this separately.
Web apps can enable the new behavior with a call of:
document.execCommand("enableCompatibleJoinSplitDirection", false, "true");
This is available when the document is in the design mode
<https://developer.mozilla.org/en-US/docs/Web/API/Document/designMode>
or has at least one element which has |contenteditable| attribute whose
value is not |"false"| *and* first joining nodes or split node
transaction is created. The latter limitation is caused by saving the
footprint with not storing the join/split node direction per transaction.
Additionally, once the new behavior is enabled by the pref, web apps
*cannot* disable the new behavior with calling it with |"false"|. The
reason is, it's too expensive and hard to support both behavior forever
(actually, I created some regressions in a couple of months only in the
new behavior mode). Therefore, we need to know that which web apps work
only with the legacy behavior.
To detect Firefox which do not support the new compatible behavior, web
apps can check the result of the above call or:
document.queryCommandState("enableCompatibleJoinSplitDirection")
*with* checking the UA is Firefox since the other browsers do not
support this Gecko specific command. Therefore, they return |false| for
these calls.
Once we ship the new behavior by default in all channels, we can just
make |Document| return |true| with nothing to do. (Without evidence of
that no web apps use these commands, we cannot remove this new command,
unfortunately.)
Since editable apps do not depend on all editing features of browsers,
web apps maybe can use the new behavior even before we ship the new
behavior in all channels. Therefore, I believe that this new command is
useful for web developers.
--
Masayuki Nakano<[email protected]>
Working on DOM, Events, editor and IME handling for Gecko
--
You received this message because you are subscribed to the Google Groups
"[email protected]" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/a/mozilla.org/d/msgid/dev-platform/29109c88-e60c-4507-4bbb-61f5c4719982%40d-toybox.com.