Commit Graph

27677 Commits

Author SHA1 Message Date
Markus Stange
0fb1ea148f Bug 1684891 - Stop allocating an autoreleased NSMutableDictionary from a C++ static initializer for sNativeKeyEventsMap. r=jrmuizel
There is no autorelease pool in place at the time that C++ globals are initialized, so this array
causes warnings when running with `OBJC_DEBUG_MISSING_POOLS=YES LIBDISPATCH_DEBUG_MISSING_POOLS=NO`.
And avoiding static initializers is a good practice anyway.

Differential Revision: https://phabricator.services.mozilla.com/D100736
2021-01-05 22:22:36 +00:00
Markus Stange
24e01d102b Bug 1684893 - Stop allocating an autoreleased NSArray from a C++ static initializer for filteredProviderNames. r=jrmuizel
There is no autorelease pool in place at the time that C++ globals are initialized, so this array
causes warnings when running with `OBJC_DEBUG_MISSING_POOLS=YES LIBDISPATCH_DEBUG_MISSING_POOLS=NO`.
And avoiding static initializers is a good practice anyway.

Differential Revision: https://phabricator.services.mozilla.com/D100734
2021-01-05 22:13:24 +00:00
Markus Stange
5cd8830a74 Bug 1683723 - Replace deprecated Cocoa enum constants with their modern replacements. r=spohl
I ran the following command:

```
rg -l 'NSAlphaShiftKeyMask' . | xargs sed -i '' -e 's/NSAlphaShiftKeyMask/NSEventModifierFlagCapsLock/g'
rg -l 'NSAlternateKeyMask' . | xargs sed -i '' -e 's/NSAlternateKeyMask/NSEventModifierFlagOption/g'
rg -l 'NSAnyEventMask' . | xargs sed -i '' -e 's/NSAnyEventMask/NSEventMaskAny/g'
rg -l 'NSApplicationDefined' . | xargs sed -i '' -e 's/NSApplicationDefined/NSEventTypeApplicationDefined/g'
rg -l 'NSBorderlessWindowMask' . | xargs sed -i '' -e 's/NSBorderlessWindowMask/NSWindowStyleMaskBorderless/g'
rg -l 'NSCenterTextAlignment' . | xargs sed -i '' -e 's/NSCenterTextAlignment/NSTextAlignmentCenter/g'
rg -l 'NSClosableWindowMask' . | xargs sed -i '' -e 's/NSClosableWindowMask/NSWindowStyleMaskClosable/g'
rg -l 'NSCommandKeyMask' . | xargs sed -i '' -e 's/NSCommandKeyMask/NSEventModifierFlagCommand/g'
rg -l 'NSCompositeCopy' . | xargs sed -i '' -e 's/NSCompositeCopy/NSCompositingOperationCopy/g'
rg -l 'NSControlKeyMask' . | xargs sed -i '' -e 's/NSControlKeyMask/NSEventModifierFlagControl/g'
rg -l 'NSDeviceIndependentModifierFlagsMask' . | xargs sed -i '' -e 's/NSDeviceIndependentModifierFlagsMask/NSEventModifierFlagDeviceIndependentFlagsMask/g'
rg -l 'NSFlagsChanged' . | xargs sed -i '' -e 's/NSFlagsChanged/NSEventTypeFlagsChanged/g'
rg -l 'NSFullScreenWindowMask' . | xargs sed -i '' -e 's/NSFullScreenWindowMask/NSWindowStyleMaskFullScreen/g'
rg -l 'NSFullSizeContentViewWindowMask' . | xargs sed -i '' -e 's/NSFullSizeContentViewWindowMask/NSWindowStyleMaskFullSizeContentView/g'
rg -l 'NSFunctionKeyMask' . | xargs sed -i '' -e 's/NSFunctionKeyMask/NSEventModifierFlagFunction/g'
rg -l 'NSHelpKeyMask' . | xargs sed -i '' -e 's/NSHelpKeyMask/NSEventModifierFlagHelp/g'
rg -l 'NSKeyDown' . | xargs sed -i '' -e 's/NSKeyDown/NSEventTypeKeyDown/g'
rg -l 'NSKeyUp' . | xargs sed -i '' -e 's/NSKeyUp/NSEventTypeKeyUp/g'
rg -l 'NSLeftMouseDownMask' . | xargs sed -i '' -e 's/NSLeftMouseDownMask/NSEventMaskLeftMouseDown/g'
rg -l 'NSLeftMouseDown' . | xargs sed -i '' -e 's/NSLeftMouseDown/NSEventTypeLeftMouseDown/g'
rg -l 'NSLeftMouseDragged' . | xargs sed -i '' -e 's/NSLeftMouseDragged/NSEventTypeLeftMouseDragged/g'
rg -l 'NSLeftMouseUp' . | xargs sed -i '' -e 's/NSLeftMouseUp/NSEventTypeLeftMouseUp/g'
rg -l 'NSMiniaturizableWindowMask' . | xargs sed -i '' -e 's/NSMiniaturizableWindowMask/NSWindowStyleMaskMiniaturizable/g'
rg -l 'NSMiniControlSize' . | xargs sed -i '' -e 's/NSMiniControlSize/NSControlSizeMini/g'
rg -l 'NSMouseEntered' . | xargs sed -i '' -e 's/NSMouseEntered/NSEventTypeMouseEntered/g'
rg -l 'NSMouseExited' . | xargs sed -i '' -e 's/NSMouseExited/NSEventTypeMouseExited/g'
rg -l 'NSMouseMoved' . | xargs sed -i '' -e 's/NSMouseMoved/NSEventTypeMouseMoved/g'
rg -l 'NSNumericPadKeyMask' . | xargs sed -i '' -e 's/NSNumericPadKeyMask/NSEventModifierFlagNumericPad/g'
rg -l 'NSOtherMouseDownMask' . | xargs sed -i '' -e 's/NSOtherMouseDownMask/NSEventMaskOtherMouseDown/g'
rg -l 'NSOtherMouseDown' . | xargs sed -i '' -e 's/NSOtherMouseDown/NSEventTypeOtherMouseDown/g'
rg -l 'NSOtherMouseDragged' . | xargs sed -i '' -e 's/NSOtherMouseDragged/NSEventTypeOtherMouseDragged/g'
rg -l 'NSOtherMouseUp' . | xargs sed -i '' -e 's/NSOtherMouseUp/NSEventTypeOtherMouseUp/g'
rg -l 'NSRegularControlSize' . | xargs sed -i '' -e 's/NSRegularControlSize/NSControlSizeRegular/g'
rg -l 'NSResizableWindowMask' . | xargs sed -i '' -e 's/NSResizableWindowMask/NSWindowStyleMaskResizable/g'
rg -l 'NSRightMouseDown' . | xargs sed -i '' -e 's/NSRightMouseDown/NSEventTypeRightMouseDown/g'
rg -l 'NSRightMouseDragged' . | xargs sed -i '' -e 's/NSRightMouseDragged/NSEventTypeRightMouseDragged/g'
rg -l 'NSRightMouseUp' . | xargs sed -i '' -e 's/NSRightMouseUp/NSEventTypeRightMouseUp/g'
rg -l 'NSRightTextAlignment' . | xargs sed -i '' -e 's/NSRightTextAlignment/NSTextAlignmentRight/g'
rg -l 'NSScrollWheelMask' . | xargs sed -i '' -e 's/NSScrollWheelMask/NSEventMaskScrollWheel/g'
rg -l 'NSScrollWheel' . | xargs sed -i '' -e 's/NSScrollWheel/NSEventTypeScrollWheel/g'
rg -l 'NSShiftKeyMask' . | xargs sed -i '' -e 's/NSShiftKeyMask/NSEventModifierFlagShift/g'
rg -l 'NSSmallControlSize' . | xargs sed -i '' -e 's/NSSmallControlSize/NSControlSizeSmall/g'
rg -l 'NSTabletPointEventSubtype' . | xargs sed -i '' -e 's/NSTabletPointEventSubtype/NSEventSubtypeTabletPoint/g'
rg -l 'NSTitledWindowMask' . | xargs sed -i '' -e 's/NSTitledWindowMask/NSWindowStyleMaskTitled/g'
```

Then I removed changes to third-party webrtc code, removed a comment in accessible/mac/mozAccessible.mm,
and performed some manual replacements in native_mouse_mac_window.xhtml.

Differential Revision: https://phabricator.services.mozilla.com/D100260
2021-01-05 21:17:11 +00:00
Cameron McCormack
88f9c54b10 Bug 1685010 - Paint indeterminate checkboxes properly on Windows high contrast mode in the non-native theme. r=spohl
Differential Revision: https://phabricator.services.mozilla.com/D100757
2021-01-05 12:46:09 +00:00
Cameron McCormack
b8b0d529d8 Bug 1684801 - Don't paint indeterminate radio buttons with a solid background. r=spohl
Differential Revision: https://phabricator.services.mozilla.com/D100756
2021-01-05 12:45:48 +00:00
Anurag Akella
54fdd3817b Bug 1684641 - fixed gtk3drawing.cpp: do not use 'else' after 'return' r=stransky
Differential Revision: https://phabricator.services.mozilla.com/D100651
2021-01-04 14:38:47 +00:00
Edgar Chen
f8fb06fea1 Bug 1662363 - Rename eTopLevel/eChild to ePlatformTopLevel/ePlatformChild; r=smaug
This is a follow-up of bug 1653949.

Differential Revision: https://phabricator.services.mozilla.com/D100729
2021-01-05 09:48:24 +00:00
Daniel Holbert
2cedf5494d Bug 1669905 part 2: Add nsIPrintSettings APIs to handle the possibility that pages and sheets may have orthogonal orientation, in pages-per-sheet printouts. r=jfkthame
This patch does three things, all centered around these new APIs:

 (1) Add the APIs themselves -- some nsIPrintSettings methods to reason about
the sheet-orientation being potentially flipped to accomodate 2 and 6
pages-per-sheet.

 (2) Use these new APIs, where appropriate, in places where we previously used
the page-orientation to set up the platform-native print-settings objects and
print-target. Now, we'll use the *sheet* orientation instead of the page
orientation, to be sure we produce the appropriately-oriented platform-native
surfaces.  Also, for symmetry, this patch adds similar logic to the reverse
codepaths, where we update an existing nsIPrintSettings object based on a
platform-native print-settings object.

 (3) Update nsPrintJob's code that informs nsPresContext about the page-size.
This patch makes sure that this code uses the *page* size, rather than the
*sheet* size, in cases where they differ.  (The code that consumes this
nsPresContext::GetPageSize API, e.g. our CSS media-query code, really does want
the page size, not the sheet size.)

Differential Revision: https://phabricator.services.mozilla.com/D100372
2021-01-05 02:24:00 +00:00
stransky
9be10fea0c Bug 1648698 [Wayland] Move nsWaylandDisplay::SyncBegin() out of FlushPendingCommitsLocked() call, r=rmader
- Move nsWaylandDisplay::SyncBegin() out of FlushPendingCommitsLocked() call to avoid a deadlock there
- Rename FlushPendingCommitsInternal() to FlushPendingCommitsLocked() to clearly state it operates on locked surface only.
- Implement nsWaylandDisplay::QueueSyncBegin() which delays SyncBegin() execution untill recent event batch is finished
  and use it instead of SyncBegin().

Differential Revision: https://phabricator.services.mozilla.com/D100384
2021-01-04 20:32:31 +00:00
Jeff Muizelaar
a00961b698 Bug 1684903 - Add nsAutoreleasePools to functions that interacts with NSScreen. r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D100696
2021-01-04 16:25:24 +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
Masayuki Nakano
1b07095476 Bug 1683226 - part 15: Get rid of plugin specific members of WidgetKeyboardEvent r=m_kato,smaug
Depends on D100388

Differential Revision: https://phabricator.services.mozilla.com/D100389
2020-12-29 21:16:48 +00:00
Cosmin Sabou
2978aa00a3 Backed out changeset dbed1cdf588f (bug 1684173) for mochitest plain and devtools failures. a=backout DONTBUILD 2020-12-28 00:43:51 +02:00
Kartik Gautam
775cdec032 Bug 1684173 - Add newline character at end of files when missing r=sylvestre
Depends on D100443

Differential Revision: https://phabricator.services.mozilla.com/D100484
2020-12-27 11:43:41 +00:00
Masatoshi Kimura
6bc6e5b3fb Bug 1684110 - Stop using some 'A'-functions in widget/windows/. r=mhowell
Depends on D100468

Differential Revision: https://phabricator.services.mozilla.com/D100469
2020-12-26 00:46:34 +00:00
Masayuki Nakano
d047e80060 Bug 1683226 - part 14: Get rid of ComplexTextInputPanel r=m_kato
It's used only for a placeholder of composition string in plugins.

Depends on D100387

Differential Revision: https://phabricator.services.mozilla.com/D100388
2020-12-24 02:49:02 +00:00
Masayuki Nakano
44dced1d87 Bug 1683226 - part 13: Get rid of nsIWidget::StartPluginFocused() r=m_kato,ipc-reviewers,mccr8
Depends on D100386

Differential Revision: https://phabricator.services.mozilla.com/D100387
2020-12-24 02:46:46 +00:00
Masayuki Nakano
968d02a1a9 Bug 1683226 - part 12: Get rid of nsIWidget::SetPluginFocus() r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D100386
2020-12-24 02:46:02 +00:00
Narcis Beleuzu
f2b3650083 Backed out changeset e8c18967320c (bug 1631061) for causing Bug 1683989 2020-12-23 12:50:06 +02:00
Cameron McCormack
eefbb537b9 Bug 1683204 - Include content theme configuration details in FullLookAndFeel. r=spohl
And re-enable the RemoteLookAndFeel by default with Gtk.

When the RemoteLookAndFeel is enabled and the non-native theme is not
enabled, we still need to configure the Gtk theme in content processes,
since we're still using Gtk to paint widget backgrounds etc. Without
this, we can end up using LookAndFeel colors from a light theme but
painting widget backgrounds from a dark theme.

Other platforms don't configure themes for content processes
differently, so on those platforms LookAndFeelTheme is an empty struct
and we skip the ConfigureTheme call.

Differential Revision: https://phabricator.services.mozilla.com/D100223
2020-12-22 19:26:41 +00:00
Jonathan Kew
2844494240 Bug 1683878 - Use a local autorelease pool in gfxMacPlatformFontList::LookupSystemFont because it may be used off-main-thread. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D100341
2020-12-22 16:49:08 +00:00
stransky
e433ead34a Bug 1648698 [Wayland] Remove mIsMainThread from WindowSurfaceWayland as we use mutexes now, r=rmader
Differential Revision: https://phabricator.services.mozilla.com/D100327
2020-12-22 13:01:35 +00:00
stransky
5a1bb7df43 Bug 1648698 [Wayland] Protect WindowSurfaceWayland public methods by Mutex, r=rmader
As WindowSurfaceWayland can be acessed from various threads we need to guard public interface by mutex to avoid
threading issues. We also can't delete WindowSurfaceWayland internals untill it's used.

Depends on D100313

Differential Revision: https://phabricator.services.mozilla.com/D100314
2020-12-22 11:40:07 +00:00
stransky
eb4144dc88 Bug 1648698 [Wayland] Use g_timeout for delayed commits, r=rmader
Use g_timeout for delayed/pending commits instead of PostDelayedTask()/NewRunnableFunction()
and remove an active timeout when WindowSurfaceWayland is deleted.

Differential Revision: https://phabricator.services.mozilla.com/D100313
2020-12-22 11:41:06 +00:00
stransky
31ad281be6 Bug 1631061 [Wayland] Remove fast track clipboard and always ask compositor for clipboard data, r=rmader
Differential Revision: https://phabricator.services.mozilla.com/D100317
2020-12-22 10:12:01 +00:00
Alastor Wu
5a96f35156 Bug 1671626 - part2 : set metadata on nowPlayingInfo. r=spohl
Differential Revision: https://phabricator.services.mozilla.com/D100077
2020-12-21 18:09:16 +00:00
Alastor Wu
0bcbe2eae9 Bug 1671626 - part1 : remove MediaPlayerWrapper. r=spohl
As now the lowest version SDK we use for developing would be 10.12, so we don't need to this wrapper anymore and can import `MediaPlayer` directly.

Differential Revision: https://phabricator.services.mozilla.com/D97223
2020-12-21 18:10:30 +00:00
Bob Owen
81777ea3b9 Bug 1465513: Call IDropTargetHelper::DragLeave before IDropTargetHelper::DragEnter. r=dmajor,NeilDeakin
This is an attempt clean up any stale information to try and solve crashes later
in the drag in nsNativeDragTarget::DragOver.

Differential Revision: https://phabricator.services.mozilla.com/D100124
2020-12-21 18:49:40 +00:00
Masayuki Nakano
9e229babfa Bug 1683226 - part 11: Get rid of IMEEnabled::Plugin r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D100123
2020-12-21 08:26:24 +00:00
Masayuki Nakano
f13852f795 Bug 1683226 - part 10: Get rid of nsIWidget::EnableIMEForPlugin() r=m_kato
This is used only on Windows.

Differential Revision: https://phabricator.services.mozilla.com/D100122
2020-12-21 06:31:16 +00:00
Masayuki Nakano
ff0e3ef67e Bug 1683226 - part 9: Get rid of nsIWidget::PluginHasFocus() r=m_kato
It's used only by IMM and keyboard handlers on Windows.

Differential Revision: https://phabricator.services.mozilla.com/D100121
2020-12-21 06:30:07 +00:00
Masayuki Nakano
27565d419d Bug 1683226 - part 8: Make IMEHandler on Windows stop handling plugin cases r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D100120
2020-12-21 06:18:04 +00:00
Masayuki Nakano
942e0a3e09 Bug 1683226 - part 7: Get rid of remaining all IMM message handlers for plugin r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D100119
2020-12-21 06:17:36 +00:00
Masayuki Nakano
deee66043a Bug 1683226 - part 6: Get rid of the path of DefaultProcOfPluginEvent r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D100118
2020-12-21 06:13:09 +00:00
Masayuki Nakano
b20f4bb5c2 Bug 1683226 - part 5: Get rid of the path setting candidate window position from plugin on Windows r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D100117
2020-12-21 06:03:33 +00:00
Masayuki Nakano
8e022b15e5 Bug 1683226 - part 4: Make stop ContentCache check whether a plugin has focus or not r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D100103
2020-12-21 05:59:57 +00:00
Masayuki Nakano
d876b20aaa Bug 1683226 - part 2: Make HTMLEmbedElement and HTMLObjectElement stop overriding nsIContent::GetDesiredIMEState() r=smaug
Currently, they are never focusable when its type is "plugin".
So, making stop them returning `IMEEnabled::Plugin` won't change
anything, but it guarantees that nobody will see `IMEEnabled::Plugin`
at runtime.  This is a preparation for the following patches.

Differential Revision: https://phabricator.services.mozilla.com/D100101
2020-12-21 05:52:26 +00:00
Masayuki Nakano
d27602eee6 Bug 1683226 - part 1: Make IMEState::Enabled an enum class r=m_kato,geckoview-reviewers
Before deleting `IMEState::Enabled::PLUGIN`, let's make it an enum class
for making the change safer.  Almost all of this change is done by
"replace" of VSCode.

Differential Revision: https://phabricator.services.mozilla.com/D100100
2020-12-21 05:52:03 +00:00
Masayuki Nakano
bc9e328cce Bug 1683027 - Make IMContextWrapper handle keyboard events asynchronously when active IM is Fcitx5 r=m_kato
Fcitx5 sets its context name to "fcitx5", not "fcitx".  Therefore,
we need to add new check for it to enable the asynchronous keyboard
event handling.

Note that some options for disabling the async handling and
enabling key snooper are not supported so that we can ignore them
at initializing the state.

Differential Revision: https://phabricator.services.mozilla.com/D100075
2020-12-19 16:03:20 +00:00
Michelle Goossens
32c85dff53 Bug 1681098 - Update the aspect ratio when a PiP video gets resized r=mconley
Differential Revision: https://phabricator.services.mozilla.com/D100150
2020-12-18 23:43:46 +00:00
Timothy Nikkel
bbb28ca9ba Bug 1683426. Assert in DManipEventHandler::OnContentUpdated that SendPinch returns true if mShouldSendPinchStart is true. r=botond
Otherwise we wouldn't send a pinch start. This should never be hit because if we get here the current scale should not be fuzzy equal to the previous scale so SendPinch should compute a non-zero deltaY and send an event and return true.

Differential Revision: https://phabricator.services.mozilla.com/D100170
2020-12-18 22:20:32 +00:00
Andrew Osmond
4b717a7593 Bug 1683343 - Ship WebRender to release for large screen Intel users on Linux. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D100137
2020-12-18 16:47:26 +00:00
Masatoshi Kimura
6a43b71a1d Bug 1679087 - Remove ability to create non-Unicode widgets. r=mhowell
Differential Revision: https://phabricator.services.mozilla.com/D100007
2020-12-17 18:21:39 +00:00
Cameron McCormack
30a84b5b6d Bug 1683026 - Don't use content configured theme values for SystemUsesDarkTheme and UseAccessibilityTheme. r=spohl
Differential Revision: https://phabricator.services.mozilla.com/D99971
2020-12-17 21:25:19 +00:00
Andrew Osmond
99e83658b9 Bug 1683117 - Ship WebRender to release for AMD Kaveri and R700 users. r=jrmuizel
Differential Revision: https://phabricator.services.mozilla.com/D100023
2020-12-17 15:34:22 +00:00
Simon Giesecke
9758d919eb Bug 1583109 - Use StringJoin(Append) where easily possible. r=nika
Bug 1583109 introduced new function templates StringJoin and StringJoinAppend.
These are now used to replace several custom loops across the codebase that
implement string-joining algorithms to simplify the code.

Differential Revision: https://phabricator.services.mozilla.com/D98750
2020-12-17 14:58:18 +00:00
Simon Giesecke
78678eab21 Bug 1679987 - Implement nsTSubstring::Split using nsTokenizedRange. r=xpcom-reviewers,necko-reviewers,nika
nsTSubstring::Split used to heap-allocate an array to store all tokens.
However, most uses of Split just use it to iterate in a range-based for loop.
The few remaining uses also don't need to iterate multiple times over all
tokens, so it's better to just use nsTokenizedRange, which tokenizes lazily.

Differential Revision: https://phabricator.services.mozilla.com/D99234
2020-12-17 12:36:47 +00:00
Jeff Muizelaar
ab23e18c10 Bug 1682966 - Enable WebRender on Baytrail in Nightly/Early Beta. r=aosmond
Differential Revision: https://phabricator.services.mozilla.com/D99943
2020-12-16 22:38:06 +00:00
Toshihito Kikuchi
39355b8a28 Bug 1644240 - Suppress playing a sound if Diebold Warsaw's modules are partially unloaded. r=cmartin
This patch is to mitigate the crash which was probably caused by Diebold Warsaw.
We couldn't reproduce the problem, but our crash reports indicate the crash happened
when `winmm!mciwindow` called `USER32!GetMessageA` but it was redirected to a freed
buffer.  This happens Firefox calls to `PlaySound` e.g. showing the menu bar by
pressing Alt key, or showing a dialogbox.

Most of (not 100%) the crash instances have wslbdhm64 loaded but wslbscrwh64.dll
was unloaded.  The proposed mitigation is to suppress playing a sound under
such a condition.

Differential Revision: https://phabricator.services.mozilla.com/D99705
2020-12-16 22:50:46 +00:00
Andrew Osmond
284c6aa966 Bug 1682636 - Don't allow generic blocklist rules to block SW-WR. r=jrmuizel
Since Software WebRender is the replacement for Basic compositor, we
should not allow generic blocklist rules which block all features to
block Software WebRender. This feature must work under all
configurations, including safe mode, so it doesn't make sense to allow
blocking it.

This does not however prevent rules specifically targeting SW-WR from
blocking/allowing it.

Differential Revision: https://phabricator.services.mozilla.com/D99834
2020-12-16 21:32:28 +00:00