Commit Graph

25828 Commits

Author SHA1 Message Date
Makoto Kato
4fe363f50d Bug 1610233 - nsEventStatus should be initialized per MaybeDispatchKeypressEvents call in DoReplaceText. r=geckoview-reviewers,esawin
According to
https://searchfox.org/mozilla-central/rev/803a42f24c8714631ed81cb824ea1c1a803cb7b8/widget/TextEventDispatcher.cpp#661,
`nsEventStatus` parameter of `MaybeDispatchKeypressEvents` should be
initialized per call.

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

--HG--
extra : moz-landing-system : lando
2020-01-30 11:56:03 +00:00
Kousuke Takaki
04bba6950f Bug 1602088 - Move nsIScrollableFrame::ScrollUnit to namespace scope. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D61140

--HG--
extra : source : 69fded25adc2ac25e302b49c1128f8926e1311a3
2020-01-30 09:13:19 +00:00
Cosmin Sabou
5a3d320cd0 Backed out changeset 69fded25adc2 (bug 1602088) for causing several box-shadow reftest failures.
CLOSED TREE
2020-01-30 13:23:10 +02:00
Kousuke Takaki
9681569b70 Bug 1602088 - Move nsIScrollableFrame::ScrollUnit to namespace scope. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D61140

--HG--
extra : moz-landing-system : lando
2020-01-30 09:13:19 +00:00
Alex Henrie
dc4c3ca267 Bug 1607990 - Link to WSCGetProviderInfo at compile time. r=aklotz
Differential Revision: https://phabricator.services.mozilla.com/D59262

--HG--
extra : moz-landing-system : lando
2020-01-29 21:18:18 +00:00
Doug Thayer
185e25fddf Bug 1606880 - Implement fast shutdown prefs r=froydnj
I originally had this as a few patches, but the work to fix test
failures and get the whole thing into a complete working state
quickly tangled them up. Apologies for that. To summarize what's
going on here, however:

- We introduce two prefs: shutdown.fastShutdownStage and
  shutdown.lateWriteChecksStage. The latter pref is set to 1, which
  will leave the existing late write checking behavior unchanged.
  However, we introduce this pref to make it simpler in the future
  to bump the late write checks window earlier in the shutdown cycle.
- We introduce an AppShutdown class, which will house static methods
  and a small amount of state for unifying some shutdown logic. Most
  importantly, it will now manage the state for app initiated restarts,
  as well as the logic for performing a safe fast shutdown.
- We refactored the existing restart code to call into the new
  AppShutdown file, so that if we are configured to actually perform
  a fast shutdown, we will be able to run the necessary restart logic
  immediately before doing so. Previously, the restart logic occurred
  later in the shutdown cycle than our late write checking, meaning
  if we were to simply exit the process at that point in time, we
  would never run the restart coe.
- Lastly, we updated two locations which called TerminateProcess and/or
  _exit(0) to call into the AppShutdown method (DoFastShutdown).

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

--HG--
extra : moz-landing-system : lando
2020-01-29 12:29:43 +00:00
Masayuki Nakano
ddb9a88943 Bug 1606655 - Make NativeKey stop adding alternative char codes while user inputs a Unicode character with Alt + some numpad keys r=m_kato
Custom keyboard layout may set unusual character to each numpad key.  In our
shortcut and acceleration key handling, we refer alternative char code values
stored in `eKeyDown` or `eKeyPress` and they may contain an alphabet which is
used by menubar but it shouldn't be performed while user inputs a Unicode
character with `Alt` + numpad keys because it's being handled by Windows.
(In strictly speaking, I think that we shouldn't dispatch key events of the
sequence, but Chrome does it so that we should keep dispatching for web-compat.)

This patch makes `NativeKey` stores same `mCommittedCharsAndModifiers`,
`mShiftedString` and `mUnshiftedString` values as usual keyboard layout
even active keyboard layout customized numpad key values.

Note that Windows handles the key sequence without virtual key code, meaning
that even if the numpad keys are shuffled by keyboard layout, typed numbers
are computed from physical key position.  E.g., even if `Numpad7` is mapped
to `1`, it's treated as `7`.  Therefore, this patch refers scan code in
some places.

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

--HG--
extra : moz-landing-system : lando
2020-01-28 12:01:56 +00:00
alwu
7040e18745 Bug 1609452 - part2 : remove redundant virtual keywords. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D60027

--HG--
extra : moz-landing-system : lando
2020-01-28 09:56:09 +00:00
alwu
400100469c Bug 1609452 - part1 : update media center's playback state whenever the event source's playback changes. r=mstange
The event source's playback state can represent if the media is currently playing. Therfore, whenever it changes, we should update the media center's playback state as well in order to show correct controller icon (eg. play and pause) on the touch bar.

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

--HG--
extra : moz-landing-system : lando
2020-01-28 09:50:04 +00:00
David Major
7987e54c54 Bug 1610974 - Use designated initializers consistently in LookAndFeelInt r=hiro
To avoid a clang-10 failure with `error: mixture of designated and non-designated initializers in the same initializer list is a C99 extension [-Werror,-Wc99-designator]`

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

--HG--
extra : moz-landing-system : lando
2020-01-27 21:22:55 +00:00
Sylvestre Ledru
4c2070edf7 Bug 1611599 - gcc-10: Add an explicit include to glib.h r=stransky
Differential Revision: https://phabricator.services.mozilla.com/D61064

--HG--
extra : moz-landing-system : lando
2020-01-27 09:16:44 +00:00
Hiroyuki Ikezoe
a04e565377 Bug 1610974 - Drop colorValue in LookAndFeelInt. r=geckoview-reviewers,snorp
It should have been dropped in bug 1606503, I did foget it.

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

--HG--
extra : moz-landing-system : lando
2020-01-24 15:01:48 +00:00
Masayuki Nakano
b1bf7e0db4 Bug 1540043 - part 1: Move all constants and methods of nsIPlaintextEditor to nsIEditor and make nsIPlaintextEditor inherit nsIEditor r=m_kato
For preparing to remove `nsIPlaintextEditor` interface, this patch moves
all of them to `nsIEditor`, but for avoiding bustage in comm-central, makes
`nsIPlaintextEditor` inherit `nsIEditor` for now (i.e., even with this patch,
script can access old `nsIPlaintextEditor` members with the interface.

In C++ code, this patch moves `SetWrapColumn()`, `InsertTextAsAction()`,
`InsertTextAsSubAction()` and `InsertLineBreakAsSubAction()` because
they do common things between `TextEditor` and `HTMLEditor`.  On the other
hand, this does not move `TextEditor::GetTextLength()` because it's designed
only for `TextEditor`.

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

--HG--
rename : editor/libeditor/tests/test_nsIPlaintextEditor_insertLineBreak.html => editor/libeditor/tests/test_nsIEditor_insertLineBreak.html
extra : moz-landing-system : lando
2020-01-24 08:33:42 +00:00
Aaron Klotz
ce2204248f Bug 1595834: Make GeckoProcessManager interface e10s-multi aware; r=snorp
This patch does not change any of the *internals* of process management in
`GeckoProcessManager`, however it upgrades the interface in preparation for
such changes.

* We add a java equivalent to Gecko's `GeckoProcessType` enumeration;
* We add the `GeckoProcessType.Selector` class which will be used for
  identifying running content processes;
* We update `ContentParent::MarkAsDead` to use `GeckoProcessType.Selector` for
  indicating which process should be marked.

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

--HG--
extra : moz-landing-system : lando
2020-01-23 18:12:51 +00:00
Brendan Dahl
764e21deb6 Bug 1607818 - Allow AppShell creation in socket process on Android. r=kmag
In local Android builds the socket process is enabled. However, AppShell
creation is not allowed which causes the process to crash. This syncs the
flags with desktop.

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

--HG--
extra : moz-landing-system : lando
2020-01-21 19:08:53 +00:00
Jan Horak
10ddd6b106 Bug 1609732 Ignore window position in the WindowSurfaceWayland::Lock; r=stransky
The window position of the popup can be changed which does not mean that the
screen size changed. Only window dimmensions are relevant there. Also as part of this
fix, don't use HideWaylandWindow when calling gdk_window_move_to_rect because it removes
the popup from gVisibleWaylandPopupWindows which breaks popup hierarchy sometimes.

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

--HG--
extra : moz-landing-system : lando
2020-01-21 15:46:23 +00:00
Sylvestre Ledru
187e9bafaf Bug 1519636 - Automatically reformat recent changes using clang-format r=Ehsan
# ignore-this-changeset

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

--HG--
extra : moz-landing-system : lando
2020-01-21 09:51:27 +00:00
Emilio Cobos Álvarez
256c124f94 Bug 1609996 - Reorder some includes affected by the previous patches. r=froydnj
This was done by:

This was done by applying:

```
diff --git a/python/mozbuild/mozbuild/code-analysis/mach_commands.py b/python/mozbuild/mozbuild/code-analysis/mach_commands.py
index 789affde7bbf..fe33c4c7d4d1 100644
--- a/python/mozbuild/mozbuild/code-analysis/mach_commands.py
+++ b/python/mozbuild/mozbuild/code-analysis/mach_commands.py
@@ -2007,7 +2007,7 @@ class StaticAnalysis(MachCommandBase):
         from subprocess import Popen, PIPE, check_output, CalledProcessError

         diff_process = Popen(self._get_clang_format_diff_command(commit), stdout=PIPE)
-        args = [sys.executable, clang_format_diff, "-p1", "-binary=%s" % clang_format]
+        args = [sys.executable, clang_format_diff, "-p1", "-binary=%s" % clang_format, '-sort-includes']

         if not output_file:
             args.append("-i")
```

Then running `./mach clang-format -c <commit-hash>`

Then undoing that patch.

Then running check_spidermonkey_style.py --fixup

Then running `./mach clang-format`

I had to fix four things:

 * I needed to move <utility> back down in GuardObjects.h because I was hitting
   obscure problems with our system include wrappers like this:

0:03.94 /usr/include/stdlib.h:550:14: error: exception specification in declaration does not match previous declaration
0:03.94 extern void *realloc (void *__ptr, size_t __size)
0:03.94              ^
0:03.94 /home/emilio/src/moz/gecko-2/obj-debug/dist/include/malloc_decls.h:53:1: note: previous declaration is here
0:03.94 MALLOC_DECL(realloc, void*, void*, size_t)
0:03.94 ^
0:03.94 /home/emilio/src/moz/gecko-2/obj-debug/dist/include/mozilla/mozalloc.h:22:32: note: expanded from macro 'MALLOC_DECL'
0:03.94     MOZ_MEMORY_API return_type name##_impl(__VA_ARGS__);
0:03.94                                ^
0:03.94 <scratch space>:178:1: note: expanded from here
0:03.94 realloc_impl
0:03.94 ^
0:03.94 /home/emilio/src/moz/gecko-2/obj-debug/dist/include/mozmemory_wrap.h:142:41: note: expanded from macro 'realloc_impl'
0:03.94 #define realloc_impl mozmem_malloc_impl(realloc)

   Which I really didn't feel like digging into.

 * I had to restore the order of TrustOverrideUtils.h and related files in nss
   because the .inc files depend on TrustOverrideUtils.h being included earlier.

 * I had to add a missing include to RollingNumber.h

 * Also had to partially restore include order in JsepSessionImpl.cpp to avoid
   some -WError issues due to some static inline functions being defined in a
   header but not used in the rest of the compilation unit.

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

--HG--
extra : moz-landing-system : lando
2020-01-20 16:19:48 +00:00
Emilio Cobos Álvarez
aa3a695712 Bug 1609996 - Remove mozilla/Move.h. r=froydnj
rg -l 'mozilla/Move.h' | xargs sed -i 's/#include "mozilla\/Move.h"/#include <utility>/g'

Further manual fixups and cleanups to the include order incoming.

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

--HG--
extra : moz-landing-system : lando
2020-01-20 16:18:20 +00:00
Aaron Klotz
c78829b682 Bug 1594820: Part 1 - Modify XPCOMEventTarget to accept method calls before JNI is ready; r=snorp
Since `XPCOMEventTarget` uses JNI, this patch makes it possible for consumers to
retrieve and invoke methods on one without needing to worry about whether JNI
is actually up yet.

To achieve this, we create the `IXPCOMEventTarget` interface, and observe that
both of its methods can be handled by a proxy if JNI is not ready:

* Calls to `dispatch` may be enqueued until JNI is up;
* Observe that, when JNI is not up yet, the result of `isOnCurrentThread`
  can never be `true`.

Once JNI is up and the event targets have been resolved, the proxies are
replaced with the real, concrete `XPCOMEventTarget`s and are no longer used for
the remainder of the Gecko instance's lifetime.

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

--HG--
extra : moz-landing-system : lando
2020-01-20 07:44:07 +00:00
Sylvestre Ledru
cc2040bf21 Bug 1605934 - Use nested namespaces r=sg
Done with:
./mach static-analysis check --checks="-*, modernize-concat-nested-namespaces" --fix .
and then clang-format on the files

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

--HG--
extra : moz-landing-system : lando
2020-01-18 13:48:34 +00:00
Dorel Luca
506e65bcab Backed out changeset bbb39655cf71 (bug 1605934) for build bustage in widget/gtk/mozwayland/mozwayland.c 2020-01-18 15:39:55 +02:00
Sylvestre Ledru
6689a37527 Bug 1605934 - Use nested namespaces r=sg
Done with:
./mach static-analysis check --checks="-*, modernize-concat-nested-namespaces" --fix .
and then clang-format on the files

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

--HG--
extra : moz-landing-system : lando
2020-01-18 13:16:39 +00:00
Masayuki Nakano
2c7d675626 Bug 1602626 - Make window_wheeltransaction.xhtml compute point to fire wheel events dynamically r=smaug
Currently, offset in root view in the test is copied from constants which are
computed from CSS rules.  However, the point may be edge of each view and
that might be outside if it meets round error of layout.  For making this
test more stable in any environments, this patch makes the test compute
point to fire wheel events dynamically.

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

--HG--
extra : moz-landing-system : lando
2020-01-17 15:07:17 +00:00
pbz
70e1dba79e Bug 1432856 - Extended focus methods in Window.webidl, Client.webidl and Element.webidl to pass CallerType. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D55811

--HG--
extra : moz-landing-system : lando
2020-01-16 14:38:40 +00:00
Jan Horak
9720234621 Bug 1607404 - Update mBounds when gdk_window_move_to_rect returns different position/size; r=stransky
Differential Revision: https://phabricator.services.mozilla.com/D59845

--HG--
extra : moz-landing-system : lando
2020-01-15 10:28:47 +00:00
Emilio Cobos Álvarez
fff6c9e1ac Bug 981248 - Rewrite <input type=number> to avoid an anonymous input. r=masayuki,surkov,jwatt,ntim,jfkthame,smaug
Instead, subclass nsTextControlFrame. This simplifies the code and avoids
correctness issues.

I kept the localization functionality though it is not spec compliant. But I
filed a bug to remove it in a followup.

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

--HG--
extra : moz-landing-system : lando
2020-01-14 19:01:05 +00:00
Mihai Alexandru Michis
0d01c60c37 Backed out 2 changesets (bug 981248) for causing multiple failures.
CLOSED TREE

Backed out changeset 7a96708cc8b7 (bug 981248)
Backed out changeset 1eace7bd28d9 (bug 981248)
2020-01-14 19:28:17 +02:00
Aaron Klotz
dddb83ab28 Bug 1608577: Part 3 - Remove |using namespace mozilla::java| from widget/android; r=geckoview-reviewers,esawin
Differential Revision: https://phabricator.services.mozilla.com/D59798

--HG--
extra : moz-landing-system : lando
2020-01-14 16:47:59 +00:00
Martin Stransky
da8ea3387b Bug 1600414 [Wayland] Get CSD decoration styles from MOZ_GTK_HEADERBAR_WINDOW, r=jhorak
- Use MOZ_GTK_HEADERBAR_WINDOW to get decoration style at moz_gtk_header_bar_paint()
- Don't return decoration size for solid-csd as it behaves as a regular window frame.

Depends on D59850

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

--HG--
extra : moz-landing-system : lando
2020-01-14 14:21:15 +00:00
Martin Stransky
076504629d Bug 1600414 [Wayland] Use GTK_WINDOW_TOPLEVEL and actual header bar to create Gtk titlebar css style, r=jhorak
- Create header bar at GTK_WINDOW_TOPLEVEL
- Use actual header bar widget as window titlebar because gtk_window_set_titlebar() sets "csd" and "solid-csd" styles.
  We need to read the styles to get correct decoration type.

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

--HG--
extra : moz-landing-system : lando
2020-01-14 14:21:22 +00:00
Emilio Cobos Álvarez
da2e4ef888 Bug 981248 - Rewrite <input type=number> to avoid an anonymous input. r=masayuki,surkov,jwatt,ntim,jfkthame,smaug
Instead, subclass nsTextControlFrame. This simplifies the code and avoids
correctness issues.

I kept the localization functionality though it is not spec compliant. But I
filed a bug to remove it in a followup.

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

--HG--
extra : moz-landing-system : lando
2020-01-14 15:05:22 +00:00
Martin Stransky
168ab8579c Bug 1608800 [Wayland] Export GL texture from WaylandDMABufSurface class, r=jhorak
We need GL texture for WebGL backend.

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

--HG--
extra : moz-landing-system : lando
2020-01-14 13:10:38 +00:00
Martin Stransky
8df4dc66e5 Bug 1608800 [Wayland] Implement DMABUF modifiers, r=jhorak
Differential Revision: https://phabricator.services.mozilla.com/D59677

--HG--
extra : moz-landing-system : lando
2020-01-14 13:13:51 +00:00
Martin Stransky
a3bc93170c Bug 1608800 [Wayland] Refactor dmabuf buffer mapping, r=jhorak
Refactor dmabuf buffer mapping, warn when we're mapping buffer with modifiers.

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

--HG--
extra : moz-landing-system : lando
2020-01-14 13:13:41 +00:00
Masayuki Nakano
90cd2122dd Bug 970802 - part 5: Make AutoEditActionDataSetter created method dispatch "beforeinput" event r=smaug,m_kato
`AutoEditActionDataSetter` is created in the stack when editor's public method
is called and that guarantees lifetime of global objects in editor such as
editor itself, selection controller, etc.

The dispatcher of `beforeinput` event returns `NS_ERROR_EDITOR_ACTION_CANCELED`
if an event is actually dispatched but canceled.  The reason why it's an error
is, editor code must stop handling anything when any methods return error.
So, returning an error code is reasonable in editor module.  But when it's
filtered by `EditorBase::ToGenericNSResult()` at return statement of public
methods, it's converted to `NS_SUCCESS_DOM_NO_OPERATION`.  This avoids throwing
new exception, but editor class users in C++ can distinguish whether each edit
action is canceled or handled.  The reason why we should not throw new
exception from XPCOM API is, without taking care of each caller may break some
our UI (especially for avoiding to break comm-central).  Therefore, this patch
does not make XPCOM methods return error code when `beforeinput` event is
canceled.

In most cases, immediately after creating `AutoEditActionDataSetter` is good
timing to dispatch `beforeinput` event since editor has not touched the DOM
yet.  If `beforeinput` requires `data` or `dataTransfer`, methods need to
dispatch `beforeinput` event after that.  Alhtough this is not a good thing
from point of view of consistency of the code.  However, I have no better
idea.

Note 1: Our implementation does NOT conform to the spec about event order
between `keypress` and `beforeinput` (dispatching `beforeinput` event after
`keypress` event).  However, we follow all other browsers' behavior so that it
must be safe and the spec should be updated for backward compatibility.
Spec issue: https://github.com/w3c/uievents/issues/220

Note 2: Our implementation does NOT conform to the spec about event order
between `compositionupdate` and `beforeinput`.  Our behavior is same as
Safari, but different from Chrome.  This might cause web-compat issues.
However, our behavior does make sense from point of view of consistency of
event spec.  Additionally, at both `compositionupdate` and `beforeinput`,
composition string in editor has not been modified yet.  Therefore, this
may not cause web-compat issues (and I hope so).
Spec issue: https://github.com/w3c/input-events/issues/49

Note that this patch makes editor detect bugs that `beforeinput` event hasn't
been handled yet when it dispatches `input` event or modifying `data` and
`dataTransfer` value are modified after dispatching `beforeinput` event with
`MOZ_ASSERT`s.

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

--HG--
extra : moz-landing-system : lando
2020-01-14 07:18:51 +00:00
Masayuki Nakano
4d302443ce Bug 970802 - part 3: Implement beforeinput event dispatcher and add onbeforeinput event handler attribute r=smaug
This patch makes `nsContentUtils::DispatchInputEvent()` dispatch `beforeinput`
event too.  And also adds `onbeforeinput` event handler which is really
important for feature detection (although Chrome has not implemented this
attribute yet: https://bugs.chromium.org/p/chromium/issues/detail?id=947408).

However, we don't implement `InputEvent.getTargetRanges()` in this bug and
implementing `beforeinput` event may hit bugs of some web apps.  Therefore,
this patch disables `beforeinput` event by default even in Nightly channel.

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

--HG--
extra : moz-landing-system : lando
2020-01-14 07:15:45 +00:00
Masayuki Nakano
0bf0eeeaa0 Bug 970802 - part 1: Add beforeinput event tests into existing mochitests r=smaug
This patch adds a lot of `beforeinput` event tests into existing mochitests
which test `input` events.  But this does not add tests of canceling
`beforeinput` event because it requires really complicated path until
implementing `beforeinput` actually.

Note that `beforeinput` event is not fired with `Document.execCommand()`.
Therefore, this patch does not add WPT for testing `beforeinput` event.
And unfortunately, WPT cannot test most cases of the new tests.

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

--HG--
extra : moz-landing-system : lando
2020-01-14 07:14:50 +00:00
Hiroyuki Ikezoe
21a5133d31 Bug 1606503 - Get the value for prefers-reduced-motion via LookAndFeelInt. r=geckoview-reviewers,snorp
With this change we have the same setup for prefers-reduced-motion so that
we can change the value with the same manner in automated tests.

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

--HG--
extra : moz-landing-system : lando
2020-01-14 05:51:06 +00:00
Hiroyuki Ikezoe
e538eea4dc Bug 1606503 - Move prefers-reduced-motion bits for testing into LookAndFeel. r=emilio
Now both of GTK and MacOSX backends use the same machinery, LookAndFeelInt, for
prefers-reduced-motion. And we are going to use it on Android as well so it'd
make sense to move the code into there.

On Windows we can also use the same LookAndFeelInt machinery and probably
all we have to do is to call SendNotifyMessage with SPI_SETCLIENTAREAANIMATION
in SetPrefersReducedMotionOverrideForTest.

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

--HG--
extra : moz-landing-system : lando
2020-01-14 05:50:53 +00:00
shindli
c03a2cf53a Backed out 3 changesets (bug 1606503) for causing bustages in nsXPLookAndFeel.cpp CLOSED TREE
Backed out changeset 7e9d421335e0 (bug 1606503)
Backed out changeset 371f74475fb9 (bug 1606503)
Backed out changeset 8aada655d8bc (bug 1606503)
2020-01-14 05:07:14 +02:00
Razvan Maries
0df75c8122 Backed out 5 changesets (bug 970802) for xpcshell perma fails. CLOSED TREE
Backed out changeset 5511edd700f7 (bug 970802)
Backed out changeset 1fb9cf2264b6 (bug 970802)
Backed out changeset 6b185296c742 (bug 970802)
Backed out changeset ce6853e64ed6 (bug 970802)
Backed out changeset aa9bd45c09b1 (bug 970802)
2020-01-14 04:41:15 +02:00
Hiroyuki Ikezoe
f2fbae5d7d Bug 1606503 - Get the value for prefers-reduced-motion via LookAndFeelInt. r=geckoview-reviewers,snorp
With this change we have the same setup for prefers-reduced-motion so that
we can change the value with the same manner in automated tests.

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

--HG--
extra : moz-landing-system : lando
2020-01-14 02:34:45 +00:00
Hiroyuki Ikezoe
37f0cf306c Bug 1606503 - Move prefers-reduced-motion bits for testing into LookAndFeel. r=emilio
Now both of GTK and MacOSX backends use the same machinery, LookAndFeelInt, for
prefers-reduced-motion. And we are going to use it on Android as well so it'd
make sense to move the code into there.

On Windows we can also use the same LookAndFeelInt machinery and probably
all we have to do is to call SendNotifyMessage with SPI_SETCLIENTAREAANIMATION
in SetPrefersReducedMotionOverrideForTest.

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

--HG--
extra : moz-landing-system : lando
2020-01-14 02:17:47 +00:00
Masayuki Nakano
00f4c31bb7 Bug 970802 - part 5: Make AutoEditActionDataSetter created method dispatch "beforeinput" event r=smaug,m_kato
`AutoEditActionDataSetter` is created in the stack when editor's public method
is called and that guarantees lifetime of global objects in editor such as
editor itself, selection controller, etc.

The dispatcher of `beforeinput` event returns `NS_ERROR_EDITOR_ACTION_CANCELED`
if an event is actually dispatched but canceled.  The reason why it's an error
is, editor code must stop handling anything when any methods return error.
So, returning an error code is reasonable in editor module.  But when it's
filtered by `EditorBase::ToGenericNSResult()` at return statement of public
methods, it's converted to `NS_SUCCESS_DOM_NO_OPERATION`.  This avoids throwing
new exception, but editor class users in C++ can distinguish whether each edit
action is canceled or handled.  The reason why we should not throw new
exception from XPCOM API is, without taking care of each caller may break some
our UI (especially for avoiding to break comm-central).  Therefore, this patch
does not make XPCOM methods return error code when `beforeinput` event is
canceled.

In most cases, immediately after creating `AutoEditActionDataSetter` is good
timing to dispatch `beforeinput` event since editor has not touched the DOM
yet.  If `beforeinput` requires `data` or `dataTransfer`, methods need to
dispatch `beforeinput` event after that.  Alhtough this is not a good thing
from point of view of consistency of the code.  However, I have no better
idea.

Note 1: Our implementation does NOT conform to the spec about event order
between `keypress` and `beforeinput` (dispatching `beforeinput` event after
`keypress` event).  However, we follow all other browsers' behavior so that it
must be safe and the spec should be updated for backward compatibility.
Spec issue: https://github.com/w3c/uievents/issues/220

Note 2: Our implementation does NOT conform to the spec about event order
between `compositionupdate` and `beforeinput`.  Our behavior is same as
Safari, but different from Chrome.  This might cause web-compat issues.
However, our behavior does make sense from point of view of consistency of
event spec.  Additionally, at both `compositionupdate` and `beforeinput`,
composition string in editor has not been modified yet.  Therefore, this
may not cause web-compat issues (and I hope so).
Spec issue: https://github.com/w3c/input-events/issues/49

Note that this patch makes editor detect bugs that `beforeinput` event hasn't
been handled yet when it dispatches `input` event or modifying `data` and
`dataTransfer` value are modified after dispatching `beforeinput` event with
`MOZ_ASSERT`s.

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

--HG--
extra : moz-landing-system : lando
2020-01-14 01:09:45 +00:00
Masayuki Nakano
81d47ee6d5 Bug 970802 - part 3: Implement beforeinput event dispatcher and add onbeforeinput event handler attribute r=smaug
This patch makes `nsContentUtils::DispatchInputEvent()` dispatch `beforeinput`
event too.  And also adds `onbeforeinput` event handler which is really
important for feature detection (although Chrome has not implemented this
attribute yet: https://bugs.chromium.org/p/chromium/issues/detail?id=947408).

However, we don't implement `InputEvent.getTargetRanges()` in this bug and
implementing `beforeinput` event may hit bugs of some web apps.  Therefore,
this patch disables `beforeinput` event by default even in Nightly channel.

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

--HG--
extra : moz-landing-system : lando
2020-01-08 09:23:40 +00:00
Masayuki Nakano
583465bce4 Bug 970802 - part 1: Add beforeinput event tests into existing mochitests r=smaug
This patch adds a lot of `beforeinput` event tests into existing mochitests
which test `input` events.  But this does not add tests of canceling
`beforeinput` event because it requires really complicated path until
implementing `beforeinput` actually.

Note that `beforeinput` event is not fired with `Document.execCommand()`.
Therefore, this patch does not add WPT for testing `beforeinput` event.
And unfortunately, WPT cannot test most cases of the new tests.

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

--HG--
extra : moz-landing-system : lando
2020-01-08 09:22:50 +00:00
Emilio Cobos Álvarez
2951992c4e Bug 1608729 - Initialize some variable in nsWindow.cpp. r=stransky
GCC warns about it and it's right. There's code null-checking the return value
of this function, so we should either initialize it or assert it's never null.

Depends on D59648

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

--HG--
extra : moz-landing-system : lando
2020-01-13 06:37:04 +00:00
Eric Rahm
78ee6675cf Bug 1606187 - Part 2b: Update users of nsClassHashtable to handle UniquePtr differences r=KrisWright,froydnj
Differential Revision: https://phabricator.services.mozilla.com/D59042

--HG--
extra : moz-landing-system : lando
2020-01-13 19:18:56 +00:00
Mark Osborne
7afd921740 Bug 782547 - Focus on last focussed control after dialog closed; r=Jamie,NeilDeakin
Differential Revision: https://phabricator.services.mozilla.com/D54464

--HG--
extra : moz-landing-system : lando
2020-01-13 14:08:43 +00:00