Commit Graph

2054 Commits

Author SHA1 Message Date
Andrew McCreight
cbba63f35e Bug 1859535, part 4 - Remove nsContentUtils::PluginTagForType. r=dom-core,sefeng
This method is never called. It is the last use of
nsPluginHost::GetInst() and various other non-static methods, so
remove them all.

Differential Revision: https://phabricator.services.mozilla.com/D191192
2023-11-20 17:44:20 +00:00
Masayuki Nakano
a9321b697e Bug 1864334 - Make nsIFrame::MovingCaretToEventPointAllowedIfSecondaryButtonEvent check whether the right click point is in a selection range first r=emilio
This is a simple mistake of the previous patch. The code path is originally for
a left click handling.  Therefore, there is no check whether the click point is
in a selection range because in that case, left click should collapse selection.
However, the selection should not be collapse when it's a right click in a
selection range because the context menu target is the selection range.

The `ui.mouse.right_click.collapse_selection.stop_if_non_collapsed_selection`
pref is set to `true` by default.  Therefore, the existence of a non-collapsed
selection has hidden this bug.  However, if it's set to `false`, this always
happens.  Additionally, editor does not set ancestor limiter of selection if the
root element is editable [1].  I think that we can now remove this special path,
but it's risky.  Therefore, this patch just adds the new check into the method.

1. https://searchfox.org/mozilla-central/rev/ce4599d3d4e20e34cb6db68f255c3dff1aec246b/editor/libeditor/EditorBase.cpp#5448,5450-5451

Differential Revision: https://phabricator.services.mozilla.com/D193529
2023-11-16 01:26:24 +00:00
Narcis Beleuzu
aeac4d77e1 Backed out 7 changesets (bug 1852098) for bustages on UseCounterMetrics.h . CLOSED TREE
Backed out changeset 3b87419a9eea (bug 1852098)
Backed out changeset d9c7c84c82df (bug 1852098)
Backed out changeset e594c7eebb91 (bug 1852098)
Backed out changeset 15e0b0bd3bfb (bug 1852098)
Backed out changeset 220e9ee63ec3 (bug 1852098)
Backed out changeset 9edef145d1c5 (bug 1852098)
Backed out changeset 920a798dbb8a (bug 1852098)
2023-11-16 01:00:42 +02:00
Chris H-C
be4023d4f6 Bug 1852098 - Increment Glean use counter metrics and submit the use-counters ping during shutdown r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D193250
2023-11-15 21:34:12 +00:00
Stanca Serban
7f8a3ccc5e Backed out 7 changesets (bug 1852098) for causing build bustages in UseCounterMetrics.cpp. CLOSED TREE
Backed out changeset 2caabd4bfe86 (bug 1852098)
Backed out changeset 5c174b0ee1ab (bug 1852098)
Backed out changeset 05ba23510b93 (bug 1852098)
Backed out changeset 256984effaa2 (bug 1852098)
Backed out changeset 8bed08cf2a68 (bug 1852098)
Backed out changeset 16b0698a239d (bug 1852098)
Backed out changeset 6e8d54a51fb7 (bug 1852098)
2023-11-15 23:02:32 +02:00
Chris H-C
1a8a70316b Bug 1852098 - Increment Glean use counter metrics and submit the use-counters ping during shutdown r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D193250
2023-11-15 17:01:30 +00:00
Noemi Erli
3ebc359ec4 Backed out 2 changesets (bug 1851816) for causing private browsing related failures CLOSED TREE
Backed out changeset d2f63b3f6342 (bug 1851816)
Backed out changeset 7d0d2fe95e67 (bug 1851816)
2023-11-07 00:18:54 +02:00
Tom Ritter
d8e7355533 Bug 1851816: Pass PBM Status into RFPIsEnabledFor r=timhuang
Differential Revision: https://phabricator.services.mozilla.com/D192501
2023-11-06 21:02:40 +00:00
Adam Brouwers-Harries
4a2ba69cbc Bug 1421651 - Remove obseleted timeline and TimelineMarker code r=canaltinova,webidl,devtools-reviewers,saschanaz,smaug,ochameau
This patch removes the old docshell timeline and timeline markers codebase and replaces them with equivalent Gecko profiler marker. This patch also fixes Bug 1834143, which is a subset of 1421651.

Differential Revision: https://phabricator.services.mozilla.com/D184217
2023-10-24 15:18:12 +00:00
Narcis Beleuzu
67b61b8b2c Backed out changeset 714aaf6484fb (bug 1421651) for causing Bug 1860719. CLOSED TREE 2023-10-24 17:31:02 +03:00
Adam Brouwers-Harries
720e582a3a Bug 1421651 - Remove obseleted timeline and TimelineMarker code r=canaltinova,webidl,devtools-reviewers,saschanaz,smaug,ochameau
This patch removes the old docshell timeline and timeline markers codebase and replaces them with equivalent Gecko profiler marker. This patch also fixes Bug 1834143, which is a subset of 1421651.

Differential Revision: https://phabricator.services.mozilla.com/D184217
2023-10-23 13:55:50 +00:00
Tim Huang
7f0348add6 Bug 1824222 - Make nsRFPService::IsRFPEnabledFor() to use the given OverriddenFingerprintingSettings for checking RFPTargets. r=tjr
Differential Revision: https://phabricator.services.mozilla.com/D185016
2023-10-17 22:02:30 +00:00
Sandor Molnar
489ab0b744 Backed out changeset e5c1b9223818 (bug 1852243) causing problems in event handling for a lot of tests. 2023-10-11 10:08:38 +03:00
Emilio Cobos Álvarez
d02e297b2d Bug 1624819 - Remove TaskCategory and other quantum dom remnants. r=smaug,media-playback-reviewers,credential-management-reviewers,cookie-reviewers,places-reviewers,win-reviewers,valentin,mhowell,sgalich,alwu
Sorry this is not a particularly easy patch to review. But it should be
mostly straight-forward.

I kept Document::Dispatch mostly for convenience, but could be
cleaned-up too / changed by SchedulerGroup::Dispatch. Similarly maybe
that can just be NS_DispatchToMainThread if we add an NS_IsMainThread
check there or something (to preserve shutdown semantics).

Differential Revision: https://phabricator.services.mozilla.com/D190450
2023-10-10 08:51:12 +00:00
Henrik Skupin
f066f34bc9 Bug 1852243 - [dom] Add specific preferences for all available async event types. r=hiro
The preference "test.events.async.enabled" controls the usage of
widget events in general, but Marionette doesn't support all of
them yet. To get widget events enabled for web-platform tests
those unsupported event types need to still synthesize the event.

Differential Revision: https://phabricator.services.mozilla.com/D188296
2023-10-06 06:13:18 +00:00
Cristina Horotan
d7356eea7d Backed out 2 changesets (bug 1852243) for causing multiple wpt failures
Backed out changeset b10876321a92 (bug 1852243)
Backed out changeset c818afe5e31e (bug 1852243)
2023-10-05 21:48:37 +03:00
Henrik Skupin
ec1d5e8c22 Bug 1852243 - [dom] Add specific preferences for all available async event types. r=hiro
The preference "test.events.async.enabled" controls the usage of
widget events in general, but Marionette doesn't support all of
them yet. To get widget events enabled for web-platform tests
those unsupported event types need to still synthesize the event.

Differential Revision: https://phabricator.services.mozilla.com/D188296
2023-10-05 15:11:59 +00:00
Tim Huang
a1849d963f Bug 1834274 - Part 1: Implement nsIRFPService.idl for nsRFPService. r=emilio
To allow remote settings client to set fingerprinting overrides from
Javascript, we need to implement nsIRFPService for nsRFPService.

This patch changes the return format of nsRFPService::GetOrCreate() to
match the singleton implementation of nsIRFPService. As a result of it,
we need to change the first init call in nsContentUtils because we
cannot forward a already_AddRefed<> to mozilla::Unused. It will cause a
memory leak.

Differential Revision: https://phabricator.services.mozilla.com/D182809
2023-09-27 14:58:25 +00:00
Valentin Gosu
ca61d34ef7 Bug 1553105 - Make URL.origin return "null" if protocol doesn't have the URI_HAS_WEB_EXPOSED_ORIGIN flag r=nika,necko-reviewers,kershaw
CLOSED TREE

Differential Revision: https://phabricator.services.mozilla.com/D188720
2023-09-27 10:29:17 +00:00
Cosmin Sabou
5f58674abb Backed out changeset c4a317778310 (bug 1553105) for causing build bustages on nsContentUtils.cpp. CLOSED TREE 2023-09-27 13:25:14 +03:00
Valentin Gosu
8f5a01e16f Bug 1553105 - Make URL.origin return "null" if protocol doesn't have the URI_HAS_WEB_EXPOSED_ORIGIN flag r=nika,necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D188720
2023-09-27 09:55:57 +00:00
Sandor Molnar
4b73c45ef4 Backed out 4 changesets (bug 1834274) Mn failures on browser/components/tests/marionette/test_no_errors_clean_profile.py CLOSED TREE
Backed out changeset c28b3520f3d7 (bug 1834274)
Backed out changeset e57a1b1b05c8 (bug 1834274)
Backed out changeset aae42550c449 (bug 1834274)
Backed out changeset 79b200c1060e (bug 1834274)
2023-09-26 19:10:23 +03:00
Tim Huang
62b66fcff1 Bug 1834274 - Part 1: Implement nsIRFPService.idl for nsRFPService. r=emilio
To allow remote settings client to set fingerprinting overrides from
Javascript, we need to implement nsIRFPService for nsRFPService.

This patch changes the return format of nsRFPService::GetOrCreate() to
match the singleton implementation of nsIRFPService. As a result of it,
we need to change the first init call in nsContentUtils because we
cannot forward a already_AddRefed<> to mozilla::Unused. It will cause a
memory leak.

Differential Revision: https://phabricator.services.mozilla.com/D182809
2023-09-26 14:07:47 +00:00
Valentin Gosu
cdd5195292 Bug 1848694 - Remove/avoid global references to nsIIOService r=mccr8,necko-reviewers,kershaw
This patch removes the static pointer to nsIIOService in nsContentUtils,
replacing it to calls to mozilla::components::IO::Service.

It also makes nsScriptSecurityManager::sIOService a StaticRefPtr.

Differential Revision: https://phabricator.services.mozilla.com/D188714
2023-09-22 12:49:44 +00:00
Sandor Molnar
a8db14100e Backed out changeset b858a0740582 (bug 1848694) for causing build bustages on dom/base/Element.cpp CLOSED TREE 2023-09-21 16:45:57 +03:00
Valentin Gosu
e058782d44 Bug 1848694 - Remove/avoid global references to nsIIOService r=mccr8,necko-reviewers,kershaw
This patch removes the static pointer to nsIIOService in nsContentUtils,
replacing it to calls to mozilla::components::IO::Service.

It also makes nsScriptSecurityManager::sIOService a StaticRefPtr.

Differential Revision: https://phabricator.services.mozilla.com/D188714
2023-09-21 12:39:20 +00:00
Olli Pettay
8349e16ebd Bug 1851526 - Don't create the event in nsContentUtils::DispatchChromeEvent if it will not be dispatched, r=mstange
Differential Revision: https://phabricator.services.mozilla.com/D187407
2023-09-05 08:37:33 +00:00
Markus Stange
755a0de1c3 Bug 1851263 - Rename nsIGlobalObject::AsInnerWindow to GetAsInnerWindow because it can return null. r=smaug
This is also the name that was originally suggested in https://bugzilla.mozilla.org/show_bug.cgi?id=218415#c53 .

Differential Revision: https://phabricator.services.mozilla.com/D187340
2023-09-04 04:06:30 +00:00
Markus Stange
325df32372 Bug 1850458 - Pass along aErrorResult to CreateEvent. r=emk
Differential Revision: https://phabricator.services.mozilla.com/D187017
2023-08-29 15:30:15 +00:00
Markus Stange
538be2c237 Bug 1843484 - Don't hold an extra strong reference to the event target. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D186979
2023-08-28 23:38:43 +00:00
Markus Stange
70bd936589 Bug 1843484 - Use EventTarget* instead of nsISupports* for the event target parameter of the nsContentUtils::Dispatch methods. r=smaug
This saves a few queryInterface calls on the hot path.

Differential Revision: https://phabricator.services.mozilla.com/D186976
2023-08-28 23:38:42 +00:00
Emilio Cobos Álvarez
b3eacea949 Bug 1849204 - Add generic atom hash keys that use the better distributed atom hash, and use it across the tree. r=mstange,xpcom-reviewers,credential-management-reviewers,sgalich,nika
Differential Revision: https://phabricator.services.mozilla.com/D186496
2023-08-18 18:43:27 +00:00
Markus Stange
d48eceba22 Bug 1843946 - Make the MiscContainer for eAtomArray refcounted. r=emilio
This makes it cheaper to copy the nsAttrValue, which improves innerHTML times on Speedometer
because it reduces the time spent creating and destroying valueForAfterSetAttr.

It will also make it possible to reuse eAtomArray values across elements.

This patch adds a copying operation in AllocClassMatchingInfo which is needed
now that the MiscContainer's mValue.mAtomArray is immutable. This is a bit
unfortunate: In the past, this was doing one atom array allocation, and now
it's doing two; one during parsing and one during the copy. However, I would
expect that most calls to getElementsByClassName only supply a single class
name and not a set of space-separated class names, but I haven't measured it.
If this copy turns out to make things slower, we can probably avoid it by
adding a way to parse a string into an AtomArray directly without going
through nsAttrValue.

Before: https://share.firefox.dev/3DAhLzm
After: https://share.firefox.dev/456TMTM

Differential Revision: https://phabricator.services.mozilla.com/D183810
2023-08-17 19:02:39 +00:00
Markus Stange
7b93a1e994 Bug 1834370 - Keep listeners for each event type in a separate array, and use binary search on the outer list. r=smaug
This considerably improves the testcase in bug 1834003, because it
reduces the amount of memory we need to look at when checking the
listeners at the nsWindowRoot. At the moment, nsWindowRoot has 156
listeners for 94 different event types, all from JSWindowActor event
listeners.

Having a separate array per event type also matches what Blink and Webkit do.

Differential Revision: https://phabricator.services.mozilla.com/D183431
2023-08-16 16:16:37 +00:00
Olli Pettay
6172d98d49 Bug 1848714 - Use unsafe methods in hot code paths to access and remove elements from nsTArray when it is guaranteed to be safe, r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D186191
2023-08-15 14:24:19 +00:00
Masayuki Nakano
33c777c972 Bug 1266437 - Drop "OS" modifier r=smaug,m_kato,karlt,Gijs
On Windows, Windows logo key was mapped to "OS" modifier, and on Linux,
it's same and the key is called "Super" and "Hyper".  That conformed to the
older UI Events spec.

However, UI Events declares that they should be mapped to "Meta" now and Chrome
handles it as the spec in Windows and Linux.  Therefore, we should align the
behavior to them.

Note that we've treated the legacy "Meta" modifier on Linux as DOM "Meta"
modifier state, and we'll keep this as-is because in Sun/Solaris keyboard
layout, they keys are mapped to the legacy "Meta".

Finally, the following check only `IsMeta()` but not `IsOS()`.  I think that
they should've checked `IsOS()` too.  Therefore, they will behave differently
in Windows and Linux.
* https://searchfox.org/mozilla-central/rev/9a4666e63199bd1bcfc9095f6efec3488c358458/dom/base/Element.cpp#3287-3288
* https://searchfox.org/mozilla-central/rev/9a4666e63199bd1bcfc9095f6efec3488c358458/dom/html/HTMLInputElement.cpp#3762-3764
* https://searchfox.org/mozilla-central/rev/9a4666e63199bd1bcfc9095f6efec3488c358458/dom/html/HTMLInputElement.cpp#3796-3806
* https://searchfox.org/mozilla-central/rev/9a4666e63199bd1bcfc9095f6efec3488c358458/dom/html/HTMLLabelElement.cpp#127-128
* https://searchfox.org/mozilla-central/rev/9a4666e63199bd1bcfc9095f6efec3488c358458/widget/gtk/nsGtkKeyUtils.cpp#1461-1462

Note that `KEY_NAME_INDEX_OS` will be removed in the patch for bug 1232918.

Differential Revision: https://phabricator.services.mozilla.com/D183480
2023-08-07 01:03:58 +00:00
Cristian Tuns
02ef83ec78 Backed out 2 changesets (bug 1266437, bug 1232918) for causing mochitest failures in test_autoplay_policy_key_blacklist.html CLOSED TREE
Backed out changeset 33e3c6593d4b (bug 1232918)
Backed out changeset 1b56e99dd221 (bug 1266437)
2023-08-03 23:29:52 -04:00
Masayuki Nakano
861dcd8b88 Bug 1266437 - Drop "OS" modifier r=smaug,m_kato,karlt,Gijs
On Windows, Windows logo key was mapped to "OS" modifier, and on Linux,
it's same and the key is called "Super" and "Hyper".  That conformed to the
older UI Events spec.

However, UI Events declares that they should be mapped to "Meta" now and Chrome
handles it as the spec in Windows and Linux.  Therefore, we should align the
behavior to them.

Note that we've treated the legacy "Meta" modifier on Linux as DOM "Meta"
modifier state, and we'll keep this as-is because in Sun/Solaris keyboard
layout, they keys are mapped to the legacy "Meta".

Finally, the following check only `IsMeta()` but not `IsOS()`.  I think that
they should've checked `IsOS()` too.  Therefore, they will behave differently
in Windows and Linux.
* https://searchfox.org/mozilla-central/rev/9a4666e63199bd1bcfc9095f6efec3488c358458/dom/base/Element.cpp#3287-3288
* https://searchfox.org/mozilla-central/rev/9a4666e63199bd1bcfc9095f6efec3488c358458/dom/html/HTMLInputElement.cpp#3762-3764
* https://searchfox.org/mozilla-central/rev/9a4666e63199bd1bcfc9095f6efec3488c358458/dom/html/HTMLInputElement.cpp#3796-3806
* https://searchfox.org/mozilla-central/rev/9a4666e63199bd1bcfc9095f6efec3488c358458/dom/html/HTMLLabelElement.cpp#127-128
* https://searchfox.org/mozilla-central/rev/9a4666e63199bd1bcfc9095f6efec3488c358458/widget/gtk/nsGtkKeyUtils.cpp#1461-1462

Note that `KEY_NAME_INDEX_OS` will be removed in the patch for bug 1232918.

Differential Revision: https://phabricator.services.mozilla.com/D183480
2023-08-04 00:10:11 +00:00
avandolder
8898fd2eec Bug 1837540 - Make radio button group navigation follow tree-order. r=sefeng,smaug
Differential Revision: https://phabricator.services.mozilla.com/D183426
2023-08-03 01:52:19 +00:00
Narcis Beleuzu
ed85f561c2 Backed out changeset 013278adabc7 (bug 1837540) for build bustages on mochitest.ini . CLOSED TREE 2023-08-03 02:25:53 +03:00
avandolder
9d805ab56a Bug 1837540 - Make radio button group navigation follow tree-order. r=sefeng,smaug
Differential Revision: https://phabricator.services.mozilla.com/D183426
2023-08-02 23:04:07 +00:00
Thomas Wisniewski
1ffb72e885 Bug 1784880 - Support range requests on blob URLs in fetch/XMLHttpRequest; r=dlrobertson,necko-reviewers,jesup
Differential Revision: https://phabricator.services.mozilla.com/D184281
2023-08-01 18:50:37 +00:00
Natalia Csoregi
d68a6831c5 Backed out 4 changesets (bug 1834370) for causing failures on pointerevent_mouse-on-object.html and hazard failures on EventListenerManager.cpp. CLOSED TREE
Backed out changeset 0f6ca90bab38 (bug 1834370)
Backed out changeset ad2415f36294 (bug 1834370)
Backed out changeset 2cb41429ffea (bug 1834370)
Backed out changeset 70fea1f92e87 (bug 1834370)
2023-08-01 20:43:07 +03:00
Markus Stange
4e7ef64fea Bug 1834370 - Keep listeners for each event type in a separate array, and use binary search on the outer list. r=smaug
This considerably improves the testcase in bug 1834003, because it
reduces the amount of memory we need to look at when checking the
listeners at the nsWindowRoot. At the moment, nsWindowRoot has 156
listeners for 94 different event types, all from JSWindowActor event
listeners.

Having a separate array per event type also matches what Blink and Webkit do.

Differential Revision: https://phabricator.services.mozilla.com/D183431
2023-08-01 14:53:10 +00:00
Cristian Tuns
8acd1060a3 Backed out changeset 384e4f88f047 (bug 1784880) for causing wpt failures in parsedepth.html CLOSED TREE 2023-08-01 05:41:04 -04:00
Thomas Wisniewski
21f4de34c5 Bug 1784880 - Support range requests on blob URLs in fetch/XMLHttpRequest; r=dlrobertson,necko-reviewers,jesup
Differential Revision: https://phabricator.services.mozilla.com/D184281
2023-08-01 02:48:47 +00:00
Iulian Moraru
d6c744aa21 Backed out 4 changesets (bug 1834370) for causing assertion failures on EventListenerManager.cpp. CLOSED TREE
Backed out changeset d279ac4c2c01 (bug 1834370)
Backed out changeset 00077ebdbfe6 (bug 1834370)
Backed out changeset 6a8a7bccbfef (bug 1834370)
Backed out changeset fa5f05b1f6a1 (bug 1834370)
2023-08-01 06:52:42 +03:00
Markus Stange
3d4cd30495 Bug 1834370 - Keep listeners for each event type in a separate array, and use binary search on the outer list. r=smaug
This considerably improves the testcase in bug 1834003, because it
reduces the amount of memory we need to look at when checking the
listeners at the nsWindowRoot. At the moment, nsWindowRoot has 156
listeners for 94 different event types, all from JSWindowActor event
listeners.

Having a separate array per event type also matches what Blink and Webkit do.

Differential Revision: https://phabricator.services.mozilla.com/D183431
2023-07-31 23:43:24 +00:00
Markus Stange
b256017c83 Bug 1845381 - For begin/repeat/end SMIL animation events, only support "beginEvent"/"repeatEvent"/"endEvent" in addEventListener. r=webcompat-reviewers,dholbert,smaug,twisniewski
Before this patch, we would have called listeners added with both
addEventListener("end", ...) and addEventListener("endEvent", ...).
Now we will just call listeners added with the latter and ignore the
former.

This change only affects listeners added with addEventListener.
For attribute handlers and IDL property listeners, we still use
onbegin/onrepeat/onend as before.

The new behavior matches Blink, simplifies the code, and will let us
improve performance by storing event listeners in a map keyed by event
type atom (bug 1834370).

Differential Revision: https://phabricator.services.mozilla.com/D184532
2023-07-31 20:43:47 +00:00
Noemi Erli
4fb434f11a Backed out changeset e104c452e06d (bug 1845381) for causing failures in href-animate-element.html CLOSED TREE 2023-07-27 16:04:18 +03:00