Граф коммитов

173 Коммитов

Автор SHA1 Сообщение Дата
Masayuki Nakano 4341d6fb0c Bug 1455514 - part 1: Add accessors and static helper methods to retrieve `nsINode` or its concrete classes from `EventTarget` r=smaug
Currently, checking whether an `EventTarget` is `nsINode` (or its concrete
classes) or not requires a QI, but it's expensive and used a lot while we
handle each event.  Therefore, it'd be nicer for creating a virtual method,
`EventTarget::IsNode()` and use it for the check.

If trying to convert `EventTarget` to a concrete class, it may require two
virtual method calls.  I'm not sure whether it's cheaper than a QI, but at
least, it won't depend on the UUID check order of `QueryInterface()` when
multiple interfaces are implemented.

Differential Revision: https://phabricator.services.mozilla.com/D129781
2021-11-02 13:03:43 +00:00
Emilio Cobos Alvarez 2ec499c7b2 Bug 1708829 - Make sure that delta* getters account for scroll speed override correctly. r=masayuki
Depends on D114052

Differential Revision: https://phabricator.services.mozilla.com/D114737
2021-05-14 17:44:29 +00:00
Sandor Molnar 7b4d940c00 Backed out 2 changesets (bug 1708829) for causing mochitest plain failures in test_continuous_wheel_events. CLOSED TREE
Backed out changeset 28faebd5fc72 (bug 1708829)
Backed out changeset 044c2060da7d (bug 1708829)
2021-05-14 17:12:03 +03:00
Emilio Cobos Alvarez 21021ee18d Bug 1708829 - Make sure that delta* getters account for scroll speed override correctly. r=masayuki
Depends on D114052

Differential Revision: https://phabricator.services.mozilla.com/D114737
2021-05-14 12:41:30 +00:00
Markus Stange 53b0e331c3 Bug 1701108 - Split this assertion up into three assertions that are easier to understand. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D109825
2021-03-26 02:06:53 +00:00
Simon Giesecke ad01a10a3b Bug 1634281 - Use nsTHashMap instead of nsDataHashtable. r=xpcom-reviewers,necko-reviewers,jgilbert,nika,valentin
Note that this patch only transforms the use of the nsDataHashtable type alias
to a directly equivalent use of nsTHashMap. It does not change the specification
of the hash key type to make use of the key class deduction that nsTHashMap
allows for in some cases. That can be done in a separate step, but requires more
attention.

Differential Revision: https://phabricator.services.mozilla.com/D106008
2021-03-10 10:47:47 +00:00
Simon Giesecke be7dc83fa6 Bug 1691913 - Mark nsBaseHashtable (and its subclasses') member functions nodiscard where appropriate. r=xpcom-reviewers,necko-reviewers,dragana,nika
Differential Revision: https://phabricator.services.mozilla.com/D105474
2021-02-26 09:22:53 +00:00
Simon Giesecke 9af107a839 Bug 1691913 - Rename nsBaseHashtable::Put to InsertOrUpdate. r=xpcom-reviewers,necko-reviewers,jgilbert,dragana,nika
This makes the naming more consistent with other functions called
Insert and/or Update. Also, it removes the ambiguity whether
Put expects that an entry already exists or not, in particular because
it differed from nsTHashtable::PutEntry in that regard.

Differential Revision: https://phabricator.services.mozilla.com/D105473
2021-02-26 09:11:46 +00:00
Masayuki Nakano a25988774a Bug 1685491 - part 5: Move the code remapping arrow keys in vertical content to `NativeKeyBindings` r=smaug,jfkthame
Currently, this feature is implemented only on Linux and macOS (see also
bug 1077515 and bug 1301497), and the code is really similar each other.
Additionally, it always tries to query selection to check whether the caret is
in vertical content or not if arrow keys are pressed.  For avoiding a lot of
query, this patch makes `TextEventDispatcher` cache writing mode at every
selection change notification.  However, unfortunately, it's not available when
non-editable content has focus, but it should be out of scope of this bug since
it requires a lot of changes.

Anyway, with this patch, we can write a mochitest only on Linux and macOS.
The following patch adds a test for this as a fix of bug 1103374.

Differential Revision: https://phabricator.services.mozilla.com/D102881
2021-02-02 03:29:31 +00:00
Masayuki Nakano cb448c5095 Bug 1685491 - part.1: Map typical commands to synthesized keyboard events for test on Linux and macOS r=smaug,remote-protocol-reviewers
Currently, we don't allow keyboard events synthesized for tests retrieve native
key bindings in content process.  However, due to this, we cannot test keyboard
navigation, deleting per word, etc on Linux and macOS either with mochitest
or WPT.  For making better compatibility with the other browsers, we should
write WPT more with the test driver.  Therefore, we should allow keyboard
events synthesized for tests retrieve native key bindings.

On the other hand, if we make them retrieve customized keyboard shortcuts
in the environment, some developers may not be able to run tests locally without
resetting their customization.  Therefore, this patch makes `NativeKeyBindings`
set "standard" shortcut keys on the platform instead of retrieving actual
shortcut key results.

If referring the default shortcut key bindings is not good thing for
WebDriver/CDP, perhaps, `TextInputProcessor` should have a new flag which can
refer customized shortcut keys even in content process.  But I think that it
should be done in another bug because some edit commands are mapped forcibly
like this patch.
https://searchfox.org/mozilla-central/rev/c03e8de87cdb0ce0378c0886d3c0ce8bbf9dc44e/remote/domains/parent/Input.jsm#82-102

Differential Revision: https://phabricator.services.mozilla.com/D102877
2021-02-02 03:02:30 +00:00
Masayuki Nakano f7b2e8084b Bug 1689573 - Make `WidgetKeyboardEvent::GetCommandStr()` map empty string to commands never executed r=smaug
Not mapping them causes creating shorter command list than expected.

Differential Revision: https://phabricator.services.mozilla.com/D103465
2021-01-29 22:26:57 +00:00
Masayuki Nakano 525ffa0f23 Bug 1683226 - part 16: Get rid of `WidgetPluginEvent` r=smaug
Depends on D100389

Differential Revision: https://phabricator.services.mozilla.com/D100390
2020-12-29 21:19:45 +00:00
Markus Stange 44e288b359 Bug 1673120 - Extract out scrollbar drawing from nsNativeThemeCocoa so that it can later be used by nsNativeBasicTheme. r=spohl
Differential Revision: https://phabricator.services.mozilla.com/D93844
2020-10-27 15:16:49 +00:00
Nathan Froyd cfb8fb313f Bug 1662251 - stop assigning from NS_Convert* values, mostly; r=sg
This patch was generated by running:

```
perl -p -i \
     -e 's/^(\s+)([a-zA-Z0-9.]+) = NS_ConvertUTF8toUTF16\((.*)\);/\1CopyUTF8toUTF16(\3, \2);/;' \
     -e 's/^(\s+)([a-zA-Z0-9.]+) = NS_ConvertUTF16toUTF8\((.*)\);/\1CopyUTF16toUTF8(\3, \2);/;' \
     $FILE
```

against every .cpp and .h in mozilla-central, and then fixing up the
inevitable errors that happen as a result of matching C++ expressions with
regexes.  The errors fell into three categories:

1. Calling the convert functions with `std::string::c_str()`; these were
   changed to simply pass the string instead, relying on implicit conversion
   to `mozilla::Span`.
2. Calling the convert functions with raw pointers, which is not permitted
   with the copy functions; these were changed to invoke `MakeStringSpan` first.
3. Other miscellaneous errors resulting from over-eager regexes and/or the
   replacement not being type-aware.  These changes were reverted.

Differential Revision: https://phabricator.services.mozilla.com/D88903
2020-09-02 09:54:37 +00:00
Simon Giesecke cd8b8939b9 Bug 1648010 - Replace uses of NS_LITERAL_STRING/NS_LITERAL_CSTRING macros by _ns literals. r=geckoview-reviewers,jgilbert,agi,hsivonen,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D80860
2020-07-01 08:29:29 +00:00
Edgar Chen 4d53288bec Bug 1635784 - Part 1: IsRemoteTarget should take fission OOP iframe into account; r=smaug
And add IsTopLevelRemoteTarget for the original usage.

Differential Revision: https://phabricator.services.mozilla.com/D79441
2020-06-18 20:38:34 +00:00
Masayuki Nakano 87ca855ece Bug 1603074 - part 1: Make `synthesizePlainDragAndDrop()` synthesize drag events without `DataTransfer` object r=smaug
`synthesizePlainDragAndDrop()` synthesizes drag events with `DataTransfer`
object which is set to `DragEvent.dataTransfer` of `dragstart` after starting
drag session explicitly.  However, this causes
`EventStateManager::DoDefaltDragStart()` does not initialize `nsIDragService`
instance.  Therefore, synthesized drag events cannot work with editor because
`DragEvent::GetMozSourceNode()` returns `nullptr` due to
`nsIDragSession::GetSourceNode()` returning `nullptr`.

On the other hand, synthesized drag events cannot use
`nsIDragService::InvodeDragSession()` normally because of hitting an assertion.
https://searchfox.org/mozilla-central/rev/690e903ef689a4eca335b96bd903580394864a1c/widget/nsBaseDragService.cpp#230-233

This patch does:
- mark drag events caused by synthesized mouse events as "synthesized for tests"
- make `synthesizePlainDragAndDrop()` stop using
  `nsIDragService.startDragSession()`
- make `nsBaseDragService` initialize and start session even for synthesized
  `dragstart` event
- make `synthesizePlainDragAndDrop()` stop synthesizing drag events with
  `DataTransfer` object since it's normal behavior and it'll be initialized
  with `nsIDragService::GetDataTransfer()`
- make `nsBaseDragService` store `effectAllowed` for the session only when
  it's synthesized session because it's required at initializing synthesized
  default `dropEffect` value of `dragenter`, `dragover`, `dragexit` and `drop`
  events' `dataTransfer`
- make all tests which use `nsIDragService.startDragSession()` use new
  API, `nsIDragService.startDragSessionForTests()` to initialize session's
  `effectAllowed` value
- make `EventStateManager::PostHandleEvent()` set drag end point of the test
  session to `eDrop` event's screen point
- make `synthesizePlainDragAndDrop()` set drag end point of the session if
  it does not synthesize `drop` event because following `endDragSession()`
  use it at dispatching `dragend` event on the source element

Additionally, this adds `dumpFunc` new param to `synthesizePlainDragAndDrop()`
because it's really useful to investigate the reason why requesting DnD isn't
performed as expected.

Differential Revision: https://phabricator.services.mozilla.com/D57425

--HG--
extra : moz-landing-system : lando
2019-12-21 12:27:06 +00:00
Chris Peterson 406763af7f Bug 1570499 - Part 1: Replace MOZ_FALLTHROUGH macro with C++17's [[fallthrough]] attribute. r=froydnj
This changeset is a simple find and replace of `MOZ_FALLTHROUGH` and `[[fallthrough]]`.

Unfortunately, the MOZ_FALLTHROUGH_ASSERT macro (to assert on case fallthrough in debug builds) is still necessary after switching from [[clang::fallthrough]] to [[fallthrough]] because:

* MOZ_ASSERT(false) followed by [[fallthrough]] triggers a -Wunreachable-code warning in DEBUG builds
* but MOZ_ASSERT(false) without [[fallthrough]] triggers a -Wimplicit-fallthrough warning in NDEBUG builds.

Differential Revision: https://phabricator.services.mozilla.com/D56440

--HG--
extra : moz-landing-system : lando
2019-12-20 07:16:43 +00:00
Sylvestre Ledru 8d2f0d1b1f Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D54686

--HG--
extra : moz-landing-system : lando
2019-11-26 14:35:02 +00:00
Masayuki Nakano 0f9b3a05da Bug 1594215 - Make `PuppetWidget::GetEditCommands()` check `mBrowserChild` before using it r=smaug
The reason of the crash is, the window may have already been destroyed and
`PuppetWidget::mBrowserChild` was set to `nullptr` when synthesizing key event.

This patch makes `PuppetWidget::GetEditCommands()` check whether it's `nullptr`
and returns whether it's succeeded or not.  Therefore, `TextInputProcessor`
can throw exception in such case.

Differential Revision: https://phabricator.services.mozilla.com/D52308

--HG--
extra : moz-landing-system : lando
2019-11-08 11:32:51 +00:00
David Parks b044993630 Bug 1384260: Part 4 - Remove SystemParametersInfo from Windows content proc plugin code r=jmathies
We use SystemParametersInfo to get the current system scroll wheel settings when we process scrollwheel movement in the content process.  We need to remove SystemParametersInfo for sandboxing the content process so this code changes the plugin behavior to cache the system wheel settings.  We do this by 1) sending wheel settings to the plugin whenever a plugin takes focus and 2) forwarding wheel settings update messages from Windows to the currently focused plugin.

Differential Revision: https://phabricator.services.mozilla.com/D47938

--HG--
extra : moz-landing-system : lando
2019-10-16 21:24:48 +00:00
kriswright be316b6bf9 Bug 1573992 - Convert 3 ui.key.* prefs to static prefs. r=njn
Converts ui.key.generalAccessKey, ui.key.chromeAccess, and ui.key.contentAccess to static prefs. Updates usages.

Differential Revision: https://phabricator.services.mozilla.com/D42392

--HG--
extra : moz-landing-system : lando
2019-08-26 20:25:42 +00:00
Nicholas Nethercote cd426e3ad2 Bug 1569526 - Remove return values from `Add*VarCache()`. r=KrisWright
They're infallible in practice and always `NS_OK`. (This stems from
`AddVarCacheNoAssignment()` always returning `NS_OK`.)

As a result, the commit removes lots of unnecessary checks.

Differential Revision: https://phabricator.services.mozilla.com/D39804

--HG--
extra : moz-landing-system : lando
2019-07-30 06:19:46 +00:00
Nicholas Nethercote 18fae65f38 Bug 1563139 - Remove StaticPrefs.h. r=glandium
This requires replacing inclusions of it with inclusions of more specific prefs
files.

The exception is that StaticPrefsAll.h, which is equivalent to StaticPrefs.h,
and is used in `Codegen.py` because doing something smarter is tricky and
suitable for a follow-up. As a result, any change to StaticPrefList.yaml will
still trigger recompilation of all the generated DOM bindings files, but that's
still a big improvement over trigger recompilation of every file that uses
static prefs.

Most of the changes in this commit are very boring. The only changes that are
not boring are modules/libpref/*, Codegen.py, and ServoBindings.toml.

Differential Revision: https://phabricator.services.mozilla.com/D39138

--HG--
extra : moz-landing-system : lando
2019-07-26 01:10:23 +00:00
Nicholas Nethercote cc534d2bb6 Bug 1561825 - Make mousewheel.* static prefs follow the naming convention. r=KrisWright
Differential Revision: https://phabricator.services.mozilla.com/D36161

--HG--
extra : rebase_source : 1466f6cb77029782b391702f5c80f34926995166
2019-06-27 17:14:02 +10:00
Masayuki Nakano 5ac5e497b5 Bug 1555227 - Make GetInternalCommand() return new commands when the command is "cmd_align" without params r=m_kato
`cmd_align` is always with `nsCommandParams` when it's executed.  However,
when somebody checks whether the command is enabled or not, or retrieves the
state, `GetInternalCommand()` is called without `nsCommandParams`.  Therefore,
even when `nsCommandParmas` is nullptr for `cmd_align`, `GetInternalCommand()`
shouldn't warn it.

Additionally, internal command supports to set `align` to empty string.
Therefore, `GetInternalCommand()` also needs to support it.

This patch adds `Command::FormatJustify` for the former case and
`Command::FormatJustifyNone` for the latter case.

Note that this does not affect to actual behavior since `AlignCommand`
does not refer the result of `GetInternalCommand()`.

Differential Revision: https://phabricator.services.mozilla.com/D33604

--HG--
extra : moz-landing-system : lando
2019-06-04 10:01:31 +00:00
Jean-Yves Avenard 04a34db033 Bug 1550422 - P12. Convert Live gfxPrefs into StaticPrefs. r=jrmuizel
gfxPrefs Live preferences are almost identical to StaticPrefs.

We leave aside for now those that set a custom change callback as this feature isn't yet supported in StaticPrefs.

Differential Revision: https://phabricator.services.mozilla.com/D31256

--HG--
extra : moz-landing-system : lando
2019-05-26 14:29:42 +00:00
Gurzau Raul 967bc2a754 Backed out 31 changesets (bug 1552643, bug 1550422) for xpcshell crash on a CLOSED TREE.
Backed out changeset e30c1aa75529 (bug 1552643)
Backed out changeset caadcd7e02d3 (bug 1552643)
Backed out changeset aa7086ab09be (bug 1552643)
Backed out changeset 0b4029671710 (bug 1550422)
Backed out changeset a16295296035 (bug 1550422)
Backed out changeset 3b70307c0db5 (bug 1550422)
Backed out changeset 69df7818d4a3 (bug 1550422)
Backed out changeset d98dfc565927 (bug 1550422)
Backed out changeset 6f0997976944 (bug 1550422)
Backed out changeset 0edd264464c2 (bug 1550422)
Backed out changeset 9ea6da7a74ec (bug 1550422)
Backed out changeset f855f9309c8b (bug 1550422)
Backed out changeset 1033546224a7 (bug 1550422)
Backed out changeset ade7384c6186 (bug 1550422)
Backed out changeset 75b04de7e99c (bug 1550422)
Backed out changeset 91c3acdb2454 (bug 1550422)
Backed out changeset 77d2f80257d1 (bug 1550422)
Backed out changeset e0cd10d35327 (bug 1550422)
Backed out changeset 097091082423 (bug 1550422)
Backed out changeset 2f328853c1ab (bug 1550422)
Backed out changeset f92f2cc29cb1 (bug 1550422)
Backed out changeset 6dc82f88333d (bug 1550422)
Backed out changeset c20f66494d69 (bug 1550422)
Backed out changeset 2ba22cddeb6f (bug 1550422)
Backed out changeset 3aa72f89e295 (bug 1550422)
Backed out changeset ab4c4e806977 (bug 1550422)
Backed out changeset 72e5de040dda (bug 1550422)
Backed out changeset 7d3c2d486706 (bug 1550422)
Backed out changeset 132e0b8d8468 (bug 1550422)
Backed out changeset 54c85ac75dd0 (bug 1550422)
Backed out changeset d7ba4a18dd54 (bug 1550422)
2019-05-25 09:07:49 +03:00
Jean-Yves Avenard af5790cf9b Bug 1550422 - P12. Convert Live gfxPrefs into StaticPrefs. r=jrmuizel
gfxPrefs Live preferences are almost identical to StaticPrefs.

We leave aside for now those that set a custom change callback as this feature isn't yet supported in StaticPrefs.

Differential Revision: https://phabricator.services.mozilla.com/D31256

--HG--
extra : moz-landing-system : lando
2019-05-25 00:03:32 +00:00
Gurzau Raul 74c555539e Backed out 28 changesets (bug 1550422) for marionette AssertionError and failing browser_policy_hardware_acceleration.js on a CLOSED TREE.
Backed out changeset 5dd10a365ba9 (bug 1550422)
Backed out changeset 529f5be01ab9 (bug 1550422)
Backed out changeset b6861d3badf8 (bug 1550422)
Backed out changeset 059cff1a3dde (bug 1550422)
Backed out changeset 6ada1116b241 (bug 1550422)
Backed out changeset ca67e8e45262 (bug 1550422)
Backed out changeset a1961a51ae44 (bug 1550422)
Backed out changeset 1c90b9cb3ad4 (bug 1550422)
Backed out changeset 285fa46e4f26 (bug 1550422)
Backed out changeset e2938a444234 (bug 1550422)
Backed out changeset 7a930fc51125 (bug 1550422)
Backed out changeset 898ed02804fe (bug 1550422)
Backed out changeset e1b7abc99ae9 (bug 1550422)
Backed out changeset f781d415cef6 (bug 1550422)
Backed out changeset 2fef10a7cce5 (bug 1550422)
Backed out changeset ea64b4d8d4ff (bug 1550422)
Backed out changeset 86a8ba1b755c (bug 1550422)
Backed out changeset 9c0c9e80f309 (bug 1550422)
Backed out changeset 10c153ddbaea (bug 1550422)
Backed out changeset 60fe635ec2c9 (bug 1550422)
Backed out changeset a38796266b28 (bug 1550422)
Backed out changeset 2db647dcdf1c (bug 1550422)
Backed out changeset 952ddac02972 (bug 1550422)
Backed out changeset ba46b53643ec (bug 1550422)
Backed out changeset ca47ef6c59f7 (bug 1550422)
Backed out changeset f45f471a1a40 (bug 1550422)
Backed out changeset 371b4da5b771 (bug 1550422)
Backed out changeset 02fc78890032 (bug 1550422)
2019-05-23 05:59:44 +03:00
Jean-Yves Avenard 2c0ce1b3ca Bug 1550422 - P12. Convert Live gfxPrefs into StaticPrefs. r=jrmuizel
gfxPrefs Live preferences are almost identical to StaticPrefs.

We leave aside for now those that set a custom change callback as this feature isn't yet supported in StaticPrefs.

Differential Revision: https://phabricator.services.mozilla.com/D31256

--HG--
extra : moz-landing-system : lando
2019-05-22 12:43:42 +00:00
Masayuki Nakano fc57d9bf0f Bug 1549661 - part 7: Make GetInternalCommand() take nsCommandParams instead of nsAString r=m_kato
`GetInternalCommand()` is currently used only by `EditorCommand` and it
treats the additional parameter only when given command is `cmd_align`.
However, the value is complicated since `AlignCommand` allows both `CString`
value and `String` value.  Therefore, `EditorCommand::DoCommandParams()` may
fail to solve `cmd_align` to a `Command` value without checking both of them.

Therefore, it must make sense that `GetInternalCommand()` take `nsCommandParams`
as optional argument and check it only when given command matches `cmd_align`.
Then, we don't need to waste unnecessary run-time cost.

Note that this bug has been hidden since `AlignCommand` class does not refer
the `Command` value but refers only `nsCommandParams`.  However, the previous
patch makes `EditorCommand::GetParamType()` not allow `Command::DoNothing`.
Therefore, we need this follow-up fix now.

Differential Revision: https://phabricator.services.mozilla.com/D30501

--HG--
extra : moz-landing-system : lando
2019-05-21 07:47:51 +00:00
Masayuki Nakano a658371e04 Bug 1546839 - part 3: Create methods which retrieve `Command` value for XUL command name r=smaug
Now, we don't have any utility method to get `Command` value for XUL command
name.  This patch creates it into `mozilla` namespace.

Differential Revision: https://phabricator.services.mozilla.com/D29173

--HG--
extra : moz-landing-system : lando
2019-04-30 04:24:26 +00:00
Masayuki Nakano b469ceda1d Bug 1546839 - part 2: Define commands which are handled by editor r=smaug
`NS_DEFINE_COMMAND_WITH_PARAM` macro is special case for `cmd_align`.
`cmd_align` can be mapped to multiple `Command` values.  It's distinguished
with additional parameter, '"left"', '"right"', '"center"' or '"justify"'.
Therefore, we cannot map from XUL command to `Command` value simply with
hashtable created by the next patch.  So, this new macro is necessary for
the next patch to ignore this special case.

The used commands are listed up from:
* [converted from `execCommand`, `cmd_bold` - `cmd_superscript`](https://searchfox.org/mozilla-central/rev/b756e6d00728dda4121f8278a744381d8643317a/dom/html/nsHTMLDocument.cpp#2066-2071)
* [converted from `execCommand`, `cmd_undo` - `cmd_redo`](https://searchfox.org/mozilla-central/rev/b756e6d00728dda4121f8278a744381d8643317a/dom/html/nsHTMLDocument.cpp#2078-2079)
* [converted from `execCommand`, `cmd_paragraphState` - `cmd_outdent`](https://searchfox.org/mozilla-central/rev/b756e6d00728dda4121f8278a744381d8643317a/dom/html/nsHTMLDocument.cpp#2080-2081,2105-2106)
* [converted from `execCommand`, `cmd_align`s](https://searchfox.org/mozilla-central/rev/b756e6d00728dda4121f8278a744381d8643317a/dom/html/nsHTMLDocument.cpp#2095-2098)
* [converted from `execCommand`, `cmd_highlight` - `cmd_decreaseFont`](https://searchfox.org/mozilla-central/rev/b756e6d00728dda4121f8278a744381d8643317a/dom/html/nsHTMLDocument.cpp#2082-2088)
* [converted from `execCommand`, `cmd_insertHR` - `cmd_ul`](https://searchfox.org/mozilla-central/rev/b756e6d00728dda4121f8278a744381d8643317a/dom/html/nsHTMLDocument.cpp#2089-2093,2101-2102)
* [converted from `execCommand`, `cmd_getContents` - `cmd_enableAbsolutePositionEditing`](https://searchfox.org/mozilla-central/rev/b756e6d00728dda4121f8278a744381d8643317a/dom/html/nsHTMLDocument.cpp#2094,2099-2100,2107-2113)
* [internal commands, `obs_documentCreated` - `obs_documentWillBeDestroyed`](https://searchfox.org/mozilla-central/rev/b756e6d00728dda4121f8278a744381d8643317a/editor/libeditor/HTMLEditorController.cpp#26-28)
* [internal command, `cmd_abbr`](https://searchfox.org/mozilla-central/rev/b756e6d00728dda4121f8278a744381d8643317a/editor/libeditor/HTMLEditorController.cpp#68)
* [internal command, `cmd_absPos`](https://searchfox.org/mozilla-central/rev/b756e6d00728dda4121f8278a744381d8643317a/editor/libeditor/HTMLEditorController.cpp#102)
* [internal commands, `cmd_acronym` - `cmd_var`](https://searchfox.org/mozilla-central/rev/b756e6d00728dda4121f8278a744381d8643317a/editor/libeditor/HTMLEditorController.cpp#58,63,65-67,69-72)
* [internal commands, `cmd_dd` - `cmd_dt`](https://searchfox.org/mozilla-central/rev/b756e6d00728dda4121f8278a744381d8643317a/editor/libeditor/HTMLEditorController.cpp#78-79)
* [internal commands, `cmd_moveDown` - `cmd_selectUp2`](https://searchfox.org/mozilla-central/rev/b756e6d00728dda4121f8278a744381d8643317a/editor/libeditor/EditorController.cpp#97-112)
* [internal command, `cmd_setDocumentModified`](https://searchfox.org/mozilla-central/rev/b756e6d00728dda4121f8278a744381d8643317a/editor/libeditor/HTMLEditorController.cpp#31)

Differential Revision: https://phabricator.services.mozilla.com/D29171

--HG--
extra : moz-landing-system : lando
2019-04-30 06:04:01 +00:00
Masayuki Nakano 6c0c323d6f Bug 1546839 - part 1: Change `enum Command` to `enum class Command` and drop "Command" prefix from each item r=smaug
If I remember correctly, `enum class` was not allowed when I added
`enum Command`.  Now, we can make it `enum class` for better type check at
compile time.

Differential Revision: https://phabricator.services.mozilla.com/D29169

--HG--
extra : moz-landing-system : lando
2019-04-30 04:23:24 +00:00
Ryan Hunt 63c8e0660c Bug 1523969 part 26 - Move method definition inline comments to new line in 'widget/'. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D21130

--HG--
extra : rebase_source : 83867879cf33ddd2cc1b19c20dff8cef6a51d1a9
extra : histedit_source : 67979b7a263223c1e48421f382ed1e78d6264cf9
2019-02-25 16:13:48 -06:00
Masayuki Nakano ed2040ac16 Bug 1447239 - Implement InputEvent.inputType r=smaug
This patch implements InputType.inputType which is declared by Input Events.
The attribute has already been implemented by Chrome and Safari.  Chrome
implements Input Events Level 1, but Safari implements Input Events Level 2.
 Difference between them is only whether it supports "insertFromComposition",
"deleteByComposition" and "deleteCompositionText".  This patch makes the
level switchable with pref and takes Level 1 by default because Level 2 is
still unstable around event order with composition events.

For reducing string copy cost at dispatching "input" event, this patch
makes EditorInternalInputEvent store valid input-type as enum class,
EditorInputType and resolves it to string value when
dom::InputEvent::GetInputType() is called.  Note that the reason why
this patch names the enum class as EditorInputType is, there is InputType
enum class already for avoiding conflict the name, this appends "Editor"
prefix because "input" and "beforeinput" events are fired only when an
editor has focus.

Differential Revision: https://phabricator.services.mozilla.com/D14128

--HG--
extra : moz-landing-system : lando
2019-01-07 10:10:57 +00:00
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Tim Huang a8de9d009f Bug 1363508 - Part 2: Suppressing the pointer events that have isPrimary as false for fingerprinting resistance r=arthuredelstein,masayuki
Because of that the isPrimary of mouse pointer events will always be
true. So, we suppress other events that have isPrimary as false when
fingerprinting resistance is enabled.

Depends on D6003

Differential Revision: https://phabricator.services.mozilla.com/D6004

--HG--
extra : moz-landing-system : lando
2018-10-09 11:50:01 +00:00
Masayuki Nakano fd4e78f2a1 Bug 1461708 - part 5: Move EditorEventListener::HandleMiddleClickPaste() to EventStateManager r=smaug
EventStateManager needs to handle middle click paste without editor.
Therefore, the handler should be in EventStateManager.

Differential Revision: https://phabricator.services.mozilla.com/D7852

--HG--
extra : moz-landing-system : lando
2018-10-10 12:04:17 +00:00
Masayuki Nakano eb2efb612f 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

--HG--
extra : moz-landing-system : lando
2018-10-03 09:21:47 +00:00
Jeff Gilbert 5b753da289 Bug 1470325 - s/FooBinding/Foo_Binding/g - r=qdot
MozReview-Commit-ID: JtTcLL5OPF0
2018-06-26 17:05:01 -07:00
Boris Zbarsky 597b4545d2 Bug 1429903 part 4. Remove nsIDOMEventTarget. r=mccr8
MozReview-Commit-ID: 9XuenUHxfPx
2018-04-20 00:49:30 -04:00
Boris Zbarsky adbcff27c1 Bug 1449631 part 7. Remove nsIDOMEventTarget::GetTargetFor* methods. r=smaug
MozReview-Commit-ID: AIzDo67mTDf
2018-04-05 13:42:41 -04:00
Olli Pettay 9e35535e7d bug 1447196, canceling pointerdown should not affect to scrollbar handling, r=masayuki
--HG--
extra : rebase_source : a84d2a393d82dcc7655e9bb48a118ddd300c3d4e
2018-03-23 17:31:13 +02:00
Margareta Eliza Balazs 9ecc515945 Backed out changeset b4f1e88f8b6e (bug 1447196) for 2 failures in dom/events/test/pointerevents/test_bug1303704.html 2018-03-23 05:37:20 +02:00
Olli Pettay 8d1253d263 bug 1447196, canceling pointerdown should not affect to scrollbar handling, r=masayuki
--HG--
extra : rebase_source : 3234983256e2d68e0ac6b21f5293b23bf6017b11
2018-03-22 20:54:50 +02:00
Andreea Pavel 12274151d8 Backed out changeset 36c52265e4a1 (bug 1447196) for mochitest headless failures at dom/events/test/pointerevents/test_bug1303704.html on a CLOSED TREE 2018-03-22 18:44:37 +02:00
Olli Pettay d660f15a38 bug 1447196, canceling pointerdown should not affect to scrollbar handling, r=masayuki
--HG--
extra : rebase_source : 148a87834ef2baf41c2889bfed1b78bc42ec5e2b
2018-03-22 15:53:55 +02:00
Masayuki Nakano 1c1a60c08d Bug 1446253 - Make EventUtils.synthesizeComposition() dispatch keydown and keyup event in default r=smaug
We'll start to dispatch keydown event and keyup event even during composition.
So, for testing those events won't break our UI, we should make
EventUtils.synhtesizeComposition() and EventUtils.synthesizeCompositionChange()
dispatch keydown event and keyup event even if callers don't specify keyboard
event explicitly.

Typically, "keydown" event is marked as "processed by IME", i.e., keyCode
value is set to DOM_VK_PROCESSKEY and key is set to "Process", with our
widget which handles native IME and key input.  On the other hand, "keyup"
is NOT marked as so.

Therefore, this patch makes TextInputProcessor emulates this behavior without
any new special flags.  And for making possible to emulate special cases,
this patch adds two flags to nsITextInputProcessor.  One is
KEY_DONT_MARK_KEYDOWN_AS_PROCESSED.  The other is KEY_MARK_KEYUP_AS_PROCESSED.
Unfortunately, those flags have opposite meaning but this must be better than
making necessary to one flag for emulating usual keydown/keyup events.

Finally, this makes some tests specify better keyboard information to
synthesizeComposition() and synthesizeCompositionChange() to emulate
actual keyboard events during composition.

MozReview-Commit-ID: ItYaXILkNQE

--HG--
extra : rebase_source : e50cc77c1efbc12686d7ea334d41926c7392b30d
2018-03-16 22:35:07 +09:00