author Masayuki Nakano <masayuki@d-toybox.com>
Wed, 03 Oct 2018 09:21:47 +0000
changeset 497850 fea8e039767a88ebfb73b1f0d43d1f87ee7394e1
parent 474357 b7832a2c2c296390c57c1261d805759530020b26
permissions -rw-r--r--
Bug 1343955 - part 2: Implement _guessCodeFromKeyName() in EventUtils.js with C++ and make it accessible with nsITextInputProcessor for EventUtils.js r=smaug We need to port synthesizeKey() of EventUtils.js to FuzzingFunctions. So, its helper function, _guessCodeFromKeyName() in EventUtils.js needs to be accessible from FuzzingFunctions. Therefore, we need to reimplement it with C++ and make it accessible via nsITextInputProcessor for EventUtils.js for making easier to maintain. This patch moves _guessCodeFromKeyName() into TextInputProcessor and WidgetKeyboardEvent. Non-printable key part of _guessCodeFromKeyName() is moved to WidgetKeyboardEvent::ComputeCodeNameIndexFromKeyNameIndex() because of not depending on active keyboard layout. On the other hand, printable key part needs to assume that active keyboard layout is en-US keyboard layout. Therefore, it's moved to TextInputProcessor::GuessCodeValueOfPrintableKeyInUSEnglishKeyboardLayout() because any Core code shouldn't refer it as utility method for keeping that we're i18n-aware. Differential Revision: https://phabricator.services.mozilla.com/D5514

  "phabricator.uri" : "https://phabricator.services.mozilla.com/",
  "repository.callsign": "MOZILLACENTRAL",
  "history.immutable": false