Commit Graph

924 Commits

Author SHA1 Message Date
Edgar Chen
ea98faae2e Bug 1694152 - Remove unused nsGlobalWindowInner::IsPopupSpamWindow; r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D105975
2021-02-23 07:12:21 +00:00
Emilio Cobos Álvarez
6225dd4a20 Bug 1689155 - Don't necessarily show outlines on refocus. r=edgar
Preserve the last state of when we focused the element in that window,
if the focus method is unknown.

Depends on D104861

Differential Revision: https://phabricator.services.mozilla.com/D104863
2021-02-15 19:08:42 +00:00
Mihai Alexandru Michis
989e70c820 Backed out 2 changesets (bug 1689155) for causing bc failures in browser_outline_refocus.js
CLOSED TREE

Backed out changeset bf4ed0fa612b (bug 1689155)
Backed out changeset 78a47c967db3 (bug 1689155)
2021-02-15 19:40:05 +02:00
Emilio Cobos Álvarez
d7560f6363 Bug 1689155 - Don't necessarily show outlines on refocus. r=edgar
Preserve the last state of when we focused the element in that window,
if the focus method is unknown.

Differential Revision: https://phabricator.services.mozilla.com/D104863
2021-02-15 12:41:23 +00:00
Andrew McCreight
1fc0937108 Bug 1624705 - Let Xray waiver nuking for local window proxies ride the trains. r=kmag
This has been on Nightly for almost a year and I don't think we've
seen any breakage, so I think it is time to let it ride the trains.

Differential Revision: https://phabricator.services.mozilla.com/D104555
2021-02-09 20:09:05 +00:00
Edgar Chen
82dbb6fe52 Bug 1690747 - Should also check blur is allowed in BrowsingContext::Blur(); r=hsivonen
When binding delegates blur() to BrowsingContext::Blur, the remote side skips
the check given that there is no js on the stack, but we should not skip the
check. This only affects design-mode which allows the focus moving to the root
element.

Differential Revision: https://phabricator.services.mozilla.com/D104008
2021-02-09 14:56:56 +00:00
Andreea Pavel
f5a83d1c26 Backed out changeset ebb61065ad47 (bug 1690747) for failing mochitests at test_focus_design_mode.html on a CLOSED TREE 2021-02-09 15:11:05 +02:00
Edgar Chen
427c05c1c2 Bug 1690747 - Should also check blur is allowed in BrowsingContext::Blur(); r=hsivonen
When binding delegates blur() to BrowsingContext::Blur, the remote side skips
the check given that there is no js on the stack, but we should not skip the
check. This only affects design-mode which allows the focus moving to the root
element.

Differential Revision: https://phabricator.services.mozilla.com/D104008
2021-02-09 12:18:15 +00:00
Henri Sivonen
cc4ed242d6 Bug 1677899 - Trust the process where where focus() is called for focusability. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D104393
2021-02-09 08:03:03 +00:00
Micah Tigley
3a08a5444e Bug 1689420 - Fix origin header for null principal content dialogs. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D103810
2021-02-05 17:39:10 +00:00
André Bargull
3258a6065d Bug 1691008 - Part 5: Remove Wrapper::NewSingleton. r=jandem
`Wrapper::NewSingleton()` performs the same operations as `Wrapper::New()`.

Depends on D104184

Differential Revision: https://phabricator.services.mozilla.com/D104185
2021-02-05 14:15:41 +00:00
Emilio Cobos Álvarez
194cef9871 Bug 1655967 - Move serviceWorkersTestingEnabled to BrowsingContext. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D103757
2021-02-03 10:38:43 +00:00
Nika Layzell
051b109be1 Bug 1687805 - Part 2: Don't use OpenNoNavigate if noopener is force-enabled, r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D103360
2021-01-29 22:15:44 +00:00
Steven MacLeod
d735a52a63 Bug 1656107 - remove obsolete comment from nsGlobalWindowOuter. r=farre
The code this comment refers to was changed/removed at some point.

Differential Revision: https://phabricator.services.mozilla.com/D98616
2021-01-21 00:44:42 +00:00
Steven MacLeod
f22bfbca2d Bug 1656107 - remove FindContentForSubDocument use from nsGlobalWindowOuter. r=farre
Differential Revision: https://phabricator.services.mozilla.com/D98615
2021-01-21 00:44:40 +00:00
Henri Sivonen
fb676b14a8 Bug 1659383 - Check if focus() is allowed even when Window_Binding::focus() delegates to BrowsingContext::Focus(). r=nika
Differential Revision: https://phabricator.services.mozilla.com/D100005
2021-01-18 12:48:42 +00:00
Csoregi Natalia
5cf34d127c Backed out changeset d2c7360e9d01 (bug 1659383) for failures on iframe-focuses-parent-different-site.html. CLOSED TREE 2021-01-18 12:36:49 +02:00
Henri Sivonen
82633069e5 Bug 1659383 - Check if focus() is allowed even when Window_Binding::focus() delegates to BrowsingContext::Focus(). r=nika
Differential Revision: https://phabricator.services.mozilla.com/D100005
2021-01-18 07:45:29 +00:00
Tim Huang
9da780d936 Bug 1685807 - Part 1: Not to reset the window.name if it's navigating to an about:blank page from a non-about:blank page. r=smaug
This patch changes the checking condition about the cases that we don't
need to reset the window.name.

Also, we take the domain into account when checking the principals of
the old and new documents. This would make the window.name to be
reset if the document.domain was changed to a cross-origin.

Differential Revision: https://phabricator.services.mozilla.com/D101359
2021-01-15 18:57:20 +00:00
Nika Layzell
a9becc7ded Bug 1597437 - Handle 'window.content' legacy getter better with Fission, r=farre,Jamie
Differential Revision: https://phabricator.services.mozilla.com/D100167
2020-12-21 12:08:08 +00:00
Emilio Cobos Álvarez
cd765e199d Bug 1685056 - For an initial, same-origin iframe, consume activation on the parent page for multiple-popup blocking. r=edgar
Sadness. Test times out without the fix.

Differential Revision: https://phabricator.services.mozilla.com/D101378
2021-01-12 11:28:50 +00:00
Sean Feng
912285022c Bug 1682866 - Always use normal priority for DelayedDeleteRunnable r=smaug
DelayedDeleteRunnable would schedule itself twice and use input priority
for the second time because it only wants to run after everything
that could possibly touch this tab. This was needed because we were
strict with IPC messages. However, this is no longer needed because
IPC messages with destroyed actors will be discarded nowadays, so
we don't have to use input priority anymore.

Another reason for making this change is that input events could be
suspended when the runnable is about to run, so we need to either
use a different priority or resume input events.

Differential Revision: https://phabricator.services.mozilla.com/D100345
2020-12-22 17:56:28 +00:00
Emilio Cobos Álvarez
cffba888db Bug 1683507 - Don't uselessly call GetCurrentInnerWindowInternal twice from nsGlobalWindowOuter::EnterModalState. r=edgar
Differential Revision: https://phabricator.services.mozilla.com/D100187
2020-12-20 20:41:13 +00:00
Bogdan Tara
1eb4f0e97b 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
9fb66aa9ff Bug 1656107 - remove obsolete comment from nsGlobalWindowOuter. r=farre
The code this comment refers to was changed/removed at some point.

Differential Revision: https://phabricator.services.mozilla.com/D98616
2020-12-16 01:06:36 +00:00
Steven MacLeod
10ed7bc9e6 Bug 1656107 - remove FindContentForSubDocument use from nsGlobalWindowOuter. r=farre
Differential Revision: https://phabricator.services.mozilla.com/D98615
2020-12-16 01:06:29 +00:00
Sean Feng
401de7849b 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
136e604164 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
Kagami Sascha Rosylight
949c6feb7f Bug 1680167 - Part 3: MOZ_CAN_RUN_SCRIPT_BOUNDARY in dom/base r=masayuki
Differential Revision: https://phabricator.services.mozilla.com/D98626
2020-12-03 22:08:36 +00:00
Razvan Maries
c641d8ebcd Backed out changeset 432c83951167 (bug 1662265) for perma failures on test_sync_xhr_event_handling_switch_bcg.html. CLOSED TREE 2020-12-03 23:03:05 +02:00
Sean Feng
35929d7fef 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-03 03:13:04 +00:00
Emilio Cobos Álvarez
4e88cb5e20 Bug 1679456 - Consume user activation on popup opening and remove popup opening tokens. r=smaug,edgar
The test tweak is needed because user interaction isn't registered by a
single mouseup, but the test is still valid with that tweak IMO.

Depends on D98021

Differential Revision: https://phabricator.services.mozilla.com/D98022
2020-11-30 17:35:59 +00:00
Simon Giesecke
c83a083a0c Bug 1676365 - Move SpinEventLoopUntil to separate header. r=#xpcom-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D96556

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

Depends on D95047
2020-11-23 16:08:03 +00:00
Simon Giesecke
eae3689379 Bug 1673931 - Avoid including Document.h from header files. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D95046

Depends on D95045
2020-11-23 16:07:43 +00:00
Simon Giesecke
46908cfb51 Bug 1660470 - Add missing include directives/forward declarations. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D87865
2020-11-23 16:21:38 +00:00
Steven MacLeod
a8a5d5d11c Bug 1585070 - move nsPIDOMWindowOuter::mIsActive to BrowsingContext. r=kmag
A new `BrowsingContext` field has been added to track the active
browser window for the `:-moz-window-inactive` pseudoclass. This
field takes the place of `nsPIDOMWindowOuter::mIsActive`.

With this change `:-moz-window-inactive` is now fission compatible.

Differential Revision: https://phabricator.services.mozilla.com/D86422
2020-11-20 15:16:58 +00:00
Edgar Chen
6c84893395 Bug 1674702 - Do not bounce IPC message to framer if focus is handled synchronously in OOP iframe; r=hsivonen
This suppress unnecessary blur and focus actions in the framer, we would need
to find a way to notify framer that the focus has moved to OOP iframe to
dispatch corresponding blur event, see bug 1677474.

Differential Revision: https://phabricator.services.mozilla.com/D97158
2020-11-17 11:47:27 +00:00
Noemi Erli
bc4586b638 Backed out changeset 18448a7ebf82 (bug 1585070) for causing failures in test_cocoa_window_focus.html CLOSED TREE 2020-11-17 06:09:50 +02:00
Steven MacLeod
9727243f2f Bug 1585070 - move nsPIDOMWindowOuter::mIsActive to BrowsingContext. r=kmag
A new `BrowsingContext` field has been added to track the active
browser window for the `:-moz-window-inactive` pseudoclass. This
field takes the place of `nsPIDOMWindowOuter::mIsActive`.

With this change `:-moz-window-inactive` is now fission compatible.

Differential Revision: https://phabricator.services.mozilla.com/D86422
2020-11-16 22:37:51 +00:00
Henri Sivonen
a26db683e0 Bug 1618386 - Add action ids to filter out stale active browsing context updates. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D94969
2020-11-16 19:16:20 +00:00
Emilio Cobos Álvarez
8bbbaa2fe7 Bug 1676843 - Make innerWidth/innerHeight return the actual CSS size rather than a rounded version of it. r=heycam
On Nightly, for now. This allows websites to get the real viewport size.

The rounded size has caused problems in the past (see bug 1648298 / bug
1648265), and changing it would be ideal.

I told the CSSWG that we can experiment with this on Nightly to
alleviate (or prove) compat concerns, in which case we'd need to use a
different solution, see https://github.com/w3c/csswg-drafts/issues/5260.

Differential Revision: https://phabricator.services.mozilla.com/D96826
2020-11-13 12:44:01 +00:00
Edgar Chen
bf73f40759 Bug 1674743 - Synchronously raise window when window.focus() called in OOP iframe; r=hsivonen
Differential Revision: https://phabricator.services.mozilla.com/D96184
2020-11-11 11:19:15 +00:00
alwu
447d36514a Bug 1667439 - remove invalid wakelock for 'DOM_Fullscreen'. r=saschanaz
Remove this invalid wakelock because our wakelock system doesn't handle this topic.

Differential Revision: https://phabricator.services.mozilla.com/D94394
2020-10-22 13:45:30 +00:00
Johann Hofmann
45cee0d6dd Bug 1623920 - Restrict window.stop with nsDocShell::IsNavigationAllowed. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D72113
2020-10-16 09:31:31 +00:00
Emilio Cobos Álvarez
aa39e68d1f Bug 1602915 - Remove nsIBrowserDOMWindow.isTabContentWindow. r=mossop,marionette-reviewers,whimboo
This only works for non-e10s and it also seems superseded by the
mPendingClose as per the comment.

Differential Revision: https://phabricator.services.mozilla.com/D92003
2020-10-13 16:58:37 +00:00
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
Emilio Cobos Álvarez
6f93d6f391 Bug 1669925 - Add a printing.trigger keyed scalar to record what triggers a particular print dialog. r=jwatt,marionette-reviewers,maja_zf
In order to avoid over/under-counting, we need to treat window.print()
specially. The new UI was using aOpenWindowInfo.isForPrintPreview for
that, but that doesn't quite work for the old UI (because it will
trigger a regular print, not a preview).

But since isForPrintPreview was only really needed to distinguish
window.print(), just rename it and set it to true when the old UI is
triggered by window.print() as well.

Differential Revision: https://phabricator.services.mozilla.com/D92925
2020-10-09 14:59:46 +00:00
Matt Woodrow
4e541a94e1 Bug 1662336 - Use static clone from print preview when printing. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D90808
2020-10-07 22:38:22 +00:00
Emilio Cobos Álvarez
1461c234bb Bug 1669772 - Don't do a silly print preview from window.print() with the new tab modal UI. r=jwatt
The comment should be self-descriptive. We keep cloning the doc sync and
the UI will preview that doc, so it works out nicely and we do less
work.

Differential Revision: https://phabricator.services.mozilla.com/D92806
2020-10-07 22:23:43 +00:00