Commit Graph

22310 Commits

Author SHA1 Message Date
Masayuki Nakano
c8d5ce8e59 Bug 1333459 - part4: Make EventStateManager resets "waiting reply from remote process" when the focused content isn't in remote process r=smaug
On macOS, we fall back eKeyPress event to native menu.  Therefore, widget always requests a reply from remote process because it's difficult to check if the eKeyPress event will be sent to a remote process actually.  If it's not sent to any remote processes, PresShell needs to dispatch the event into the DOM tree.  Additionally, even if it's marked as "waiting reply from remote process", it needs to dispatch the DOM event in the main process first because we need to check if the key combination is reserved by chrome (if it's reserved, the eKeyPress event shouldn't be fired in the remote process).

Therefore, this patch makes EventStateManager::PreHandleEvent() resets the state when focused content isn't in any remote processes and the event's propagation hasn't been stopped.

Additionally, this patch makes PresShell::HandleEventInternal() checks WidgetEvent::PropgationStopped() with WidgetEvent::IsWaitingReplyFromRemoteProcess() before dispatching the event into the DOM tree.

MozReview-Commit-ID: FmgL3rCuQ8y

--HG--
extra : rebase_source : aa8d6b924fc78d1d9dd35a35c92976c35c758657
2017-07-21 17:22:08 +09:00
Masayuki Nakano
0ebdc75b7b Bug 1333459 - part2-3: Make nsMenuBarListener::KeyPress() wait reply from remote process if the eKeyPress event will be sent to a remote process later r=smaug
nsMenuBarListener::KeyPress() is eKeyEvent listener in the system event group.  If the target is a remote process, it shouldn't handle accesskey immediately because preceding eKeyDown event may be consumed in the remote process or eKeyPress event itself may be consumed in the remote process.

This patch makes nsMenuBarListener::KeyPress() mark eKeyPress event as "waiting reply from remote process" only when the event matches with a menu item's accesskey and it will be send to a remote process later.  Then, reply event should be handled in this method if it's available.

MozReview-Commit-ID: KOpCVgElnca

--HG--
extra : rebase_source : 881ec01f5c8e21c790bf9a8c3167d6c3f932524a
2017-07-19 18:39:34 +09:00
Masayuki Nakano
44d5a33919 Bug 1333459 - part2-2: EventStateManager should check if it needs to wait reply from remote content before handling access keys r=smaug
Currently, access key is handled in EventStateManager::PreHandleEvent() with eKeyPress event, i.e., before dispatching it into the DOM tree, if the access key is registered in EventStateManager.  So, the main process does not check if the preceding eKeyDown event is consumed in focused remote process.

When preceding eKeyDown event is consumed in the main process, eKeyPress event won't be dispatched by widget.  However, if remote process has focus, it's impossible widget to stop dispatching eKeyPress event because preceding eKeyDown event hasn't been handled in the focused remote process yet.  Therefore, main process needs to post eKeyPress event to check if preceding eKeyDown event was consumed.  When eKeyPress event is marked as "waiting reply from remote process", TabChild sends it back to the main process only when preceding eKeyDown event wasn't consumed.  So, only when eKeyPress event is back to the main process, main process should handle accesskey with it.

This patch makes EventStateManager::PreHandleEvent() check if a remote target has focus before handling accesskey.  If a remote process has accesskey and there is an accesskey matching with eKeyPress event, it marks the event as "waiting reply from remote content" and stop propagation in the process.

Finally, when eKeyPress event is sent back to TabParent, TabParent::RecvReplyKeyEvent() calls EventStateManager::HandleAccessKey() before dispatching the reply event into the DOM tree.

MozReview-Commit-ID: KsOkakaIVzb

--HG--
extra : rebase_source : 7e0c6966a1bde085e34d45bca4b0166b9fc2f3f1
2017-07-22 10:50:41 +09:00
Masayuki Nakano
6c68caecd7 Bug 1333459 - part1: Move methods of EventStateManager which check modifiers of access key to WidgetKeyboardEvent r=smaug
EventStateManager checks if every keypress event's modifiers match with access key modifiers which are in prefs. Moving related methods of this to WidgetKeyboardEvent makes EventStateManager simpler and we can hide the NS_MODIFIER_* constants (they may make developers confused between Modifiers of WidgetInputEvent) into WidgetEventImpl.cpp.

MozReview-Commit-ID: 23NUQ51lJ1M

--HG--
extra : rebase_source : 341f3764ef62575577572d8b349159e2d5512b26
2017-07-06 17:36:19 +09:00
Wes Kocher
d45eb771f0 Merge m-c to inbound, a=merge
MozReview-Commit-ID: Ah48RzFU8Mt
2017-07-21 18:20:46 -07:00
Wes Kocher
051dc17e6c Merge inbound to central, a=merge CLOSED TREE
MozReview-Commit-ID: GYc8r8gnS0j
2017-07-21 18:12:55 -07:00
Ryan VanderMeulen
f4e3a91992 Merge m-c to inbound. a=merge 2017-07-21 09:40:28 -04:00
Sebastian Hengst
367f0ac5a2 merge mozilla-inbound to mozilla-central. r=merge a=merge
MozReview-Commit-ID: IWRTFZdtzaE
2017-07-21 12:56:44 +02:00
Sylvestre Ledru
7c0ae251cd Bug 1381253 - Remove redundant control flow declarations rs=ehsan
MozReview-Commit-ID: FFxP4aMCbOL

--HG--
extra : amend_source : 3aec108430b11048f47ffe19d5da7ac5034770a9
2017-07-15 19:03:04 +02:00
Kentaro Hayashi
ef93e64d0d Bug 1382142 - Fix a typo about MOZ_CONTAINER_GET_CLASS definition. r=karlt
There is no side-effects by this commit because this macro definition is
not used in actual implementation.

--HG--
extra : amend_source : 6075bacf7c0e2c10dd66dcfda8e28f16786d58de
2017-07-19 17:01:59 +09:00
Stone Shih
a930bf9910 Bug 1372097 Implement tangential pressure and twist on Mac. r=mstange.
MozReview-Commit-ID: 5eigFssLEGR
2017-06-12 16:25:49 +08:00
Andrew Osmond
69da7c2120 Bug 1381095 - Fallback correctly to non-WebRender if the GPU process/WebRender are disabled when creating a remote compositor session. r=dvander 2017-07-20 09:20:22 -04:00
Johann Hofmann
3eac596d72 Bug 1371219 - Add an inputSource attribute to XULCommandEvent. r=smaug
In the frontend we need to know if XUL buttons in the toolbar were
triggered by a touch event, so we're passing on the inputSource
in the command event.

MozReview-Commit-ID: DMvgZULk9hT

--HG--
extra : rebase_source : c455c8ec77e439bf02c1e3e8d34a36e1fb5e3bd0
2017-07-20 17:45:56 +02:00
Ryan VanderMeulen
d229288071 Merge m-c to autoland. a=merge
CLOSED TREE

--HG--
extra : amend_source : 2ab51304cc7df444f22c3aac001a1aba61faee3a
2017-07-21 09:42:41 -04:00
Dão Gottwald
f605598222 Bug 1379266 - Tweak -moz-win-accentcolortext formula to better match native title bars. r=jimm
MozReview-Commit-ID: 9unrhFI3sWh

--HG--
extra : rebase_source : 096198d640ee39c87d8495fe6e6e872544aa6478
2017-07-18 13:23:25 +02:00
Stone Shih
a5bccae405 Bug 1351148 Part4: Revise those test cases that have some tasks have to be processed before or after the synthesized key events. r=smaug.
Make sure input events are processed before or after the dependent tasks.

MozReview-Commit-ID: 8KfZnT2wjJR
2017-06-07 14:28:16 +08:00
Wes Kocher
b5bcc4905e Merge inbound to central, a=merge CLOSED TREE
MozReview-Commit-ID: CBL7SUEUGKV
2017-07-19 17:29:56 -07:00
Jim Chen
8b6bd21a0b Bug 1351170 - 2. Notify selection listeners after adjusting range offsets; r=smaug
`nsRange` registers mutation observers to adjust the range when content
changes. However, there are some cases where we adjust the start and/or
end offsets but don't notify selection listeners (i.e. we don't call
`nsRange::DoSetRange` to set the new range points, contrary to what the
comment above `nsRange::DoSetRange` says). This patch makes us call
`nsRange::DoSetRange` in those cases. The patch adds a testcase in
test_selectevents.html, and changes a few unexpected-pass cases in
test_composition_text_querycontent.xul that this patch fixed.

MozReview-Commit-ID: 73D8RYMS3MS

--HG--
extra : rebase_source : da0cc3073e4b8ad23c6f6eab42da5aa8b269cae9
2017-07-19 14:29:59 -04:00
Jim Chen
41148177ef Bug 1351170 - 1. Correctly calculate start offset for non-text nodes; r=masayuki
When the start node is a non-container node (i.e. <br>), and the start
offset is 0, we should not include a newline character for the node. For
example, for this range,

> <br/>hello
>  \___/

the start node/offset is (<br/>, 0) and end node/offset is ("hello", 1).
The calculated range offset should be 0, and the range length should be
2: 1 for the <br/> newline character plus 1 for "h".

The patch also ensures this behavior for pre-mode nsContentIterator, for
both start and end node adjustments. For start nodes, we include any
non-container nodes with offset 0 in the range. For end node, we exclude
any non-container nodes with offset 0 from the range.

MozReview-Commit-ID: Lt2tCLbapq7

--HG--
extra : rebase_source : 7d86b6cf04581f1cd71fa85f8c8586541b3a84e9
2017-07-19 14:29:59 -04:00
Ryan Hunt
017d292cac Bug 1382128 part 2 - Remove WrPoint, WrSize, WrRect, WrMatrix, and WrColor. r=kats
MozReview-Commit-ID: 9koNScu4CyE

--HG--
extra : rebase_source : 68185e949ddf2ae346a5d597d056a7f2d9ea7a28
2017-07-18 18:32:46 -04:00
Dão Gottwald
4b7389da4e Bug 1379938 - Rename the -moz-windows-accent-color-applies media query and make -moz-win-accentcolor available without it. r=jimm
MozReview-Commit-ID: 9zMr9JwkloF

--HG--
extra : rebase_source : 25e9cfa11dc0c3ff09e4e3aac18a53535cbcc27b
2017-07-19 16:38:49 +02:00
Ryan Hunt
3f3cb0a954 Bug 1382128 part 1 - Use a namespace in webrender_bindings. r=kats
MozReview-Commit-ID: 3JTMa9Ix5S7

--HG--
extra : rebase_source : 0bea14d9e395cab260d2db5135b1f64e9f82b2e2
2017-06-27 19:20:36 -04:00
Benjamin Smedberg
e92ddc293b Bug 1374038 - _exit() can call static destructors on Windows! So replace it with TerminateProcess which can't, r=jimm r=mstange
MozReview-Commit-ID: FSsOU85yA18

--HG--
extra : rebase_source : 7247a9940d7729e003af51c0cc7de15b08aa54d0
2017-07-17 16:06:15 -04:00
Andrew Osmond
094c212d54 Bug 1350408 - Gracefully handle failures in WebRenderLayerManager::Initialize to allow reinit. r=kats 2017-07-18 09:35:07 -04:00
Haik Aftandilian
09507f2814 Bug 1353064 - Add-on always prints at 100% due to missing nsPrintSettingsX::GetScaling() impl r=cosmo0920
MozReview-Commit-ID: AhIFJUfRrPJ

--HG--
extra : rebase_source : b01c8e6099df8de46c2e0ba983ac91738d648c84
2017-06-14 15:06:18 -07:00
Doug Thayer
7646a8ed3b Bug 1380629 - Check GetTheme result in nsNativeThemeWin r=jimm
The fix for bug 1373079 neglected the detail of OpenThemeData
that it can return null if no match is found for the specified
class name. The set of matching class data sections varies with
the default and the classic theme, and the classic theme doesn't
have matches for a few of the values that we try to get. This
causes us to pass a null theme to subsequent functions, which of
course breaks the layout.

MozReview-Commit-ID: 5LaR0qZlOzd

--HG--
extra : rebase_source : ba97163e5dfdd7127d550be54524e93f12195ffb
2017-07-17 13:55:28 -07:00
Samael Wang
e90e4d4b15 Bug 1350643 - Part 7: Remove sync GetDPI/DefaultScale/WidgetRounding. Use primary screen's value until RecvShow. r=kanru
MozReview-Commit-ID: GlDMNecWp3j

--HG--
extra : rebase_source : 1f8573df8845c100172f41febc5a84bbcd069769
2017-05-19 18:20:18 +08:00
Samael Wang
f41a004bb1 Bug 1350643 - Part 6.2: Get per-monitor dpi in ScreenHelperWin & use the same value in nsWindow::GetDPI. r=jimm
MozReview-Commit-ID: 3oEvQe8zNJ0

--HG--
extra : rebase_source : b4c7d97ec1f701bbd1058ef40994f9874f6117cc
2017-06-16 11:16:47 +08:00
Samael Wang
b75d05055a Bug 1350643 - Part 6.1: Extract getting DPI logic from LogToPhysFactor & SystemScaleFactor to provide new functions MonitorDPI & SystemDPI. r=jimm
MozReview-Commit-ID: E9mXvFMM3pA

--HG--
extra : rebase_source : 1cc0f80c41054d6400d03b663f5b0037fbdb4cad
2017-06-16 01:11:41 +08:00
Samael Wang
a4e6b1337a Bug 1350643 - Part 5.2: Use per-monitor gdkScaleFactor to set contentsScaleFactor & nsWindow::GetDesktopToDeviceScale if running in gtk/wayland. r=karlt
MozReview-Commit-ID: Grs4dUqvLew

--HG--
extra : rebase_source : a5524e08fea8fb3623a55c486b33e95c4212fa59
2017-06-16 11:13:59 +08:00
Samael Wang
a4ddae112e Bug 1350643 - Part 5.1: Get per-monitor dpi in ScreenHelperGTK & use the same value in nsWindow::GetDPI. r=karlt
MozReview-Commit-ID: 9dOkUEzuUL8

--HG--
extra : rebase_source : 26fdbcc54edf8a3f4f0b166a88f85f98313bfe39
2017-06-16 10:58:11 +08:00
Samael Wang
480a9d013c Bug 1350643 - Part 4.2: Use screen.dpi in nsChildView::GetDPI. r=mstange
MozReview-Commit-ID: AiGBxTNzxSp

--HG--
extra : rebase_source : 50dcdca6e6b63ab3cbae7e00ecc8c8e7e4f10b74
2017-06-16 10:55:09 +08:00
Samael Wang
e6f4039653 Bug 1350643 - Part 4.1: Get per-monitor dpi in ScreenHelperCocoa. r=mstange
MozReview-Commit-ID: OHa8h2sh26

--HG--
extra : rebase_source : 67d7be6a51ad81d0d2cfe48ad4c92d0a6ef3c666
2017-06-06 18:18:52 +08:00
Samael Wang
3810bc3903 Bug 1350643 - Part 3: Add GetDPI to nsIScreen & ScreenDetails. r=kanru
MozReview-Commit-ID: HEFyuYV26Wy

--HG--
extra : rebase_source : fb172f4ba99ab7119036ddf4ec1b3eeeaead186c
2017-06-06 18:09:34 +08:00
Samael Wang
44adcfaeea Bug 1350643 - Part 2: Use gdk functions to enumerate monitors instead of Xinerama. r=karlt
MozReview-Commit-ID: D9f65oZMBuV

--HG--
extra : rebase_source : e4dfa2ee593b9e06433569aaa8f3ec965fca5f2d
2017-06-06 17:57:54 +08:00
Samael Wang
c9d2b57f92 Bug 1350643 - Part 1: Rename gfxPlatformGtk::GetDPI/GetDPIScale to GetFontScaleDPI/GetFontScaleFactor to better distinguish from nsIWidget::GetDPI. r=karlt
MozReview-Commit-ID: 4fxMG1FBlM8

--HG--
extra : rebase_source : 767780c828b2a9914b5f3af3c2749568099bece1
2017-06-14 16:54:21 +08:00
Kris Maglione
86877fceef Bug 1381097: Part 1 - Add default-false pref to enable APZ in remote popups. r=kats
Ideally, we definitely want APZ in remote popup browsers for the sake of
responsiveness. However, there are currently some serious painting and
checkerboarding issues that make APZ popups unsuitable for release
populations.

Once these issues are addressed, we should enable the preference by default.
But given the relative lack of testing, and the issues we've seen so far, we
should keep the preference so that we can disable it with a hotfix if further
issues arise.

MozReview-Commit-ID: GOZRdsmLNZR

--HG--
extra : rebase_source : ce0f2ca029d951a9c65ec1482e065b6695793133
2017-07-15 12:01:36 -07:00
David Parks
1dc60d3f88 Bug 1373220 - Use correct window reference when setting parent window in Windows widget. r=jimm
SetParent removes the widget from the old parent widget and then sets its new one.  We were incorrectly using the new parent widget when we needed the old one.
2017-07-12 19:32:48 -07:00
Kris Maglione
d60e48a1e8 Bug 1378948: Remove unused layers.popups.compositing.enabled preference. r=trivial
MozReview-Commit-ID: Css0qzakw14
2017-07-15 11:03:07 -07:00
Wes Kocher
6d62b1970e Merge m-c to inbound, a=merge
MozReview-Commit-ID: 4kiY84LofOi
2017-07-14 17:19:10 -07:00
Wes Kocher
e9fa5c772a Merge inbound to central, a=merge
MozReview-Commit-ID: 8nlqm5dHCUQ
2017-07-14 17:14:43 -07:00
David Anderson
983fda7771 Remove the Intel HD Graphics blocklist entry for Advanced Layers. (bug 1380580, r=milan) 2017-07-14 16:35:10 -07:00
Milan Sreckovic
b60a342a2b Bug 1381074: Have downloadable blocklist recognize advanced layers. r=dvander
MozReview-Commit-ID: GlzDUQoAH6P

--HG--
extra : rebase_source : 0e32b40f1d4939431bad194706f623bbf4a3829b
2017-07-14 14:13:54 -04:00
James Cheng
950fc2b63c Bug 1379866 - Implement MediaResource Suspend and Resume in HLSResource. r=jolin
1. Pause the Exoplayer when navigating to another page and resume playback when navigating back.

2. Fix the OOM issue.

MozReview-Commit-ID: 5UGmBzpObsb

--HG--
extra : rebase_source : f8f268612687669e1b31881465600b02b3531c55
2017-07-14 01:29:00 +08:00
Blake Kaplan
46f55c55cc Bug 1374862 - Avoid setting gHandled when we don't handle signals. r=masayuki
This avoids a fatal assertion for some key events when focus isn't on a text
input.

MozReview-Commit-ID: Hqr6LNW61Kn

--HG--
extra : rebase_source : adc954fc355044c91dc34e9e689a745da95e78c9
2017-06-20 17:03:09 -07:00
Nicholas Nethercote
c86dc10505 Bug 1380227 - Avoid many UTF16toUTF8 and UTF8toUTF16 conversions in nsStringBundle. r=emk.
Most of the names passed to nsIStringBundle::{Get,Format}StringFromUTF8Name
have one of the two following forms:

- a 16-bit C string literal, which is then converted to an 8-bit string in
  order for the lookup to occur;

- an 8-bit C string literal converted to a 16-bit string, which is then
  converted back to an 8-bit string in order for the lookup to occur.

This patch introduces and uses alternative methods that can take an 8-bit C
string literal, which requires changing some signatures in other methods and
functions. It replaces all C++ uses of the old methods.

The patch also changes the existing {Get,Format}StringFromName() methods so
they take an AUTF8String argument for the name instead of a wstring, because
that's nicer for JS code.

Even though there is a method for C++ code and a different one for JS code,
|binaryname| is used so that the existing method names can be used for the
common case in both languages.

The change reduces the number of NS_ConvertUTF8toUTF16 and
NS_ConvertUTF16toUTF8 conversions while running Speedometer v2 from ~270,000 to
~160,000. (Most of these conversions involved the string
"deprecatedReferrerDirective" in nsCSPParser.cpp.)

--HG--
extra : rebase_source : 3bee57a501035f76a81230d95186f8c3f460ff8e
2017-07-12 15:13:37 +10:00
Brendan Dahl
80c9890f5c Bug 1376812 - Create default headless draw target. r=jrmuizel
Defining the default draw target avoids the previous mix of cairo
and d2d layers, which would trigger an assertion when capturing
a page with the widget layers.
2017-07-13 16:55:23 -07:00
Dão Gottwald
8f5c440b72 Backed out changeset 5a5d8de65b70 (bug 1379938) on CLOSED TREE 2017-07-13 23:16:12 +02:00
Farmer Tseng
9b1bba24c6 Bug 1380301 - Add windows.h include to nsLookAndFeel.h r=heycam
MozReview-Commit-ID: Js9Kc73VXS1

--HG--
extra : rebase_source : 05b984cc3aa219dddc10faf22de046d03144bf45
2017-07-13 13:36:31 +08:00
Farmer Tseng
225f9a9b82 Bug 1380301 - Add missing "#ifdef MOZ_ENABLE_SKIA_PDF" to nsDeviceContextSpecWin.h r=heycam
MozReview-Commit-ID: YxvOID7Xbp

--HG--
extra : rebase_source : 5e8b4e37e7f74e4f0eecd35b5e5366a7953cb996
2017-07-13 13:07:18 +08:00