Commit Graph

848 Commits

Author SHA1 Message Date
Noemi Erli
24dfe6678b Backed out changeset 4c6b9209306d (bug 1507287) for causing geckoview failures CLOSED TREE 2020-03-16 23:23:09 +02:00
Alphan Chen
afa243f82c Bug 1507287 - Make sessionRestore work with session history living in the parent process. r=peterv,mikedeboer
Differential Revision: https://phabricator.services.mozilla.com/D46281
2020-03-16 18:33:32 +00:00
Christoph Walcher
7ff5809f3f Bug 1616964 - Remove support for "loadAsInteractiveData" in XMLDocument r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D63774
2020-02-24 17:46:04 +00:00
Nika Layzell
8025e42fa7 Bug 1617488 - Delay setting sandbox flags until frameloader has been initialized, r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D64106
2020-02-26 21:36:54 +00:00
Daniel Varga
1f76c49b49 Backed out changeset e51b4e883adc (bug 1507287) for not having proper review 2020-03-03 18:23:07 +02:00
Alphan Chen
4a2e26cab8 Bug 1507287 - Make sessionRestore work with session history living in the parent process. r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D46281
2020-03-03 16:16:03 +00:00
Nika Layzell
9638b99abf Bug 1615480 - Part 3: Rename nsFrameLoader::mBrowsingContext to avoid confusion, r=kmag
The new name should make it more clear that this should not be the default way
to look up the BrowsingContext instance from a nsFrameLoader, as it does not
ensure that the BrowsingContext has been fully initialized and attached to the
tree.

Differential Revision: https://phabricator.services.mozilla.com/D62959
2020-02-21 21:53:33 +00:00
Nika Layzell
832cbb7565 Bug 1615480 - Part 2: Call GetBrowsingContext from ApplySandboxFlags, r=kmag
This will ensure that the BrowsingContext has been attached before trying to
access properties on it.

Differential Revision: https://phabricator.services.mozilla.com/D62958
2020-02-21 21:03:52 +00:00
Nika Layzell
b6a044a365 Bug 1615480 - Part 1: Return a raw pointer from Get[Extant]BrowsingContext, r=kmag
The BrowsingContext is guaranteed to be being kept alive by
`nsFrameLoader::mBrowsingContext` and by the nsDocShell or RemoteBrowser object.
This improves the ergonomics of this helper method, which may help avoid misuse
of `mBrowsingContext`.

Differential Revision: https://phabricator.services.mozilla.com/D62957
2020-02-21 21:03:54 +00:00
Cosmin Sabou
243d82098b Backed out 3 changesets (bug 1615480) for causing build bustages on nsFrameLoader.cpp.
CLOSED TREE

Backed out changeset d6fd08e3fccf (bug 1615480)
Backed out changeset ad31eae54af2 (bug 1615480)
Backed out changeset 70aff2593d98 (bug 1615480)
2020-02-21 23:00:55 +02:00
Nika Layzell
38ed6e3be9 Bug 1615480 - Part 3: Rename nsFrameLoader::mBrowsingContext to avoid confusion, r=kmag
The new name should make it more clear that this should not be the default way
to look up the BrowsingContext instance from a nsFrameLoader, as it does not
ensure that the BrowsingContext has been fully initialized and attached to the
tree.

Differential Revision: https://phabricator.services.mozilla.com/D62959
2020-02-21 18:46:38 +00:00
Nika Layzell
f426d9252c Bug 1615480 - Part 2: Call GetBrowsingContext from ApplySandboxFlags, r=kmag
This will ensure that the BrowsingContext has been attached before trying to
access properties on it.

Differential Revision: https://phabricator.services.mozilla.com/D62958
2020-02-21 18:45:25 +00:00
Nika Layzell
88323b85cf Bug 1615480 - Part 1: Return a raw pointer from Get[Extant]BrowsingContext, r=kmag
The BrowsingContext is guaranteed to be being kept alive by
`nsFrameLoader::mBrowsingContext` and by the nsDocShell or RemoteBrowser object.
This improves the ergonomics of this helper method, which may help avoid misuse
of `mBrowsingContext`.

Differential Revision: https://phabricator.services.mozilla.com/D62957
2020-02-21 18:44:57 +00:00
Kris Maglione
3036cd06c5 Bug 1615508: Fix printing frames. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D63379
2020-02-19 22:47:05 +00:00
David Major
1e85042bfa Bug 1613606 - Bonus cleanup of IPC::Principals r=nika
All of these call sites were unnecessarily converting nsIPrincipal* => IPC::Principal => nsIPrincipal*.

Differential Revision: https://phabricator.services.mozilla.com/D62327
2020-02-10 20:52:56 +00:00
Tetsuharu OHZEKI
dd72142270 Bug 1597449 - Remove mozilla::dom::BrowserChild::Send/RecvSetWindowName() to remove usages of nsIDocShellTreeItem. r=kmag
Instead we should set a name to BrowsingContext directly.

Differential Revision: https://phabricator.services.mozilla.com/D61342
2020-02-10 20:27:30 +00:00
Nika Layzell
e8a0b02dfa Bug 1610614 - Part 1: Ensure remoteSubframes status matches before allowing frameLoader swap, r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D61923
2020-02-10 21:34:23 +00:00
Kris Maglione
3af7a24cdd Bug 1582832: Part 3 - Correctly handle windowless BCs created for printing. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D61006
2020-02-06 19:08:06 +00:00
Kris Maglione
c48e9854bb Bug 1582832: Part 2 - Don't attach a BrowsingContext before a FrameLoader is initialized. r=nika
There are cases where the initial BrowsingContext that we create for a
FrameLoader will never have a DocShell created for it. In the particular case
when the frame it belongs to is part of an inactive document, trying to
eagerly attach the BrowsingContext ends up attaching it as an active child of
its parent BrowsingContext, when it should be either cached or detached. Which
causes no end of problems.

This patch delays attaching the BrowsingContext until the FrameLoader is
initialized, which solves most of these problems.

Differential Revision: https://phabricator.services.mozilla.com/D59009
2020-02-06 19:08:04 +00:00
Kris Maglione
d7e4043bb8 Bug 1582832: Part 1 - Make FrameLoader owner rather than DocShell responsible for discarding a BC. r=nika
There are all sorts of lifecycle issues which arise from making DocShell
responsible for discarding BrowsingContexts. In this particular bug, we tend
to run into them in cases where we create a BrowsingContext for a FrameLoader,
and then never create a DocShell for it, leading to it never being destroyed.
But there are myriad other issues as well.

This patch moves the responsibility for BrowsingContext lifecycle management
to the FrameLoader/FrameLoaderOwner, rather than the DocShell, which makes
things more consistent, and more closely aligns with spec-defined behavior.

Differential Revision: https://phabricator.services.mozilla.com/D59008
2020-02-06 19:07:56 +00:00
David Teller
c4ec2d7156 Bug 1587963 - Don't change sameTabGroupAs from a WindowGlobalParent that doesn't exist;r=nika
We currently have a hack that sets the TabGroup based on the current window global. There
are a few cases in which we do not have a window global, though – as far as I can tell from
the code, these might be race conditions between loading and closing the tab. Just don't
do anything in such cases.

Differential Revision: https://phabricator.services.mozilla.com/D61284
2020-01-31 08:46:42 +00:00
Kris Maglione
5f3ffd1b57 Bug 1595936: Part 4 - Assert that we don't init FrameLoaders when unsafe. r=smaug
We go to some lengths to defer FrameLoader initialization to the end of
document updates. However, it is still possible for initialization to happen
earlier as a side-effect of other operations (such as
`nsFrameLoader::GetBrowsingContext()`) if they're called before initialization
has already happened. Since this is such an easy mistake to make, we should
assert that it doesn't happen so that we find out about it sooner rather than
later.

Differential Revision: https://phabricator.services.mozilla.com/D55877
2020-01-24 19:03:20 +00:00
Kris Maglione
2ccd93002d Bug 1595936: Part 3b - Don't force FrameLoader initialization on removal. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D55875
2020-01-24 19:03:20 +00:00
Kris Maglione
f170f8d7d1 Bug 1595936: Part 3a - Don't force early FrameLoader initialization in recursion check. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D55874
2020-01-24 19:03:12 +00:00
Kris Maglione
04adf714ef Bug 1595936: Part 2 - Refresh feature policy when attaching browsing context. r=farre,baku
We go to great lengths to try to avoid initializing FrameLoaders during
document updates. That means that when `BindToTree` is called, the element's
FrameLoader is not initialized, and it has no BrowsingContext. Calling
`GetBrowsingContext()` (which happens as a side-effect of
`HTMLIFrameElement::RefreshFeaturePolicy`), however, forces eager
initialization, which can cause any number of problems.

This patch moves that logic from being triggered by `BindToTree` to being
triggered by `BrowsingContext::Embed`, which happens as soon as the
BrowsingContext is bound to the element, but does not force it to be created
early.

Differential Revision: https://phabricator.services.mozilla.com/D55872
2020-01-24 19:03:10 +00:00
Nika Layzell
3892961095 Bug 1609187 - Remove child-initiated remote subframe logic, r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D60268
2020-01-22 19:29:32 +00:00
Sylvestre Ledru
9bd2328337 Bug 1519636 - Automatically reformat recent changes using clang-format r=Ehsan
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D60354
2020-01-21 09:51:27 +00:00
Emilio Cobos Álvarez
b4d31a953b Bug 1588791 - Cleanup threading of OwnerShowInfo. r=mattwoodrow
Right now we do the same thing in two pretty different code paths... That's not
great, so unify them.

Differential Revision: https://phabricator.services.mozilla.com/D59629
2020-01-13 11:30:36 +00:00
Ciure Andrei
dcf9890bea Backed out 2 changesets (bug 1588791) for causing test_bug369370.html and test_transformed_scrolling_repaints_3.html to permafail
Backed out changeset 52e661ff161d (bug 1588791)
Backed out changeset d59e691bda9e (bug 1588791)
2020-01-13 04:49:16 +02:00
Emilio Cobos Álvarez
e5ca64b0c8 Bug 1588791 - Cleanup threading of OwnerShowInfo. r=mattwoodrow
Right now we do the same thing in two pretty different code paths... That's not
great, so unify them.

Differential Revision: https://phabricator.services.mozilla.com/D59629
2020-01-12 22:22:20 +00:00
Matt Woodrow
8f333e70fe Bug 1603196 - Skip START_STOP notifications from old process being delivered to RemoteWebProgress when process switching during a load. r=kmag,nika
This doesn't block the STATE_START notification from the new process, as we currently have a second start notification (when DocumentChannel redirects to the real channel), so this is unchanged.

Differential Revision: https://phabricator.services.mozilla.com/D56818
2020-01-09 22:31:40 +00:00
Tetsuharu OHZEKI
cf400c58a4 Bug 1597431 - Fix uses of nsIDocShellTreeItem in nsFrameLoader::MaybeUpdatePrimaryBrowserParent in dom/base/nsFrameLoader.cpp. r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D58718
2020-01-08 09:41:47 +00:00
Emilio Cobos Álvarez
587af16ed9 Bug 1606659 - Fix a subtle behavior difference from the first patch in this bug. r=mattwoodrow
We should check which conditions in here can and cannot happen, as try was
pretty green without this change...

Differential Revision: https://phabricator.services.mozilla.com/D58730
2020-01-05 23:26:21 +00:00
Emilio Cobos Álvarez
5eba0dc604 Bug 1606659 - Make Browser*::Show take two arguments, one from the parent process, one from the owner of the frame. r=mattwoodrow
This makes clear where the information comes from, and also that there are some
bits of information that we should pass down from the child that we don't, like
allowfullscreen and the frame name.

Differential Revision: https://phabricator.services.mozilla.com/D58535
2020-01-05 20:58:21 +00:00
Emilio Cobos Álvarez
07b0dcbdab Bug 1606659 - Don't pass margin and scrollbar preferences to nsFrameLoader::Show. r=mattwoodrow
Instead, get them on the relevant code paths.

Differential Revision: https://phabricator.services.mozilla.com/D58534
2020-01-05 22:48:40 +00:00
Emilio Cobos Álvarez
80a4c2e0ee Bug 1606638 - Remove AutoResetInShow in nsFrameLoader.cpp. r=bzbarsky
MakeScopeExit does the same and is shorter.

Differential Revision: https://phabricator.services.mozilla.com/D58523
2020-01-03 16:46:27 +00:00
Emilio Cobos Álvarez
3a412cb3ee Bug 1603889 - Simplify the scrollbar preference setup. r=smaug
So much plumbing to pass an enum down.

Differential Revision: https://phabricator.services.mozilla.com/D57182
2019-12-15 22:56:23 +00:00
Boris Zbarsky
8f97398a08 Bug 1602483 part 2. Add a window id argument to CheckLoadURIWithPrincipal. r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D56428
2019-12-12 16:41:19 +00:00
Ciure Andrei
2e0157c747 Backed out 4 changesets (bug 1602483, bug 1602090) for causing perma leackchecks CLOSED TREE
Backed out changeset 6b057ba06b4a (bug 1602483)
Backed out changeset 9be3269d781d (bug 1602483)
Backed out changeset e3e2c1d7478e (bug 1602090)
Backed out changeset fdc4a588912e (bug 1602090)
2019-12-12 18:37:01 +02:00
Boris Zbarsky
f99de7f9a0 Bug 1602483 part 2. Add a window id argument to CheckLoadURIWithPrincipal. r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D56428
2019-12-12 13:05:12 +00:00
Emma Malysz
ce4da4686b Bug 1601094, rename the remaining .xul files in browser/ to .xhtml r=marionette-reviewers,whimboo,mossop
Differential Revision: https://phabricator.services.mozilla.com/D55751
2019-12-11 00:27:19 +00:00
Gabriele Svelto
eb403b8785 Bug 1600545 - Remove useless inclusions of header files generated from IDL files in dom/ r=Ehsan
The inclusions were removed with the following very crude script and the
resulting breakage was fixed up by hand. The manual fixups did either
revert the changes done by the script, replace a generic header with a more
specific one or replace a header with a forward declaration.

find . -name "*.idl" | grep -v web-platform | grep -v third_party | while read path; do
    interfaces=$(grep "^\(class\|interface\).*:.*" "$path" | cut -d' ' -f2)
    if [ -n "$interfaces" ]; then
        if [[ "$interfaces" == *$'\n'* ]]; then
          regexp="\("
          for i in $interfaces; do regexp="$regexp$i\|"; done
          regexp="${regexp%%\\\|}\)"
        else
          regexp="$interfaces"
        fi
        interface=$(basename "$path")
        rg -l "#include.*${interface%%.idl}.h" . | while read path2; do
            hits=$(grep -v "#include.*${interface%%.idl}.h" "$path2" | grep -c "$regexp" )
            if [ $hits -eq 0 ]; then
                echo "Removing ${interface} from ${path2}"
                grep -v "#include.*${interface%%.idl}.h" "$path2" > "$path2".tmp
                mv -f "$path2".tmp "$path2"
            fi
        done
    fi
done

Differential Revision: https://phabricator.services.mozilla.com/D55442
2019-12-06 09:24:56 +00:00
Boris Zbarsky
2df1df0176 Bug 1517588. Use nsIPrincipal::IsSystemPrincipal instead of nsContentUtils::IsSystemPrincipal r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D53067
2019-12-05 04:44:32 +00:00
Dorel Luca
67889e1013 Backed out changeset f6e53d1c6518 (bug 1600545) for Android build bustage. CLOSED TREE 2019-12-04 17:32:27 +02:00
Gabriele Svelto
dc6fa2e86c Bug 1600545 - Remove useless inclusions of header files generated from IDL files in dom/ r=Ehsan
The inclusions were removed with the following very crude script and the
resulting breakage was fixed up by hand. The manual fixups did either
revert the changes done by the script, replace a generic header with a more
specific one or replace a header with a forward declaration.

find . -name "*.idl" | grep -v web-platform | grep -v third_party | while read path; do
    interfaces=$(grep "^\(class\|interface\).*:.*" "$path" | cut -d' ' -f2)
    if [ -n "$interfaces" ]; then
        if [[ "$interfaces" == *$'\n'* ]]; then
          regexp="\("
          for i in $interfaces; do regexp="$regexp$i\|"; done
          regexp="${regexp%%\\\|}\)"
        else
          regexp="$interfaces"
        fi
        interface=$(basename "$path")
        rg -l "#include.*${interface%%.idl}.h" . | while read path2; do
            hits=$(grep -v "#include.*${interface%%.idl}.h" "$path2" | grep -c "$regexp" )
            if [ $hits -eq 0 ]; then
                echo "Removing ${interface} from ${path2}"
                grep -v "#include.*${interface%%.idl}.h" "$path2" > "$path2".tmp
                mv -f "$path2".tmp "$path2"
            fi
        done
    fi
done

Differential Revision: https://phabricator.services.mozilla.com/D55442
2019-12-04 15:01:19 +00:00
Olli Pettay
219b48ed9c Bug 1596763 - Remove unused ParentSHistory, r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D53190
2019-11-27 10:36:32 +00:00
Dorel Luca
c4c3d1ed72 Backed out changeset eaee8979fdc4 (bug 1594529) for Browser-chrome in toolkit/components/passwordmgr/test/browser/browser_doorhanger_crossframe.js. CLOSED TREE 2019-11-07 02:12:16 +02:00
Kris Maglione
184f4783e8 Bug 1594529: Infer nsDocShell::IsFrame from BrowsingContext. r=nika
This fixes the content policy type for document loads in these frames, where
the explicit mIsFrame flag was not set, due to DocShell creation taking a
different code path in remote frames than in in-process frames.

Differential Revision: https://phabricator.services.mozilla.com/D52093
2019-11-06 20:34:36 +00:00
Brendan Dahl
ef30c33394 Bug 1470510 - Rename nsXULWindow and nsIXULWindow to AppWindow and nsIAppWindow. r=smaug
nsXULWindow is no longer XUL specific and is somewhat confusing name.

Differential Revision: https://phabricator.services.mozilla.com/D51486
2019-11-05 17:56:28 +00:00
Mihai Alexandru Michis
5803a050c4 Backed out 2 changesets (bug 1470510) for causing bustages in widget/cocoa/nsChildView.mm CLOSED TREE
Backed out changeset a343f30c34a3 (bug 1470510)
Backed out changeset 4da64790094d (bug 1470510)
2019-11-05 09:24:26 +02:00