Bug 1514940 - part 1: Forcibly disable new keyCode/charCode value of keypress events if the document is Confluence r=smaug,Ehsan,kmag
Old Confluence does not aware of conflated model keypress event (see UI Events spec, https://w3c.github.io/uievents/#determine-keypress-keyCode). Additionally, Confluence can be hosted with any domains. Therefore, we cannot use blacklist to disable the conflated model keypress event only on it. This patch checks whether current or parent document is Confluence with JS module, called KeyPressEventModelCheckerChild. For kicking this module, nsHTMLDocument dispatches an custom event, CheckKeyPressEventModel, when it becomes editable only first time. Finally, if it's a Confluence instance, the module let PresShell know that we need to use split model keypress event in it. Differential Revision: https://phabricator.services.mozilla.com/D17907
This commit is contained in:
@@ -7811,7 +7811,7 @@ nsresult PresShell::EventHandler::DispatchEventToDOM(
|
||||
nsContentUtils::IsURIInPrefList(
|
||||
uri,
|
||||
"dom.keyboardevent.keypress.hack.dispatch_non_printable_keys");
|
||||
mPresShell->mForceUseLegacyKeyCodeAndCharCodeValues =
|
||||
mPresShell->mForceUseLegacyKeyCodeAndCharCodeValues |=
|
||||
nsContentUtils::IsURIInPrefList(uri,
|
||||
"dom.keyboardevent.keypress.hack."
|
||||
"use_legacy_keycode_and_charcode");
|
||||
|
||||
Reference in New Issue
Block a user