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

3951 Коммитов

Автор SHA1 Сообщение Дата
Edgar Chen 4827c5658b Bug 1686037 - Part 3: Remove duplicated ImplicitlyReleasePointerCapture call in PresShell; r=smaug
EventStateManager::PostHandleEvent would do the same thing, but need to handle
the cases that PresShell is destroyed and frame is destroyed in
pointerup/pointercancel event listener.

The former case would be handled in D102403. For the latter case, we allow
EventStateManager::PostHandleEvent to handle pointerup/pointercancel event while
frame is no longer available in this patch.

Differential Revision: https://phabricator.services.mozilla.com/D102404
2021-01-21 14:54:55 +00:00
Edgar Chen b615527436 Bug 1686037 - Part 2: Clean up pointer capture info when PresContext is destroyed; r=smaug
Found a possible leak from running layout/base/tests/test_bug993936.html after
enable implicit pointer capture for touch event. The test synthesize touchstart
and touchmove event, but no touchend, so we don't run the release steps and the
PointerCaptureInfo still hold a reference to Element which cause the leak.

This could also possible happens in real world, for example, user touch a page
with finger that triggers pointer capture, and then tab get closed before touch
is released.

Differential Revision: https://phabricator.services.mozilla.com/D102403
2021-01-21 16:38:59 +00:00
Edgar Chen f43f83b1a9 Bug 1686037 - Part 1: Move nsGenericHTMLElement::GetPresContext to Element; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D102321
2021-01-21 14:19:57 +00:00
Edgar Chen dc442f6bea Bug 1556703 - Part 2: Convert new added WPT into mochitest test; r=smaug
Geckodriver doesn't support touch input yet, so convert new added the touch tests
into mochitest, these mochitest wpt could be removed once we could pass the
corresponding tests in wpt.

Depends on D101667

Differential Revision: https://phabricator.services.mozilla.com/D102044
2021-01-18 21:05:59 +00:00
Edgar Chen fcbd3d2887 Bug 1556703 - Part 1: Update active pointer state properly; r=smaug
Calling setPointerCapture or releasePointerCapture in pointerup event handler would
throw error due to the active pointer is removed in PreHandlerEvent which is too
early. So defer removing active pointer to PostHandeEvent to make the active pointer
available in pointerup or pointercancel event handler.

This patch adds WPTs which has been verified on Chrome. geckodriver doesn't support
touch input yet, so mark tests for touch as expected ERROR for now.

Differential Revision: https://phabricator.services.mozilla.com/D101667
2021-01-18 22:14:39 +00:00
Edgar Chen 59f2cc6232 Bug 1687069 - Part 2: Remove test_wpt_pointerevent_setpointercapture_to_same_element_twice-manual.html; r=masayuki
As the wpt is not longer a manual test, and we could pass the wpt one.

Depends on D102070

Differential Revision: https://phabricator.services.mozilla.com/D102071
2021-01-18 07:06:52 +00:00
Edgar Chen 1c65254657 Bug 1687068 - Part 2: Remove test_wpt_pointerevent_setpointercapture_override_pending_capture_element-manual.html; r=masayuki
As the wpt is not longer a manual test, and we could pass the wpt one.

Depends on D102068

Differential Revision: https://phabricator.services.mozilla.com/D102069
2021-01-18 07:05:18 +00:00
Edgar Chen ddbdc9a935 Bug 1687066 - Part 2: Remove test_wpt_pointerevent_releasepointercapture_release_right_after_capture-manual.html; r=masayuki
As it is not longer a manual test in wpt, and we could pass the wpt one.

Differential Revision: https://phabricator.services.mozilla.com/D102059
2021-01-18 07:04:50 +00:00
Edgar Chen 79d4538dcb Bug 1687062 - Part 2: Remove test_wpt_pointerevent_element_haspointercapture_release_pending_capture-manual.html; r=masayuki
As it is not longer a manual test in wpt, and we could pass the wpt one.

Differential Revision: https://phabricator.services.mozilla.com/D102057
2021-01-18 06:58:21 +00:00
Edgar Chen a7eb9d0cb4 Bug 1687052 - Part 5: Remove test_wpt_pointerevent_capture_suppressing_mouse-manual.html; r=masayuki
pointerevent_capture_suppressing_mouse-manual.html are no longer a manual test
in wpt after using web-driver, and we could pass most of test in wpt one,
- https://wpt.fyi/results/pointerevents/pointerevent_capture_suppressing_mouse.html?label=experimental&label=master&aligned

Depends on D102050

Differential Revision: https://phabricator.services.mozilla.com/D102051
2021-01-15 23:35:45 +00:00
Edgar Chen 1173ded146 Bug 1687052 - Part 4: Remove test_wpt_pointerevent_pointerenter_does_not_bubble-manual.html; r=masayuki
pointerevent_pointerenter_does_not_bubble-manual.html are no longer a manual test
in wpt after using web-driver, and we could pass most of test in wpt one,
- https://wpt.fyi/results/pointerevents/pointerevent_pointerenter_does_not_bubble.html?label=experimental&label=master&aligned

Depends on D102049

Differential Revision: https://phabricator.services.mozilla.com/D102050
2021-01-15 23:35:09 +00:00
Edgar Chen bc26284dab Bug 1687052 - Part 3: Remove test_wpt_pointerevent_pointerleave_does_not_bubble-manual.html; r=masayuki
pointerevent_pointerleave_does_not_bubble-manual.html are no longer a manual test
in wpt after using web-driver, and we could pass most of test in wpt one,
- https://wpt.fyi/results/pointerevents/pointerevent_pointerleave_does_not_bubble.html?label=experimental&label=master&aligned

Depends on D102048

Differential Revision: https://phabricator.services.mozilla.com/D102049
2021-01-15 23:34:27 +00:00
Edgar Chen a1cdfafa0c Bug 1687052 - Part 2: Remove test_wpt_pointerevent_releasepointercapture_onpointerup_mouse-manual.html; r=masayuki
pointerevent_releasepointercapture_onpointerup_mouse-manual.html are no longer a
manual test in wpt after using web-driver, and we could pass the wpt one,
- https://wpt.fyi/results/pointerevents/pointerevent_releasepointercapture_onpointerup_mouse.html?label=experimental&label=master&aligned

Depends on D102047

Differential Revision: https://phabricator.services.mozilla.com/D102048
2021-01-15 23:33:59 +00:00
Edgar Chen 16481bafe5 Bug 1687052 - Part 1: Remove test_wpt_test_pointerevent_suppress_compat_events_on_*; r=masayuki
pointerevent_suppress_compat_events_on_* are no longer a manual test in wpt after
using web-driver, and we could pass the wpt one,
- https://wpt.fyi/results/pointerevents/pointerevent_suppress_compat_events_on_click.html?label=experimental&label=master&aligned
- https://wpt.fyi/results/pointerevents/pointerevent_suppress_compat_events_on_drag_mouse.html?label=experimental&label=master&aligned

Differential Revision: https://phabricator.services.mozilla.com/D102047
2021-01-15 23:32:10 +00:00
Olli Pettay b6bb80bd47 Bug 1686716 - Calling event.preventDefault in drop event handler causes a crash after target iframe has been removed, r=masayuki
Outerwindow implements nsIScriptObjectPrincipal.

Differential Revision: https://phabricator.services.mozilla.com/D101774
2021-01-15 10:04:50 +00:00
Edgar Chen abee684546 Bug 1686722 - Part 2: Move wpt resources to wpt/; r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D101820
2021-01-15 01:09:07 +00:00
Edgar Chen cb33f7db53 Bug 1686722 - Part 1: Rename mochitest tests that run wpt to test_wpt_*; r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D101819
2021-01-15 01:01:32 +00:00
Mirko Brodesser f6f7a6f1aa Bug 1685303: part 8) Annotate `nsFrameSelection::SetDragState` with `MOZ_CAN_RUN_SCRIPT`. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D101467
2021-01-14 13:24:16 +00:00
Bogdan Tara 0700454a9e Backed out 4 changesets (bug 1685303) for bustage complaining about offsets CLOSED TREE
Backed out changeset a4640aac6619 (bug 1685303)
Backed out changeset bd2020c26531 (bug 1685303)
Backed out changeset 3f2e96b93f19 (bug 1685303)
Backed out changeset 8cf49a7677c9 (bug 1685303)
2021-01-14 12:58:25 +02:00
Mirko Brodesser 353996bf27 Bug 1685303: part 8) Annotate `nsFrameSelection::SetDragState` with `MOZ_CAN_RUN_SCRIPT`. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D101467
2021-01-14 10:20:30 +00:00
Edgar Chen 00dc0793aa Bug 1686045 - Part 1: Rewrite popup blocker tests for mouse/pointer event; r=smaug
And add more tests for different button value.

Differential Revision: https://phabricator.services.mozilla.com/D101507
2021-01-13 23:33:10 +00:00
Masayuki Nakano 4b218fc374 Bug 1357365 - part 2: Make `TypeInState::OnSelectionChange()` stop inserting new content into the link if clicked outside it r=m_kato
When mouse button is clicked outside a link element but caret is positioned
start or end of the link, our traditional behavior keeps inserting new content
into the link.  But this is different from the other browsers, and it does
not make sense to treat such selection change is intended to keep typing in
the link element.

Therefore, this patch makes `TypeInState::OnSelectionChange()` handle
selection change reason is `mousedown` and `mouseup` cases.  However,
it cannot know whether the event was fired in the parent link element or
not.  Therefore, this patch makes `HTMLEditorEventListener` notifies
`TypeInState` of mouse events via `HTMLEditor`.

Differential Revision: https://phabricator.services.mozilla.com/D101001
2021-01-13 01:55:27 +00:00
Razvan Maries 2947602bcd Backed out 3 changesets (bug 1677253) for multiple perma failures. CLOSED TREE
Backed out changeset 01b34d4be08c (bug 1677253)
Backed out changeset aabba45e0b43 (bug 1677253)
Backed out changeset 171689d8d386 (bug 1677253)
2021-01-12 17:18:04 +02:00
Kagami Sascha Rosylight 8bbd008864 Bug 1677253 - Part 1: Fire select event from SelectionChangeEventDispatcher r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D101245
2021-01-12 08:59:34 +00:00
Masatoshi Kimura 3f402bfcc4 Bug 1683464 - Reduce nsContentPolicyType usage. r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D100181
2021-01-07 15:18:52 +00:00
Kartik Gautam 7ae6aea145 Bug 1684173 - Add newline character at end of files when missing r=sylvestre,geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D100484
2021-01-07 08:53:08 +00:00
Emilio Cobos Álvarez 5279ef0ebd Bug 1684973 - Return mouse offset coordinates in SVG relative to the SVG root. r=smaug
This matches other browsers. Needs a test, if the try server comes back
green.

Differential Revision: https://phabricator.services.mozilla.com/D100762
2021-01-05 15:44:28 +00:00
Razvan Maries 6a4eb25b10 Backed out 4 changesets (bug 1683464) for multiple perma failures. CLOSED TREE
Backed out changeset a5d315c017d0 (bug 1683464)
Backed out changeset 5f91001e4923 (bug 1683464)
Backed out changeset 1b7fe904e8af (bug 1683464)
Backed out changeset eb1c479fddca (bug 1683464)
2021-01-05 16:47:22 +02:00
Masatoshi Kimura dfb97ca7cf Bug 1683464 - Reduce nsContentPolicyType usage. r=ckerschb
Depends on D100180

Differential Revision: https://phabricator.services.mozilla.com/D100181
2021-01-05 12:21:46 +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
Emilio Cobos Álvarez 925ab25267 Bug 1684220 - Remove some dead plugins code. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D100472
2021-01-04 20:12:05 +00:00
Emilio Cobos Álvarez bd8cffdd58 Bug 1351248 - Simplify nsIFrame::IsFocusable API. r=layout-reviewers,mats
We always compute the tabindex value, so just return it to the caller
all the time. This allows us to use early-returns which makes the code a
bit easier to follow.

This patch shouldn't change behavior.

Differential Revision: https://phabricator.services.mozilla.com/D100423
2021-01-03 23:30:51 +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
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
Edgar Chen 0fd119dae0 Bug 582459 - Reset the focused element when a frame loses document focus; r=mikedeboer,NeilDeakin,hsivonen,jaws
Resetting focus would also clear selection on editable element, so get
current selected text before moving focus to findbar to make
prefill-with-selection work if the content is loaded in chrome process.

Differential Revision: https://phabricator.services.mozilla.com/D89557
2020-12-21 21:35:49 +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 5599ddec3c Bug 1683226 - part 3: Get rid of pathes for handling plugin from `IMEStateManager`, `IMEContentObserver` and `ContentEventHandler` r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D100102
2020-12-21 05:52:49 +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
Edgar Chen 2b16b12d46 Bug 1680405 - Make mouse capture working on OOP iframe; r=smaug
This patch add a way to track remote target for mouse capturing. The tracking
remote target will be reset when capturing content is changed or
ReleaseCapturingContent() is called.

In order to make `mouseup` would also be dispatched to correct remote target, we
do ReleaseCapturingContent in EventSetateManager::PostHandleEvent, instead of
in nsIFrame::HandleRelease.

Differential Revision: https://phabricator.services.mozilla.com/D98592
2020-12-18 18:21:23 +00:00
Bogdan Tara 0e0311351e Backed out 9 changesets (bug 1656107) for frequent assertion failures on layout/style/nsComputedDOMStyle.cpp CLOSED TREE
Backed out changeset 2d9843871809 (bug 1656107)
Backed out changeset 87031ccf6c8e (bug 1656107)
Backed out changeset 1e06017a213c (bug 1656107)
Backed out changeset b51bae240379 (bug 1656107)
Backed out changeset 8d98b76de39a (bug 1656107)
Backed out changeset 0f4ea8cdd34a (bug 1656107)
Backed out changeset 95eeff5318e5 (bug 1656107)
Backed out changeset 469fa7a429c2 (bug 1656107)
Backed out changeset ec3d7e825bc9 (bug 1656107)
2020-12-17 22:19:09 +02:00
Steven MacLeod 1c72bc8ce8 Bug 1656107 - remove FindContentForSubDocument use from EventStateManager. r=farre
Differential Revision: https://phabricator.services.mozilla.com/D98617
2020-12-16 01:06:39 +00:00
Razvan Maries a7af908f30 Backed out changeset 5e9006d8c218 (bug 1680405) for perma failures on PresShell.cpp and browser_mouse_enterleave_switch_tab.js. CLOSED TREE 2020-12-17 13:24:39 +02:00
Edgar Chen 45ea02297b Bug 1680405 - Make mouse capture working on OOP iframe; r=smaug
This patch add a way to track remote target for mouse capturing. The tracking
remote target will be reset when capturing content is changed or
ReleaseCapturingContent() is called.

In order to make `mouseup` would also be dispatched to correct remote target, we
do ReleaseCapturingContent in EventSetateManager::PostHandleEvent, instead of
in nsIFrame::HandleRelease.

Differential Revision: https://phabricator.services.mozilla.com/D98592
2020-12-17 09:28:00 +00:00
Olli Pettay f02bd8c282 Bug 1457859 - PointerEvent.getCoalescedEvents timeStamps are zero, r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D99922
2020-12-16 19:42:54 +00:00
Dorel Luca c7cf087b6e Backed out changeset 7253a9d881d0 (bug 1680405) for assertion failures in worker/checkouts/gecko/layout/base/PresShell.cpp. CLOSED TREE 2020-12-16 07:19:44 +02:00
Edgar Chen 9b5d278abd Bug 1680405 - Make mouse capture working on OOP iframe; r=smaug
This patch add a way to track remote target for mouse capturing. The tracking
remote target will be reset when capturing content is changed or
ReleaseCapturingContent() is called.

In order to make `mouseup` would also be dispatched to correct remote target, we
do ReleaseCapturingContent in EventSetateManager::PostHandleEvent, instead of
in nsIFrame::HandleRelease.

Differential Revision: https://phabricator.services.mozilla.com/D98592
2020-12-16 00:29:40 +00:00
Dorel Luca cbf69a75c1 Backed out changeset 2ac614e69ecb (bug 582459) for Mochitest failures in dom/tests/mochitest/chrome/test_focus.xhtml. CLOSED TREE 2020-12-16 03:44:13 +02:00
Edgar Chen f9b8ba2a7c Bug 582459 - Reset the focused element when a frame loses document focus; r=mikedeboer,NeilDeakin,hsivonen,jaws
Resetting focus would also clear selection on editable element, so get
current selected text before moving focus to findbar to make
prefill-with-selection work if the content is loaded in chrome process.

Differential Revision: https://phabricator.services.mozilla.com/D89557
2020-12-15 19:55:35 +00:00
Olli Pettay ff1b3ed869 Bug 1679204 - Consider to add signal to addEventListener, r=edgar
This passes the tests which are in https://github.com/web-platform-tests/wpt/pull/26472

Because of complications in #include handling, AbortFollower needs to be in a different
header file than AbortSignal, yet AbortSignalImpl needs to be available when AbortFollower is used.
Another option would have been to make DOMEventTargetHelper.h a bit different and uninline some hot methods
there or move them to another file, but that would have been equally bad and Abort* is used way less often.
AbortFollower and AbortSignalImpl are thus just moved to a new header.

Memory management is such that Listener in EventListenerManager owns the possible ListenerSignalFollower
instance which follows the relevant signal. In order to be able remove event listener,
ListenerSignalFollower has many similar fields as Listener.
ListenerSignalFollower can't easily have just a pointer to Listener* since Listener isn't stored as a pointer
in EventListenerManager.
ListenerSignalFollower is cycle collectable so that Listener->ListenerSignalFollower can be traversed/unlinked
and also strong pointers in ListenerSignalFollower itself can be traversed/unlinked.

There is an XXX in the .webidl, since nullability of signal is unclear in the spec pr.
Whether or not it ends up being nullable shouldn't change the actual C++ implementation.

Differential Revision: https://phabricator.services.mozilla.com/D97938
2020-12-14 15:45:15 +00:00
Emilio Cobos Álvarez 3987c781d0 Bug 1635914 - Move active flag handling explicitly to BrowsingContext. r=nika
And have it mirror in the parent process more automatically.

The docShellIsActive setter in the browser-custom-element side needs to
be there rather than in the usual DidSet() calls because the
AsyncTabSwitcher code relies on getting an exact amount of notifications
as response to that specific setter. Not pretty, but...

BrowserChild no longer sets IsActive() on the docshell itself for OOP
iframes. This fixes bug 1679521. PresShell activeness is used to
throttle rAF as well, which handles OOP iframes nicely as well.

Differential Revision: https://phabricator.services.mozilla.com/D96072
2020-12-11 15:43:19 +00:00
Edgar Chen 11c32bb13e Bug 1673531 - Wait for focus before starting pointer lock tests; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D99367
2020-12-10 17:00:48 +00:00
Simon Giesecke 7499023887 Bug 1673931 - Avoid including DebuggerNotificationBinding.h from header files. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D97611
2020-12-10 11:09:32 +00:00
Makoto Kato bbb3785586 Bug 1678844 - Don't call SetInputContext on keyboard event. r=masayuki
This is another regression by bug 1658948 and Windows only.

When user script calls element.focus() during keyboard event, our TSF client
implementation commits composition string.

It is unnecessary to call SetInputContext when real keybaord event is fired.

Because,

- If keybaord event is fired, virtual keybaord is already shown
- We don't open virtual keyboard when physical keyboard is available on Android

So I shouldn't call SetInputContext on user interaction by keyboard.

Differential Revision: https://phabricator.services.mozilla.com/D98882
2020-12-09 07:02:19 +00:00
Henri Sivonen e0bd11a140 Bug 1660805 - In OOP iframes, run window raising to completion synchronously to ensure correct order of focus and mouseup when focusing an OOP iframe by click. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D97553
2020-12-07 16:29:16 +00:00
Edgar Chen fddfd41f71 Bug 1659940 - Use mLastOverElement to notify the mouse leaving for an iframe; r=smaug
mLastOverFrame is a WeakFrame, it could possibly be nulled-out, for example
after restyling, and the sub-document won't be able to be notified the mouse
leaving.

Differential Revision: https://phabricator.services.mozilla.com/D98787
2020-12-07 14:51:23 +00:00
Simon Giesecke 1c53236b70 Bug 1679272 - Include ScopeExit.h exactly where used. r=andi
Differential Revision: https://phabricator.services.mozilla.com/D98888
2020-12-07 14:25:59 +00:00
Kagami Sascha Rosylight cd517fc839 Bug 1680167 - Part 5: MOZ_CAN_RUN_SCRIPT_BOUNDARY in dom/* r=masayuki
Depends on D98627

Differential Revision: https://phabricator.services.mozilla.com/D98628
2020-12-03 21:34:06 +00:00
Masayuki Nakano 912a5bc76d Bug 1678553 - part 13: Make `WidgetQueryContentEvent` use `Maybe` to store some data r=m_kato,geckoview-reviewers
Sorry for this big patch.

This makes `WidgetQueryContentEvent::Reply` is stored with `Maybe` to get
rid of `WidgetQueryContentEvent`.  And `Reply` stores offset and string
with `Maybe` and ``OffsetAndData<uint32_t>`, and also tentative caret offset
with `Maybe`.  Then, we can get rid of `WidgetQueryContentEvent::NOT_FOUND`.

Note that I tried to make `OffsetAndData` have a method to create `NSRange`
for cocoa widget.  However, it causes the column limit`to 100 or longer
and that causes unrelated changes in `TextEvents.h` and `IMEData.h`.
Therefore, I create an inline function in `TextInputHandler.mm` instead.

Differential Revision: https://phabricator.services.mozilla.com/D98264
2020-12-02 05:32:19 +00:00
Tom Schuster d55b53f0f0 Bug 1670252 - Throw an NotAllowedError for missing user-activation when using clipboard.write. r=annyG
Differential Revision: https://phabricator.services.mozilla.com/D97862
2020-11-30 19:27:26 +00:00
Henri Sivonen f62955287d Bug 1661227 - Change test_focus_blur_on_click_in_deep_cross_origin_iframe to treat extra focus event as a failure. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D98042
2020-11-30 13:08:18 +00:00
Masayuki Nakano 85b84f8248 Bug 1677684 - part 2: Make `ContentCache` cache character rects in last commit composition string for undoing the commit r=m_kato
Usually, IME sets selection and considers candidate list position at starting
new composition.  However, Apple Japanese IME sometimes consider the candidate
list position at retrieving the character rects before setting selection.
Therefore, we need to store last commit string's character rects, but don't
need to store it in long time because Kakutei-Undo is supported by Japanese
IMEs and they work only immediately after committing a composition.  E.g.,
after moving caret, it won't be available.

Depends on D97838

Differential Revision: https://phabricator.services.mozilla.com/D97839
2020-11-24 01:31:46 +00:00
Simon Giesecke dd80614fa0 Bug 1678062 - Remove unnecessary includes. r=andi
Differential Revision: https://phabricator.services.mozilla.com/D97467

Depends on D96561
2020-11-23 16:12:02 +00:00
Simon Giesecke 49ca733d11 Bug 1673931 - Hide dependency on EventListenerManager from DOMEventTargetHelper.h. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D96551

Depends on D96550
2020-11-23 16:10:04 +00:00
Simon Giesecke 6fac745ea4 Bug 1673931 - Remove dependency of BindingUtils.h on Document.h.
Differential Revision: https://phabricator.services.mozilla.com/D95048

Depends on D95047
2020-11-23 16:08:03 +00:00
Simon Giesecke 971b645fe3 Bug 1660470 - Add missing include directives/forward declarations. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D87865
2020-11-23 16:21:38 +00:00
Masayuki Nakano e256502715 Bug 1674044 - Make `IMEStateManager` put off to handle focused browser change while the application becomes activated r=hsivonen
`IMEStateManager::OnFocusMovedBetweenBrowsers()` is called by
`BrowserParent::UnsetTopLevelWebFocusAll()` from
`nsFocusManager::WindowRaised()` when a window becomes active from the app
itself is deactivated.  At this time, `aBlur` is  set to the last
`BrowserParent` which had focus before inactivated, and `aFocus` is always
`nullptr` because of assuming the following code in
`nsFocusManager::WindowRised()` will call `OnFocusMovedBetweenBrowsers()` to
set focus to focused browser part at that time.  However, the first call of
`OnFocusMovedBetweenBrowsers()` requesting to commit composition if there is
a composition because it believes that the focused process is just blurred and
nobody would take focus.

So, `IMEStateManager::OnFocusMovedBetweenBrowsers()` needs to wait to handle
its jobs until another its call for setting focus to the remote process when
the app is activated.

Therefore, this patch makes `IMEStateManager` manage whether the process is
active or not from the point of view of IME handling.  I.e., in the main
process, it can be treated as active when a window is the focused window in
the desktop, and in a content process, it can be treated as active when the
process has focus.  So, this is managed by `sIsActive`.

Then, `IMEStateManager` needs information of first blurred `BrowserParent`
and `last focused `BrowserParent` in the case for putting off to handle its
jobs.  Therefore, this patch adds
`IMEStateManager::sPendingFocusedBrowserSwitchingData` to manage them.

Finally, this patch makes `IMEStateManager::OnFocusMovedBetweenBrowsers()`
cancel pending handling if first blurred `BrowserParent` and last focused
`RrowserParent`are same.  And also making
`IMEStateManager::OnFocusChangeInternal()` call `OnFocusMoveBetweenBrowsers()`
if there is pending jobs of `OnFocusMoveBetweenBrowsers()`.

UThis requires an API to create the case to all windows deactive to test it.
However, there is no way to do that.  Therefore, this patch does not have
any tests.

Differential Revision: https://phabricator.services.mozilla.com/D97687
2020-11-20 14:55:31 +00:00
Masayuki Nakano 2efcda6dc7 Bug 1335347 - Make `nsMenuBarListener::KeyUp` wait replay event if a content process has focus r=smaug
`keyup` event of `Alt` key should be fired in content process even if it'll
activate the menubar, and it should be cancelable as same as before enabling
e10s.

Unfortunately, the new test is complicated even they test simple things.
The reason is, this test requires the window running it is the active window.
However, the window may become inactive on Linux, therefore, this test
needs to manage window state by itself.

And another reason is, after inactivating the menubar, somebody keeps
consuming keyboard events in chrome.  Although, popups shouldn't be
opened by this test, but waiting all popups hidden makes the remaining
intermittent failure gone.  Therefore, this patch waits all popups become
hidden after inactivating the menubar and before new test.

Differential Revision: https://phabricator.services.mozilla.com/D95984
2020-11-20 03:49:55 +00:00
Csoregi Natalia 1d34bd022d Merge autoland to mozilla-central. a=merge 2020-11-19 11:56:07 +02:00
Csoregi Natalia 511fc14c29 Backed out changeset e176bd45edd8 (bug 1335347) for failures on browser_alt_keyup_in_content.js. a=backout 2020-11-19 11:47:55 +02:00
Markus Stange ec6e4c4f05 Bug 1677396 - Redirect composition payloads through the refresh driver. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D97382
2020-11-19 04:02:46 +00:00
Razvan Maries b7eeb731df Backed out 23 changesets (bug 1675409) for build bustages on Preferences.cpp. CLOSED TREE
Backed out changeset c1a131a55767 (bug 1675409)
Backed out changeset 47d210802a5d (bug 1675409)
Backed out changeset e8ebb1c58d30 (bug 1675409)
Backed out changeset 69a1e9aeff2a (bug 1675409)
Backed out changeset 68f330b387a8 (bug 1675409)
Backed out changeset e4750d9ef5a1 (bug 1675409)
Backed out changeset bb6bb71e5ab3 (bug 1675409)
Backed out changeset 988d7f4716df (bug 1675409)
Backed out changeset ca41382e891c (bug 1675409)
Backed out changeset 90f3fbbbbeda (bug 1675409)
Backed out changeset 9b109d61a6f6 (bug 1675409)
Backed out changeset 3dd66abfdaa2 (bug 1675409)
Backed out changeset 44181df5f0db (bug 1675409)
Backed out changeset bb2603d947fc (bug 1675409)
Backed out changeset 97055cf20a56 (bug 1675409)
Backed out changeset f88fcf09de0d (bug 1675409)
Backed out changeset 7963e1c49786 (bug 1675409)
Backed out changeset 4c379c1061c3 (bug 1675409)
Backed out changeset b8be8ae7da63 (bug 1675409)
Backed out changeset 0b90aa89421e (bug 1675409)
Backed out changeset c10fb46467c9 (bug 1675409)
Backed out changeset 894ac233b290 (bug 1675409)
Backed out changeset 075d1d8e34c2 (bug 1675409)
2020-11-18 20:06:28 +02:00
David Parks 1e71ef1cb8 Bug 1675349: Replace plugin behavior with a basic fallback r=jmathies,mixedpuppy
The browser currently only enables plugin behavior for Flash and our internal test plugins.  This patch replaces support for those plugins with a simple fallback that shows a transparent region where the plugin would have been.  It removes the file system search(es) for the plugin dynamic libraries and short-circuits the logic to determine if plugins should do something special -- all implementations now behave the same in the presence of plugin elements.

The new behavior is:
1. If the <object> or <embed> element lists a type of something other than "x-shockwave-flash" or "x-test" then the behavior is unchanged.  This means that non-plugin types behave properly and unknown types (for example, typos) are also unaffected (they reduce to 0x0 elements).
2. If the <object> element has an HTML fallback in the DOM (see spec for <object> elements) then the fallback is always shown.
3. Otherwise, the element is shown as a transparent region with the size specified in attributes.

Differential Revision: https://phabricator.services.mozilla.com/D95902
2020-11-18 15:55:34 +00:00
Sylvestre Ledru bebb9f9181 Bug 1519636 - Reformat with clang-format-11 to the Google coding style r=andi,sg,geckoview-reviewers,snorp
It is bringing some minor changes

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D90795
2020-11-18 09:05:59 +00:00
Bogdan Tara 56346a0425 Backed out 19 changesets (bug 1675349) for lint failures on browser_ext_browsingData_pluginData and test_archive CLOSED TREE
Backed out changeset 244e0f2b410c (bug 1675349)
Backed out changeset ba5724069dd4 (bug 1675349)
Backed out changeset 37fca259c7e9 (bug 1675349)
Backed out changeset f2b16caca1fc (bug 1675349)
Backed out changeset 28835d4935be (bug 1675349)
Backed out changeset eb913f58953a (bug 1675349)
Backed out changeset 19e3cb80f469 (bug 1675349)
Backed out changeset d9723f3a3a7e (bug 1675349)
Backed out changeset c888dfcdf70e (bug 1675349)
Backed out changeset 48f153341af6 (bug 1675349)
Backed out changeset 7fc67a9b2932 (bug 1675349)
Backed out changeset 1cee4d97f801 (bug 1675349)
Backed out changeset 59a0cb79c7c1 (bug 1675349)
Backed out changeset 43d349fa37b1 (bug 1675349)
Backed out changeset c84bfb6eae59 (bug 1675349)
Backed out changeset 38e9af69ae57 (bug 1675349)
Backed out changeset 3255c1ab3059 (bug 1675349)
Backed out changeset 2f3eaf9c342c (bug 1675349)
Backed out changeset 769e5c0db4c2 (bug 1675349)
2020-11-18 06:06:36 +02:00
David Parks ca8ad84d31 Bug 1675349: Replace plugin behavior with a basic fallback r=jmathies,mixedpuppy
The browser currently only enables plugin behavior for Flash and our internal test plugins.  This patch replaces support for those plugins with a simple fallback that shows a transparent region where the plugin would have been.  It removes the file system search(es) for the plugin dynamic libraries and short-circuits the logic to determine if plugins should do something special -- all implementations now behave the same in the presence of plugin elements.

The new behavior is:
1. If the <object> or <embed> element lists a type of something other than "x-shockwave-flash" or "x-test" then the behavior is unchanged.  This means that non-plugin types behave properly and unknown types (for example, typos) are also unaffected (they reduce to 0x0 elements).
2. If the <object> element has an HTML fallback in the DOM (see spec for <object> elements) then the fallback is always shown.
3. Otherwise, the element is shown as a transparent region with the size specified in attributes.

Differential Revision: https://phabricator.services.mozilla.com/D95902
2020-11-18 03:08:29 +00:00
Masayuki Nakano 1e8bac4c18 Bug 1335347 - Make `nsMenuBarListener::KeyUp` wait replay event if a content process has focus r=smaug
`keyup` event of `Alt` key should be fired in content process even if it'll
activate the menubar, and it should be cancelable as same as before enabling
e10s.

Unfortunately, the new test is complicated even they test simple things.
The reason is, this test requires the window running it is the active window.
However, the window may become inactive on Linux, therefore, this test
needs to manage window state by itself.

And another reason is, after inactivating the menubar, somebody keeps
consuming keyboard events in chrome.  Although, popups shouldn't be
opened by this test, but waiting all popups hidden makes the remaining
intermittent failure gone.  Therefore, this patch waits all popups become
hidden after inactivating the menubar and before new test.

Differential Revision: https://phabricator.services.mozilla.com/D95984
2020-11-17 23:09:25 +00:00
Gerald Squelart 9506ea6302 Bug 1675409 - Migrated TracingMarkerPayload to Markers 2.0 API - r=gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D96053
2020-11-17 22:25:06 +00:00
Edgar Chen c66538cec2 Bug 1660752 - Enable dom/events/test_bug238987.html on fission and cross-origin; r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D96701
2020-11-17 13:11:13 +00:00
Gerald Squelart a10f7166db Bug 1675409 - Migrated TracingMarkerPayload to Markers 2.0 API - r=gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D96053
2020-11-18 21:55:51 +00:00
Razvan Maries efd002addd Backed out 2 changesets (bug 1677396, bug 1677868) for perma failures on browser_startup_syncIPC.js. CLOSED TREE
Backed out changeset e43e56bfbfc6 (bug 1677396)
Backed out changeset 0ecfa354c74c (bug 1677868)
2020-11-19 01:03:25 +02:00
Markus Stange 127c67fe26 Bug 1677396 - Redirect composition payloads through the refresh driver. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D97382
2020-11-18 21:01:46 +00:00
Mihai Alexandru Michis c0d25b01b2 Backed out 24 changesets (bug 1666566, bug 1675409) for causing hazard failures in profiler/core/platform.cpp
CLOSED TREE

Backed out changeset 4d8af8533fd4 (bug 1666566)
Backed out changeset f031a3a8a20f (bug 1675409)
Backed out changeset 2b7e1a031921 (bug 1675409)
Backed out changeset bda5a24b2d0a (bug 1675409)
Backed out changeset 4282e2284314 (bug 1675409)
Backed out changeset 0637f1b26e9f (bug 1675409)
Backed out changeset 67ae04c8f607 (bug 1675409)
Backed out changeset 6c7b3f3618ef (bug 1675409)
Backed out changeset 2f325c22d169 (bug 1675409)
Backed out changeset 1e48ff70ad8f (bug 1675409)
Backed out changeset 1dfc32d6871d (bug 1675409)
Backed out changeset 4f1f218a777b (bug 1675409)
Backed out changeset e6ac8722b38e (bug 1675409)
Backed out changeset cf132e15fb57 (bug 1675409)
Backed out changeset a126e6b00ba9 (bug 1675409)
Backed out changeset fbc7fbb04f33 (bug 1675409)
Backed out changeset 554c69681474 (bug 1675409)
Backed out changeset 44d0521c701f (bug 1675409)
Backed out changeset 04653dfe4720 (bug 1675409)
Backed out changeset 41ca2c043a00 (bug 1675409)
Backed out changeset 264ae4c805d4 (bug 1675409)
Backed out changeset 5f3bbdac0d52 (bug 1675409)
Backed out changeset 11311c11a6e8 (bug 1675409)
Backed out changeset 0355fbc44baf (bug 1675409)
2020-11-17 19:31:28 +02:00
Gerald Squelart e89990aa2c Bug 1675409 - Migrated TracingMarkerPayload to Markers 2.0 API - r=gregtatum
Differential Revision: https://phabricator.services.mozilla.com/D96053
2020-11-17 11:39:42 +00:00
Sylvestre Ledru 0129dd3f83 Bug 1519636 - Reformat recent changes to the Google coding style r=andi,necko-reviewers,dragana
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D96608
2020-11-16 22:09:25 +00:00
Karl Tomlinson dfb919d222 Bug 1213512 use UTF8 for MediaMgrError and SpeechRecognitionError message r=jib
for consistency with ErrorResult and dom::Promise, which will mean no reverse
conversion is required for rejecting Promises.

Differential Revision: https://phabricator.services.mozilla.com/D95967
2020-11-15 21:59:05 +00:00
Emilio Cobos Álvarez ac6e97d5f9 Bug 1618639 - Make focus-visible match the spec more closely. r=edgar
The spec text has been improved a while ago, so I think we should do
this. This keeps the current moz-focusring behavior when the pref is
disabled, but when enabled it becomes effectively an alias of
focus-visible.

Differential Revision: https://phabricator.services.mozilla.com/D96697
2020-11-13 12:53:45 +00:00
Tim Huang 0de41786ee Bug 1641270 - Part 8: Make the Drag&Drop to use the correct cookieJarSettings to download the url. r=smaug,dimi
Differential Revision: https://phabricator.services.mozilla.com/D95618
2020-11-11 11:14:05 +00:00
Mihai Alexandru Michis 4038013e6f Backed out 9 changesets (bug 1641270) for causing dt failures in browser_jsonview_save_json.js
CLOSED TREE

Backed out changeset 89a6dab92f1a (bug 1641270)
Backed out changeset 5f9c5af66b77 (bug 1641270)
Backed out changeset dfeb879f4131 (bug 1641270)
Backed out changeset 143728b1b1ab (bug 1641270)
Backed out changeset 265ae2953416 (bug 1641270)
Backed out changeset 55ea7810c160 (bug 1641270)
Backed out changeset 7bef9112f296 (bug 1641270)
Backed out changeset 2663dc1e9a3e (bug 1641270)
Backed out changeset fcba6dba3649 (bug 1641270)
2020-11-11 13:10:11 +02:00
Makoto Kato 01848f9cac Bug 1673434 - change event isn't always user interaction event. r=edgar,masayuki
Software keyboard is shown by user interaction. But `change` event by
`element.click()` becomes user interaction event by bug 1543439 even if
it is called by script.

Since `change` event can be fired by click() method, we shouldn't be
that it is always user interaction.

Also, we have setUserInput that is chrome API to emulate user input. It
should be defined as user interaction.

Differential Revision: https://phabricator.services.mozilla.com/D95818
2020-11-09 09:04:22 +00:00
Tim Huang 4cdeceaaf8 Bug 1641270 - Part 8: Make the Drag&Drop to use the correct cookieJarSettings to download the url. r=smaug,dimi
Differential Revision: https://phabricator.services.mozilla.com/D95618
2020-11-10 21:11:14 +00:00
Steven MacLeod 971103bdd5 Bug 1606061 - move TouchEventsOverride to BrowsingContext. r=farre,devtools-backward-compat-reviewers
This change removes docshell's `mTouchEventsOverride` and replaces it
with a new `BrowsingContext` field `TouchEventsOverrideInternal`.
All uses of the old field have been replaced and an override should
now work under fission when there are cross-origin descendent frames.

Differential Revision: https://phabricator.services.mozilla.com/D96414
2020-11-10 15:57:30 +00:00
Emilio Cobos Álvarez 3c8e145cf7 Bug 1676149 - Set a pref that a test relies on.
Differential Revision: https://phabricator.services.mozilla.com/D96413
2020-11-09 14:12:58 +00:00
Emilio Cobos Álvarez 796add1c53 Bug 1676011 - Set a pref that a test relies on.
Differential Revision: https://phabricator.services.mozilla.com/D96340
2020-11-09 02:30:20 +00:00
Makoto Kato 499ac3195b Bug 1675313 - Don't update IMEState during composition when element.focus() is called. r=masayuki
This is regression by bug 1658948.

We shouldn't update IME state during composition even if element.focus() is
called to current focused element.

Also, although this depends on netive impelentation of IME handling, I would
like to add unit test for this situation since we might add mock tests for
native IME handling.

Differential Revision: https://phabricator.services.mozilla.com/D96308
2020-11-08 08:36:58 +00:00
Emilio Cobos Álvarez 0d187533ef Bug 1392460 - Add a couple prefs to expose DOM_DELTA_PIXEL rather than DOM_DELTA_LINES to the web. r=masayuki,smaug
And use them to disable DOM_DELTA_LINES on Nightly builds, to see the
impact, since this is pretty hard to measure just with telemetry.

Differential Revision: https://phabricator.services.mozilla.com/D95388
2020-11-07 16:12:34 +00:00
Gerald Squelart 5f4f178337 Bug 1674737 - Use SpliceableJSONWriter instead of JSONWriter when streaming markers - r=gregtatum
Some markers (e.g., GC major/minor/slice) need to splice JSON strings in their data.
So now, instead of JSONWriter, StreamJSONMarkerData functions will be given a mozilla::baseprofiler::SpliceableJSONWriter.

Differential Revision: https://phabricator.services.mozilla.com/D95511
2020-11-06 11:28:33 +00:00
Andrew Halberstadt 331bc892dd Bug 1675319 - [manifestparser] Properly support multiline skip-if statements, r=jmaher,extension-reviewers,zombie
This supports one manifestparser expression per line in the 'skip-if',
'fail-if' and 'run-if' keys. As a side effect the:

    skip-if = foo ||
        bar

syntax is no longer supported. Instead it can be:

    skip-if =
        foo  # bug 123
        bar  # bug 456

Differential Revision: https://phabricator.services.mozilla.com/D95927
2020-11-05 19:55:08 +00:00
Sylvestre Ledru fde06f6d21 Bug 1674637 - Use nested namespaces in dom/ r=sg,andi
Also add some missing namespace qualifications

Done with:
./mach static-analysis check --checks="-*,modernize-concat-nested-namespaces" --fix dom/
./mach clang-format -p $(hg status dom/|grep ^M|awk '{print $2}')

Differential Revision: https://phabricator.services.mozilla.com/D95456
2020-11-04 17:04:01 +00:00
Andreas Pehrson 0ff315007b Bug 1573300 - Make BlobEvent's data attribute non-nullable. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D95693
2020-11-04 15:05:18 +00:00
Csoregi Natalia 9390a1055f Backed out changeset 99f858e7cd02 (bug 1573300) for failures on test_eventctors.html. CLOSED TREE 2020-11-04 16:18:14 +02:00
Andreas Pehrson 24defb28ee Bug 1573300 - Make BlobEvent's data attribute non-nullable. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D95693
2020-11-04 13:43:39 +00:00
Butkovits Atila 964cca3198 Backed out changeset c0adbf7522dc (bug 1674637) for bustage on GMPParent.cpp. CLOSED TREE 2020-11-04 10:54:36 +02:00
Sylvestre Ledru 5f29324f60 Bug 1674637 - Use nested namespaces in dom/ r=sg,andi
Also add some missing namespace qualifications

Done with:
./mach static-analysis check --checks="-*,modernize-concat-nested-namespaces" --fix dom/
./mach clang-format -p $(hg status dom/|grep ^M|awk '{print $2}')

Differential Revision: https://phabricator.services.mozilla.com/D95456
2020-11-04 08:29:00 +00:00
Edgar Chen 2737da4055 Bug 1671657 - setPointerCapture should do nothing if the element's node document is not active document for the pointer; r=smaug
Depends on D94297

Differential Revision: https://phabricator.services.mozilla.com/D94001
2020-10-30 08:31:42 +00:00
Edgar Chen d3681664c5 Bug 1655239 - Make pointer capture fission compatible; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D94297
2020-10-26 21:00:50 +00:00
Ricky Stewart 02a7b4ebdf Bug 1654103: Standardize on Black for Python code in `mozilla-central`.
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.

5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-26 18:34:53 +00:00
Edgar Chen 60998d6d23 Bug 1665752 - Do not send IPC to request focus if the browsing context already has the focus; r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D94678
2020-10-26 14:19:59 +00:00
Alaa Emad aa2ac69761 Bug 1507189 - Replace nsIPresShell::ScrollDirection with an enumset over layers::ScrollDirection r=botond
Differential Revision: https://phabricator.services.mozilla.com/D94146
2020-10-26 04:04:16 +00:00
Bogdan Tara da1098d4aa Backed out 10 changesets (bug 1654103, bug 1672023, bug 1518999) for PanZoomControllerTest.touchEventForResult gv-junit failures CLOSED TREE
Backed out changeset ff3fb0b4a512 (bug 1672023)
Backed out changeset e7834b600201 (bug 1654103)
Backed out changeset 807893ca8069 (bug 1518999)
Backed out changeset 13e6b92440e9 (bug 1518999)
Backed out changeset 8b2ac5a6c98a (bug 1518999)
Backed out changeset 575748295752 (bug 1518999)
Backed out changeset 65f07ce7b39b (bug 1518999)
Backed out changeset 4bb80556158d (bug 1518999)
Backed out changeset 8ac8461d7bd7 (bug 1518999)
Backed out changeset e8ba13ee17f5 (bug 1518999)
2020-10-24 03:36:18 +03:00
Ricky Stewart c0cea3b0fa Bug 1654103: Standardize on Black for Python code in `mozilla-central`. r=remote-protocol-reviewers,marionette-reviewers,webdriver-reviewers,perftest-reviewers,devtools-backward-compat-reviewers,jgilbert,preferences-reviewers,sylvestre,maja_zf,webcompat-reviewers,denschub,ntim,whimboo,sparky
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.

5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-23 20:40:42 +00:00
Makoto Kato 462059cb77 Bug 1672095 - Always send NOTIFY_IME_OF_BLUR on GeckoView. r=masayuki
This is regression by bug 1672095. `GeckoEditableSupport` expects that
NOTIFY_IME_OF_BLUR is always sent. I would like to allow this even if
IME content observer is being destroyed.

To reproduce this, we have to lost application focus, I cannot write
geckoview-junit test.

Differential Revision: https://phabricator.services.mozilla.com/D94414
2020-10-23 08:07:02 +00:00
Dorel Luca 1ff59cb7a3 Backed out changeset 7558c8821a07 (bug 1654103) for multiple failures. CLOSED TREE 2020-10-22 03:51:06 +03:00
Ricky Stewart 50762dacab Bug 1654103: Standardize on Black for Python code in `mozilla-central`. r=remote-protocol-reviewers,marionette-reviewers,webdriver-reviewers,perftest-reviewers,devtools-backward-compat-reviewers,jgilbert,preferences-reviewers,sylvestre,maja_zf,webcompat-reviewers,denschub,ntim,whimboo,sparky
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.

To produce this patch I did all of the following:

1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.

2. Run ./mach lint --linter black --fix

3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.

4. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).

# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D94045
2020-10-21 21:27:27 +00:00
Andi-Bogdan Postelnicu c954c55398 Bug 1671641 - Make `dom/events` buildable outside of `unified-build` environment. r=sg
Differential Revision: https://phabricator.services.mozilla.com/D93998
2020-10-21 08:00:18 +00:00
Masayuki Nakano 04027a5656 Bug 1607131 - Make `beforeinput` event for `MozEditableElement.setUserInput()` not cancelable by default r=smaug
Blink and WebKit do not fire `beforeinput` event when user uses build-in
password manager and autocomplete.  But the `inputType` value for this case,
`"insertReplacementText"` is defined as cancelable in the spec, and it's
actually cancelable when it's fired for correcting a word with built-in
spellchecker of them.

For making only our users' autocomplete and password manager not blocked by
web apps, we should make them not cancelable by default, but I think that we
should keep dispatching such non-cancelable `beforeinput` for conforming to
the standard unless we'd get a web-compat report for this.

Differential Revision: https://phabricator.services.mozilla.com/D93206
2020-10-20 00:13:43 +00:00
Edgar Chen 8091754168 Bug 1669673 - Part 3: Wrap manual wpt pointerevent_drag_interaction-manual.html into mochitest test; r=smaug
Depends on D93296

Differential Revision: https://phabricator.services.mozilla.com/D93295
2020-10-19 09:22:45 +00:00
Edgar Chen 8d1634d001 Bug 1669673 - Part 1: setPointerCapture shoult not make a draggable element to be undraggable; r=smaug
See https://w3c.github.io/pointerevents/#the-pointercancel-event.

Differential Revision: https://phabricator.services.mozilla.com/D93294
2020-10-16 15:28:12 +00:00
Bogdan Tara 2df6edfdf1 Backed out 3 changesets (bug 1669673) for test_pointerevent_drag_interaction-manual.html failures
Backed out changeset 3150ac63c05e (bug 1669673)
Backed out changeset 6bc4e4281e96 (bug 1669673)
Backed out changeset a28ad4aebb13 (bug 1669673)
2020-10-16 18:24:21 +03:00
Edgar Chen 6ecb24d4d2 Bug 1669673 - Part 3: Wrap manual wpt pointerevent_drag_interaction-manual.html into mochitest test; r=smaug
Depends on D93296

Differential Revision: https://phabricator.services.mozilla.com/D93295
2020-10-15 23:08:28 +00:00
Edgar Chen fd2c481654 Bug 1669673 - Part 1: setPointerCapture shoult not make a draggable element to be undraggable; r=smaug
See https://w3c.github.io/pointerevents/#the-pointercancel-event.

Differential Revision: https://phabricator.services.mozilla.com/D93294
2020-10-16 12:27:55 +00:00
Masayuki Nakano 053daa2052 Bug 1627924 - Make `HTMLEditor::HideGrabberInternal()` reset dragging state r=emilio
When the grabber to move absolutely positioned element is disabled,
`HTMLEditor::HideGrabberInternal()` is called to delete it.  However,
it does not reset dragging state.  Therefore, `mousemove` event listener
will try to handle drag even after the grabber is removed.

This patch makes `HideGrabberInternal()` reset the dragging state to
make the event listener stop handling the drag action.

However, I hit a buggy assertion in `EventStateManager`.  It tries to
set active state to parent of the grabber (in this case, absolutely positioned
element).  However, editable element in `contenteditable` cannot have
active state.  Therefore, `leaf` becomes `nullptr`, but `newleaf` is the
absolutely positioned element.  Therefore, this patch adds this condition
into the `MOZ_ASSERT`.

Differential Revision: https://phabricator.services.mozilla.com/D93632
2020-10-16 02:34:15 +00:00
Johann Hofmann c710f7ef10 Bug 1666095 - Fix requireUserinteraction usage in DoScrollHistory. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D93421
2020-10-15 15:59:43 +00:00
Makoto Kato a01752f95a Bug 1658948 - Ace editor doesn't show software keyboard. r=masayuki
Actually software keyboard is opened by the following situations.
- Click event in editor
- Get new focus event.

Ace editor has small <textarea> element to handles some input events.
When clicking editable-like area (but this isn't ediable on Ace editor),
mousedown handler calls `event.preventDefault()` then set focus to
<textarea> element. So editor doesn't get click event and focus is still
keep in <textarea> element. At finally, we cannot open software keyboard
again since focus isn't changed.

So even if focus isn't changed, we should call SetInputContext to open
software keyboard.

Also, actually we doesn't have generic test code for notification of
software keyboard change (bug 1670539). I will add the test by bug 1670539.

Differential Revision: https://phabricator.services.mozilla.com/D93326
2020-10-14 02:27:22 +00:00
Gerald Squelart 2621d4cbf0 Bug 1640999 - Add `MarkerTypeDisplay` to all marker type definitions - r=gregtatum
Add `static mozilla::MarkerSchemaWriter MarkerTypeDisplay()` for each existing marker type.

Because all markers of a given type now must have the same payload and display schema, the DOM event marker has changed from type=tracing with category=DOMEvent, to its own type=DOMEvent, which is now accepted on the front-end.

Based on c9692715f2/src/profile-logic/marker-schema.js

Differential Revision: https://phabricator.services.mozilla.com/D90658
2020-10-14 02:11:25 +00:00
Masayuki Nakano 190b2c2740 Bug 1612802 - Make `IMEStateManager` stop notifying `PuppetWidget` of editor state changes while its `StopIMEStateManagement()` r=m_kato
Currently, `BrowserParent` rejects any notifications which come after
it blurs from IME focus.
https://searchfox.org/mozilla-central/rev/919607a3610222099fbfb0113c98b77888ebcbfb/dom/ipc/BrowserParent.cpp#2157,2169,2181,2192,2203,2216

But for saving unnecessary IPC messages, we should make `IMEStateManager` in
a content process stop sending notifications which occurs during its
`StopIMEStateManagement()` is called.

Differential Revision: https://phabricator.services.mozilla.com/D93176
2020-10-13 23:29:29 +00:00
Edgar Chen 07458c65e6 Bug 1670919 - Cleanup some code around nsIFormControl::GetFormElement; r=emilio
nsIFormControl::GetFormElement now returns HTMLFormElement*, we could remove
some type convertion.

Differential Revision: https://phabricator.services.mozilla.com/D93349
2020-10-13 15:15:57 +00:00
Emilio Cobos Álvarez c5baeaba64 Bug 1670316 - Undo full zoom in ShouldBlockCustomCursor. r=hiro
Full zoom in the child process won't be applied to the cursor rect, so
undo it before checking to consider the actual rect that will be used.

Differential Revision: https://phabricator.services.mozilla.com/D93329
2020-10-13 11:05:50 +00:00
Masayuki Nakano efdb198637 Bug 1539769 - Make `eSetSelection` event go to focused `BrowserParent` instead of `BrowserPargent` for focused content in the main process r=hsivonen
when there is no composition, `IMEStateManager::HandleSelectionEvent()` calls
`TextComposition::HandleSelectionEvent()` with `BrowserParent` which is
retrieved from `aEventTargetContent` which is focused content in the main
process.  This means that `eSetSelection` event is handled in root document
of the focused tab when there is no composition.  However, following composition
events will go to focused `BrowserParent`, i.e., if an OOP iframe has focus
in the tab, `eSetSelection` event won't be handled in it.  Therefore, IME
always fails to replace existing text with new composition.

This patch makes both `IMEStateManager::HandleSelectionEvent()` and
`PresShell::EventHandler::DispatchEventToDOM()` use
`IMEStateManager::GetActiveBrowserParent()` for sending both `eSetSelection`
and composition events to same process.  Additionally, this patch make
`IMEStateManager::GetActiveBrowserParent()` returns
`IMEStateManager::sFocusedIMEBrowserParent` when it's set to non-nullptr
because native IME tries to modify the editor which enabled IME context.

On the other hand, for making the behavior safer, we should make
`eCompositionStart` event have replacing range optionally.  I filed
bug 1669907 to change the design, but it requires several non-tiny patches.
Once we fix it, we can write automated tests for this simply, but without
the fix, I need to write too many lines with low level API, and it becomes
unnecessary after fixing the bug.  Therefore, I give up to write a test
for this for now.

Differential Revision: https://phabricator.services.mozilla.com/D93053
2020-10-09 07:01:20 +00:00
Masayuki Nakano 8c5fa85517 Bug 1668134 - part 1: Make `nsPIDOMWindowInner` have an API to know whether the window or its descendants has had `beforeinput` event listeners r=smaug
When `HTMLEditor` instances are destroyed, I'd like to collect how much
instances are worked with `beforeinput` event listeners.  Before adding such
telemetry probe, this patch adds methods to set/get whether a `beforeinput`
event listener has had added or not to `nsPIDOMWindowInner`.

Differential Revision: https://phabricator.services.mozilla.com/D92546
2020-10-08 02:25:35 +00:00
Masayuki Nakano 2fde14a338 Bug 1623918 - part 2: Mark `nsINode::GetSelectionRootContent()` and its root callers as `MOZ_CAN_RUN_SCRIPT` as far as possible r=smaug
This patch tries to mark root callers of `nsINode::GetSelectionRootContent()`
which calls `nsINode::GetAnonymousRootElementOfTextEditor()` as far as possible
(and reasonable).

It's used by `ContentEventHandler` so that a lot of methods of
`EventStateManager`, `ContentEventHandler`, `IMEContentObserver` which are main
users of it are also marked as `MOZ_CAN_RUN_SCRIPT`.  I think that this is
reasonable.

On the other hand, it might not be reasonable to mark `IMEStateManager` methods
as `MOZ_CAN_RUN_SCRIPT` for initializing `IMEContentObserver` because
`IMEStateManager` may be able to initialize `IMEContentObserver` asynchronously
and its root callers are in XUL layout code.  Therefore, this patch uses
`MOZ_CAN_RUN_SCRIPT_BOUNDARY` for `IMEStateManager` at least for now.

Differential Revision: https://phabricator.services.mozilla.com/D92730
2020-10-09 02:37:47 +00:00
Makoto Kato 578afbd850 Bug 1661617 - Use password hint for software keyboard. r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D91237
2020-10-01 07:23:59 +00:00
Narcis Beleuzu c163b394ef Backed out 2 changesets (bug 1623918) for crashtest failure on 1623918.html CLOSED TREE
Backed out changeset 519ca1b069e5 (bug 1623918)
Backed out changeset d8a09a5fea47 (bug 1623918)
2020-10-08 12:06:58 +03:00
Masayuki Nakano da386ef224 Bug 1623918 - part 2: Mark `nsINode::GetSelectionRootContent()` and its root callers as `MOZ_CAN_RUN_SCRIPT` as far as possible r=smaug
This patch tries to mark root callers of `nsINode::GetSelectionRootContent()`
which calls `nsINode::GetAnonymousRootElementOfTextEditor()` as far as possible
(and reasonable).

It's used by `ContentEventHandler` so that a lot of methods of
`EventStateManager`, `ContentEventHandler`, `IMEContentObserver` which are main
users of it are also marked as `MOZ_CAN_RUN_SCRIPT`.  I think that this is
reasonable.

On the other hand, it might not be reasonable to mark `IMEStateManager` methods
as `MOZ_CAN_RUN_SCRIPT` for initializing `IMEContentObserver` because
`IMEStateManager` may be able to initialize `IMEContentObserver` asynchronously
and its root callers are in XUL layout code.  Therefore, this patch uses
`MOZ_CAN_RUN_SCRIPT_BOUNDARY` for `IMEStateManager` at least for now.

Differential Revision: https://phabricator.services.mozilla.com/D92730
2020-10-08 03:56:51 +00:00
Kartikaya Gupta 3c8d434ae6 Bug 1668870 - Ignore touch listeners in the system group for event retargeting. r=smaug
The audio/video controls element has touch listeners on the scrubber, which
steals events when we don't want it to. So let's ignore those listeners.

Ignoring system group listeners for the purposes of event retargeting seems
reasonable in the general case, because those listeners are coming from the
browser itself. If we're relying on the event retargeting to make those browser
elements easy to hit, then we should not be doing that and instead just make
them bigger.

Test coverage for this change is provided by the android-components tests that
failed in bug 1668112. The next patch re-enables touch event retargeting and
exercises this code in the context of those tests.

Depends on D92436

Differential Revision: https://phabricator.services.mozilla.com/D92437
2020-10-06 18:03:25 +00:00
Emilio Cobos Álvarez 4ad501e86f Bug 1666497 - Don't flush layout from popuppositioned events. r=mconley,Gijs,smaug
We don't need to flush before dispatching the event because we know that
if the values we cared about changed, then we'd get another event.

Differential Revision: https://phabricator.services.mozilla.com/D92444
2020-10-06 16:28:41 +00:00
Greg Tatum c8755d4217 Bug 1669266 - Upgrade the DOMEvent marker to not be of type "tracing" r=gerald
This is part of the Markers 2.0 work. This payload proved to be a bit ambiguous
when moving to the new marker schema, so it requires an upgrader.

The test is included as the following commit.

Differential Revision: https://phabricator.services.mozilla.com/D92456
2020-10-06 13:57:46 +00:00
Edgar Chen 53a7fb1fb0 Bug 1669197 - Use Element in PointerCaptureInfo; r=smaug
mPendingElement and mOverrideElement are always Element, we could just use
Element to make the code clear.

Differential Revision: https://phabricator.services.mozilla.com/D92433
2020-10-05 15:56:52 +00:00
Masayuki Nakano ec2e1c9705 Bug 1669133 - Get rid of pref to disable `text` event in the default group and telemetry for it r=smaug
The telemetry probe was added in bug 1506434, and it's not necessary anymore
because of the event in the default group was completely disabled in
bug 1288640 (Gecko 65).

Therefore, we can get rid of the pref, and we can take back a room for a
bool member in `nsPIDOMWindowInner` for new telemetry probes which need
to know whether a specific event listener has been added or not.

Depends on D92395

Differential Revision: https://phabricator.services.mozilla.com/D92397
2020-10-05 11:17:17 +00:00
longsonr 67be8b29cb Bug 1669161 - Remove dead SVG event code r=smaug
-  onSVGZoom is gone and we no longer dispatch it.
- we've never dispatched SVGUnload or SVGResize events and if we did implement these they would be unload and resize events now.

Differential Revision: https://phabricator.services.mozilla.com/D92381
2020-10-05 11:19:47 +00:00
Timothy Nikkel 223e9bb630 Bug 1667612. Factor waitToClearOutAnyPotentialScrolls out from various tests and put it in apz_test_utils.js. r=kats
Differential Revision: https://phabricator.services.mozilla.com/D92318
2020-10-03 15:58:16 +00:00
Jonathan Kew 2655501b30 Bug 1665196 - Use the main-thread idle queue rather than a repeating timer to finalize font loading. r=lsalzman
Differential Revision: https://phabricator.services.mozilla.com/D92302
2020-10-03 16:03:54 +00:00
Edgar Chen a9816b2cdb Bug 1662094 - Remove test_pointerevent_setpointercapture_inactive_button_mouse-manual.html; r=smaug
After bug 1520785, we could pass the wpt one and could just remove this.

Depends on D90558

Differential Revision: https://phabricator.services.mozilla.com/D90559
2020-10-01 08:52:13 +00:00
Masayuki Nakano 68a5d8313d Bug 1609291 - Fix a simple bug of `test_dom_keyboard_event.html` r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D91860
2020-10-01 07:36:55 +00:00
Gerald Squelart 79c0e0c0ef Bug 1667915 - Marker type is now given as a reified empty argument instead of a template argument - r=gregtatum
This makes it clearer where marker-type-specific payload arguments start, just after the marker type object.

Also improved the main API documentation.

Differential Revision: https://phabricator.services.mozilla.com/D91681
2020-10-01 11:02:54 +00:00
Gerald Squelart ee701f64d7 Bug 1667915 - Separate marker category from marker options - r=gregtatum
The `category.WithOptions(...)` syntax was a bit strange and difficult to explain.

Now the category and options are separate parameters. Default options can be specified with `MarkerOptions{}` or just `{}`.

As a special case, defaulted-NoPayload functions don't need `<>`, and defaulted-NoPayload functions and macros don't even need `{}` for default options, e.g.:
`profiler_add_marker("name", OTHER); PROFILER_MARKER_UNTYPED("name", OTHER);`

Differential Revision: https://phabricator.services.mozilla.com/D91680
2020-10-01 11:02:23 +00:00
Bogdan Tara ababae891b Backed out 2 changesets (bug 1667915) for platform related bustage CLOSED TREE
Backed out changeset e7a0788a1741 (bug 1667915)
Backed out changeset d34505b2d81b (bug 1667915)
2020-10-01 12:34:39 +03:00
Gerald Squelart 58ca6739aa Bug 1667915 - Marker type is now given as a reified empty argument instead of a template argument - r=gregtatum
This makes it clearer where marker-type-specific payload arguments start, just after the marker type object.

Also improved the main API documentation.

Differential Revision: https://phabricator.services.mozilla.com/D91681
2020-10-01 01:45:20 +00:00
Gerald Squelart e07ae06a1d Bug 1667915 - Separate marker category from marker options - r=gregtatum
The `category.WithOptions(...)` syntax was a bit strange and difficult to explain.

Now the category and options are separate parameters. Default options can be specified with `MarkerOptions{}` or just `{}`.

As a special case, defaulted-NoPayload functions don't need `<>`, and defaulted-NoPayload functions and macros don't even need `{}` for default options, e.g.:
`profiler_add_marker("name", OTHER); PROFILER_MARKER_UNTYPED("name", OTHER);`

Differential Revision: https://phabricator.services.mozilla.com/D91680
2020-10-01 01:44:47 +00:00
Bogdan Tara 222e4f64b7 Backed out 5 changesets (bug 1662094, bug 1666201, bug 1520785) for pointerevent related failures CLOSED TREE
Backed out changeset 0ff76cb4b991 (bug 1662094)
Backed out changeset 94bf1aff7bff (bug 1520785)
Backed out changeset 1688cdab3d48 (bug 1666201)
Backed out changeset e960f750c588 (bug 1666201)
Backed out changeset cb30150e8289 (bug 1666201)
2020-10-01 11:46:32 +03:00