Commit graph

1502 commits

Author SHA1 Message Date
Emilio Cobos Álvarez
4b713033ac Bug 1736141 - Make Document::PreferredColorScheme safe to call off-main-thread. r=mstange
Document::GetBrowsingContext uses a WeakPtr<nsIDocShell> so we can't do
that. But we have all the other media emulation data and so on in the
pres context which we can access off the main thread for style, so move the
override code there.

Differential Revision: https://phabricator.services.mozilla.com/D128673
2021-10-19 09:00:42 +00:00
Sean Feng
3416efe3f7 Bug 1735945 - Split unload into unload and beforeunload for BFCACHE_COMBO telemetry probe r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D128625
2021-10-18 17:31:28 +00:00
Emilio Cobos Álvarez
c4b7109fac Bug 1736038 - Remove -moz-toolbar-prefers-color-scheme. r=dao
By making prefers-color-scheme return the ColorSchemeForChrome(), which
accounts for the Firefox theme.

Differential Revision: https://phabricator.services.mozilla.com/D128611
2021-10-15 16:53:08 +00:00
Emilio Cobos Álvarez
fb8e2b5796 Bug 1736038 - Simplify some color-scheme handling in core. r=mstange
Remove the follow-firefox-theme pref as now that's default everywhere,
and document better the behavior of the color-scheme property by
reworking and commenting the logic on it a bit.

Differential Revision: https://phabricator.services.mozilla.com/D128610
2021-10-15 16:53:08 +00:00
Emilio Cobos Álvarez
36c2a542fd Bug 1529323 - Make prefers-color-scheme follow the Firefox theme, not the system theme (by default). r=mstange,dao,extension-reviewers,robwu
Given all our UI is using -moz-toolbar-prefers-color-scheme, this seems
like a more reasonable default nowadays. Allow for it to be
configurable via the existing pref.

Differential Revision: https://phabricator.services.mozilla.com/D128527
2021-10-15 16:23:36 +00:00
Emilio Cobos Álvarez
9ab29157c0 Bug 1735574 - Simplify meta viewport handling. r=smaug
We only need the whole array to deal with removals, but other browsers
don't deal with them, see:

  https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/html/html_meta_element.cc;l=479;drc=439c6ac35199f3828faf0f0d070d84109c9bf6a1

Given <meta name=viewport> is weird enough as it is, we should probably
do this and simplify the code.

The header data thing was just synonym to "has a meta viewport", so
simplify that code too.

Depends on D128389

Differential Revision: https://phabricator.services.mozilla.com/D128390
2021-10-15 16:08:02 +00:00
Emilio Cobos Álvarez
edaed7ecbf Bug 1735574 - Cleanup HTMLMetaElement handling of <meta name content>. r=smaug
This shouldn't change behavior, but I find it a bit easier to reason
about (and should be marginally faster by not doing double attribute
lookups, but not like the should usually matter).

Differential Revision: https://phabricator.services.mozilla.com/D128389
2021-10-15 12:11:14 +00:00
Butkovits Atila
a0651d797e Backed out 2 changesets (bug 1735574) for causing failures at test_meta_viewport_change_name.html. CLOSED TREE
Backed out changeset 86e71bf1ba6c (bug 1735574)
Backed out changeset f69838cbf52b (bug 1735574)
2021-10-15 03:29:29 +03:00
Emilio Cobos Álvarez
e64507f95f Bug 1735574 - Simplify meta viewport handling. r=smaug
We only need the whole array to deal with removals, but other browsers
don't deal with them, see:

  https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/html/html_meta_element.cc;l=479;drc=439c6ac35199f3828faf0f0d070d84109c9bf6a1

Given <meta name=viewport> is weird enough as it is, we should probably
do this and simplify the code.

The header data thing was just synonym to "has a meta viewport", so
simplify that code too.

Differential Revision: https://phabricator.services.mozilla.com/D128390
2021-10-14 18:56:16 +00:00
Emilio Cobos Álvarez
7e67655c8d Bug 1735574 - Cleanup HTMLMetaElement handling of <meta name content>. r=smaug
This shouldn't change behavior, but I find it a bit easier to reason
about (and should be marginally faster by not doing double attribute
lookups, but not like the should usually matter).

Differential Revision: https://phabricator.services.mozilla.com/D128389
2021-10-14 18:56:15 +00:00
Paul Zuehlcke
b1b6e2bb07 Bug 1732919 - Use user activation for Storage Access API. r=edgar,anti-tracking-reviewers,timhuang
Differential Revision: https://phabricator.services.mozilla.com/D127151
2021-10-14 12:22:02 +00:00
Andreea Pavel
383080bb17 Backed out 3 changesets (bug 1732919) for wpt failures at requestStorageAccess.sub.window.html on a CLOSED TREE
Backed out changeset 00afa32396d0 (bug 1732919)
Backed out changeset 887e3b523bf3 (bug 1732919)
Backed out changeset 096f7a2f65fe (bug 1732919)
2021-10-12 18:22:25 +03:00
Paul Zuehlcke
6abcdb4407 Bug 1732919 - Use user activation for Storage Access API. r=edgar,anti-tracking-reviewers,timhuang
Differential Revision: https://phabricator.services.mozilla.com/D127151
2021-10-12 13:03:14 +00:00
Emilio Cobos Álvarez
4f8856c545 Bug 1730503 - Make RDM force Android-style scrollbars better. r=mstange,devtools-backward-compat-reviewers,nchevobbe
There are a few bits that still don't work with this patch but will with the
following patches.

Differential Revision: https://phabricator.services.mozilla.com/D128083
2021-10-12 09:21:17 +00:00
Masayuki Nakano
25a3c48305 Bug 1732845 - Add nsINode::IsInDesignMode() to check whether the node is directly in design mode r=smaug
There are a lot of check of `Document`'s editable state **with** comments. This
means that it's unclear for developers that only `Document` node is editable in
design mode.

Additionally, there are some points which use composed document rather than
uncomposed document even though the raw API uses uncomposed document. Comparing
with the other browsers, checking uncomposed document is compatible behavior,
i.e., nodes in shadow trees are not editable unless `contenteditable`.

Therefore, `nsINode` should have a method to check whether it's in design mode
or not.

Note that it may be called with a node in UA widget.  Therefore, this patch
adds new checks if it's in UA widget subtree or native anonymous subtree,
checking whether it's in design mode with its host.

Differential Revision: https://phabricator.services.mozilla.com/D126764
2021-10-12 03:14:43 +00:00
Cristian Tuns
8b33a0ebd9 Backed out 2 changesets (bug 1732919) for causing mochitest failures on browser_webconsole_requestStorageAccess_errors.js. CLOSED TREE
Backed out changeset 759d9b550cca (bug 1732919)
Backed out changeset 2c86a1d595b8 (bug 1732919)
2021-10-11 12:10:06 -04:00
Paul Zuehlcke
f111e5e543 Bug 1732919 - Use user activation for Storage Access API. r=edgar,anti-tracking-reviewers,timhuang
Differential Revision: https://phabricator.services.mozilla.com/D127151
2021-10-11 14:54:49 +00:00
Marian-Vasile Laza
b139f7c95a Backed out changeset a586415a372b (bug 1661152) for causing bc failures on browser_partitionedLocalStorage.js. CLOSED TREE 2021-10-06 21:00:43 +03:00
Benjamin VanderSloot
4b6f68e098 Bug 1661152 - hasStorageAccess will return false when all cookies are blocked. r=timhuang
- Adding a test to validate behavior on non-tracking first-party requests
- Correct the result of a tracking same-origin request (now hasStorageAccess() == false when cookiePolicy = 2)
- Add check near the top of Document::HasStorageAccess to immediately return false when cookiePolicy is REJECT.

Differential Revision: https://phabricator.services.mozilla.com/D126399
2021-10-06 16:19:05 +00:00
Tim Huang
336b189ae0 Bug 1724376 - Part 10: Only expose the privilege SSA to system prinicpal and content scripts of webcompt extension. r=dimi,edgar
This patch changes the way how we decide to expose the privilege SSA to
document interface. We will expose the interface for system principal
and the content script of the webcompat extension only.

Differential Revision: https://phabricator.services.mozilla.com/D125959
2021-10-05 15:16:23 +00:00
Tim Huang
305df77d27 Bug 1724376 - Part 8: Use the given origin of the privilege API as the third-party origin in the storage access prompt. r=pbz
Differential Revision: https://phabricator.services.mozilla.com/D123810
2021-10-05 15:16:22 +00:00
Tim Huang
832ce02a1c Bug 1724376 - Part 7: Implement Document::RequestStorageAccessForOrigin() r=dimi,edgar
Differential Revision: https://phabricator.services.mozilla.com/D123809
2021-10-05 15:16:21 +00:00
amurali
204f95e233 Bug 1675640 - Renaming internal FirstContentfulPaint to FirstContentfulComposite r=sefeng,mstange
Renaming older versions of FirstContentfulPaint - literal,variables and method to FirstContentfulComposite

Differential Revision: https://phabricator.services.mozilla.com/D110133
2021-10-01 17:02:49 +00:00
Olli Pettay
a20bf5465f Bug 1731132, unsuppress painting on top level content presshells sooner, r=emilio
Unsuppressing is done only if the page can use stylesheet cache. That should mean the
load isn't a cold load and also some other resources may be cached and thus
painting could happen sooner.

There is currently a regression around dom.ipc.processCount.webIsolated handling, but the
testing has been done with dom.ipc.processCount.webIsolated==1, and the patch for bug 1731792
should give back similar behavior as what process count 1 has.

Differential Revision: https://phabricator.services.mozilla.com/D125878
2021-09-28 12:04:42 +00:00
Tim Huang
bedecdcbae Bug 1731557 - Part 3: Check the fact if the channel/window is allowlisted in ContentBlocking checks. r=pbz
Priviously, the ContentBlocking::ShouldAllowAccessFor() checkes don't
check if the storage permission was came from the allowList or not. This
patch changes that and it will check if the channel/window is
allowlisted at the same moment as checking the ContentBlockingAllowList.
It returns early if the channel/window is in the allowList.

Differential Revision: https://phabricator.services.mozilla.com/D126278
2021-09-27 22:50:42 +00:00
Tim Huang
8cdcc3ac79 Bug 1731557 - Part 2: Modify the antitracking code to use the nsILoadInfo.storagePermission. r=pbz
After we change the old nsILoadInfo.hasStoragePermission, we need to
modify the code that is using it.

Differential Revision: https://phabricator.services.mozilla.com/D126277
2021-09-27 22:50:41 +00:00
Emily McDonough
b542ee1e58 Bug 1732393 - Remove useless include of ServoCSSPropList.h in Document.cpp r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D126552
2021-09-26 00:14:39 +00:00
owlishDeveloper
800e6ffa5d Bug 1697866 - Add HTTPS-only specific error code and pass it to GeckoView, to handle HTTPS-only specific errors correctly r=agi,JulianWels,nika,ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D120914
2021-09-23 01:41:47 +00:00
Noemi Erli
50d4e6c878 Backed out changeset 890d147bad1d (bug 1697866) for causing bustages in WindowGlobalParent.cpp CLOSED TREE 2021-09-23 01:20:43 +03:00
owlishDeveloper
7acebc65af Bug 1697866 - Add HTTPS-only specific error code and pass it to GeckoView, to handle HTTPS-only specific errors correctly r=agi,JulianWels,nika,ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D120914
2021-09-22 18:30:39 +00:00
Tooru Fujisawa
f263a1ae81 Bug 1718481 - Use stencil in nsXULPrototypeCache. r=tcampbell,kmag
Differential Revision: https://phabricator.services.mozilla.com/D121254
2021-09-21 03:18:02 +00:00
Olli Pettay
f083f381d8 Bug 1727514 - media playback should stop in the bfcache, r=peterv
This version doesn't change SetContainer handling, since it seems to be tricky for the top level page.
So only activity change notification is fired and IsActive() is updated.
The comment about IsActive() was wrong even with the old bfcache implementation.
(I did check that it returned false when the page was in bfcache and many of the activity observers rely on that)

The changes to HTMLMediaElement are needed to ensure page can enter bfcache..

Differential Revision: https://phabricator.services.mozilla.com/D124684
2021-09-20 08:49:22 +00:00
Butkovits Atila
8957144a0f Backed out 3 changesets (bug 1718194, bug 1718623, bug 1718481) for causing leaks. CLOSED TREE
Backed out changeset 1cd8bdf1fc92 (bug 1718481)
Backed out changeset aa56fe2c069d (bug 1718194)
Backed out changeset f7cb7313d1c7 (bug 1718623)
2021-09-18 15:47:45 +03:00
Tooru Fujisawa
58155ebcca Bug 1718481 - Use stencil in nsXULPrototypeCache. r=tcampbell,kmag
Differential Revision: https://phabricator.services.mozilla.com/D121254
2021-09-18 11:16:46 +00:00
Masayuki Nakano
5912f0b3ff Bug 1729480 - Make keypress event listener of editor and execCommand related methods access editor instance after flushing pending layout r=emilio,smaug
I have no idea how to make the test result stable because the intermittent
failure is caused by a race of `IMEContentObserver`'s content query performend
at vsync and `keypress` event after the `keydown` event.  Therefore, I try to
fix the root cause of the failure.

There are two paths reaching a public method of editor with pending
notifications.  One is `keypress` event listener of the editor.  The other is
`execCommand` related methods of `Document`.  Therefore, we should make them
flush pending notifications before accessing editor, but the cost may be too
expensive.  So we should consider whether we should flush pending notifications
or not as far as later.

Note that we cannot fix the `beforeinput` cases because flushing pending
notifications after dispatching `beforeinput` event may cause oranges.  It'll
be fixed while I'm working on bug 1710784.

Differential Revision: https://phabricator.services.mozilla.com/D125805
2021-09-17 17:48:05 +00:00
Olli Pettay
b9336991af Bug 1730977 - Check the existence of requests before calling Stop(), r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D125752
2021-09-17 14:18:20 +00:00
Sandor Molnar
c60bc752d8 Backed out changeset 2d49d73f38aa (bug 1727514) for causing frequent crashes. a=backout 2021-09-16 15:52:56 +03:00
Dan Minor
9f1ed581a6 Bug 1729909 - Fix crash in Document::LocalizationLinkAdded; r=platform-i18n-reviewers,zbraniecki
If for some reason we can't create the promise for mDocumentL10n, we should
return early rather than crashing.

Differential Revision: https://phabricator.services.mozilla.com/D125234
2021-09-13 12:56:06 +00:00
Olli Pettay
d0485c8a55 Bug 1727514 - media playback should stop in the bfcache, r=peterv
SetContainer handling is similar to what DocumentViewer does for the old bfcache implementation.
(The old implementation hides it quite well).
The changes to HTMLMediaElement are needed to ensure page can enter bfcache.

Removed erroneous MOZ_ASSERT in nsPresContext, it is ok to trigger that code path in the new implementation.
And the Run() method of the relevant nsIRunnable already deals with that case.

Differential Revision: https://phabricator.services.mozilla.com/D124684
2021-09-13 12:40:18 +00:00
Nika Layzell
c525c65ff8 Bug 1722880 - Part 1: Add IsInBFCache to WindowContext, and make it non-SHIP compatible, r=smaug,necko-reviewers,dragana
This field will be useful to JS code such as JSWindowActors which need to be
able to detect when their WindowContext is no longer active.

Differential Revision: https://phabricator.services.mozilla.com/D124098
2021-09-03 15:26:13 +00:00
Paul Zuehlcke
518d5ded96 Bug 1683165 - Add a pref to control anti-tracking webcompat features. r=timhuang,twisniewski,webcompat-reviewers,dimi
Differential Revision: https://phabricator.services.mozilla.com/D123614
2021-08-26 15:13:10 +00:00
Mirko Brodesser
69287a69c2 Bug 1727271: part 3) const-qualify Document::HasValidTransientUserGestureActivation. r=edgar
Depends on D123438

Differential Revision: https://phabricator.services.mozilla.com/D123450
2021-08-25 07:29:56 +00:00
Olli Pettay
50a110f8af Bug 1726364 - Scroll events stop working after synchronous XHR request while scrolling an iframe, r=edgar
I tried to keep the changes minimal in this case.
We may need some more changes to Document::UnsuppressEventHandlingAndFireEvents to make it work
well with Fission (but that Fission work is totally unrelated to this fix).

Differential Revision: https://phabricator.services.mozilla.com/D123389
2021-08-24 11:43:06 +00:00
Peter Van der Beken
1d099d0913 Bug 1706347 - Check mOOPChildrenLoading when deciding to put page in BFCache with Fission enabled. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D117199
2021-08-16 09:08:33 +00:00
Emilio Cobos Álvarez
ad5e89ee0d Bug 1722886 - Add a way to override prefers-color-scheme for content without messing with widget values. r=stransky
Differential Revision: https://phabricator.services.mozilla.com/D122455
2021-08-13 11:02:38 +00:00
Sebastian Hengst
30cca9cb15 Backed out changeset f912045db98d (bug 1706347) for causing content crashes (bug 1725558). a=backout DONTBUILD 2021-08-13 11:19:42 +02:00
Olli Pettay
fdb97b51e8 Bug 1724899, suppress microtasks and timers only in the current tab when dom.input_events.canSuspendInBCG.enabled is false, r=kashav
Depends on D122290

Differential Revision: https://phabricator.services.mozilla.com/D122298
2021-08-12 16:01:08 +00:00
Olli Pettay
5beba99004 Bug 1724777, optimize suppressed MicroTask handling, r=mccr8
The test is in theory racy, but trying to limit the cases when it might behave badly
by running it on opt desktop builds only. Without the patch the 'period' check takes over 400ms locally and with the
patch 1-3ms.

The changes are just trying to optimize execution, not change the behavior.
Use of SuppressedMicroTasks is perhaps a bit odd, but it helps keeping
SavedMicroTaskQueue and similar code simple.

Differential Revision: https://phabricator.services.mozilla.com/D122290
2021-08-12 16:01:08 +00:00
Peter Van der Beken
f78596c95a Bug 1706347 - Check mOOPChildrenLoading when deciding to put page in BFCache with Fission enabled. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D117199
2021-08-12 14:11:29 +00:00
Paul Zuehlcke
099c7a952f Bug 1658578 - Remove nsContentUtils::IsThirdPartyWindowOrChannel. r=timhuang
Differential Revision: https://phabricator.services.mozilla.com/D122272
2021-08-11 10:37:18 +00:00
Edgar Chen
61b3f2657e Bug 1724905 - Remove native only updateURLAndHistory in nsIDocShell; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D122211
2021-08-10 22:15:09 +00:00
Emilio Cobos Álvarez
2d0a072174 Bug 1723921 - Cleanup nsComputedDOMStyle and related APIs. r=layout-reviewers,jfkthame
This will make implementing the new behavior behind a pref
really straight-forward, and is generally nicer.

Depends on D121858

Differential Revision: https://phabricator.services.mozilla.com/D121705
2021-08-07 09:47:15 +00:00
Kartikaya Gupta
21071d6b64 Bug 1723761 - Update outdated URL to new location. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D122042
2021-08-07 01:21:18 +00:00
Zibi Braniecki
92183f248d Bug 1613705 - [localization] part9: Update DOMLocalization to match Localization constructor. r=nika,emilio
Depends on D113691

Differential Revision: https://phabricator.services.mozilla.com/D113692
2021-08-03 16:25:13 +00:00
Zibi Braniecki
9f3aa2521f Bug 1613705 - [localization] part2: Switch Localization class to use localization-ffi. r=emilio,nika
Depends on D104788

Differential Revision: https://phabricator.services.mozilla.com/D104789
2021-08-03 16:25:10 +00:00
Butkovits Atila
949da905e7 Backed out 19 changesets (bug 1613705) for causing build bustages complaining about Document.cpp. CLOSED TREE
Backed out changeset 2ee1091dd20d (bug 1613705)
Backed out changeset d377afc0b09f (bug 1613705)
Backed out changeset de9d4378f0ac (bug 1613705)
Backed out changeset 9843372abb6e (bug 1613705)
Backed out changeset 5fc5918e5905 (bug 1613705)
Backed out changeset a7aeae7afd49 (bug 1613705)
Backed out changeset 5d61617a5402 (bug 1613705)
Backed out changeset 85bf98573899 (bug 1613705)
Backed out changeset 175af8a1b8c2 (bug 1613705)
Backed out changeset 93fcb23d7898 (bug 1613705)
Backed out changeset 595529cd906f (bug 1613705)
Backed out changeset 9f3e2963d925 (bug 1613705)
Backed out changeset 442289058933 (bug 1613705)
Backed out changeset fc3b9acb0e81 (bug 1613705)
Backed out changeset 408983c64f7f (bug 1613705)
Backed out changeset 08b637fc3fcd (bug 1613705)
Backed out changeset 6ef0aafd2db0 (bug 1613705)
Backed out changeset d88b294e0a5e (bug 1613705)
Backed out changeset e6bebff87544 (bug 1613705)
2021-08-03 12:36:01 +03:00
Zibi Braniecki
36d143e8ba Bug 1613705 - [localization] part9: Update DOMLocalization to match Localization constructor. r=nika,emilio
Depends on D113691

Differential Revision: https://phabricator.services.mozilla.com/D113692
2021-08-03 05:52:03 +00:00
Zibi Braniecki
294c93befa Bug 1613705 - [localization] part2: Switch Localization class to use localization-ffi. r=emilio,nika
Depends on D104788

Differential Revision: https://phabricator.services.mozilla.com/D104789
2021-08-03 05:52:00 +00:00
Hiroyuki Ikezoe
a7abbb66f2 Bug 1718012 - Call UpdateSizesBeforeReflow only for resize reflow cases and set MobileViewportManager::mMobileViewportSize even if mDisplaySize hasn't been changed in UpdateSizesBeforeReflow. r=tnikkel
In the case of reflowing caused by full zoom changes, the mDisplaySize isn't
changed, whereas mMobileViewportSize should be changed.

Differential Revision: https://phabricator.services.mozilla.com/D120190
2021-08-02 21:27:19 +00:00
Kagami Sascha Rosylight
86a6ba4bda Bug 1723050 - Part 2: Replace typedef by using in dom/base/ r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D121294
2021-08-02 14:40:41 +00:00
Cosmin Sabou
3564c330b3 Backed out 11 changesets (bug 1613705) for several test failures. CLOSED TREE
Backed out changeset 4e690882b6af (bug 1613705)
Backed out changeset 302e7a75affc (bug 1613705)
Backed out changeset 626b40e3aad1 (bug 1613705)
Backed out changeset 1cbab987bb7d (bug 1613705)
Backed out changeset 2213917abb30 (bug 1613705)
Backed out changeset c89aa0375690 (bug 1613705)
Backed out changeset 6466027c5767 (bug 1613705)
Backed out changeset 6c188c4b38bf (bug 1613705)
Backed out changeset 8d0c087b9896 (bug 1613705)
Backed out changeset 3404fd6725f1 (bug 1613705)
Backed out changeset c9cfbba15d90 (bug 1613705)
2021-08-02 14:04:29 +03:00
Zibi Braniecki
458a2494df Bug 1613705 - [localization] part9: Update DOMLocalization to match Localization constructor. r=nika,emilio
Depends on D113691

Differential Revision: https://phabricator.services.mozilla.com/D113692
2021-08-02 09:54:10 +00:00
Zibi Braniecki
bcc80223e2 Bug 1613705 - [localization] part2: Switch Localization class to use localization-ffi. r=emilio,nika
Depends on D104788

Differential Revision: https://phabricator.services.mozilla.com/D104789
2021-08-02 09:54:07 +00:00
Neil Deakin
25c196780b Bug 1717684, remove the popupRangeParent and popupRangeOffset properties in document and just use the cached event in the PendingPopup, r=emilio
This also limits computing the range properties to only the context menu cases that need them rather than all popups.

Differential Revision: https://phabricator.services.mozilla.com/D120132
2021-07-22 19:50:10 +00:00
Kris Maglione
3ee95f8b32 Bug 1716849: Add crash annotation for error when aborting for failed module import. r=mccr8
There are a number of modules that we import from C++ and can't continue
running without. We have a number of crashes for some of those failed loads. A
lot of them are from OOMs or corruption, but we're not sure about the rest.

This patch adds a crash annotation with the details of the error wherever we
abort for failing to load a module.

Differential Revision: https://phabricator.services.mozilla.com/D120290
2021-07-22 16:58:02 +00:00
Butkovits Atila
f1369e39ea Backed out changeset ef812b3d914d (bug 1716849) for causing assertion failures at nsImportModule.cpp. CLOSED TREE 2021-07-22 06:49:23 +03:00
Kris Maglione
f69238e72d Bug 1716849: Add crash annotation for error when aborting for failed module import. r=mccr8
There are a number of modules that we import from C++ and can't continue
running without. We have a number of crashes for some of those failed loads. A
lot of them are from OOMs or corruption, but we're not sure about the rest.

This patch adds a crash annotation with the details of the error wherever we
abort for failing to load a module.

Differential Revision: https://phabricator.services.mozilla.com/D120290
2021-07-22 01:28:22 +00:00
Emilio Cobos Álvarez
60812fc63c Bug 1711437 - Don't EnsureUniqueInner from the cssRules getter. r=layout-reviewers,jfkthame
Instead, fix up the various content data structures when the stylesheet
is mutated. This makes reading a stylesheet not disable style sharing.

Differential Revision: https://phabricator.services.mozilla.com/D115203
2021-07-20 13:17:02 +00:00
Csoregi Natalia
1b9596a92c Backed out changeset b6399ca8a2c1 (bug 1706347) for failures on iframe-cross-origin-print.sub.html. CLOSED TREE 2021-07-20 00:41:23 +03:00
Peter Van der Beken
276952b05e Bug 1706347 - Check mOOPChildrenLoading when deciding to put page in BFCache with Fission enabled. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D117199
2021-07-19 19:18:02 +00:00
Dorel Luca
42ae3bea10 Merge autoland to mozilla-central. a=merge 2021-07-14 00:41:42 +03:00
Dorel Luca
d1e1f219ba Backed out changeset 0e17878eeb86 (bug 1711437) for causing Bug 1719963. a=backout DONTBUILD 2021-07-14 00:36:05 +03:00
vinoth
eedf3ef13e Bug 1432170 - Add tests for CSP sandbox bypass with Blob. r=ckerschb,dveditz
Differential Revision: https://phabricator.services.mozilla.com/D118008
2021-07-13 13:54:32 +00:00
Masayuki Nakano
d9481b8a6a Bug 1706268 - Add telemetry probes to collect usage of Document.execCommand etc with Gecko-specific commands r=smaug, data-review=travis_
Currently, `increasefontsize`, `decreasefontsize`, `gethtml`, `heading`,
`contentReadOnly`, `readonly` and `insertBrOnReturn` commands are supported
only by Gecko.  So, if nobody uses some or all of them, we can drop the
unused commands.

For saving the space of `Document.mUseCounters`, this patch groups
`Document.queryCommandState` and `Document.queryCommandValue` because they
are both getter of the command.  The difference is not important.  And also
this patch groups `Document.queryCommandSupported` and
`Document.queryCommandEnabled` because they may be used for feature detection
and the difference is not important.

Differential Revision: https://phabricator.services.mozilla.com/D118956
2021-07-13 12:39:15 +00:00
Emilio Cobos Álvarez
241951bce9 Bug 1711437 - Don't EnsureUniqueInner from the cssRules getter. r=layout-reviewers,jfkthame
Instead, fix up the various content data structures when the stylesheet
is mutated. This makes reading a stylesheet not disable style sharing.

Differential Revision: https://phabricator.services.mozilla.com/D115203
2021-07-12 16:02:58 +00:00
Alexandru Michis
6550c23862 Backed out changeset 998af7ced46f (bug 1711437) for causing Bug 1719963. a=backout 2021-07-10 12:44:08 +03:00
Emilio Cobos Álvarez
3de336bbc1 Bug 1711437 - Don't EnsureUniqueInner from the cssRules getter. r=layout-reviewers,jfkthame
Instead, fix up the various content data structures when the stylesheet
is mutated. This makes reading a stylesheet not disable style sharing.

Differential Revision: https://phabricator.services.mozilla.com/D115203
2021-07-09 16:25:54 +00:00
Neil Deakin
931c6d6227 Bug 1717680, remove the now unused document.popupNode and document.tooltipNode properties, r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D118524
2021-07-09 11:51:15 +00:00
Emilio Cobos Álvarez
a7273a0cfc Bug 1717620 - ResizeObserverController shouldn't need to keep observers alive. r=smaug
The observers take care of unregistering when they need to. Instead,
make the ResizeObservation keep the element alive just like
nsMutationReceiver keeps the mutation observer alive.

Differential Revision: https://phabricator.services.mozilla.com/D118477
2021-07-09 09:29:18 +00:00
Marian-Vasile Laza
62e5bd4ede Backed out changeset 5a4f865e6d5d (bug 1717620) for causing crashes in Bug 1718286. a=backout DONTBUILD 2021-06-26 00:37:43 +03:00
Emilio Cobos Álvarez
e19569fbb1 Bug 1717620 - ResizeObserverController shouldn't need to keep observers alive. r=smaug
The observers take care of unregistering when they need to. Instead,
make the ResizeObservation keep the element alive just like
nsMutationReceiver keeps the mutation observer alive.

Differential Revision: https://phabricator.services.mozilla.com/D118477
2021-06-24 15:01:05 +00:00
Peter Van der Beken
71e7900a51 Bug 1711544 - Move decision about name resetting to the parent process if we're replacing the BC for BFCache in the parent. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D116759
2021-06-21 10:31:36 +00:00
Emilio Cobos Álvarez
9db2aa0440 Bug 1699837 - Make sure that remote iframes honor print settings. r=mattwoodrow
This fixes it since we honor the print resolution properly now.

Differential Revision: https://phabricator.services.mozilla.com/D115263
2021-06-13 09:16:53 +00:00
Dana Keeler
ef0a88c6f2 Bug 1715142 - introduce nsIPublicKeyPinningService and remove 'type' parameter from nsISiteSecurityService r=rmf,necko-reviewers
The public key pinning implementation is much less complex than the HSTS
implementation, and only needs a small subset of the parameters of the latter.
Furthermore, the information it relies on is static, and so is safe to access
from content processes. This patch separates the two implementations, thus
simplifying both of them and avoiding some unnecessary IPC calls in the
process.

Differential Revision: https://phabricator.services.mozilla.com/D117096
2021-06-12 01:12:25 +00:00
Butkovits Atila
e4394b27a2 Backed out 3 changesets (bug 1715142) for causing build bustages. CLOSED TREE
Backed out changeset 7e67994f6a65 (bug 1715142)
Backed out changeset f58d5156f332 (bug 1715142)
Backed out changeset f8a7bd4519c6 (bug 1715142)
2021-06-11 21:20:02 +03:00
Dana Keeler
f84faf1bf5 Bug 1715142 - introduce nsIPublicKeyPinningService and remove 'type' parameter from nsISiteSecurityService r=rmf,necko-reviewers
The public key pinning implementation is much less complex than the HSTS
implementation, and only needs a small subset of the parameters of the latter.
Furthermore, the information it relies on is static, and so is safe to access
from content processes. This patch separates the two implementations, thus
simplifying both of them and avoiding some unnecessary IPC calls in the
process.

Differential Revision: https://phabricator.services.mozilla.com/D117096
2021-06-11 17:58:19 +00:00
Dorel Luca
71abb3ab93 Backed out changeset 43a82597dade (bug 1699837) for Crashtest in layout/printing/crashtests/1671503.html. CLOSED TREE 2021-06-11 19:48:10 +03:00
Emilio Cobos Álvarez
7af763acbe Bug 1699837 - Make sure that remote iframes honor print settings. r=mattwoodrow
This fixes it since we honor the print resolution properly now.

Differential Revision: https://phabricator.services.mozilla.com/D115263
2021-06-11 13:07:55 +00:00
Iulian Moraru
955a3ab572 Backed out 2 changesets (bug 1715142) for causing marionette failures on test_navigation.py and mochitest failures on browser_setIgnoreCertificateErrors.js. CLOSED TREE
Backed out changeset 83206685ca0b (bug 1715142)
Backed out changeset ab3060a5f69e (bug 1715142)
2021-06-11 02:45:34 +03:00
Dana Keeler
f3c620e4c3 Bug 1715142 - introduce nsIPublicKeyPinningService and remove 'type' parameter from nsISiteSecurityService r=rmf,necko-reviewers
The public key pinning implementation is much less complex than the HSTS
implementation, and only needs a small subset of the parameters of the latter.
Furthermore, the information it relies on is static, and so is safe to access
from content processes. This patch separates the two implementations, thus
simplifying both of them and avoiding some unnecessary IPC calls in the
process.

Differential Revision: https://phabricator.services.mozilla.com/D117096
2021-06-10 22:13:32 +00:00
Masayuki Nakano
4bc0632c23 Bug 1713758 - Make everyone outside editor module use EditorBase instead of TextEditor if the instance can be an HTMLEditor instance r=m_kato
Differential Revision: https://phabricator.services.mozilla.com/D117119
2021-06-09 23:51:37 +00:00
Olli Pettay
08f0e2afbb Bug 1706167, don't update SessionHistoryEntry.title when doing same document navigations, r=peterv
The change to DoNotifyPossibleTitleChange handling is needed so that we flush the pending title change
before adding a new active entry.

aUpdateEntryInSessionHistory is a bit odd name, since it is really about SHIP only. The patch isn't trying to
fix non-SHIP UI issues, but just give Fission similar behavior what Chrome has.

Differential Revision: https://phabricator.services.mozilla.com/D116504
2021-06-08 12:49:47 +00:00
Henri Sivonen
9bac3b6ab2 Bug 1709125 - Make Document::HasFocus() use the BrowsingContext hierarchy. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D114348
2021-06-04 17:05:02 +00:00
Edgar Chen
1ebbd60592 Bug 1685421 - Part 2: Stop using NS_ERROR_DOM_HIERARCHY_REQUEST_ERR in nsINode; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D113344
2021-06-02 13:43:39 +00:00
Edgar Chen
e4b0233fcd Bug 1685421 - Part 1: Stop using NS_ERROR_DOM_HIERARCHY_REQUEST_ERR in Document; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D113343
2021-06-02 13:43:38 +00:00
R. Martinho Fernandes
7ea1bcd018 Bug 1597600 - make certificate overrides depend on origin attributes r=keeler,geckoview-reviewers,smaug,agi
Differential Revision: https://phabricator.services.mozilla.com/D91962
2021-06-01 06:55:07 +00:00
Matt Woodrow
c1f699cc3d Bug 1713489 - Record telemetry for how long we spend waiting on the main thread to process image preload network steps. r=bas,dragana,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D116318
2021-05-31 22:44:18 +00:00
Dorel Luca
211b017ce9 Backed out changeset 089c88b9657b (bug 1597600) for XPCshell failures in toolkit/components/cleardata/tests/unit/test_certs.js. CLOSED TREE 2021-05-29 23:31:00 +03:00
R. Martinho Fernandes
a9e55ea7fc Bug 1597600 - make certificate overrides depend on origin attributes r=keeler,geckoview-reviewers,smaug,agi
Differential Revision: https://phabricator.services.mozilla.com/D91962
2021-05-29 19:34:35 +00:00
Sean Feng
debfd025a0 Bug 1690905 - Report the DOM portion of memory usage for data documents in about:memory r=smaug
Depends on D111317

Differential Revision: https://phabricator.services.mozilla.com/D111318
2021-05-27 17:55:45 +00:00
Sean Feng
e58bb429df Bug 1690905 - Factors DOM memory sizes out to its own struct r=mccr8
This patch factors the DOM related sizes in nsWindowSizes to its own
struct, such that callers can easily acess DOM memory sizes.

Differential Revision: https://phabricator.services.mozilla.com/D111317
2021-05-27 17:55:44 +00:00
Andrew McCreight
de9a604411 Bug 1709236 - Avoid calling Document::GetDocGroup() during unlinking. r=farre
Running AssertDocGroupMatchesKey() on an unlinked document can cause
a crash in debug builds, so pass in the group directly, because all
of the callers are Documents so they already have it.

Differential Revision: https://phabricator.services.mozilla.com/D115272
2021-05-18 16:32:08 +00:00
Nika Layzell
c2a86c631c Bug 1711078 - Part 1: Stop using the component manager to create non-system principals, r=ckerschb
This is necessary to remove the Init methods from principals, allowing
immutable fields to be marked as const and clearly separated from mutable
fields to improve threadsafety.

Differential Revision: https://phabricator.services.mozilla.com/D115091
2021-05-17 20:50:08 +00:00
Emilio Cobos Álvarez
8e90e61906 Bug 1710822 - Copy mIsSrcdocDocument for print clones. r=smaug
So that we correctly avoid choosing about:srcdoc as a base URI.

Differential Revision: https://phabricator.services.mozilla.com/D114989
2021-05-12 18:24:48 +00:00
Denis Palmeiro
d2a8c4a659 Bug 1709139 - Replace JS pageload proportion probes with absolute time measurements and add new probes to measure GC and main thread parsing impact during page load. r=sfink,iain,smaug
Replace JS pageload proportion probes with absolute time measurements and add new probes to measure GC and main thread parsing impact during page load.

Differential Revision: https://phabricator.services.mozilla.com/D114388
2021-05-12 16:38:40 +00:00
Edgar Chen
f10ffb593c Bug 1709217 - Part 6: Get rid of NS_ERROR_DOM_INVALID_STATE_DOCUMENT_QUERY_COMMAND_VALUE; r=smaug
Depends on D114185

Differential Revision: https://phabricator.services.mozilla.com/D114186
2021-05-11 19:38:46 +00:00
Edgar Chen
22ee127c8b Bug 1709217 - Part 5: Get rid of NS_ERROR_DOM_INVALID_STATE_DOCUMENT_QUERY_COMMAND_SUPPORTED; r=smaug
Depends on D114184

Differential Revision: https://phabricator.services.mozilla.com/D114185
2021-05-11 19:38:46 +00:00
Edgar Chen
0362d20990 Bug 1709217 - Part 4: Get rid of NS_ERROR_DOM_INVALID_STATE_DOCUMENT_QUERY_COMMAND_STATE; r=smaug
Depends on D114183

Differential Revision: https://phabricator.services.mozilla.com/D114184
2021-05-11 19:38:45 +00:00
Edgar Chen
d1ca0306a2 Bug 1709217 - Part 3: Get rid of NS_ERROR_DOM_INVALID_STATE_DOCUMENT_QUERY_COMMAND_INDETERM; r=smaug
Depends on D114182

Differential Revision: https://phabricator.services.mozilla.com/D114183
2021-05-11 19:38:45 +00:00
Edgar Chen
b6a7d80197 Bug 1709217 - Part 2: Get rid of NS_ERROR_DOM_INVALID_STATE_DOCUMENT_QUERY_COMMAND_ENABLED; r=smaug
Depends on D114181

Differential Revision: https://phabricator.services.mozilla.com/D114182
2021-05-11 19:38:44 +00:00
Edgar Chen
567d46362c Bug 1709217 - Part 1: Get rid of NS_ERROR_DOM_INVALID_STATE_DOCUMENT_EXEC_COMMAND; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D114181
2021-05-11 19:38:44 +00:00
Csoregi Natalia
0b62baa16a Backed out changeset 86a2163e7a47 (bug 1709125) for failures on test_hover_mouseleave.html. CLOSED TREE 2021-05-08 18:54:14 +03:00
Henri Sivonen
fe2cba99c6 Bug 1709125 - Make Document::HasFocus() use the BrowsingContext hierarchy. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D114348
2021-05-07 16:16:35 +00:00
Edgar Chen
a3ff3d48aa Bug 1709200 - Rename nsContentUtils::GetRootDocument to GetInProcessSubtreeRootDocument; r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D114177
2021-05-05 09:42:20 +00:00
Valentin Gosu
a656634321 Bug 1694662 - Remove appcache from document r=dragana
Differential Revision: https://phabricator.services.mozilla.com/D106448
2021-04-30 07:20:21 +00:00
Olli Pettay
ce456233be Bug 1706090 - Only allow unload event listeners in bfcache when doing cross-site navigation, r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D112621
2021-04-27 23:30:17 +00:00
Olli Pettay
83625b981f Bug 1704068 - Enable test_multi_sharedWorker_lifetimes_bfcache.html on Fission, r=peterv,emilio
Differential Revision: https://phabricator.services.mozilla.com/D111403
2021-04-26 22:25:58 +00:00
Masayuki Nakano
7ce105e3db Bug 1705519 - Make Document::ExecCommand not stop handling selectall command when there is no editable content r=smaug
When `document.execCommand("selectall")` is called, it should behave exactly
same as "Select All" in the UI for compatibility with the other browsers.

And also this patch fixes a bug of the WPT.  `selectionchange` event should
be fired, but asynchronously.  Therefore, Chrome also fails the check.

Differential Revision: https://phabricator.services.mozilla.com/D112307
2021-04-19 23:03:54 +00:00
Brendan Early
11d4046786 Bug 1120222 - Set AudioSink name to title of MediaElement's parent r=padenot
Differential Revision: https://phabricator.services.mozilla.com/D93462
2021-04-19 15:17:26 +00:00
Peter Van der Beken
164f59d833 Bug 1696158 - Move CanSavePresentation to the parent process. Keep track of various flags for deciding whether to put a page in BFCache. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D110231
2021-04-19 14:50:54 +00:00
smolnar
84a0543987 Backed out 8 changesets (bug 1696158) for causing multiple failures. CLOSED TREE
Backed out changeset 09c598c8fd29 (bug 1696158)
Backed out changeset 02f956c26901 (bug 1696158)
Backed out changeset b61a3a324cce (bug 1696158)
Backed out changeset 95810ed7f1e5 (bug 1696158)
Backed out changeset 4f93a7b61496 (bug 1696158)
Backed out changeset c80c55b56f2a (bug 1696158)
Backed out changeset 11627c409882 (bug 1696158)
Backed out changeset b98b4316a510 (bug 1696158)
2021-04-19 17:04:08 +03:00
Peter Van der Beken
a1306f8324 Bug 1696158 - Move CanSavePresentation to the parent process. Keep track of various flags for deciding whether to put a page in BFCache. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D110231
2021-04-19 12:39:19 +00:00
Kris Maglione
62019b1fab Bug 1704686: Rename Document::GetTopLevelContentDocument. r=nika
It's deprecated, and returns null if the top document isn't in-process, so its
name should be clear on that point.

Differential Revision: https://phabricator.services.mozilla.com/D111771
2021-04-15 21:19:28 +00:00
Olli Pettay
fae44f08b8 Bug 1692639 - Change dom/broadcastchannel/tests/test_bfcache.html to use BroadcastChannel, r=annyG
This changes the test a bit. It doesn't test BroadcastChannel's postMessage anymore, but receiving the message.
I can't see how postMessage could be tested, since given the new setup, no one should have access to it anymore.

This is functionally now very similar to another test I wrote recently, but I think it is fine to keep this too.

Differential Revision: https://phabricator.services.mozilla.com/D109539
2021-04-08 21:15:02 +00:00
Emilio Cobos Álvarez
5d28fe67d1 Bug 1702867 - Static print documents do have a browsing context and are loaded as data. r=smaug
Document::CrossOriginIsolated() was assuming this wasn't possible,
so when you print from an isolated page from a different site, then we
end up with the wrong docgroup.

Differential Revision: https://phabricator.services.mozilla.com/D110988
2021-04-06 19:29:49 +00:00
David Parks
7a4e918916 Bug 1682030 - Clean up NPAPI plugin fallback behavior. r=jmathies,emilio
Similifies use of EventStates and ObjectType/FallbackType enums since most states they represented are no longer valid with the removal of NPAPI plugins.  The state machine for (unsupported) plugin elements is now much simpler but still distinguishes between HTML fallbacks, fallbacks leading to a "BROKEN" state (e.g. failing to load the image the element refers to), and fallbacks that would simply lead the element to occupy an empty region.  The last type of fallback is behind a pref "layout.use-plugin-fallback" and is disabled by default.

Simplifying the state machine allows us to clean up nsObjectLoadingContent.  We also update many of the enums which refered to plugins, which would otherwise get confusing.

Differential Revision: https://phabricator.services.mozilla.com/D107158
2021-04-06 19:28:18 +00:00
Csoregi Natalia
d68661e2cc Backed out 24 changesets (bug 1682030) for bustage on ProcessHangMonitor.cpp and nsCOMPtr.h. CLOSED TREE
Backed out changeset 5b1644096477 (bug 1682030)
Backed out changeset 35ae60eea3c7 (bug 1682030)
Backed out changeset 3eca76a6d639 (bug 1682030)
Backed out changeset 259c45447ad9 (bug 1682030)
Backed out changeset de9222dc8c31 (bug 1682030)
Backed out changeset 2986c7e14349 (bug 1682030)
Backed out changeset 6af3410bdb93 (bug 1682030)
Backed out changeset 42b0621c2927 (bug 1682030)
Backed out changeset 366e3e371858 (bug 1682030)
Backed out changeset 9adb2865adea (bug 1682030)
Backed out changeset 6af6af3bc03a (bug 1682030)
Backed out changeset da94a91b35ae (bug 1682030)
Backed out changeset 9143da258d0e (bug 1682030)
Backed out changeset 5e20d06952ba (bug 1682030)
Backed out changeset 6253d7e1ce7d (bug 1682030)
Backed out changeset 0e06ddeea3e2 (bug 1682030)
Backed out changeset 9c58d57c9e44 (bug 1682030)
Backed out changeset e90edd89430e (bug 1682030)
Backed out changeset 5861b8166b10 (bug 1682030)
Backed out changeset b4b88cdc7993 (bug 1682030)
Backed out changeset b80054e9805c (bug 1682030)
Backed out changeset 580d857674c0 (bug 1682030)
Backed out changeset a9cdf93c2662 (bug 1682030)
Backed out changeset 9c9c8b4998e2 (bug 1682030)
2021-04-06 03:54:12 +03:00
David Parks
ef8f5b1e09 Bug 1682030 - Clean up NPAPI plugin fallback behavior. r=jmathies,emilio
Similifies use of EventStates and ObjectType/FallbackType enums since most states they represented are no longer valid with the removal of NPAPI plugins.  The state machine for (unsupported) plugin elements is now much simpler but still distinguishes between HTML fallbacks, fallbacks leading to a "BROKEN" state (e.g. failing to load the image the element refers to), and fallbacks that would simply lead the element to occupy an empty region.  The last type of fallback is behind a pref "layout.use-plugin-fallback" and is disabled by default.

Simplifying the state machine allows us to clean up nsObjectLoadingContent.  We also update many of the enums which refered to plugins, which would otherwise get confusing.

Differential Revision: https://phabricator.services.mozilla.com/D107158
2021-04-05 23:48:42 +00:00
Sean Feng
d5bb4c62a6 Bug 1696352 - Handle SetHadLazyLoadImage failure gracefully r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D110803
2021-04-05 15:35:51 +00:00
Tim Huang
ffb0945fe9 Bug 1695050 - Part 6: Update the call-site of CookieJarSettings::Create() for Document. r=dimi
Differential Revision: https://phabricator.services.mozilla.com/D109049
2021-03-29 11:01:52 +00:00
Kris Maglione
5db2bf4bdb Bug 1581859: Part 3b - Update existing GetPropertyAsInterface callers to use typesafe do_GetProperty instead. r=mccr8,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D103211
2021-03-25 19:47:02 +00:00
Simon Giesecke
613e20d136 Bug 1184468 - Use nsBaseHashtable::Values. r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D108587
2021-03-24 17:56:49 +00:00
Simon Giesecke
4803e61816 Bug 708901 - Migrate to nsTHashSet in dom/base. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D108593
2021-03-24 17:56:46 +00:00
Csoregi Natalia
f54ee076ae Backed out 13 changesets (bug 708901, bug 1184468) for causing build bustage on GeckoViewHistory.cpp. CLOSED TREE
Backed out changeset b1e4c01e63b8 (bug 708901)
Backed out changeset 37b52cce83c0 (bug 708901)
Backed out changeset eee75f33f060 (bug 708901)
Backed out changeset 479bf64c7986 (bug 708901)
Backed out changeset 15a8fb94d15d (bug 708901)
Backed out changeset be31ccd9a61d (bug 708901)
Backed out changeset fc54f4eaedd5 (bug 708901)
Backed out changeset 03c3a56c3d13 (bug 708901)
Backed out changeset 73f11d3c1298 (bug 708901)
Backed out changeset aed22fd80893 (bug 708901)
Backed out changeset 74d8249fbe7e (bug 708901)
Backed out changeset acb725eb3c1d (bug 1184468)
Backed out changeset 70f3ea6efec4 (bug 1184468)
2021-03-24 19:26:20 +02:00
Simon Giesecke
82e566bfca Bug 708901 - Migrate to nsTHashSet in dom/base. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D108593
2021-03-24 16:58:58 +00:00
Csoregi Natalia
024e0b2323 Backed out 10 changesets (bug 1581859) for causing hazard failures. CLOSED TREE
Backed out changeset 93fe6801a5e2 (bug 1581859)
Backed out changeset 0a33cb185fb3 (bug 1581859)
Backed out changeset 9ceaad6dab5b (bug 1581859)
Backed out changeset ee611f0839ca (bug 1581859)
Backed out changeset 4199963fe477 (bug 1581859)
Backed out changeset b4c5ace21b9e (bug 1581859)
Backed out changeset 6003469dc449 (bug 1581859)
Backed out changeset 826c62b783c0 (bug 1581859)
Backed out changeset e1d7851295fd (bug 1581859)
Backed out changeset 9796577af27a (bug 1581859)
2021-03-24 08:48:00 +02:00
Masayuki Nakano
fad3ed3447 Bug 1220696 - part 5: Support "contentReadOnly" and "getHTML" commands in <input> and <textarea> r=smaug
Although these commands supported supported only by Gecko, we shouldn't stop
supporting them unless we know the usage in the wild.  Therefore, this patch
adds the handling code for `TextEditor` too.

Differential Revision: https://phabricator.services.mozilla.com/D108571
2021-03-24 01:55:09 +00:00
Masayuki Nakano
b2fd51c051 Bug 1220696 - part 4: Make Document consider whether the target is editable or not-editable with target editor r=smaug
Currently, `Document` checks it only with whether the document is editable
or not.  Only with this check, `execCommand` and the other related methods
work only when there is `contenteditable`.

Therefore, this patch makes it to check whether the target is editable or not
with target editor.

Differential Revision: https://phabricator.services.mozilla.com/D108570
2021-03-24 01:55:08 +00:00
Masayuki Nakano
f956ee81ea Bug 1220696 - part 3: Make AutoEditorCommandTarget consider command handling editor with command and focused TextEditor or HTMLEditor r=smaug
For making `execCommand` and related methods with `<input>` and `<textarea>`
even if they are in `contenteditable` and focused, command should be handled
in active editor (focused editor if in foreground window and tab).

However, some commands should be handled by `HTMLEditor` even if an `TextEditor`
has focus.  Therefore, this patch adds new enum class which have 3 state into
`InternalCommandData` and makes `AutoEditorCommandTarget` consider it with the
enum class.

Note that the new failures about `contentReadOnly` command will be fixed by
a following patch.

Differential Revision: https://phabricator.services.mozilla.com/D108569
2021-03-24 01:55:08 +00:00
Masayuki Nakano
11e0a6e76c Bug 1220696 - part 2: Make related methods of Document::ExecCommand use AutoEditorCommandTarget r=smaug
This will guarantee that when `<input>` or `<textarea>` is in `contenteditable`,
`execCommand` and the other related methods work with same command class
instance and same command context (in this case, it's editor instance).

Differential Revision: https://phabricator.services.mozilla.com/D108568
2021-03-24 01:55:07 +00:00
Masayuki Nakano
4c7c22c5b9 Bug 1220696 - part 1: Split off the code considering EditorCommand in Document::ExecCommand r=smaug
Editor command should be handled in same command table between `ExecCommand`
and the other related methods.  However, currently, only `ExecCommand` does
optimized things.  For using same logic in the other methods, the code should
be in an independent stack class.

Differential Revision: https://phabricator.services.mozilla.com/D108567
2021-03-24 01:55:07 +00:00
Kris Maglione
6e2223e151 Bug 1581859: Part 3b - Update existing GetPropertyAsInterface callers to use typesafe do_GetProperty instead. r=mccr8,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D103211
2021-03-23 23:57:11 +00:00
Butkovits Atila
3361c11f7d Backed out 7 changesets (bug 1220696) for causing build bustages. CLOSED TREE
Backed out changeset 1ad2d5c0f253 (bug 1220696)
Backed out changeset 5e2f62a11d95 (bug 1220696)
Backed out changeset 07012ed7a30e (bug 1220696)
Backed out changeset a4e90de9355d (bug 1220696)
Backed out changeset 63ec6c3d05fd (bug 1220696)
Backed out changeset f165f45f8e1a (bug 1220696)
Backed out changeset ade95bf58db4 (bug 1220696)
2021-03-24 01:34:56 +02:00
Masayuki Nakano
843cdb6b35 Bug 1220696 - part 5: Support "contentReadOnly" and "getHTML" commands in <input> and <textarea> r=smaug
Although these commands supported supported only by Gecko, we shouldn't stop
supporting them unless we know the usage in the wild.  Therefore, this patch
adds the handling code for `TextEditor` too.

Differential Revision: https://phabricator.services.mozilla.com/D108571
2021-03-23 19:29:23 +00:00
Masayuki Nakano
4bce87d3e4 Bug 1220696 - part 4: Make Document consider whether the target is editable or not-editable with target editor r=smaug
Currently, `Document` checks it only with whether the document is editable
or not.  Only with this check, `execCommand` and the other related methods
work only when there is `contenteditable`.

Therefore, this patch makes it to check whether the target is editable or not
with target editor.

Differential Revision: https://phabricator.services.mozilla.com/D108570
2021-03-23 19:29:22 +00:00
Masayuki Nakano
fc94975380 Bug 1220696 - part 3: Make AutoEditorCommandTarget consider command handling editor with command and focused TextEditor or HTMLEditor r=smaug
For making `execCommand` and related methods with `<input>` and `<textarea>`
even if they are in `contenteditable` and focused, command should be handled
in active editor (focused editor if in foreground window and tab).

However, some commands should be handled by `HTMLEditor` even if an `TextEditor`
has focus.  Therefore, this patch adds new enum class which have 3 state into
`InternalCommandData` and makes `AutoEditorCommandTarget` consider it with the
enum class.

Note that the new failures about `contentReadOnly` command will be fixed by
a following patch.

Differential Revision: https://phabricator.services.mozilla.com/D108569
2021-03-23 19:29:22 +00:00
Masayuki Nakano
79e9ddf2f5 Bug 1220696 - part 2: Make related methods of Document::ExecCommand use AutoEditorCommandTarget r=smaug
This will guarantee that when `<input>` or `<textarea>` is in `contenteditable`,
`execCommand` and the other related methods work with same command class
instance and same command context (in this case, it's editor instance).

Differential Revision: https://phabricator.services.mozilla.com/D108568
2021-03-23 19:29:21 +00:00
Masayuki Nakano
7c376d3a5d Bug 1220696 - part 1: Split off the code considering EditorCommand in Document::ExecCommand r=smaug
Editor command should be handled in same command table between `ExecCommand`
and the other related methods.  However, currently, only `ExecCommand` does
optimized things.  For using same logic in the other methods, the code should
be in an independent stack class.

Differential Revision: https://phabricator.services.mozilla.com/D108567
2021-03-23 19:29:21 +00:00
Cosmin Sabou
7eba371387 Backed out 10 changesets (bug 1581859) for causing hazard failures on ExtensionsParent.cpp.
Backed out changeset 6020ec7d7f32 (bug 1581859)
Backed out changeset 07901e457839 (bug 1581859)
Backed out changeset e23389fc98b5 (bug 1581859)
Backed out changeset 4287eebc2c77 (bug 1581859)
Backed out changeset eeff6f501cfc (bug 1581859)
Backed out changeset 22db36f7d16d (bug 1581859)
Backed out changeset 16831d45d0ed (bug 1581859)
Backed out changeset 816643de7694 (bug 1581859)
Backed out changeset 6fd5aa7895e3 (bug 1581859)
Backed out changeset 2b68d2eee18e (bug 1581859)
2021-03-23 05:48:27 +02:00
Kris Maglione
2c7c5a81f0 Bug 1581859: Part 3b - Update existing GetPropertyAsInterface callers to use typesafe do_GetProperty instead. r=mccr8,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D103211
2021-03-22 20:12:16 +00:00
Olli Pettay
b535d5b970 Bug 1698663 - Make Document::RemoveFromBFCacheSync() work with SHIP+BFCache, r=peterv
Depends on D108487

Differential Revision: https://phabricator.services.mozilla.com/D108851
2021-03-21 21:46:25 +00:00
Nika Layzell
c733984c4b Bug 1675820 - Part 6: Make DocGroup cycle-collected, r=farre,smaug
Previously, the DocGroup type was not cycle-collected, as it needed to have
references from other threads for Quantum DOM. Nowadays the only off-main-thread
use of DocGroup is for dispatching runnables to the main thread which should be
tracked using a performance counter for about:performance. This means we can
remove the DocGroup references from these dispatching callsites, only storing
the Performance Counter we're interested in, and simplify make DocGroup be
cycle-collected itself.

This fixes a leak caused by adding the WindowGlobalChild getter to
WindowContext, by allowing cycles between the document and its BrowsingContext
to be broken by the cycle-collector.

Differential Revision: https://phabricator.services.mozilla.com/D108865
2021-03-18 19:24:50 +00:00
Narcis Beleuzu
ffb77b2d9a Backed out 9 changesets (bug 1581859) for bustages jsapi.h . CLOSED TREE
Backed out changeset 2a3a77ae1eae (bug 1581859)
Backed out changeset 181c3f29f222 (bug 1581859)
Backed out changeset f7c39feb502e (bug 1581859)
Backed out changeset 9c7d0015c616 (bug 1581859)
Backed out changeset d2b8ee78745d (bug 1581859)
Backed out changeset 92359266d420 (bug 1581859)
Backed out changeset 98ba6b96c900 (bug 1581859)
Backed out changeset 0eb043b5c904 (bug 1581859)
Backed out changeset 55a4c2fc561d (bug 1581859)
2021-03-18 08:26:57 +02:00
Kris Maglione
82fc76ce55 Bug 1581859: Part 3b - Update existing GetPropertyAsInterface callers to use typesafe do_GetProperty instead. r=mccr8,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D103211
2021-03-18 05:51:06 +00:00
Masayuki Nakano
6135954cfb Bug 1697078 - Make Document#execCommand and related methods never throw exceptions r=smaug
According to the source code of Chromium, we should throw exceptions from
them only when the document is not for HTML nor XHTML.  For the other reasons,
we should not throw any exceptions even if it's unknown command.

Differential Revision: https://phabricator.services.mozilla.com/D108573
2021-03-16 21:33:07 +00:00
Dimi Lee
f39a177e9a Bug 1166995 - P2. Call onFormSubmit when a form or a password field is removed from the DOM tree r=sfoster,tgiles,smaug
This patch adds two events - `DOMFormRemoved` and `DOMInputPasswordRemoved`.
These events are notified when a form/password field is removed from
the DOM tree. When the LoginManagerChild receives the event, it calls
_onFormSubmit as the form is submitted.

This patch also adds a WeakFieldSet formlessModifiedPasswordFields to
record all the form-less password fields that users have interacted
with to track whether a formless password is removed

Depends on D106024

Differential Revision: https://phabricator.services.mozilla.com/D106025
2021-03-16 09:15:19 +00:00
Dimi Lee
d6530bf9ad Bug 1166995 - P1. Notify DOMDocFetchSuccess when a fetch or XHR request completes successfully r=smaug,sfoster
The goal of this series of patches is to address the cases where sites
don't use standard form submission events.

The basic idea is inferring a form is submitted when the form is removed
from the DOM tree, but with one premise:
There must be a successful fetch or XHR request sent in the document before the
form is removed.

This is because websites usually send the credentials with a fetch or an
XHR. After the request succeeds, the website removes the form.

In summary, this patch does the following:
1. Add NotifyFetchOrXHRSuccess API in Document. The API sends a
   "DOMDocFetchSuccess" event to who registers the event listener.

2. When a fetch request or a XMLHttpReuqest completes and succeeds,
   call NotifyFetchOrXHRSuccess().

3. LoginMangerChild listen to `DOMDocFetchSuccess` event only when there
   is an user interaction on the password field.

Differential Revision: https://phabricator.services.mozilla.com/D106024
2021-03-16 09:15:19 +00:00
Simon Giesecke
91fdeec18c Bug 1695162 - Migrate from custom hashtable iteration to range-based for in accessible, dom/animation, dom/base, dom/localstorage, gfx/thebes. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D106895
2021-03-12 16:14:58 +00:00
Alexandru Michis
c691800cb0 Backed out changeset fd03162e726d (bug 1695162) for causing bustages in Document.cpp
CLOSED TREE
2021-03-12 17:10:02 +02:00
Simon Giesecke
2fb6095f16 Bug 1695162 - Migrate from custom hashtable iteration to range-based for in accessible, dom/animation, dom/base, dom/localstorage, gfx/thebes. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D106895
2021-03-12 14:54:08 +00:00
Steven MacLeod
bf39b3bc8e Bug 1647442 - handle OOP ancestors in Document::AdoptNode. r=nika
We now use BrowsingContext to climb the tree and grab frame elements so
we skip over any OOP ancestors.

`Document::GetBrowsingContext()` may be `null` when the document was
just created with `document.implementation.createDocument`.
`Document::GetWindow()` will also return `null` in this case, so we
assume the document isn't a descendant of the adoptedNode, preserving
the old behaviour.

Differential Revision: https://phabricator.services.mozilla.com/D107584
2021-03-09 18:37:26 +00:00
Henri Sivonen
9ff110ad01 Bug 1695537 - Make the template contents owner XML when not in HTML. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D107216
2021-03-09 13:34:51 +00:00
Simon Giesecke
cb6c8aead4 Bug 1695162 - Make nsTHashtable::ConstIter return a real ConstIterator. r=xpcom-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D107038
2021-03-09 10:28:16 +00:00
Emilio Cobos Álvarez
f43b9d5fe9 Bug 1696717 - Ignore viewport meta in fullscreen. r=botond
This seems to match Chrome, and makes our fullscreen implementation more
consistent between desktop and mobile.

Do you know how to best test this? This repros in RDM, but all
fullscreen tests seem disabled on Android...

Differential Revision: https://phabricator.services.mozilla.com/D107365
2021-03-09 03:28:02 +00:00
Emilio Cobos Álvarez
dc86e8c401 Bug 1684001 - Move the code to compute a principal for blocklisting to Document. r=masayuki
Depends on D107455

Differential Revision: https://phabricator.services.mozilla.com/D107456
2021-03-08 23:36:41 +00:00
Butkovits Atila
d795f5b731 Backed out 2 changesets (bug 1684001) for causing failures on test_ext_webRequest_filterResponseData.js. CLOSED TREE
Backed out changeset 2396dd65ee8d (bug 1684001)
Backed out changeset 52c6a21b39fb (bug 1684001)
2021-03-09 03:10:19 +02:00
Emilio Cobos Álvarez
5bc8dcd002 Bug 1684001 - Move the code to compute a principal for blocklisting to Document. r=masayuki
Depends on D107455

Differential Revision: https://phabricator.services.mozilla.com/D107456
2021-03-08 23:36:41 +00:00
Emilio Cobos Álvarez
d5a1f6115c Bug 1696717 - Constify the dom fullscreen code a bit. r=hiro
Differential Revision: https://phabricator.services.mozilla.com/D107362
2021-03-07 21:46:00 +00:00
Emilio Cobos Álvarez
8508ab62bb Bug 1694548 - Move devtools breakpoints out of mutation events. r=smaug,jdescottes
Use internal events which get fired for CSSOM changes, and in Shadow
DOM. This will also allow us to remove mutation events in the future.

Depends on D106273

Differential Revision: https://phabricator.services.mozilla.com/D106274
2021-03-02 18:57:31 +00:00
Emilio Cobos Álvarez
156a1feb88 Bug 1694548 - Rename Document.dontWarnAboutMutationEventsAndAllowSlowDOMMutations and other misc cleanup in Document. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D106273
2021-03-02 18:57:31 +00:00
Mihai Alexandru Michis
fd8d19d660 Backed out 2 changesets (bug 1694548) on suspicion of causing dt crashes in nsINode::LastRelease.
CLOSED TREE

Backed out changeset c87745c8f28b (bug 1694548)
Backed out changeset 3faa9b27e4a5 (bug 1694548)
2021-03-02 18:46:18 +02:00
Emilio Cobos Álvarez
d16bd56f10 Bug 1694548 - Move devtools breakpoints out of mutation events. r=smaug,jdescottes
Use internal events which get fired for CSSOM changes, and in Shadow
DOM. This will also allow us to remove mutation events in the future.

Depends on D106273

Differential Revision: https://phabricator.services.mozilla.com/D106274
2021-03-02 12:54:21 +00:00
Emilio Cobos Álvarez
9530285f69 Bug 1694548 - Rename Document.dontWarnAboutMutationEventsAndAllowSlowDOMMutations and other misc cleanup in Document. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D106273
2021-03-02 12:54:21 +00:00
Olli Pettay
9a5e1b83eb Bug 1689601, hide fission.bfcacheInParent pref access behind a function which checks that also SHIP is enabled, r=peterv,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D106562
2021-03-02 12:13:21 +00:00
Olli Pettay
911d46a8b6 Bug 1689601, try to use bfcache for top level pages, r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D105238
2021-03-02 12:13:20 +00:00
Olli Pettay
d9ede66ac9 Bug 1689601, add a log module for SHIP BFCache, r=peterv
There are quite a few different logging modules for session history, but while developing
SHIP BFCache, I'd prefer to add some specific one for it. Later we can perhaps
merge various modules to some generic session history related.

SHIPBFCache log module will be used more in the followup patches.

Differential Revision: https://phabricator.services.mozilla.com/D105237
2021-03-02 12:13:19 +00:00
Olli Pettay
2835639129 Bug 1689601, make it possible to call Document::CanSavePresentation non-recursively, r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D105236
2021-03-02 12:13:19 +00:00
Mihai Alexandru Michis
87f481bf9a Backed out 16 changesets (bug 1689601) for causing cpp bustages in nsFrameLoader.
CLOSED TREE

Backed out changeset 6e5523a7210d (bug 1689601)
Backed out changeset 745eaa468c74 (bug 1689601)
Backed out changeset a594bd02b8b6 (bug 1689601)
Backed out changeset 0c5fe977ced6 (bug 1689601)
Backed out changeset 2fca23521891 (bug 1689601)
Backed out changeset 334aeb627855 (bug 1689601)
Backed out changeset 2b2081a15d67 (bug 1689601)
Backed out changeset 307bde43cc96 (bug 1689601)
Backed out changeset 04aadec67ce2 (bug 1689601)
Backed out changeset 701eccb34772 (bug 1689601)
Backed out changeset 278db692aa8b (bug 1689601)
Backed out changeset c261c243a64d (bug 1689601)
Backed out changeset 7e8022e5696a (bug 1689601)
Backed out changeset 6138bfc6c08d (bug 1689601)
Backed out changeset 63295b3a62d0 (bug 1689601)
Backed out changeset 6d02e59ddc51 (bug 1689601)
2021-03-02 13:15:10 +02:00
Olli Pettay
f09a7f25d5 Bug 1689601, hide fission.bfcacheInParent pref access behind a function which checks that also SHIP is enabled, r=peterv,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D106562
2021-03-02 09:44:14 +00:00
Olli Pettay
101955fa30 Bug 1689601, try to use bfcache for top level pages, r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D105238
2021-03-02 09:44:12 +00:00
Olli Pettay
3571739670 Bug 1689601, add a log module for SHIP BFCache, r=peterv
There are quite a few different logging modules for session history, but while developing
SHIP BFCache, I'd prefer to add some specific one for it. Later we can perhaps
merge various modules to some generic session history related.

SHIPBFCache log module will be used more in the followup patches.

Differential Revision: https://phabricator.services.mozilla.com/D105237
2021-03-02 09:44:12 +00:00
Olli Pettay
1eac846424 Bug 1689601, make it possible to call Document::CanSavePresentation non-recursively, r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D105236
2021-03-02 09:44:11 +00:00
Simon Giesecke
ee037ba882 Bug 1693541 - Improve uses of nsBaseHashtable and descendants and avoid multiple subsequent lookups in dom/base. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D106105
2021-02-26 11:36:40 +00:00
Simon Giesecke
9af107a839 Bug 1691913 - Rename nsBaseHashtable::Put to InsertOrUpdate. r=xpcom-reviewers,necko-reviewers,jgilbert,dragana,nika
This makes the naming more consistent with other functions called
Insert and/or Update. Also, it removes the ambiguity whether
Put expects that an entry already exists or not, in particular because
it differed from nsTHashtable::PutEntry in that regard.

Differential Revision: https://phabricator.services.mozilla.com/D105473
2021-02-26 09:11:46 +00:00
Simon Giesecke
4f75368dcb Bug 1691913 - Rename nsBaseHashtable::GetOrInsert(With) to LookupOrInsert(With). r=xpcom-reviewers,necko-reviewers,jgilbert,dragana,nika
The functions should be called "Lookup" rather than "Get" because they return
a DataType& (rather than UserDataType).

Differential Revision: https://phabricator.services.mozilla.com/D105472
2021-02-26 09:11:45 +00:00
Emilio Cobos Álvarez
02f55d8bdf Bug 1694616 - Document doesn't need to inherit from nsStubMutationObserver. r=smaug
We don't override any of the methods. I wonder when this stopped being
useful, it seemed useless before bug 1420547 already, and the comment
oes back to bug 342062...

Differential Revision: https://phabricator.services.mozilla.com/D106268
2021-02-24 11:48:57 +00:00
Emilio Cobos Álvarez
15ff419df0 Bug 1694059 - Rename various nnt prefs. r=spohl,mstange
As per feedback in D105931.

Differential Revision: https://phabricator.services.mozilla.com/D105991
2021-02-22 20:05:35 +00:00
Alexis Beingessner
bd14ca539e Bug 1686616 - make ThirdPartyUtil use Components instead of Services. r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D105523
2021-02-18 13:26:29 +00:00
Sean Feng
93ae22d5b9 Bug 1692350 - Implement a telemetry probe to collect page load data for documents that use lazyload r=emilio,chutten
Differential Revision: https://phabricator.services.mozilla.com/D104912
2021-02-17 22:25:02 +00:00
Mihai Alexandru Michis
8d0efc214f Backed out changeset 6a0dcd8f4e3e (bug 1692350) for causing crashes in WindowContext.
CLOSED TREE
2021-02-17 21:02:59 +02:00
Sean Feng
7917a71b50 Bug 1692350 - Implement a telemetry probe to collect page load data for documents that use lazyload r=emilio,chutten
Differential Revision: https://phabricator.services.mozilla.com/D104912
2021-02-17 17:17:52 +00:00
Simon Giesecke
661e25bf09 Bug 1692880 - Make Put accept DataType instead of wrapping UserDataType. r=xpcom-reviewers,necko-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D104850
2021-02-16 15:53:33 +00:00
smolnar
1afbbe67e1 Backed out 5 changesets (bug 1691894) for causing hazard failures in nsXULPrototypeCache. CLOSED TREE
Backed out changeset 22dc870ee609 (bug 1691894)
Backed out changeset 58c31e9d6ae3 (bug 1691894)
Backed out changeset 7483e84149d8 (bug 1691894)
Backed out changeset f977d6cfa973 (bug 1691894)
Backed out changeset db4503476f34 (bug 1691894)
2021-02-15 16:43:23 +02:00
Simon Giesecke
3c29a68440 Bug 1691894 - Make Put accept DataType instead of wrapping UserDataType. r=xpcom-reviewers,necko-reviewers,nika
Differential Revision: https://phabricator.services.mozilla.com/D104850
2021-02-15 10:04:46 +00:00
Kris Maglione
0ec4615244 Bug 1662840: Move overrideDPPX from nsIContentViewer to BrowsingContext. r=whimboo,remote-protocol-reviewers,mtigley,emilio
Differential Revision: https://phabricator.services.mozilla.com/D104001
2021-02-10 01:30:35 +00:00
Simon Giesecke
d4f7649e81 Bug 1688833 - Migrate LookupForAdd to WithEntryHandle in dom/base. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D104203
2021-02-09 18:19:39 +00:00
James Teh
f01ed6dea6 Bug 1646486: Move dom::Document::IsVisibleConsideringAncestors to a11y::nsCoreUtils::IsDocumentVisibleConsideringInProcessAncestors. r=emilio
Renaming the function makes it clear that it only deals with in-process ancestors, which is an important distinction for Fission.
A11y is the only consumer of this and it only cares about in-process ancestors in this case (OOP stuff is handled elsewhere), so the functionality doesn't need to change.
Since a11y is the only consumer, move this into the a11y code.

Differential Revision: https://phabricator.services.mozilla.com/D104341
2021-02-09 00:44:21 +00:00
Kashav Madan
7c15901cf9 Bug 1646498 - Fix GetInProcessTop usage in nsAutoSyncOperation, r=kmag
This makes it so that we correctly set nsIGlobalObject::IsInSyncOperation
for in-process descendant frames that have out-of-process ancestors.

Differential Revision: https://phabricator.services.mozilla.com/D102330
2021-02-06 20:16:17 +00:00
Emilio Cobos Álvarez
c4c42b29f3 Bug 1690658 - Don't mess with SVG use shadow trees in print docs. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D104382
2021-02-08 13:23:22 +00:00
Emilio Cobos Álvarez
bfe77f303a Bug 1591120 - Move print and color-scheme simulation to browsingContext. r=ochameau,nika,devtools-backward-compat-reviewers
We keep mMedium in nsPresContext rather than just looking it up in the
browsing context because that's used quite more frequently.

Differential Revision: https://phabricator.services.mozilla.com/D103782
2021-02-03 10:38:09 +00:00
Emilio Cobos Álvarez
fe36177806 Bug 1637651 - Assume non-quirks mode for style Link header preloads. r=smaug
This is an issue I found while going through this code and
writing/debugging a test for the bug at hand. Without this, the test in
the actual fix for this bug will fail to actually reuse the preloaded
stylesheet.

It seems reasonable to assume that the intersection of quirks mode
documents using link preload headers is small (and in that case we'd
parse the sheet twice, but oh well).

Differential Revision: https://phabricator.services.mozilla.com/D103567
2021-02-01 23:23:50 +00:00
Butkovits Atila
ae40e11a24 Backed out changeset 4500122fa98d (bug 476384) as requested by Henri. CLOSED TREE 2021-01-30 11:36:07 +02:00
Butkovits Atila
254a9c3644 Backed out changeset 1acbaa0d067c (bug 1689541) as requested by Henri. CLOSED TREE 2021-01-30 11:35:29 +02:00
Sean Feng
71ce0cfc2a Bug 1687358 - Implement telemetry probes to determine the best possible threshold for <lazyload> r=emilio
This patch implements five telemetry probes to help us learn how
lazyload thresholds perform in the wild.

Differential Revision: https://phabricator.services.mozilla.com/D102845
2021-01-29 17:03:25 +00:00
Henri Sivonen
4da9196207 Bug 1689541 - Review comment fixup for bug 476384. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D103443
2021-01-29 08:51:16 +00:00
Henri Sivonen
e59c6f33f3 Bug 476384 - Use the TLD as a CJK font hint for UTF-8 pages. r=jfkthame
Differential Revision: https://phabricator.services.mozilla.com/D103188
2021-01-28 17:59:14 +00:00
Butkovits Atila
7127d7e4aa Backed out changeset 5fa332822cee (bug 1689052) for causing failures on nsPresContext.cpp. CLOSED TREE 2021-01-28 02:10:53 +02:00
Joan Jennings
4748dcb616 Bug 1689052 - Only get a docshell when the document is visible. r=rickiedennehy
Differential Revision: https://phabricator.services.mozilla.com/D103149
2021-01-27 22:51:11 +00:00
Edgar Chen
c2c0ea7709 Bug 1672330 - Move pointer lock code to PointerLockManager; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D101054
2021-01-27 16:38:29 +00:00
Dorel Luca
b5c5a81751 Backed out changeset 4e317086de97 (bug 1672330) for Mochitest failures in dom/tests/mochitest/pointerlock/test_pointerlock_focus.html. CLOSED TREE 2021-01-27 14:05:29 +02:00
Edgar Chen
b81855eeb2 Bug 1672330 - Move pointer lock code to PointerLockManager; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D101054
2021-01-27 10:08:29 +00:00
Bogdan Tara
a9b6b7cff8 Backed out changeset a77ccd1c1659 (bug 1687358) for browser_lazyload_telemetry.js failures CLOSED TREE 2021-01-27 02:46:06 +02:00
Sean Feng
14dee2e52c Bug 1687358 - Implement telemetry probes to determine the best possible threshold for <lazyload> r=emilio
This patch implements five telemetry probes to help us learn how
lazyload thresholds perform in the wild.

Differential Revision: https://phabricator.services.mozilla.com/D102845
2021-01-26 21:54:33 +00:00
Bogdan Tara
d8c3aca81c Backed out changeset a911e7cbb478 (bug 1646498) for open-features-negative-innerwidth-innerheight.html failures CLOSED TREE 2021-01-26 22:40:15 +02:00
Kashav Madan
cab4dac2a5 Bug 1646498 - Fix GetInProcessTop usage in nsAutoSyncOperation, r=kmag
This makes it so that we correctly set nsIGlobalObject::IsInSyncOperation
for in-process descendant frames that have out-of-process ancestors.

Differential Revision: https://phabricator.services.mozilla.com/D102330
2021-01-25 19:59:51 +00:00
Steven MacLeod
615c7cc3b1 Bug 1656107 - remove unused Document::FindContentForSubDocument. r=farre
Differential Revision: https://phabricator.services.mozilla.com/D98622
2021-01-21 00:45:14 +00:00
Steven MacLeod
101370035a Bug 1656107 - remove FindContentForSubDocument use from Document. r=farre
Differential Revision: https://phabricator.services.mozilla.com/D98621
2021-01-21 00:45:03 +00:00
Steven MacLeod
797463b77e Bug 1656107 - Add Document::GetEmbedderElement to replace Document::FindContentForSubDocument. r=farre
Differential Revision: https://phabricator.services.mozilla.com/D102516
2021-01-21 08:21:43 +00:00
Mats Palmgren
b80f010fb4 Bug 1687239 part 3 - Remove the PluginProblem UA Widget and related CSS pseudos. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D102901
2021-01-25 11:53:57 +00:00
Emilio Cobos Álvarez
b74a3bb722 Bug 1688508 - Fire shadowrootattached only if devtools is observing the document. r=smaug
Much like devtools manages the existing stylesheet changed events.

This is tested by devtools/client/inspector/markup/test/browser_markup_shadowdom.js

Differential Revision: https://phabricator.services.mozilla.com/D102875
2021-01-25 11:30:51 +00:00
Emilio Cobos Álvarez
dc3b061703 Bug 1572798 - Call MaybeActiveMediaComponents only if the visibility state changed. r=bzbarsky,farre
All sets of mVisibilityState go through this function now, and not
having a window implies that the visibility state must be hidden, so
this should be sound now.

I'll land this separately anyway since it's slightly more risky.

Differential Revision: https://phabricator.services.mozilla.com/D41439
2021-01-23 20:48:20 +00:00
Timothy Nikkel
cf1910bbf7 Bug 1688127. Fix warning spam in Document::GetParentFeaturePolicy. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D102690
2021-01-22 11:08:22 +00:00
Emilio Cobos Álvarez
80755ed700 Bug 1572798 - Should call MaybeActiveMediaComponents from SetScriptGlobalObject if becoming visible. r=bzbarsky,farre
Windows start blocking media by default (see the
media.block-autoplay-until-in-foreground pref).

If the document becomes visible from GetScriptHandlingObject(), we
hand-rolled our own UpdateVisibilityState and didn't call
MaybeActiveMediaComponents (which unblocks media playback).

It couldn't call it there before since given content docshells used
start as active, but now that they don't we can do that and fix the bug.

Differential Revision: https://phabricator.services.mozilla.com/D41438
2021-01-22 05:45:52 +00:00
Shane Caraveo
4a14410028 Bug 1594234 manifest v3 content security policy support r=robwu,geckoview-reviewers,agi
Implement manifest v3 CSP that is compatible with the current chrome implementation.

Support for content_security_policy.isolated_world (a.k.a. content_security_policy.content_scripts)
has been removed for consistency with
345390adf6%5E%21/

Differential Revision: https://phabricator.services.mozilla.com/D100573
2021-01-07 14:53:18 +00:00
Masatoshi Kimura
a29e207781 Bug 1685900 - Split internal and external contentPolicyType. r=ckerschb,smaug
Differential Revision: https://phabricator.services.mozilla.com/D101271
2021-01-15 12:07:16 +00:00
Narcis Beleuzu
0322452233 Backed out changeset a52961071dcd (bug 1685900) for Build bustage in nsContentSecurityManager.cpp. CLOSED TREE 2021-01-15 04:04:37 +02:00
Masatoshi Kimura
b384f14cde Bug 1685900 - Split internal and external contentPolicyType. r=ckerschb,smaug
Differential Revision: https://phabricator.services.mozilla.com/D101271
2021-01-15 04:02:41 +02:00
Dorel Luca
9ed19e2828 Backed out changeset a52961071dcd (bug 1685900) for Build bustage in nsContentSecurityManager.cpp. CLOSED TREE 2021-01-15 02:45:34 +02:00
Masatoshi Kimura
87e50835c4 Bug 1685900 - Split internal and external contentPolicyType. r=ckerschb,smaug
Differential Revision: https://phabricator.services.mozilla.com/D101271
2021-01-14 20:44:54 +00:00
Paul Zuehlcke
547f195fc5 Bug 1679512 - Move contentBlockingAllowListPrincipal to WindowGlobalParent. r=timhuang,nika
We only use the contentBlockingAllowListPrincipal for excluding sites from content
blocking for top level documents. We don't need it in the content process and should
not compute it for every document.

Differential Revision: https://phabricator.services.mozilla.com/D100781
2021-01-14 20:37:35 +00:00
Dana Keeler
103f64a076 Bug 1685552 - move certificate subject alternative name processing for error pages from backend to frontend r=bbeurdouche,johannh,baku
This removes nsIX509Cert.subjectAltNames and reduces potential attack surface
by avoiding parsing subject alternative names in C/C++. It also reduces PSM
reliance on NSS types.

Differential Revision: https://phabricator.services.mozilla.com/D101418
2021-01-14 09:58:03 +00:00
Steve Fink
67527b7f14 Bug 1685420 - ~nsCOMPtr and related hazard fixes. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D100966
2021-01-12 22:25:07 +00:00
Tom Tung
d7a1ef74c4 Bug 1685475 - Get cross-origin-isolated state from the scope object when it's a data document and thus don't have a browsing context; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D101327
2021-01-14 13:22:52 +00:00
Andreas Farre
78e800dabe Bug 1612147 - Don't store FeaturePolicy in BrowsingContext. r=smaug
Syncing the container FeaturePolicy across BrowsingContext is actually
a bit more heavy-handed than necessary. We only ever need a container
FeaturePolicy when inheriting a FeaturePolicy in exactly the document
the container contains. Not every process that the tree the container
is a part of. So instead of storing a FeaturePolicy in a synced field,
we manually send it to the correct WindowGlobalChild (which
corresponds to a document) and retrieve it from there.

Differential Revision: https://phabricator.services.mozilla.com/D61479
2021-01-14 11:15:24 +00:00
Edgar Chen
f3d1dfa460 Bug 1684837 - Adjust pointer lock request handling; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D100960
2021-01-08 21:18:07 +00:00
Olli Pettay
e831069d3a Bug 1682394 - Consider to not check *unload event listeners for bfcache, r=jesup
Differential Revision: https://phabricator.services.mozilla.com/D99716
2021-01-07 23:43:44 +00:00
Noemi Erli
ebe9167de8 Backed out changeset 4de429b6ad64 (bug 1572798) for causing browser chrome failures CLOSED TREE 2021-01-06 07:05:57 +02:00
Emilio Cobos Álvarez
9501e93bb6 Bug 1572798 - Should call MaybeActiveMediaComponents from SetScriptGlobalObject if becoming visible. r=bzbarsky,farre
Windows start blocking media by default (see the
media.block-autoplay-until-in-foreground pref).

If the document becomes visible from GetScriptHandlingObject(), we
hand-rolled our own UpdateVisibilityState and didn't call
MaybeActiveMediaComponents (which unblocks media playback).

It couldn't call it there before since given content docshells used
start as active, but now that they don't we can do that and fix the bug.

Differential Revision: https://phabricator.services.mozilla.com/D41438
2021-01-05 23:27:12 +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
a47b184119 Bug 1656107 - remove unused Document::FindContentForSubDocument. r=farre
Differential Revision: https://phabricator.services.mozilla.com/D98622
2020-12-17 13:54:40 +00:00
Steven MacLeod
aee135115c Bug 1656107 - remove FindContentForSubDocument use from Document. r=farre
Differential Revision: https://phabricator.services.mozilla.com/D98621
2020-12-16 01:06:57 +00:00
Emilio Cobos Álvarez
039592f4d8 Bug 1682003 - Avoid UTF-8 -> UTF-16 conversion during CSSOM serialization. r=heycam
This lifts a bunch of string conversions higher up the stack, but allows
us to make the servo code use utf-8 unconditionally, and seemed faster
in my benchmarking (see comment 0).

It should also make a bunch of attribute setters faster too (like
setting .cssText), now that we use UTF8String for them (we couldn't
because we couldn't specify different string types for the getter and
setters).

Differential Revision: https://phabricator.services.mozilla.com/D99590
2020-12-17 14:04:35 +00:00
Paul Zuehlcke
be3f13ec21 Bug 1654649 - Deny requestStorageAccess for sites with denied cookie permission. r=timhuang
Differential Revision: https://phabricator.services.mozilla.com/D99802
2020-12-16 16:45:18 +00:00
Sean Feng
12424aa6b0 Bug 1662265 - Fix input events handling for sync XHR when both TaskController and e10s are enabled r=smaug
There are two issues in our current setup

1) Input events which are occurring in the same tab are going to be lost
because sync XHR. We have event handling suppression for synx XHR, so input
events are going to be discarded.

2) Input events that are happening in another tab (same process as the
synx XHR tab) are not going to be delayed. This is not correct since
sync XHR should block the Javascript execution.

This patches fixes the above cases for when both TaskController and e10s are
enabled by suspending the InputTaskManager during sync XHR, which
delays the input event handling and keeps the events around.

Differential Revision: https://phabricator.services.mozilla.com/D90780
2020-12-15 01:33:24 +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
Simon Giesecke
5db2472bdf Bug 1673931 - Avoid including ReferrerPolicyBinding.h from header files. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D97610
2020-12-10 11:09:29 +00:00
Bryce Seager van Dyk
3c358eec6e Bug 1675360 - Shutdown MediaKeys when parent inner window is destroyed rather than document. r=karlt
Rework the MediaKeys class to shutdown when its parent inner window is destroyed
rather than the document it's created in. This is done to mitigate the case
where a MediaKeys is created in an about:blank document that has not yet
undergone its async load (i.e. blank document that will stay blank, blank
documents loading to other pages will still clobber their keys on load). This
specifically addresses cases where sites could create an iframe, not wait for
load, create a MediaKeys in the iframe, and then find the keys had become
unusable.

This is achieved by associating MediaKeys instances with their inner window and
having the window notify keys when a window is going to be destroyed. I decided
to use this approach rather than have MediaKeys observe for window destruction
for a few reasons:
- The keys would need to support weak references to use the observer service in
  the desired way. Implementing this interface on the MediaKeys adds a
  non-trivial level of complexity and means the keys would implement the WeakPtr
  interface (already in place prior to this patch) and also the NS weak
  reference interface, which I found confusing.
- If the inner window stores pointers to MediaKeys created in it, it can be self
  aware of if EME activity is taking place within it. The allows us to better
  identify EME activity in documents. Historically one of the ways we'd
  determined EME activity by checking if media elements have MediaKeys attached,
  but this had lead to issues where if MediaKeys are created but not attached
  to a media element we overlook them. With this patch's changes, we can also
  have a document check its inner window to see if there are any MediaKeys. This
  patch uses this to extend our check to avoid bfcaching pages with EME content.
- There appears to be prior art using a similar approach for audio contexts and
  peer connections, which I assume is sensible and I'm not reinventing the wheel
  by following.

Differential Revision: https://phabricator.services.mozilla.com/D98641
2020-12-10 01:03:27 +00:00
Bogdan Tara
ade4d82c59 Backed out changeset 98c3e6255c58 (bug 1597600) for browser_installssl.js failures CLOSED TREE 2020-12-07 21:01:50 +02:00
R. Martinho Fernandes
c99fe51d2d Bug 1597600 - make certificate overrides depend on origin attributes r=keeler,geckoview-reviewers,smaug,agi
Differential Revision: https://phabricator.services.mozilla.com/D91962
2020-12-07 17:10:52 +00:00
Emilio Cobos Álvarez
75be5de2e1 Bug 1666739 - Add an optional opacity threshold for visibility hit-test. r=mconley,miko
This is a best-effort thing of course, but so is the rest of the
visibility threshold stuff in practice and this should be good enough.

Differential Revision: https://phabricator.services.mozilla.com/D98360
2020-12-04 00:48:45 +00:00