Граф коммитов

551 Коммитов

Автор SHA1 Сообщение Дата
Kris Maglione eb14dd1d2c Bug 1478124: Part 8b - Update DocShell module to use a static component manifest. r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D15040

--HG--
extra : rebase_source : d89ac470241cb6f6a43c29c6e90b1c0e4fc78028
extra : source : b0444e0bc801f828b49f9953a73498cf5ff5024b
2018-12-16 17:27:58 -08:00
arthur.iakab c1fae83952 Backed out 16 changesets (bug 1478124) for failing android geckoview-junit CLOSED TREE
Backed out changeset fce62c77a56b (bug 1478124)
Backed out changeset eb2fa3b5edf7 (bug 1478124)
Backed out changeset 8dacce59fcc0 (bug 1478124)
Backed out changeset 012fd0107204 (bug 1478124)
Backed out changeset 496aaf774697 (bug 1478124)
Backed out changeset 21f4fda03159 (bug 1478124)
Backed out changeset b0444e0bc801 (bug 1478124)
Backed out changeset d94039b19943 (bug 1478124)
Backed out changeset 5d85deac61c2 (bug 1478124)
Backed out changeset 929fd654c9df (bug 1478124)
Backed out changeset 1ddd80d9e91a (bug 1478124)
Backed out changeset b8d2dfdfc324 (bug 1478124)
Backed out changeset f500020a273a (bug 1478124)
Backed out changeset dd00365ebb55 (bug 1478124)
Backed out changeset 538e40c5ee13 (bug 1478124)
Backed out changeset bedaa9c437ad (bug 1478124)
2019-01-29 10:03:06 +02:00
Kris Maglione 586d1722ec Bug 1478124: Part 8b - Update DocShell module to use a static component manifest. r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D15040

--HG--
extra : rebase_source : 4de6207229742168f534f618fe4881f19e3135c9
extra : absorb_source : 63106bea2b2a9c9a90e2d8cd08429b5de0f2cd09
extra : histedit_source : 02a263131b092b1d1ac4901f1a37a1b842b3103f
2018-12-16 17:27:58 -08:00
Ehsan Akhgari e5e885ae31 Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre
# ignore-this-changeset

--HG--
extra : amend_source : 7221c8d15a765df71171099468e7c7faa648f37c
extra : histedit_source : a0cce6015636202bff09e35a13f72e03257a7695
2019-01-18 10:16:18 +01:00
Jan Henning 70dd21256f Bug 1498812 - Part 9: Switch session store/session history to use visual viewport for scroll position tracking. r=mikedeboer,snorp
For simplicity's sake, for now we keep storing only one scroll position per
history entry (bug 1499210), so if we have to choose between the layout and the
visual viewport, the latter is a vastly better choice, as it more accurately
represents the scroll position as perceived by the user, especially when the
page has been pinch-zoomed.

This also means that instead of the normal scroll events, the session store now
has to listen for the corresponding events specific to the visual viewport.

We also extend the scroll position test to check that the scroll position isn't
just properly saved, but also actually properly restored in practice as well.
We only add this test now instead of already adding it beforehand like we did
with the rest of the test
- to avoid having to temporarily extend the checkScroll() helper function to
  deal with todo()/todo_is etc.
- because getting that part of the test to complete without timing out (which
  would be one of its natural failure modes, because the expected events would
  be missing) would require faking even more scroll events
- because we already have the todo() tests that are telling us the we didn't
  *store* any scroll position in the first place, so there's no point in trying
  to actually restore anything

For the GeckoView saveAndRestoreState test, we now spin the event loop once
before setting the scroll position in order to give APZ opportunity to settle
down after the initial page load.

Differential Revision: https://phabricator.services.mozilla.com/D15690

--HG--
extra : moz-landing-system : lando
2019-01-11 19:50:09 +00:00
Emilio Cobos Álvarez d2ed260822 Bug 1517241 - Rename nsIDocument to mozilla::dom::Document. r=smaug
Summary: Really sorry for the size of the patch. It's mostly automatic
s/nsIDocument/Document/ but I had to fix up in a bunch of places manually to
add the right namespacing and such.

Overall it's not a very interesting patch I think.

nsDocument.cpp turns into Document.cpp, nsIDocument.h into Document.h and
nsIDocumentInlines.h into DocumentInlines.h.

I also changed a bunch of nsCOMPtr usage to RefPtr, but not all of it.

While fixing up some of the bits I also removed some unneeded OwnerDoc() null
checks and such, but I didn't do anything riskier than that.
2019-01-03 17:48:33 +01:00
Kyle Machulis 7ce2d5568b Bug 1497995 - Make URI a constructor argument of nsDocShellLoadState; r=bzbarsky
We'll always need a URI for DocShellLoadState, and it should only
change is special circumstances. Construct the object with it, and
then follow up in Bug 1515433 for more cleanup.

Differential Revision: https://phabricator.services.mozilla.com/D13490

--HG--
extra : moz-landing-system : lando
2018-12-21 20:17:43 +00:00
Jonathan Kingston 0d4c03a307 Bug 1508642 - Add in session history triggering principal to nsSHistory. r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D14976

--HG--
extra : moz-landing-system : lando
2018-12-20 12:17:45 +00:00
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Jonathan Kingston 02cef3103a Bug 1508609 - Add strict checking of principals into DocShell LoadURI. r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D12425

--HG--
extra : moz-landing-system : lando
2018-11-20 18:08:03 +00:00
Gabriele Svelto 266ef73c96 Bug 1503207 - Remove nsWeakPtr.h and cleanup all files including weak reference-related headers r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D10251

--HG--
extra : moz-landing-system : lando
2018-10-31 20:39:03 +00:00
Kyle Machulis 6d3b4e7492 Bug 1492648 - Move from nsDocShellLoadInfo to nsDocShellLoadState; r=bz, nika
Creates the nsDocShellLoadState object, which is basically
nsDocShellLoadInfo plus a few extra fields to make it usable as a
single argument to nsDocShell::LoadURI (and eventually
nsDocShell::InternalLoad).

Subframe history handling is a huge logic block in
nsDocShell::LoadURI, which is only used on history loads. This patch
also extracts the logic out into its own function to make the body of
LoadURI clearer.
2018-10-29 17:13:29 -07:00
Kyle Machulis ee8ccacb05 Backed out changeset fa8487b94a38 due to a=BUSTAGE on comm-central 2018-10-29 12:28:02 -07:00
Kyle Machulis ca0550b32b Bug 1492648 - Move from nsDocShellLoadInfo to nsDocShellLoadState r=bzbarsky,nika
Creates the nsDocShellLoadState object, which is basically
nsDocShellLoadInfo plus a few extra fields to make it usable as a
single argument to nsDocShell::LoadURI (and eventually
nsDocShell::InternalLoad).

Subframe history handling is a huge logic block in
nsDocShell::LoadURI, which is only used on history loads. This patch
also extracts the logic out into its own function to make the body of
LoadURI clearer.

Differential Revision: https://phabricator.services.mozilla.com/D6944

--HG--
rename : docshell/base/nsDocShellLoadInfo.cpp => docshell/base/nsDocShellLoadState.cpp
rename : docshell/base/nsDocShellLoadInfo.h => docshell/base/nsDocShellLoadState.h
extra : moz-landing-system : lando
2018-10-26 03:50:37 +00:00
Narcis Beleuzu 5d00f78a13 Backed out changeset 8dd09fad1f35 (bug 1492648) for bc failures on browser_auto_close_window.js
--HG--
rename : docshell/base/nsDocShellLoadState.cpp => docshell/base/nsDocShellLoadInfo.cpp
rename : docshell/base/nsDocShellLoadState.h => docshell/base/nsDocShellLoadInfo.h
2018-10-19 10:11:33 +03:00
Kyle Machulis 0bb3246aa5 Bug 1492648 - Move from nsDocShellLoadInfo to nsDocShellLoadState r=bzbarsky,nika
Creates the nsDocShellLoadState object, which is basically
nsDocShellLoadInfo plus a few extra fields to make it usable as a
single argument to nsDocShell::LoadURI (and eventually
nsDocShell::InternalLoad).

Subframe history handling is a huge logic block in
nsDocShell::LoadURI, which is only used on history loads. This patch
also extracts the logic out into its own function to make the body of
LoadURI clearer.

Differential Revision: https://phabricator.services.mozilla.com/D6944

--HG--
rename : docshell/base/nsDocShellLoadInfo.cpp => docshell/base/nsDocShellLoadState.cpp
rename : docshell/base/nsDocShellLoadInfo.h => docshell/base/nsDocShellLoadState.h
extra : moz-landing-system : lando
2018-10-18 22:14:54 +00:00
Mats Palmgren faeddacfac Bug 1494745 part 5 - Don't check the result from ns[Auto]TObserverArray insertions since they're infallible. r=bz 2018-10-14 18:12:23 +02:00
Nicholas Nethercote 73e2b20c61 Bug 1490858 - Reorder nsISHEntry. r=nika
nsISHEntry's attributes and methods are thoroughly mixed. This patch separates
them, making it easier to understand.

--HG--
extra : rebase_source : 8a7822b5289fbb67e74dfa3cb42aa31206ee0e16
2018-09-12 13:20:14 +10:00
Nicholas Nethercote eb5daf71af Bug 1490858 - Simplify some nsISHEntry attributes. r=nika
Both nsISHEntry.URI and nsISHEntry isSubFrame are readonly, but also have a
setter. This is silly, so this patch removes the setter and makes them
modifiable.

The patch also renames nsISHEntry.setAsHistoryLoad() as setLoadTypeAsHistory(),
which makes it clearer that it modifies the loadType attribute.

--HG--
extra : rebase_source : 7772e2c1d90d4fd9f462f20c777d6eacc65801c5
2018-09-12 12:54:11 +10:00
Nicholas Nethercote f659c0df65 Bug 1490858 - Streamline nsISHEntry a little more. r=nika
By marking some C++-only nsISHistory methods as [noscript] or [noscript,
notxpcom].

--HG--
extra : rebase_source : 1216e755a227fd13f01057afd71ea082a2a79ad7
2018-09-12 11:59:06 +10:00
Nicholas Nethercote f9b2172b05 Bug 1490858 - Make most nsISHEntry attributes infallible. r=nika
The patch also removes some NS_ENSURE_ARG_POINTER checks from these attributes'
getters. Most of these getters already lack such checks, and as long as the
infallible getters are used a non-null pointer is guaranteed. In the worst case
we'll safely null-crash anyway.

--HG--
extra : rebase_source : 87d4f7fccfa7ffb605c514cf8c2abd270a13b24a
2018-09-07 11:56:23 +10:00
Nicholas Nethercote 2d47fcde1c Bug 1490828 - Handle mPersist in the nsSHEntry copy constructor. r=nika
--HG--
extra : rebase_source : 11bc9b8881467bbf6a4cee9800bf1d13707856b6
2018-09-14 11:09:19 +10:00
Nicholas Nethercote 57abe0460a Bug 1490524 - Streamline nsISHistory a little more. r=nika
- Move VIEWER_WINDOW from nsISHistory to nsSHistory.

- Mark some C++-only nsISHistory methods as [noscript, notxpcom].

- Add gotoIndex() to nsISHistory so that LegacySHistoryImpl() can be removed.

--HG--
extra : rebase_source : c33081d527af6f9697fad095d24824fc4d451f4d
2018-09-11 16:08:39 +10:00
Nicholas Nethercote a0583f1a89 Bug 1490524 - Make some nsISHistory attributes infallible. r=nika
This also requires making nsISHistory `builtinclass`.

--HG--
extra : rebase_source : a1f2c7a60782dcd741b350f6cd3979d888008a97
2018-09-11 16:08:37 +10:00
Nicholas Nethercote 86422376e7 Bug 1490524 - Remove nsISHistory.maxLength. r=nika
It's unused.

--HG--
extra : rebase_source : d835dd5f650515740e31d9f30535ea2a13d9556b
2018-09-11 16:08:35 +10:00
Nicholas Nethercote 0935270972 Bug 1490158 - Add a clarifying comment. r=nika
--HG--
extra : rebase_source : ab987310ca62b5587f7437d91f7be4345bc5cb16
2018-09-11 15:04:16 +10:00
Nicholas Nethercote 7f2bb554d6 Bug 1490158 Remove On{Length,Index}Changed from nsISHistoryListener. r=nika
They're never used.

--HG--
extra : rebase_source : 94f94e4d198917aa5e1d9322e9ba195f641e6e45
2018-09-07 10:27:05 +10:00
Nicholas Nethercote 951d44ded0 Bug 1490158 - Minimize cancelability in nsISHistoryListener. r=nika
nsISHistoryListener can cancel several operations, but the functionality is
only ever used for OnHistoryReload(). So this patch removes it for the other
operations.

--HG--
extra : rebase_source : 433422e9160f7d645570baaaff4779c4bcc3ec04
2018-09-06 16:51:58 +10:00
Nicholas Nethercote 55657f2206 Bug 1488628 - Change nsISHEntry.title to an AString. r=nika
This patch also removes the setTitle() method and makes `title` non-readonly.

--HG--
extra : rebase_source : 87e394ec5cb0eed7a9b77fa105b6dd45111d75fd
2018-09-05 11:29:36 +10:00
Nicholas Nethercote f5d9c8867c Bug 1488321 - Remove all traces of the "transaction" terminology in SHistory. r=nika.
This patch:

- removes GetTransactionAtIndex(), because getTransactionAtIndex() can be used
  instead;

- renames a lot of things;

- updates some comments.

--HG--
extra : rebase_source : 845a1c1d5fe7f84eaa03db39a344d98fd5784afd
2018-09-05 09:03:22 +10:00
Nicholas Nethercote 13643f64e8 Bug 1488321 - Fix up nsISHEntry.{index,getEntryAtIndex()}. r=nika
nsISHEntry.index is readonly, but if you pass `true` as getEntryAtIndex()'s
second argument, nsISHEntry.index will be modified. This is pretty gross.

This patch changes `index` so it's not readonly (because it's not!) and removes
getEntryAtIndex()'s second argument.

--HG--
extra : rebase_source : c519d77fcc1c3bda2f260b5888ce9cd0f6cfdab5
2018-09-05 09:02:37 +10:00
Nicholas Nethercote 54ca088229 Bug 1488321 - Remove nsISHTransaction. r=nika
Because it's a wafer-thin wrapper around nsISHEntry that just complicates
things.

This patch leaves behind a combination of "entry" and "transaction"
terminology. I'll fix that in a subsequent patch.

--HG--
extra : rebase_source : ca15187447bf3d93c65ed3980ead5bca958471be
2018-09-05 09:02:37 +10:00
Nicholas Nethercote b546759d02 Bug 1488321 - Move the `persist` attribute from nsISHTransaction to nsISHEntry. r=nika
This requires making nsISHEntry `builtinclass`.

--HG--
extra : rebase_source : 90e792ee35c01b0d90c52315e4cb6d85667c58fa
2018-09-05 09:02:37 +10:00
Nicholas Nethercote cd3fc14877 Bug 1488321 - Improve GetTransactionAtIndex() result checking. r=nika
Specifically:

- Check the nsresult consistently, but don't check (unnecessarily) for null on
  success.

- In AddEntry(), move GetTransactionAtIndex() before all state-changing
  operations, so we don't end up with partial state updates upon failure.

- Use early returns to reduce indenting.

--HG--
extra : rebase_source : 17815f6813f024fae1cf4ec3cf1b7985ab7a2ff2
2018-09-05 08:53:28 +10:00
Nicholas Nethercote b212c4a09a Bug 1488321 - Enforce non-nullness for nsISHTransaction.sHEntry. r=nika
In practice it's always non-null, and only half the places that deal with it
have null handling code. So this simplifies things.

--HG--
extra : rebase_source : 250b286b6b2c10aeb0c4486ebe13b1e071bf6c8a
2018-09-05 08:53:28 +10:00
Nicholas Nethercote 268dd7e600 Bug 1488321 - Make nsISHTransaction builtin and its attributes infallible. r=nika
--HG--
extra : rebase_source : 2a4068b80ea20b9c25cbb8239dfada992c758821
2018-08-28 12:00:44 +10:00
Nicholas Nethercote 3062776635 Bug 1488321 - Remove `currentIndex` in nsSHistory::AddEntry(). r=nika
It was used to protect against changes in mIndex by history listeners, but the
new code structure doesn't need it, because we want to use mIndex afterwards.

--HG--
extra : rebase_source : 74f0cc7f696b101b8e9d699790f2f2c141c5f51b
2018-09-04 14:00:45 +10:00
Nicholas Nethercote 09a6eb41df Bug 1487328 - Make nsSHistory *not* implement nsIWebNavigation. r=nika
nsSHistory currently implements nsIWebNavigation, but only three of the methods
are actually used, and the rest call MOZ_CRASH. This patch removes the
inheritance and changes the implementations of those three methods (Reload(),
GetCurrentURI(), and GotoIndex()) to pure C++.

There is one test, bug662200_window.xul, that calls Reload() from JS, which is
no longer possible. Fortunately, nsSHistory::ReloadCurrentEntry() -- which *is*
available from JS -- is similar enough to Reload(0) that it can be used
instead.

(The only difference between Reload(0) and ReloadCurrentEntry() is that the
former triggers the `OnHistoryReload` notification and the latter triggers
`OnHistoryGotoIndex`, which doesn't matter for this test.)

--HG--
extra : rebase_source : 69dba04f14b1438f50f597f3d16b77225795f8a7
2018-09-03 09:27:37 +10:00
Nicholas Nethercote 70d22aa86a Bug 1487328 - Remove nsISHistoryListener.OnHistoryGo{Back,Forward}. r=nika
As per the previous commit, they are now subsumed by OnHistoryGotoIndex.

--HG--
extra : rebase_source : 627a32ed9378c7dd5364323183297933f90f9d72
2018-09-03 09:27:37 +10:00
Nicholas Nethercote 6347de0109 Bug 1487328 - Clarify which nsIWebNavigation methods in nsSHistory are unreachable. r=nika
The only ones that are reachable are GotoIndex(), GetCurrentURI(), and
Reload(). This patch makes all the others crash.

Note that the reason that Go{Back,Forward}() are unreachable is because of this
behaviour in ChildHistory::Go():

  // XXX(nika): Should we turn Go(-1) and Go(1) to call GoForward and GoBack?
  // They technically fire different change events but I couldn't find anyone
  // who cares, so I'm inclined not to.

I.e. those functions are now subsumed by GotoIndex().

As for CanGo{Back,Forward}(), a try push plus code inspection confirm that they
are unused.

--HG--
extra : rebase_source : 6509e635478f257be1271b51d352e0a9d81899ec
2018-09-03 09:27:37 +10:00
Nicholas Nethercote f369a978ca Bug 1487296 - Merge nsISHistoryInternal into nsISHistory. r=nika
With legacy add-ons gone, there is no benefit to keeping them separate.
2018-08-30 11:37:40 +10:00
Nicholas Nethercote 54524b264e Bug 1487296 - Fix nsIHistory.idl formatting. r=nika
Mostly:
- Fix indenting.
- Remove trailing whitespace.
- Use `aFoo` arguments.
2018-08-30 11:08:59 +10:00
Nicholas Nethercote 03f4d6c3ac Bug 1487541 - Keep mRequestedIndex in bounds in PurgeHistory(). r=me
--HG--
extra : rebase_source : 1488b7a2d3bab7e9a746ddd1fbf70a155cec3933
2018-08-31 16:25:32 +10:00
Nicholas Nethercote 1035277500 Bug 1486358 - Mark GetTransactionAtIndex() as NS_IMETHODIMP. r=me
Because of one this bug's earlier commits made it an XPIDL method.

--HG--
extra : rebase_source : d0e69d5c5eb1fd1caf0946872c8319029591fcc3
2018-08-31 15:32:14 +10:00
Nicholas Nethercote cfd6ca43dd Bug 1486358 - Factor out shistory entry window code. r=nika
(It's worth noting that I had to fix one of these instances in the previous
patch, by adding a -1.)

--HG--
extra : rebase_source : ea45cd7dc59b6649f1b46a2c917def79538fcbe8
2018-08-28 12:00:41 +10:00
Nicholas Nethercote beb090da4a Bug 1486358 - Change nsISHistory's transactions list to an nsTArray. r=nika
- nsISHistoryInternal loses `rootTransaction`, and gains
  GetTransactionAtIndex(). (The implementing class `nsSHistory` already
  implemented a method by that method.)

- nsSHistory loses `mListRoot` in favour of `mTransactions`. It also loses
  `mLength`, because `mTransactions` tracks the length itself.

- nsISHTransaction.{prev,next} are no longer needed.

- nsISHTransaction.create() is no longer needed, because all it does now is set
  the SHEntry, and we can use SetSHEntry() for that.

Overall this deletes about 200 lines of code.

--HG--
extra : rebase_source : eac6334b653e04634baa86a0f4e3c8f07c06e560
2018-08-27 14:28:46 +10:00
Nicholas Nethercote 814d346fbe Bug 1486358 - Fix nsISHTransaction.idl's formatting.
By replacing tabs with spaces, and cleaning up the comments slightly.

--HG--
extra : rebase_source : dd122be19197614bf3a048b235eb857647456fde
2018-08-27 14:28:44 +10:00
Nicholas Nethercote f751b544bf Bug 1486356 - Remove the XPCOM component registration for nsSHTransaction. r=nika
--HG--
extra : rebase_source : 992dfc8d0c836f3adf499ca1974a70656ee11791
2018-08-27 14:27:34 +10:00
Nicholas Nethercote a4afa80372 Bug 1486356 - Remove nsISHistory.restoreToEntryAtIndex. r=nika
It's unused.

--HG--
extra : rebase_source : b687ecd1f02f6de141fe03b06b555d742d8f8887
2018-08-27 14:27:34 +10:00
Ehsan Akhgari 888504fd4c Bug 1485870 - Remove the XPCOM registration for nsSHTransaction; r=nika 2018-08-28 08:29:33 -04:00