Commit Graph

3124 Commits

Author SHA1 Message Date
Masayuki Nakano
ad34e89b46 Bug 1543315 - part 9: Mark nsIPresShell::FlushPendingNotifications() as MOZ_CAN_RUN_SCRIPT r=smaug
So, this patch makes all caller of it safe including its arguments unless
they come from other methods.

Differential Revision: https://phabricator.services.mozilla.com/D27225
2019-04-13 12:43:57 +00:00
Masayuki Nakano
d0d9ccd592 Bug 1542506 - Make nsDocShell use mozilla::PresShell* directly rather than nsIPresShell* r=bzbarsky
This patch makes `nsDocShell::GetPresShell()` and
`nsDocShell::GetEldestPresShell()` return `mozilla::PresShell*` and
some non-public methods use `mozilla::PresShell*` directly.

Differential Revision: https://phabricator.services.mozilla.com/D26424
2019-04-13 01:03:13 +00:00
Boris Zbarsky
f84e5421de Bug 1543564 part 2. Get rid of pointless nsPIDOMWindowInner::AsInner methods. r=farre
Differential Revision: https://phabricator.services.mozilla.com/D27027
2019-04-11 14:12:43 +00:00
Boris Zbarsky
c5af831021 Bug 1543564 part 1. Get rid of pointless nsPIDOMWindowOuter::AsOuter() methods. r=farre
Differential Revision: https://phabricator.services.mozilla.com/D27026
2019-04-11 12:12:04 +00:00
Anny Gakhokidze
0bac5fce79 Bug 1539482 - Reduce the number of IPC calls on nsISHEntry in nsDocShell::LoadHistoryEntry, r=peterv, r=nika for adding sync IPC messages
In nsDocShell::LoadHistoryEntry method, when it gets called
from parent process, there are 13 sync IPC calls on nsISHEntry
that retrieve  information from the session history entry and
create a  doc shell load state object using the retrieved
information.  By adding a new method 'CreateLoadInfo'on nsISHEntry,
inside of which the doc shell load state object will be
created (with appropriate data filled out) and returned,
we eliminate 12 sync IPC call, resulting in just 1 IPC call
to nsISHEntry::CreateLoadInfo.

Differential Revision: https://phabricator.services.mozilla.com/D26042
2019-03-29 15:48:59 -04:00
Anny Gakhokidze
ff3030eb50 Bug 1539238 - Modify nsSHEntry::Create to consolidate setter calls on nsSHEntry in nsDocShell::AddToSessionHistory, r=peterv
nsDocShell is the only consumer of nsISHEntry::Create, and
in AddToSessionHistory method, after calling nsISHEntry::Create,
it calls 8 setter methods on nsISHEntry, which results in a
total of 9 sync IPC calls.

With the proposed solution of setting everything via
nsISHEntry::Create, we get a total of 1 sync IPC call.

Differential Revision: https://phabricator.services.mozilla.com/D24979
2019-03-26 15:46:36 -04:00
Anny Gakhokidze
4f6495f1ee Bug 1536471 - Consolidate calls to nsISHEntry::GetChildAt in nsDocShell::AddToSessionHistory by adding nsSHEntry::ClearEntry method, r=peterv, r=nika for adding sync IPC messages
Currently, nsDocShell repeatedly calls nsISHEntry::GetChildAt and
nsISHEntry::RemoveChild  in nsDocShell::AddToSessionHistory,
which results in twice as many IPC calls as the number of children
a session history entry has. Additionally, there is one extra
IPC sync call to nsISHEntry::AbandonBFCacheEntry after the loop.

With the proposed solution, there will only be 1 sync IPC call.

Differential Revision: https://phabricator.services.mozilla.com/D24978
2019-03-26 14:24:33 -04:00
Anny Gakhokidze
90b0f601c4 Bug 1536471 - Consolidate calls to nsISHEntry::GetChildAt in nsDocShell::ClearFrameHistory by adding a new sync IPC call nsISHistory::RemoveFrameEntries, r=peterv, r=nika for adding sync IPC messages
Currently, nsDocShell repeatedly calls nsISHEntry::GetChildAt, which
results in as many IPC sync calls as the number of children
a session history entry has. Calling nsISHEntry::GetChildCount and
ChildSHistory::Index and incurs additional extra 2 sync IPC calls.

With the proposed solution, there will only be 1 sync IPC call.

Differential Revision: https://phabricator.services.mozilla.com/D24980
2019-03-22 15:45:38 -04:00
Peter Van der Beken
a7d8307b79 Bug 1534638 - Part 3: rename SetRootDocShell to ClearDocShell. r=qdot
Depends on D25763

Differential Revision: https://phabricator.services.mozilla.com/D25764
2019-04-04 16:20:19 +00:00
Peter Van der Beken
cd80fed289 Bug 1534638 - Part 1: remove unused arguments from session history listeners. r=qdot
Differential Revision: https://phabricator.services.mozilla.com/D25761
2019-04-04 16:18:48 +00:00
Olli Pettay
3525b8789c Bug 1542673, increase history.state size limit, r=qdot
Differential Revision: https://phabricator.services.mozilla.com/D26881
2019-04-10 20:21:55 +00:00
Valentin Gosu
a5601d3bf3 Bug 1530303 - Put CrossOriginOpenerPolicy in BrowsingContext r=nika
Differential Revision: https://phabricator.services.mozilla.com/D23935
2019-04-09 20:10:13 +00:00
Andrea Marchesini
f6465d5679 Bug 1534351 - HTMLInputElement should always allow popups for system principal, r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D26671
2019-04-09 19:27:15 +00:00
Brindusan Cristian
175fc2eba1 Backed out changeset 2647a23c02bf (bug 1534351) for mochitest failures at test_multipleFilePicker.html. CLOSED TREE 2019-04-09 20:45:05 +03:00
Andrea Marchesini
6b552fd8ae Bug 1534351 - HTMLInputElement should always allow popups for system principal, r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D26671
2019-04-09 14:25:58 +00:00
Nika Layzell
32f3dfd7fd Bug 1542778 - Part 2: Fix clang-format fallout for DocShell and LoadContext, r=Ehsan
Differential Revision: https://phabricator.services.mozilla.com/D26546
2019-04-08 20:30:37 +00:00
Masayuki Nakano
297d5cb658 Bug 1540969 - Get rid of nsPICommandUpdater r=bzbarsky
`nsPICommandUpdater` is a scriptable interface, but nobody refers it from JS,
and it's implemented only by `nsCommandManager`.  Therefore, we can get rid
of this interface.

Additionally, `nsCommandManager::Init()` is called only by `nsDocShell`, which
is the only instantiater of the class, and returns error only when given window
is nullptr.  Therefore, we can make the constructor take the window instead.

Differential Revision: https://phabricator.services.mozilla.com/D25729
2019-04-03 12:53:54 +00:00
Masayuki Nakano
1b2614bcc1 Bug 1540962 - Make nsICommandManager builtinclass and make users use nsCommandManager directly r=bzbarsky
`nsICommandManager` isn't implemented by JS even in comm-central nor
BlueGriffon.  Therefore, we can make it a builtinclass.

Additionally, this patch makes all users in C++ use `nsCommandManager` which is
the only implementation of `nsICommandManager`.  This avoids QI from
`nsICommandManager` to `nsPICommandUpdater`.

Differential Revision: https://phabricator.services.mozilla.com/D25726
2019-04-03 12:51:38 +00:00
Makoto Kato
b87cd0d3e4 Bug 1540107 - Use nsEditingSession directly in nsDocShellEditorData. r=masayuki
`nsIEditingSession.SetupEditorOnWindow` is used in `nsDocShellEditorData`.
To get rid of it, I would like to use `nsEditSession` directly instead of
`nsIEditingSession`.

Differential Revision: https://phabricator.services.mozilla.com/D25537
2019-04-03 01:56:31 +00:00
Peter Van der Beken
2ff411da5f Bug 1438272 - Part 3: move session history to parent process. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D26904
2019-03-05 15:46:10 +01:00
Peter Van der Beken
546c50e1b5 Bug 1438272 - Part 2: replace docshell with browsing context in session history. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D25767
2019-03-05 23:59:28 +01:00
Peter Van der Beken
d39c3601d1 Bug 1438272 - Part 1: move HistoryID to BrowsingContext. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D25766
2019-03-05 10:33:42 +01:00
Masayuki Nakano
e56c690088 Bug 1540015 - part 3: Rename Document::GetShell() to Document::GetPresShell() and make it return PresShell* rather than nsIPresShell* r=smaug,emilio
This makes `Document::GetShell()` return `PresShell*` instead of `nsIPresShell`.

Additonally, "shell" is unclear ("docshell" vs. "presshell").  Therefore, this
also renames `Document::GetShell()` to `Document::GetPresShell()`.

Similarly, some other method names of `Document` are also renamed from
`*Shell*` to `*PresShell*`.

Differential Revision: https://phabricator.services.mozilla.com/D25338
2019-03-29 15:12:47 +00:00
Dorel Luca
6cd4166b18 Backed out 3 changesets (bug 1540015) for build bustage. CLOSED TREE
Backed out changeset 7b71c9da0214 (bug 1540015)
Backed out changeset 5723ddbc5c44 (bug 1540015)
Backed out changeset 9561d2c36fa5 (bug 1540015)
2019-03-29 16:14:26 +02:00
Masayuki Nakano
12ec0ad7f4 Bug 1540015 - part 3: Rename Document::GetShell() to Document::GetPresShell() and make it return PresShell* rather than nsIPresShell* r=smaug,emilio
This makes `Document::GetShell()` return `PresShell*` instead of `nsIPresShell`.

Additonally, "shell" is unclear ("docshell" vs. "presshell").  Therefore, this
also renames `Document::GetShell()` to `Document::GetPresShell()`.

Similarly, some other method names of `Document` are also renamed from
`*Shell*` to `*PresShell*`.

Differential Revision: https://phabricator.services.mozilla.com/D25338
2019-03-29 13:09:26 +00:00
Botond Ballo
99f3269349 Bug 1538511 - Get rid of nsIPresShell::ScrollMode (use mozilla::ScrollMode instead). r=kats
Differential Revision: https://phabricator.services.mozilla.com/D24797
2019-03-26 00:51:57 +00:00
Botond Ballo
ad3bd04424 Bug 1538511 - Move nsIScrollableFrame::ScrollMode into a separate file. r=kats
This allows this enumeration to be used from nsIPresShell.h without introducing
a circular dependency.

Its new home in layout/base/ScrollTypes.h, included as mozilla/ScrollTypes.h.
Others similar enums can be added to that file if desired.

This patch also makes ScrollMode an enum class (as it's no longer nested
inside a class) and switches its enumerators to the |eName| naming convention.

Differential Revision: https://phabricator.services.mozilla.com/D24796
2019-03-25 23:17:20 +00:00
Randell Jesup
a7248a358c Bug 1531926: move bfcache logging to MOZ_LOG (PageCache:N) r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D21798
2019-03-01 16:53:54 -05:00
Nika Layzell
cf99caa1d4 Bug 1536405 - Cycle-collect through ChromeEventHandler, r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D24422
2019-03-22 23:35:15 +00:00
dlee
9725154c92 Bug 1522412 - P3. Adopt nsIChannel.LOAD_BYPASS_URL_CLASSIFIER in the algorithm determining if we should classify a channel's URI. r=Ehsan,mayhemer
This patch uses the flag to exempt channels from classification, but it
doesn't include the use cases of this flag.

See Bug 1442496 for the list of the call sites should use this flag.

Differential Revision: https://phabricator.services.mozilla.com/D22112
2019-03-25 12:48:25 +00:00
dlee
3b26e613f7 Bug 1522412 - P2. Remove nsIChannel.LOAD_CLASSIFY_URI flag. r=Ehsan
nsIChannel.LOAD_CLASSIFY_URI is no longer required so we can remove it from
the codebase.
In the mean time, we add a new LOAD_BYPASS_URL_CLASSIFIER load flag for
channel creator to be able to force channel to bypass URL classifier check.
The use of the new LOAD_BYPASS_URL_CLASSIFIER flag will be addressed in
the other patches.

Differential Revision: https://phabricator.services.mozilla.com/D22111
2019-03-25 12:47:57 +00:00
Botond Ballo
cee6f62d12 Bug 1531535 - Use the visual smooth scrolling API in nsDocShell::SetCurScrollPosEx() if appropriate. r=kats
Differential Revision: https://phabricator.services.mozilla.com/D24554
2019-03-23 20:23:44 +00:00
Botond Ballo
a76969f2b8 Bug 1531535 - Add visual smooth scroll support to nsIPresShell. r=kats
This patch renames nsIPresShell::SetPendingVisualScrollUpdate() to
ScrollToVisual(), and adds an instant vs. smooth option.

SetPendingVisualScrollUpdate() still exists, as a helper for the instant case.

Differential Revision: https://phabricator.services.mozilla.com/D24553
2019-03-23 20:23:35 +00:00
Gurzau Raul
8cd94b1658 Backed out 7 changesets (bug 1522412) for xpcshell failures at test_shouldclassify.js on a CLOSED TREE.
Backed out changeset 7c998456e1fd (bug 1522412)
Backed out changeset ebb581ddf1d1 (bug 1522412)
Backed out changeset 850e1c68d978 (bug 1522412)
Backed out changeset fe288a48cecb (bug 1522412)
Backed out changeset 5399bca472b1 (bug 1522412)
Backed out changeset 91e5b339fe11 (bug 1522412)
Backed out changeset b80098d0a5c4 (bug 1522412)
2019-03-21 11:02:09 +02:00
Dimi Lee
e501babda0 Bug 1522412 - P3. Adopt nsIChannel.LOAD_BYPASS_URL_CLASSIFIER in the algorithm determining if we should classify a channel's URI. r=Ehsan,mayhemer
This patch uses the flag to exempt channels from classification, but it
doesn't include the use cases of this flag.

See Bug 1442496 for the list of the call sites should use this flag.

Differential Revision: https://phabricator.services.mozilla.com/D22112
2019-03-21 07:32:46 +00:00
Dimi Lee
2aec02089a Bug 1522412 - P2. Remove nsIChannel.LOAD_CLASSIFY_URI flag. r=Ehsan
nsIChannel.LOAD_CLASSIFY_URI is no longer required so we can remove it from
the codebase.
In the mean time, we add a new LOAD_BYPASS_URL_CLASSIFIER load flag for
channel creator to be able to force channel to bypass URL classifier check.
The use of the new LOAD_BYPASS_URL_CLASSIFIER flag will be addressed in
the other patches.

Differential Revision: https://phabricator.services.mozilla.com/D22111
2019-03-21 07:30:51 +00:00
Alastor Wu
4f26766702 Bug 1524065 - part1 : implement the way to resume delayed autoplay media via browsing context. r=farre
After enable Fission, we're not able to resume media in the different process, because the current way we use can only notify one process and would cause the media on other process can't be resumed.

Therefore, we should use the browsing context to notify the web content which might be on different processes.

Differential Revision: https://phabricator.services.mozilla.com/D18136
2019-03-20 03:15:36 +00:00
Christoph Kerschbaumer
887a31ee01 Bug 1534971: Add helper function within CSP to check if two CSPs are equal. r=jkt
Differential Revision: https://phabricator.services.mozilla.com/D23567
2019-03-15 12:20:52 +00:00
Botond Ballo
dca72b1b66 Bug 1517895 - Scroll the visual viewport in nsDocShell::SetCurScrollPosEx(). r=qdot
Differential Revision: https://phabricator.services.mozilla.com/D20031
2019-03-13 23:07:17 +00:00
Felipe Gomes
097696c2d3 Bug 827976 - Teach leaks.py to ignore the hidden window. r=Ehsan
Differential Revision: https://phabricator.services.mozilla.com/D21089
2019-03-04 20:21:31 +00:00
Cosmin Sabou
45f2559b66 Backed out 16 changesets (bug 827976) for causing bug 1532054. a=backout
Backed out changeset 54c0b12443ed (bug 827976)
Backed out changeset 92b45080d080 (bug 827976)
Backed out changeset 443087a359f9 (bug 827976)
Backed out changeset f976c2d4cebb (bug 827976)
Backed out changeset 66cffb171024 (bug 827976)
Backed out changeset 845e1d0b2402 (bug 827976)
Backed out changeset fd94066a1d76 (bug 827976)
Backed out changeset e253b264e7bd (bug 827976)
Backed out changeset 07ef335770a8 (bug 827976)
Backed out changeset 9d3805d77b99 (bug 827976)
Backed out changeset eed600ceb606 (bug 827976)
Backed out changeset 3b64368cff52 (bug 827976)
Backed out changeset 69d0378e0c09 (bug 827976)
Backed out changeset 9203871a5c6f (bug 827976)
Backed out changeset 96a507c818e2 (bug 827976)
Backed out changeset e254496ff95b (bug 827976)
2019-03-02 20:40:01 +02:00
Felipe Gomes
2354f82fd3 Bug 827976 - Teach leaks.py to ignore the hidden window. r=Ehsan
Differential Revision: https://phabricator.services.mozilla.com/D21089
2019-03-01 21:07:41 +00:00
Ryan Hunt
3d8d412bc2 Bug 1523969 part 5 - Move method definition inline comments to new line in 'docshell/'. r=qdot
Differential Revision: https://phabricator.services.mozilla.com/D21105
2019-02-25 16:04:59 -06:00
Boris Zbarsky
b61174af9c Bug 1489308 part 9. Remove now-unused wyciwyg bits. r=mccr8
Differential Revision: https://phabricator.services.mozilla.com/D17327
2019-02-28 01:09:48 +00:00
Boris Zbarsky
49a8c7d41b Bug 1489308 part 4. Allow UpdateURLAndHistory to work even if there's no root session history. r=smaug
This can happen when someone does a document.open() on a document that has no session history.

Differential Revision: https://phabricator.services.mozilla.com/D17322
2019-02-27 05:10:11 +00:00
Boris Zbarsky
bcb6d1032a Bug 1489308 part 2. Allow UpdateURLAndHistory to work even if mOSHE is null, if we're doing a replace. r=smaug
We're going to end up hitting this if someone does a document.open() before mOSHE
has been set. We shouldn't need to worry about mLSHE, because the document.open()
will cancel the corresponding load.

Differential Revision: https://phabricator.services.mozilla.com/D17319
2019-02-27 06:01:57 +00:00
Boris Zbarsky
69ebb5e0ff Bug 1489308 part 1. Factor out part of nsDocShell::AddState into a separate method. r=qdot
This implements the "URL and history update steps" from the HTML spec.  See
<https://html.spec.whatwg.org/multipage/history.html#url-and-history-update-steps>.

Differential Revision: https://phabricator.services.mozilla.com/D17318
2019-02-27 05:56:23 +00:00
Boris Zbarsky
504b7df982 Bug 1531128 part 2. Add a docshell API for determining whether a navigation is in progress. r=mccr8
This is needed by the document.open spec, which cancels loads for the document
only if a navigation is pending.

Differential Revision: https://phabricator.services.mozilla.com/D21441
2019-02-27 23:21:29 +00:00
Christoph Kerschbaumer
bd82a2ed63 Bug 1518454: Part 1, backend changes, add CSP to loadURIOptions dictionary and pass CSP explicitly from frontend to docshell. r=bz 2019-02-21 16:00:32 +01:00
Christoph Kerschbaumer
1a72eb2a6b Bug 1528677: Remove nullchecks for loadinfo since we have loadinfo on all channels. r=baku 2019-02-20 13:27:25 +01:00