Commit Graph

92332 Commits

Author SHA1 Message Date
Nika Layzell
daa9e7acad Bug 1580565 - Part 2: Delay creating nsFrameLoader in static clone until embedder has window, r=smaug
Follow-up parts in this bug depend on being able to read the `nsGlobalWindow`
which embeds a `nsFrameLoader` within `CreateBrowsingContext`, which is called
from the `nsFrameLoader` constructor. Unfortunately, we depend on creating the
`nsFrameLoader` and `BrowsingContext` before we have the window as part of the
fix to bug 1577711.

This patch changes `BuildNestedPrintObjects` to instead use a list of pending
clones stored on the parent `Document` object, and delays creation of the
`nsFrameLoader`, and thus the inner `BrowsingContext`, until after the document
has an owner global.

Due to the low number of automated tests for printing, I manually tested
print-previewing both the reduced test case from bug 1577711, a wikipedia
article, and 'data:text/html,<object data="data:text/html,hi">' to avoid
regressions.

Differential Revision: https://phabricator.services.mozilla.com/D71236
2020-04-22 03:22:00 +00:00
Kagami Sascha Rosylight
6da77fced9 Bug 1632116 - Introduce dom.window.content.untrusted.enabled r=emilio
`window.content` is currently disabled only in Nightly by C preprecessor, and this patch replaces it with a new flag to allow users to manipulate.

Differential Revision: https://phabricator.services.mozilla.com/D71775
2020-04-22 13:08:25 +00:00
Liang-Heng Chen
24bab2a04e Bug 1630763 - ensure PartitionedLocalStorage is only used in correct mode; r=baku
Differential Revision: https://phabricator.services.mozilla.com/D71816
2020-04-22 09:22:22 +00:00
Steve Fink
2ff9dc2267 Bug 1565224 - Re-enable Key gtests and fix usage of JSAPI r=sg,dom-workers-and-storage-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D69709
2020-04-22 08:01:00 +00:00
Dorel Luca
41c3ea3ee8 acked out changeset 6bbecc3020b7 (bug 1631684) for build bustage in bindings/IDBObjectStoreBinding.cpp. CLOSED TREE 2020-04-22 08:41:47 +03:00
Chris Peterson
0aeb2db4f6 Bug 1631684 - Replace MOZ_MUST_USE with [[nodiscard]] in dom/indexedDB. r=dom-workers-and-storage-reviewers,sg
Also move MOZ_MUST_USE before function declarations' specifiers and return type. While clang and gcc's __attribute__((warn_unused_result)) can appear before, between, or after function specifiers and return types, the [[nodiscard]] attribute must precede the function specifiers.

Differential Revision: https://phabricator.services.mozilla.com/D71713
2020-04-22 05:22:44 +00:00
Bogdan Tara
4bd759fa8e Backed out 7 changesets (bug 1580565) for browser_entry_point_telemetry.js failures CLOSED TREE
Backed out changeset 12a4f3de76a8 (bug 1580565)
Backed out changeset 81d537df2dc1 (bug 1580565)
Backed out changeset b182e872c9d4 (bug 1580565)
Backed out changeset 0b4595b2c153 (bug 1580565)
Backed out changeset 4363e3a3d799 (bug 1580565)
Backed out changeset cbb14b2c7b33 (bug 1580565)
Backed out changeset 46b251848297 (bug 1580565)
2020-04-22 06:15:43 +03:00
Makoto Kato
f052a12a9d Bug 1626389 - Part 2. Remove unnecessary GetShowPasswordSetting sync IPC. r=mccr8
GeckoView no longer uses this sync IPC, so we should remove this.

Differential Revision: https://phabricator.services.mozilla.com/D71708
2020-04-21 17:31:00 +00:00
Makoto Kato
4c21ee5564 Bug 1606885 - Add control+backspace/delete shortcut. r=geckoview-reviewers,snorp
According to [*1], Android's text control now supports ctrl+backspace and
ctrl+delete shortcut. So we should support it since Chrome already have this.

*1 f2b233d44c

Differential Revision: https://phabricator.services.mozilla.com/D71736
2020-04-21 14:55:16 +00:00
alwu
c89616453c Bug 1625615 - part6 : add test. r=bryce
Differential Revision: https://phabricator.services.mozilla.com/D69675
2020-04-20 21:19:57 +00:00
alwu
1933899aff Bug 1625615 - part5 : add test-only attribute and event for media element. r=bryce,emilio
Differential Revision: https://phabricator.services.mozilla.com/D69674
2020-04-20 21:19:57 +00:00
alwu
7cd282b498 Bug 1625615 - part4 : start listener if we haven't started listener yet. r=bryce
There is actually possible to start the listener already while running `SuspendOrResumeElement()`, so we should remove the assertion and use a check instead.

Eg.  JS can call `play()`, which would start the listener, before we run this method. This situation can be found when browsing Youtube on the GeckoView.

Differential Revision: https://phabricator.services.mozilla.com/D69673
2020-04-20 21:19:57 +00:00
alwu
a4a77fb633 Bug 1625615 - part3 : prevent media starting playing when inactive docshell wants to suspend any media. r=bryce
When the docShell's `SuspendMediaWhenInactive` flag is true, no media should be allowed to start playing. Therefore, we add a check in `Play()`, `CanActivateAutoplay()` to prevent media from playing. In addition, we should also prevent the audio channel agant from starting.

Differential Revision: https://phabricator.services.mozilla.com/D69672
2020-04-20 21:19:57 +00:00
alwu
b69e72e2f8 Bug 1625615 - part2 : suspend or resume media element according to docShell's SuspendMediaWhenInactive r=bryce
If docShell's `SuspendMediaWhenInactive` is true, then we should suspend or resume the media element according to the docshell active state when the docshell changes it active state.

Differential Revision: https://phabricator.services.mozilla.com/D69671
2020-04-20 21:19:56 +00:00
alwu
f6f59cedd1 Bug 1625615 - part0 : create and set the flag suspendMediaWhenInactive on docShell. r=baku,farre
Implemecurnt a flag `suspendMediaWhenInactive` on the docShell that indicates media in that shell should be suspended when the shell is inactive. Currently, only GeckoView is using this flag.

---

The reason of implementing this flag is because in bug1577890 we remove the old way to suspend/resume the media, and I thought setting docshell to inactive is enough to suspend the media because we already have a mechanism which would suspend/resume media when document becomes inactive/active [1].

However, the active state of document is actually different from what I thought it was. Setting docshell to inactive won't change the document's active state, because that indicates if the document is the current active document for the docshell [2] (docshell can have multiple documents), instead of indicating if the docshell is active or not.

Therefore, we have to add another flag to indicate if the docshell wants to suspend its media when it's inactive, in order to use current mechanism to suspend/resume media.

[1] https://searchfox.org/mozilla-central/rev/4d2a9d5dc8f0e65807ee66e2b04c64596c643b7a/dom/html/HTMLMediaElement.cpp#6453
[2] https://searchfox.org/mozilla-central/rev/4d2a9d5dc8f0e65807ee66e2b04c64596c643b7a/dom/base/Document.h#2627-2633

Differential Revision: https://phabricator.services.mozilla.com/D69669
2020-04-20 21:19:56 +00:00
Nika Layzell
09f0ec0bae Bug 1580565 - Part 7: Handle attaching WindowContext to zombie BrowsingContext in the child, r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D71805
2020-04-22 01:38:07 +00:00
Nika Layzell
5708211961 Bug 1580565 - Part 6: Add a unique ID to each BrowsingContextGroup, r=kmag
This allows us to explicitly specify BrowsingContextGroups when synchronizing
them. A major advantage of this is that it means we can handle an attempt to
create a BrowsingContext with a parent which the content process is unaware of,
which is possible due to changes to the EnsureSubscribed logic in earlier
patches in this stack.

This is OK, because in the case where the content process cannot see its parent,
the parent must be imminently discarding.

Differential Revision: https://phabricator.services.mozilla.com/D71668
2020-04-22 01:38:05 +00:00
Nika Layzell
88b3fbe306 Bug 1580565 - Part 4: Use WindowContext to manage BrowsingContext cached status, r=farre
The existing infrastructure which stored cached BrowsingContexts on the
BrowsingContextGroup was added before WindowContexts were added, and can cause
racing issues with partially discarded trees during process switches.

Differential Revision: https://phabricator.services.mozilla.com/D71238
2020-04-22 01:37:55 +00:00
Nika Layzell
1872a6cc8d Bug 1580565 - Part 2: Delay creating nsFrameLoader in static clone until embedder has window, r=smaug
Follow-up parts in this bug depend on being able to read the `nsGlobalWindow`
which embeds a `nsFrameLoader` within `CreateBrowsingContext`, which is called
from the `nsFrameLoader` constructor. Unfortunately, we depend on creating the
`nsFrameLoader` and `BrowsingContext` before we have the window as part of the
fix to bug 1577711.

This patch changes `BuildNestedPrintObjects` to instead use a list of pending
clones stored on the parent `Document` object, and delays creation of the
`nsFrameLoader`, and thus the inner `BrowsingContext`, until after the document
has an owner global.

Due to the low number of automated tests for printing, I manually tested
print-previewing both the reduced test case from bug 1577711, a wikipedia
article, and 'data:text/html,<object data="data:text/html,hi">' to avoid
regressions.

Differential Revision: https://phabricator.services.mozilla.com/D71236
2020-04-22 01:37:50 +00:00
Tom Tung
09903525ea Bug 1628076 - Ensure sFactory alive while it is calling Abort; r=dom-workers-and-storage-reviewers,asuth
Differential Revision: https://phabricator.services.mozilla.com/D71323
2020-04-21 19:57:46 +00:00
Nika Layzell
df943db304 Bug 1625513 - Part 4: Don't require being in tabbrowser for subframe process switches, r=mattwoodrow,necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D71396
2020-04-21 22:33:14 +00:00
Nika Layzell
975ef89398 Bug 1625513 - Part 1: Perform onMayChangeProcess handling within DocumentLoadListener, r=mattwoodrow,pbone,droeh,necko-reviewers,valentin
When I first added this method last year, I added it in JS, handled from within
SessionStore.jsm, as that was the easiest place to do it. Now that
DocumentLoadListener exists, it makes more sense to handle this logic directly
from within that code.

Many parts of the process switch are still handled by frontend JS, such as
selecting remote types, and performing toplevel process switches.

Differential Revision: https://phabricator.services.mozilla.com/D68594
2020-04-21 22:33:00 +00:00
Cosmin Sabou
190731f374 Backed out 5 changesets (bug 1625513) for bc failures on browser_identity_UI.js. CLOSED TREE
Backed out changeset 88ac5d853e38 (bug 1625513)
Backed out changeset 8ac6db819435 (bug 1625513)
Backed out changeset cc19c74910d1 (bug 1625513)
Backed out changeset 8c235f0f967c (bug 1625513)
Backed out changeset 24a646225c68 (bug 1625513)
2020-04-22 00:17:08 +03:00
Emily McDonough
9c69d6e813 Bug 1631644 - Add Element::HasGridFragments() and use it in appropriate locations in devtools r=bradwerth,emilio
This is cheaper than calling Element::GetGridFragments as it does not need to
to construct an entire array of results. Most uses of GetGridFragments in the
devtools are only testing for the existence of grid fragments, and can be
changed to this cheaper method instead.

Differential Revision: https://phabricator.services.mozilla.com/D71674
2020-04-21 18:46:35 +00:00
Nika Layzell
2447bb3983 Bug 1625513 - Part 4: Don't require being in tabbrowser for subframe process switches, r=mattwoodrow,necko-reviewers,valentin
Differential Revision: https://phabricator.services.mozilla.com/D71396
2020-04-21 18:33:52 +00:00
Nika Layzell
8438107f7a Bug 1625513 - Part 1: Perform onMayChangeProcess handling within DocumentLoadListener, r=mattwoodrow,pbone,droeh,necko-reviewers,valentin
When I first added this method last year, I added it in JS, handled from within
SessionStore.jsm, as that was the easiest place to do it. Now that
DocumentLoadListener exists, it makes more sense to handle this logic directly
from within that code.

Many parts of the process switch are still handled by frontend JS, such as
selecting remote types, and performing toplevel process switches.

Differential Revision: https://phabricator.services.mozilla.com/D68594
2020-04-21 18:33:39 +00:00
Aaron Klotz
b1c5810208 Bug 1630229: Part 1 - Ensure that GMP process notifies GeckoView when its actor is destroyed; r=jya
When a GMP process's top-level actor is destroyed, we need to relay that
information up to GeckoView's Java layer. We only want to do this when the
process had previously been successfully started.

Differential Revision: https://phabricator.services.mozilla.com/D71405
2020-04-18 04:12:50 +00:00
Emilio Cobos Álvarez
17c0d2b9bb Bug 1631776 - Store an HTMLImageElement in ImageDocument. r=smaug
Saves a few QIs and such.

Differential Revision: https://phabricator.services.mozilla.com/D71759
2020-04-21 16:45:36 +00:00
Emilio Cobos Álvarez
d2d688801d Bug 1631776 - Track less state about overflow in ImageDocument. r=smaug
The overflow can be inferred from other variables.

Differential Revision: https://phabricator.services.mozilla.com/D71758
2020-04-21 16:45:23 +00:00
Emilio Cobos Álvarez
ca6c55183a Bug 1631776 - Remove ImageDocument.restoreImageTo. r=smaug
Unused except for one caller that can just be inlined.

Differential Revision: https://phabricator.services.mozilla.com/D71757
2020-04-21 16:51:51 +00:00
Emilio Cobos Álvarez
36096a9aee Bug 1631776 - Miscellaneous cleanups on ImageDocument. r=smaug
The comment no longer made any sense, and IgnoreErrors() is nicer than
manually doing so.

Differential Revision: https://phabricator.services.mozilla.com/D71755
2020-04-21 16:51:51 +00:00
Bogdan Tara
76b2fc7b60 Bug 1618542 - Fixed whitespace on ActorsParent.cpp CLOSED TREE 2020-04-21 20:19:50 +03:00
Brindusan Cristian
c4fd863aaa Backed out 2 changesets (bug 1626174, bug 1625876) for build bustages at LibrarySandboxPreload.cpp and OggDemuxer.cpp. CLOSED TREE
Backed out changeset 40fea0f3ab6c (bug 1626174)
Backed out changeset a3117fce845d (bug 1625876)
2020-04-21 19:29:02 +03:00
Alex Chronopoulos
1fb9641c89 Bug 1630986 - Notify asynchronously when the audio device has started. r=padenot
The existing `MTGImpl::NotifyWhenGraphStarted()` has been enhanced to work with a MediaTrack instead of AudioNodeTrack. In addition to that, an option has been added about resolving the retuned promise in the audio thread instead of the fallback thread when the Graph has just started. Also, a unit test has been added to verify the behavior.

Differential Revision: https://phabricator.services.mozilla.com/D71339
2020-04-21 16:14:00 +00:00
Simon Giesecke
ecfe1e0e4d Bug 1618542 - Add use of new transformation algorithms in ActorsChild. r=dom-workers-and-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D69044
2020-04-21 14:35:03 +00:00
Simon Giesecke
e4e19aad28 Bug 1618542 - Add use of new transformation algorithms in TestFileInfo. r=dom-workers-and-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D69043
2020-04-21 14:34:51 +00:00
Simon Giesecke
d11730c4fe Bug 1618542 - Remove redundant assertions on infallible array operations. r=dom-workers-and-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D69042
2020-04-21 14:34:43 +00:00
Simon Giesecke
410c229065 Bug 1618542 - Add further uses of new transformation algorithms. r=dom-workers-and-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D69041
2020-04-21 14:56:20 +00:00
Simon Giesecke
48fc4a573b Bug 1618542 - Make OpenDatabaseOp::MetadataToSpec fallible. r=dom-workers-and-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D69040
2020-04-21 14:34:26 +00:00
Simon Giesecke
2fd18d4675 Bug 1618542 - Made possibly large memory allocations fallible. r=dom-workers-and-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D69038
2020-04-21 14:34:19 +00:00
Simon Giesecke
09fa9d86d9 Bug 1618542 - Add further uses of new transformation algorithms. r=dom-workers-and-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D69037
2020-04-21 14:54:41 +00:00
Simon Giesecke
931e494dba Bug 1618542 - Remove uses of FallibleTArray in ActorsParent.cpp. r=dom-workers-and-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D69036
2020-04-21 14:37:51 +00:00
Simon Giesecke
0a8f7dc852 Bug 1618542 - Remove use of FallibleTArray in IDBObjectStore.cpp. r=dom-workers-and-storage-reviewers,ttung,janv
Differential Revision: https://phabricator.services.mozilla.com/D69034
2020-04-21 14:45:55 +00:00
Simon Giesecke
ef41d753b5 Bug 1623278 - Eliminate output and raw pointer input parameters on some ActorsParent functions. r=dom-workers-and-storage-reviewers,ttung
Differential Revision: https://phabricator.services.mozilla.com/D68338
2020-04-21 14:40:00 +00:00
Simon Giesecke
4968855eb7 Bug 1623278 - Eliminate output parameters on GetOrCreateConnection. r=dom-workers-and-storage-reviewers,janv
Differential Revision: https://phabricator.services.mozilla.com/D68337
2020-04-21 14:33:06 +00:00
Simon Giesecke
18c7f261c4 Bug 1623278 - Use SafeRefPtr for IDBTransaction. r=dom-workers-and-storage-reviewers,ttung,janv
Differential Revision: https://phabricator.services.mozilla.com/D67287
2020-04-21 14:32:51 +00:00
Emilio Cobos Álvarez
3cb235302a Bug 1631776 - Convert some imagedocument prefs to static prefs. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D71753
2020-04-21 15:40:55 +00:00
Paul Adenot
bbddb266a3 Bug 1611622 - Add a decode test for an OGG Vorbis file with a nil packet at EOS. r=bryce
The test file was created using VLC, that has a muxer that does this.

Differential Revision: https://phabricator.services.mozilla.com/D71351
2020-04-21 09:30:57 +00:00
Paul Adenot
2ff258c252 Bug 1611622 - Allow testing for a decode success without checking the file. r=bryce
Useful to test the demuxer in the web audio case.

Differential Revision: https://phabricator.services.mozilla.com/D71350
2020-04-21 09:30:40 +00:00
Paul Adenot
428794fe58 Bug 1611622 - Allow nil packets in OGG demuxer. r=bryce
Differential Revision: https://phabricator.services.mozilla.com/D71349
2020-04-21 09:30:27 +00:00