Commit Graph

1223 Commits

Author SHA1 Message Date
Cameron McCormack
1b039e486b Bug 1656114 - Part 4: Accumulate page use counters in the parent process. r=emilio,nika
This changes the way we deal with page use counters so that we can
handle out of process iframes.

Currently, when a parent document is being destroyed, we poke into all
of the sub-documents to merge their use counters into the parent's page
use counters, which we then report via Telemetry.  With Fission enabled,
the sub-documents may be out of process.  We can't simply turn these
into async IPC calls, since the parent document will be destroyed
shortly, as might the content processes holding the sub-documents.

So instead, each document during its initialization identifies which
ancestor document it will contribute its page use counters to, and
stores its WindowContext id to identify that ancestor.  A message is
sent to the parent process to notify it that page use counter data will
be sent at some later point.  That later point is when the document
loses its window.  It doesn't matter if the ancestor document has
already been destroyed at this point, since all we need is its
WindowContext id to uniquely identify it.  Once the parent process has
received all of the use counters it expects to accumulate to a given
WindowContext Id, it reports them via Telemetry.

Reporting of document use counters remains unchanged and is done by each
document in their content process.

While we're here, we also:

* Limit use counters to be reported for a pre-defined set of document
  URL schemes, rather than be based on the document principal.

* Add proper MOZ_LOG logging for use counters instead of printfs.

Differential Revision: https://phabricator.services.mozilla.com/D87188
2020-10-11 22:03:43 +00:00
Cameron McCormack
ca870cf9d1 Bug 1656114 - Part 3: Switch use counter storage to mozilla::BitSet. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D87187
2020-10-11 22:03:41 +00:00
Cameron McCormack
b00de54049 Bug 1656114 - Part 1: Don't null check Document::mStyleUseCounters. r=emilio
We always have one.

Differential Revision: https://phabricator.services.mozilla.com/D87185
2020-10-11 22:03:31 +00:00
Emilio Cobos Álvarez
7c2471648b Bug 1665792 - Null-check mTiming before clone. r=jwatt
There's no guarantee that mTiming is non-null. This can happen for a
variety of reasons.

Differential Revision: https://phabricator.services.mozilla.com/D92894
2020-10-08 14:26:26 +00:00
Denis Palmeiro
759ed522ab Bug 1664475: Add telemetry probes to collect data for script delazification, xdr encoding time, bytecode caching time, and baseline compilation time. r=nbp,Dexter,sefeng,smaug
Differential Revision: https://phabricator.services.mozilla.com/D90798
2020-10-08 13:46:29 +00:00
Narcis Beleuzu
5a0a0a0cd0 Backed out changeset 43d2e0a07c33 (bug 1665792) for crashtests failre on 1665792.html CLOSED TREE 2020-10-08 16:02:35 +03:00
Emilio Cobos Álvarez
c496eeabc8 Bug 1665792 - Null-check mTiming before clone. r=jwatt
There's no guarantee that mTiming is non-null. This can happen for a
variety of reasons.

Differential Revision: https://phabricator.services.mozilla.com/D92894
2020-10-08 11:05:28 +00:00
julianwels
c0d05f3250 Bug 1653026 - Added HTTPS-Only Mode upgrade info to browser UI state. r=mattwoodrow,necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D86566
2020-10-06 00:34:55 +00:00
Marcos Cáceres
32b27fd9a9 Bug 1665252 - remove allowpaymentrequest attribute from HTMLIFrameElement r=dom-workers-and-storage-reviewers,smaug,asuth
Differential Revision: https://phabricator.services.mozilla.com/D90505
2020-10-05 05:45:38 +00:00
Cameron McCormack
1a10f8e9fc Bug 1662839 - Set author style disabled state correctly on newly created iframes. r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D90953
2020-10-04 03:25:16 +00:00
Brindusan Cristian
3cc0d3988e Backed out 2 changesets (bug 1653026) for mochitest failures at WindowGlobalParent.cpp. CLOSED TREE
Backed out changeset 54c69c99b241 (bug 1653026)
Backed out changeset e70649f78910 (bug 1653026)
2020-10-03 10:49:04 +03:00
julianwels
6bc43a95a4 Bug 1653026 - Added HTTPS-Only Mode upgrade info to browser UI state. r=mattwoodrow,necko-reviewers,dragana
Differential Revision: https://phabricator.services.mozilla.com/D86566
2020-10-03 01:22:19 +00:00
Kagami Sascha Rosylight
93ff5ccbf4 Bug 1667911 - Return OwningNonNull from ResolveWithBaseURI() r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D91741
2020-09-29 21:50:21 +00:00
Edgar Chen
ed7c6f194b Bug 1667081 - Part 1: Replace usage of nsIFocusManager with nsFocusManager; r=hsivonen
This patch is bascially done by:
perl -p -i -e "s/nsIFocusManager\* /nsFocusManager* /g;" $( find . -name *.cpp )
perl -p -i -e "s/nsCOMPtr<nsIFocusManager>/RefPtr<nsFocusManager>/g;" $( find . -name *.cpp )

Differential Revision: https://phabricator.services.mozilla.com/D91287
2020-09-29 07:21:09 +00:00
Bogdan Tara
65af1066d4 Backed out 9 changesets (bug 1667081) for assertion failure on nsFocusManager CLOSED TREE
Backed out changeset 156ab3eba505 (bug 1667081)
Backed out changeset 2e37f347082c (bug 1667081)
Backed out changeset 8f59cef879ae (bug 1667081)
Backed out changeset 1298ff140218 (bug 1667081)
Backed out changeset 91342c822425 (bug 1667081)
Backed out changeset aafb1878c590 (bug 1667081)
Backed out changeset 2252e975f0d7 (bug 1667081)
Backed out changeset c3bac5f407d2 (bug 1667081)
Backed out changeset b1e6e81396ae (bug 1667081)
2020-09-28 20:02:52 +03:00
Edgar Chen
0d9571517d Bug 1667081 - Part 1: Replace usage of nsIFocusManager with nsFocusManager; r=hsivonen
This patch is bascially done by:
perl -p -i -e "s/nsIFocusManager\* /nsFocusManager* /g;" $( find . -name *.cpp )
perl -p -i -e "s/nsCOMPtr<nsIFocusManager>/RefPtr<nsFocusManager>/g;" $( find . -name *.cpp )

Differential Revision: https://phabricator.services.mozilla.com/D91287
2020-09-28 14:04:12 +00:00
alwu
3bbdc5fd0e Bug 1659060 - part1 : treat lock visible if corresponding document has in use picture-in-picture element. r=bryce,smaug
When a tab is in the background, its document visibility would become invisible even if a tab owns a video which is visible because of being used in picture in picture mode.

When a document changes its visibility, the wakelock would change its lockstate from `lock-foreground` to `lock-background`. For `video-playing` wakelock topic, we would only request a real platform lock for `lock-foreground` because we don't want to prevent screen from sleeping if the video is invisible.

Therefore, considering if video is being used in picture in picture mode, when determining the wakelock's visible state. If video is still being used in picture in picture mode, then we would treat wakelock as if it's in foreground in order to keep a screen lock.

Differential Revision: https://phabricator.services.mozilla.com/D90781
2020-09-23 23:34:12 +00:00
alwu
dec4bc83f9 Bug 1652108 - part2 : modify page_had_media_count to in_page_count r=nika,bryce
We would like to remove `page_had_media_count` and use a new probe `in_page_count` to record the total number of top level content documents using media.

Therefore, we would rename WindowContext's `DocTreeHadAudibleMedia` to `DocTreeHadMedia` in order to support the new usage.

In the future, if we want to know something like "the percentage of media element is being used for MSE/EME?", then this scalar can be the base and used to calculate the answser.

Differential Revision: https://phabricator.services.mozilla.com/D83225
2020-09-24 21:41:10 +00:00
Dorel Luca
14793e80a6 Backed out changeset a06cc26fbb60 (bug 1665252) for WPT failures in feature-policy/payment-allowed-by-feature-policy-attribute.https.sub.html. CLOSED TREE 2020-09-24 15:06:19 +03:00
Marcos Cáceres
4dbaa97fdd Bug 1665252 - remove allowpaymentrequest attribute from HTMLIFrameElement r=dom-workers-and-storage-reviewers,smaug,asuth
Differential Revision: https://phabricator.services.mozilla.com/D90505
2020-09-24 03:41:26 +00:00
Simon Giesecke
ab6f0a7137 Bug 1650145 - Replace all value uses of Empty[C]String by 0-length _ns literals. r=froydnj,geckoview-reviewers,agi
Differential Revision: https://phabricator.services.mozilla.com/D82325
2020-09-23 15:17:15 +00:00
Edgar Chen
879c42dcc0 Bug 1662587 - Make pointer lock fission compatible; r=smaug
Now requesting/releasing pointer lock in content process will send IPC to let
parent process know which content process request a lock, so parent process
could dispatch mouse event to the right content process. And if there is already
a content proess had a lock, parent process will reject lock request from other
content proesses.

Differential Revision: https://phabricator.services.mozilla.com/D90313
2020-09-21 11:01:27 +00:00
Narcis Beleuzu
217b3a8ac5 Backed out changeset 12856303559f (bug 1662587) for mochitest crashes on test_pointerlock_xorigin_iframe.html 2020-09-21 04:07:59 +03:00
Edgar Chen
ace439156d Bug 1662587 - Make pointer lock fission compatible; r=smaug
Now requesting/releasing pointer lock in content process will send IPC to let
parent process know which content process request a lock, so parent process
could dispatch mouse event to the right content process. And if there is already
a content proess had a lock, parent process will reject lock request from other
content proesses.

Differential Revision: https://phabricator.services.mozilla.com/D90313
2020-09-19 00:01:51 +00:00
Emilio Cobos Álvarez
6f7cd547ea Bug 1663826 - Keep freezing navigation during window.print() for compat. r=smaug
This broke in bug 1636728 because we started setting the bit in the
cloned docshell rather than the original one.

Behavior in other browsers seems to be a bit all over the place, but for
now keeping our behavior during window.print() seems sane.

Differential Revision: https://phabricator.services.mozilla.com/D90456
2020-09-16 22:55:19 +00:00
Emilio Cobos Álvarez
864c51f341 Bug 1557645 - Unify in-process document cloning a bit more. r=jwatt
By passing the content viewer to CreateStaticClone we can do this fairly
easily. I'm going to add another entry-point to the clone process and
it'd be good if we avoid repeating the SetDocument dance and so on.

Differential Revision: https://phabricator.services.mozilla.com/D90315
2020-09-15 23:03:23 +00:00
Emilio Cobos Álvarez
cf74a95c63 Bug 1557645 - Document::CreateStaticClone shouldn't be virtual. r=jwatt
Just minor preliminar cleanup.

Differential Revision: https://phabricator.services.mozilla.com/D90314
2020-09-15 21:39:00 +00:00
Barret Rennie
34f94c5415 Bug 1657188 - Implement rel=preload load time telemetry r=Dexter,emilio,nika
Differential Revision: https://phabricator.services.mozilla.com/D86074
2020-09-14 21:03:52 +00:00
Emilio Cobos Álvarez
2e179aba86 Bug 1664411 - Factor out a condition to unconditionally enable clipboard events in some documents. r=masayuki
This patch shouldn't introduce any behavior change.

Differential Revision: https://phabricator.services.mozilla.com/D89834
2020-09-11 11:08:35 +00:00
Barret Rennie
7a2e181cd8 Bug 1663963 - Remove expired scroll anchor adjustment telemetry r=rhunt
Differential Revision: https://phabricator.services.mozilla.com/D89650
2020-09-10 00:52:39 +00:00
Razvan Maries
b64d7c61d5 Backed out 2 changesets (bug 1663963, bug 1657188) for perma failures on browser_Telemetry_loadTimePreload.js. CLOSED TREE
Backed out changeset 643f16da7b99 (bug 1657188)
Backed out changeset 0c9661a5c8f9 (bug 1663963)
2020-09-10 03:48:48 +03:00
Barret Rennie
cce3bfd481 Bug 1657188 - Implement rel=preload load time telemetry r=Dexter,emilio,nika
Differential Revision: https://phabricator.services.mozilla.com/D86074
2020-09-09 21:44:48 +00:00
Barret Rennie
1219744b77 Bug 1663963 - Remove expired scroll anchor adjustment telemetry r=rhunt
Differential Revision: https://phabricator.services.mozilla.com/D89650
2020-09-09 21:44:48 +00:00
Edgar Chen
c5e2d5c217 Bug 1646493 - Make GetPointerLockError Fission compatible; r=smaug
by replacing the usage of GetInProcessScriptableTop with {Browsing/Window}Context

Differential Revision: https://phabricator.services.mozilla.com/D89144
2020-09-08 10:20:58 +00:00
Emilio Cobos Álvarez
06e090f6dd Bug 1663140 - Don't block on window.print() if there are print callbacks. r=smaug
Not really a fan of this, but I can't think of a better alternative
really... Ideas welcome :)

The main issue is that in bug 1662975 we made window.print() not return
until the user has closed the print / print preview dialog (as it is
needed for some use cases). This matches other browsers, too.

We use an nsAutoSyncOperation here, in order not to violate the
run-to-completion invariants, which turns off micro-tasks, timers,
etc... However we'd still want promises inside mozPrintCallback to
resolve and such, which is a bit contradictory. It is really awkward to
have this behavior change based on whether we have a print callback...

Differential Revision: https://phabricator.services.mozilla.com/D89298
2020-09-06 10:57:48 +00:00
Narcis Beleuzu
02671e992c Backed out changeset 45df7207f4e1 (bug 1663140) for bc failure on browser_window_print.js 2020-09-06 05:43:56 +03:00
Emilio Cobos Álvarez
e33681205b Bug 1663140 - Don't block on window.print() if there are print callbacks. r=smaug
Not really a fan of this, but I can't think of a better alternative
really... Ideas welcome :)

The main issue is that in bug 1662975 we made window.print() not return
until the user has closed the print / print preview dialog (as it is
needed for some use cases). This matches other browsers, too.

We use an nsAutoSyncOperation here, in order not to violate the
run-to-completion invariants, which turns off micro-tasks, timers,
etc... However we'd still want promises inside mozPrintCallback to
resolve and such, which is a bit contradictory. It is really awkward to
have this behavior change based on whether we have a print callback...

Differential Revision: https://phabricator.services.mozilla.com/D89298
2020-09-06 00:54:08 +00:00
Emilio Cobos Álvarez
b60b3eb19c Bug 1662277 - Make IntersectionObserver entries have the same timestamp as other timestamp-returning things during the "update the rendering steps". r=sefeng
This is per spec, see the link in the test. I wouldn't see much point on
doing this for IntersectionObserver on its own, see:

  https://bugzilla.mozilla.org/show_bug.cgi?id=1518999#c28

Though I see the point of doing this for the paint timing API, and I
guess for consistency we should do it here too.

Differential Revision: https://phabricator.services.mozilla.com/D88926
2020-09-01 15:02:54 +00:00
Alphan Chen
5a6cdf74df Bug 1585074 - Audit usage of nsIDocShellTreeItem in PendingFullscreenChangeList::Iterator::Iterator r=smaug,nika,xidorn
Differential Revision: https://phabricator.services.mozilla.com/D85988
2020-09-01 01:48:06 +00:00
Emilio Cobos Álvarez
2042d6df12 Bug 1662204 - Prevent all printed documents, not just print preview, from getting a regular non-print presentation. r=jwatt
Before bug 1636728 this couldn't happen because print documents weren't
hosted in an <browser>. The presentation of documents that are being
printed should be managed by the print job.

We should, in fact, probably just make mDocument->IsStaticDocument() the
condition, or such.

Differential Revision: https://phabricator.services.mozilla.com/D88901
2020-08-31 20:16:11 +00:00
Kris Maglione
c67b4248ac Bug 1650257: Part 2 - Abort SetNewDocument() if ancestors are discarded/cached. r=nika,smaug,sg
Differential Revision: https://phabricator.services.mozilla.com/D87486
2020-08-31 18:51:56 +00:00
Hiroyuki Ikezoe
a29b510c53 Bug 1660490 - Reset IsTopLevelContentDocument and IsContentDocument depending on the given docshell in Document::SetContainer. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D88244
2020-08-26 10:21:27 +00:00
Henri Sivonen
06f054041a Bug 1660764 - Reset mSetCompleteAfterDOMContentLoaded in Document::Open(). r=mattwoodrow
Differential Revision: https://phabricator.services.mozilla.com/D88008
2020-08-25 04:20:42 +00:00
Stephen A Pohl
5a0360f887 Bug 1660813: Allow for Android to enable the new non-native theme via pref. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D88040
2020-08-24 15:51:53 +00:00
Stephen A Pohl
aaed6ae1f0 Bug 1657743: Add ability to enable the new non-native theming on Android. r=emilio,geckoview-reviewers,snorp
Differential Revision: https://phabricator.services.mozilla.com/D86268
2020-08-21 14:01:44 +00:00
Honza Bambas
661ab0a0b1 Bug 1657974 - MOZ_LOG schedule and run of FrameRequestCallback, r=froydnj
Depends on D86740

Differential Revision: https://phabricator.services.mozilla.com/D86741
2020-08-13 14:41:16 +00:00
Honza Bambas
34816c5879 Bug 1657968 - MOZ_LOG schedule and run of mFrameLoaderFinalizers, r=froydnj
Depends on D86739

Differential Revision: https://phabricator.services.mozilla.com/D86740
2020-08-13 14:41:16 +00:00
Simon Giesecke
a8062966f9 Bug 1659923 - Avoid unnecessary copies around Base64Encode. r=xpcom-reviewers,necko-reviewers,froydnj,valentin
This also adds some more variants of Base64Encode and Base64EncodeAppend.

Differential Revision: https://phabricator.services.mozilla.com/D87559
2020-08-19 17:45:16 +00:00
Sean Feng
a230dc3241 Bug 1200896 - Make the document blocked by the topmost element in the top layer r=emilio
Spec: https://html.spec.whatwg.org/multipage/#blocked-by-a-modal-dialog

Depends on D86392

Differential Revision: https://phabricator.services.mozilla.com/D86227
2020-08-17 15:41:19 +00:00
Sean Feng
958bf69c8f Bug 1200896 - Make TopLayerPush to return void r=emilio
TopLayerPush has always been returning true, so returning it as a
boolean is incorrect.

Differential Revision: https://phabricator.services.mozilla.com/D86392
2020-08-17 15:41:12 +00:00