Commit Graph
4545 Commits
Author SHA1 Message Date
Andrea Marchesini 5f2e690d2b Bug 1986320 - Implement an add-on block URL-Classifier feature - part 5 - Block top-level documents when loaded by add-ons, r=extension-reviewers,dimi,fluent-reviewers,robwu,bolsson,android-reviewers,android-l10n-reviewers,delphine,tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D263425
2025-12-03 09:47:57 +00:00
pstanciu 7890c2d852 Revert "Bug 2002654 - Initialize about:blank policy container in edge case. r=dom-core,smaug" for causing build bustage @ nsIPrincipal::GetIsNullPrincipal
This reverts commit a7b3748dfc.
2025-12-02 09:41:52 +00:00
Simon Farre a7b3748dfc Bug 2002654 - Initialize about:blank policy container in edge case. r=dom-core,smaug
The bug introduces itself in edge cases where we open a new tab that has
about:blank. In those cases `StartDocumentLoad` doesn't get called for
the document and initialization of policy container does not happen.

Which is why we make sure to initialize it properly here.

Differential Revision: https://phabricator.services.mozilla.com/D274472
2025-12-02 07:50:29 +00:00
Emilio Cobos Álvarez ba0e228d4f Bug 2000639 - Remove nsViewManager. r=jwatt
After the previous patches, nsViewManager is basically a backpointer to
its pres shell.

Remove it and just make PresShell manage the root view directly. After
this is done, we can decide what to do about nsView (which is itself
little more than a widget listener that forwards to pres shell right
now).

This technically starts listening to mParentWidget slightly later (on
pres shell creation), but I think that's ok.

Differential Revision: https://phabricator.services.mozilla.com/D272890
2025-11-28 10:48:18 +00:00
Adam Vandolder 46ea2de4d3 Bug 2002159 - Update the navigation API entries before scrolling during a same-document navigation. r=dom-core,farre
When performing a same-document navigation, we update the active entry
in the docshell and browsing context, then we call ScrollToAnchor,
and only after scrolling we call UpdateEntriesForSameDocumentNavigation.
However, ScrollToAnchor can trigger script to run, and if this script
performs a same-document replace navigation via replaceState we end up
in state where the docshell's mActiveEntry and the navigation API's
current entry are out of sync, resulting in us triggering the assertion
that guarantees replaced entries have the same navigation key as the
entry replacing them.
This patch fixes this by updating the navigation API entries before
scrolling, which more closely follows the #scroll-to-fragid steps
in the spec.

Differential Revision: https://phabricator.services.mozilla.com/D274048
2025-11-26 15:37:55 +00:00
Vincent Hilla 9812cb2647 Bug 543435 - Only reuse inner window for uncommitted initial documents. r=smaug,asuth,credential-management-reviewers,webrtc-reviewers,pehrsons,hsivonen,dimi
The conceptual change is small but it requires several test changes.

In principle, tests cannot open a new empty window, modify the global, then
load their target document and expect their modifications to stick. Only if the
target URI is opened directly, the synchronously available window is reused. So
either tests need to do that, or rely on messages.

Differential Revision: https://phabricator.services.mozilla.com/D265268
2025-11-24 05:34:29 +00:00
Vincent Hilla 967fc6d445 Bug 543435 - Ensure the initial about:blank SH entry is replaced. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D237598
2025-11-24 05:34:26 +00:00
Henri SivonenandVincent Hilla 39a8a4171b Bug 543435 - Make initial about:blank not get overwritten by an async about:blank load. r=sessionstore-reviewers,sfoster,timhuang,credential-management-reviewers,issammani,webidl,extension-reviewers,tabbrowser-reviewers,migration-reviewers,home-newtab-reviewers,hsivonen,cookie-reviewers,fxview-reviewers,firefox-desktop-core-reviewers ,dao,valentin,mossop,smaug,geckoview-reviewers,Jamie,mtigley,thecount,media-playback-reviewers,padenot,dom-worker-reviewers,jesup,jdescottes,asuth,robwu,karlt,profiler-reviewers,kpatenio,devtools-reviewers,tcampbell,nchevobbe
Co-authored-by: Vincent Hilla <[email protected]>
Signed-off-by: Vincent Hilla <[email protected]>

Differential Revision: https://phabricator.services.mozilla.com/D155376
2025-11-24 05:34:22 +00:00
Simon Farre 4e44144ea2 Bug 1999663 - Fix restoration of scroll position r=dom-core,smaug
This patch updates the scroll position data of the "local" (i.e. not
SHIP/in parent process) navigation API entries at the right time and
removes restoring scroll position from mActiveEntry of nsDocShell and
instead uses the target history entry, i.e. the one we're navigating
towards and use that scroll that. This is technically spec compliant
since the active entry is supposed to be the target entry at that
moment.

SHIP still works as intended and is left unchanged by this patch.

Differential Revision: https://phabricator.services.mozilla.com/D272446
2025-11-18 16:18:03 +00:00
Andreas Farre 9243421d50 Bug 1998121 - Manually change LOAD_LINK to LOAD_NORMAL_REPLACE. r=dom-core,smaug
Differential Revision: https://phabricator.services.mozilla.com/D272864
2025-11-18 10:51:15 +00:00
Emilio Cobos Álvarez 8bd614f762 Bug 1999627 - Remove nsViewManager's device context. r=tnikkel,layout-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D272211
2025-11-12 18:37:00 +00:00
Emilio Cobos Álvarez b9bd75cab0 Bug 1999619 - Remove nsIBaseWindow.repaint(). r=tnikkel,smaug,layout-reviewers,dom-core
It's unused. Found when removing more view code.

Differential Revision: https://phabricator.services.mozilla.com/D272204
2025-11-12 07:55:27 +00:00
Valentin Gosu 521ac98b00 Bug 1999266 - Extract PREDICT_LINK from predictor r=necko-reviewers,jesup
Differential Revision: https://phabricator.services.mozilla.com/D271984
2025-11-11 13:28:13 +00:00
Emilio Cobos Álvarez 18be90ee9f Bug 1994942 - Don't use views for subdocs. r=tnikkel,jwatt
This allows to clean up even more view code, since views now are just a
link between layout and widget at the root and little else (so the whole
view children and so on can go), but that will be done in separate
patches since these patches are not risk-free.

Notable changes:

 * PresShell::WillPaint() now recurses into subdocuments. That was done
   previously via CallWillPaintOnObservers().
 * Embedder frame is tracked directly by nsSubDocumentFrame an
   PresShell. It might be possible to simplify this further,
   if bug 1997773 sticks.

Differential Revision: https://phabricator.services.mozilla.com/D232057
2025-11-11 07:33:01 +00:00
Andreas Farre 12c885354d Bug 1998735 - Pass user navigation involvment from form submission. r=dom-core,smaug
Differential Revision: https://phabricator.services.mozilla.com/D271621
2025-11-10 14:54:09 +00:00
Andreas Farre eb1df5971c Bug 1998680 - Make sure to preserve navigationKey on replace. r=smaug,avandolder
Differential Revision: https://phabricator.services.mozilla.com/D271604
2025-11-07 07:25:58 +00:00
Andreas Farre dc09d8d832 Bug 1998121 - Make following a hyperlink do push/replace conversion. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D271373
2025-11-05 12:16:24 +00:00
Emilio Cobos Álvarez cb52781342 Bug 1998202 - Don't use views in nsDocShell::GetVisibility. r=jwatt
We have a better function to compute pres shell visibility.

Differential Revision: https://phabricator.services.mozilla.com/D271252
2025-11-04 20:17:35 +00:00
Emilio Cobos Álvarez 2daf495209 Bug 1997763 - Factor document viewer destruction into its own function. r=dom-core,smaug
No behavior change but noticed while looking / poking at this code for
bug 1994942.

Differential Revision: https://phabricator.services.mozilla.com/D270952
2025-11-03 13:43:27 +00:00
serge-sans-paille 2680f1aa2a Bug 1995938 - Remove unused inclusion of DebugOnly.h r=emilio,necko-reviewers,application-update-reviewers,media-playback-reviewers,profiler-reviewers,win-reviewers,toolkit-telemetry-reviewers,firefox-svg-reviewers,layout-reviewers,dom-worker-reviewers,bytesized,gstoll,mstange,TYLin,chunmin,jesup,asuth
Differential Revision: https://phabricator.services.mozilla.com/D269780
2025-10-27 10:48:42 +00:00
Cristian Tuns 6f66cdf3c7 Revert "Bug 1995938 - Remove unused inclusion of DebugOnly.h r=emilio,necko-reviewers,application-update-reviewers,media-playback-reviewers,profiler-reviewers,win-reviewers,toolkit-telemetry-reviewers,firefox-svg-reviewers,layout-reviewers,dom-worker-reviewers,bytesized,gstoll,mstange,TYLin,chunmin,jesup,asuth" for causing build bustages in TargetFunction.h
This reverts commit 10e5184168.
2025-10-27 08:58:03 +00:00
serge-sans-paille 10e5184168 Bug 1995938 - Remove unused inclusion of DebugOnly.h r=emilio,necko-reviewers,application-update-reviewers,media-playback-reviewers,profiler-reviewers,win-reviewers,toolkit-telemetry-reviewers,firefox-svg-reviewers,layout-reviewers,dom-worker-reviewers,bytesized,gstoll,mstange,TYLin,chunmin,jesup,asuth
Differential Revision: https://phabricator.services.mozilla.com/D269780
2025-10-27 08:00:43 +00:00
Andreas Farre 16d14c6570 Bug 1996220 - Disable Navigation API when document is loaded using multipart/x-mixed-replace. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D269943
2025-10-24 13:34:32 +00:00
Valentin Gosu af26e0d427 Bug 1984105 - Disable Public to Private network LNA checks for Captive Portals r=sunil,necko-reviewers,tabbrowser-reviewers,sthompson
This patch adds a isCaptivePortalTab field to the browsingContext.
We still keep setting the LOAD_FLAGS_DISABLE_TRR loadFlags,
though we could probably move that to BrowsingContext eventually.

nsHttpChannel now automatically allows captive portal browsing contexts
to do public -> private loads without prompting.

Differential Revision: https://phabricator.services.mozilla.com/D267943
2025-10-24 13:04:03 +00:00
Andreas Farre 7f8616af94 Bug 1996016 - Copy over previous entries for multipart/x-mixed-replace. r=jjaschke
Differential Revision: https://phabricator.services.mozilla.com/D269758
2025-10-23 17:36:20 +00:00
serge-sans-paille 1667ec582b Bug 1995723 - Remove unused inclusion of mozilla/ArrayUtils.h r=necko-reviewers,application-update-reviewers,media-playback-reviewers,profiler-reviewers,win-reviewers,firefox-svg-reviewers,layout-reviewers,gstoll,canaltinova,bytesized,alwu,dholbert
Differential Revision: https://phabricator.services.mozilla.com/D269573
2025-10-23 07:30:37 +00:00
Andreas Farre 8c62080bf9 Bug 1995693 - Make sure NotifiedBeforeUnloadListeners is sent over IPC. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D269547
2025-10-22 10:53:24 +00:00
Jan-Niklas Jaeschke f1839c7ffa Bug 1995598 - Navigation API - Remove upcoming non-traverse API method tracker from the navigation object. r=smaug
Having this tracker as part of the navigation state led to
broken state when reentering a navigation by triggering
a new navigation from a `navigateerror` handler.

This patch removes the upcoming non-traverse API method tracker
from `Navigation` and passes it as argument, hereby following the spec.

Differential Revision: https://phabricator.services.mozilla.com/D269448
2025-10-22 09:14:29 +00:00
serge-sans-paille 7662b3abdc Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.

In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.

One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.

Most of the heavy lifting was done through:

    $ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
    $ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'

Differential Revision: https://phabricator.services.mozilla.com/D268706
2025-10-21 19:36:01 +00:00
Cristina Horotan 8a1b1970b7 Revert "Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch" for causing Gtest failures on AlreadyAddRefed.h
This reverts commit e98adca292.
2025-10-21 16:16:29 +00:00
serge-sans-paille e98adca292 Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.

In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.

One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.

Most of the heavy lifting was done through:

    $ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
    $ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'

Differential Revision: https://phabricator.services.mozilla.com/D268706
2025-10-21 15:05:17 +00:00
Cristina Horotan aab924e90d Revert "Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch" for causing build bustage at nsBrowserApp.cpp
This reverts commit fd0ffa193c.
2025-10-21 10:44:13 +00:00
serge-sans-paille fd0ffa193c Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.

In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.

One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.

Most of the heavy lifting was done through:

    $ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
    $ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'

Differential Revision: https://phabricator.services.mozilla.com/D268706
2025-10-21 09:44:11 +00:00
Narcis Beleuzu e1e6bbb1c9 Revert "Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch" for causing bustages on Document.cpp
This reverts commit b23c15e927.
2025-10-21 06:34:58 +00:00
serge-sans-paille b23c15e927 Bug 1994397 - Remove obsolete Unused.h header r=emilio,tschuster,geckoview-reviewers,extension-reviewers,application-update-reviewers,media-playback-reviewers,webrtc-reviewers,cookie-reviewers,places-reviewers,profiler-reviewers,win-reviewers,dom-storage-reviewers,permissions-reviewers,profiles-reviewers,toolkit-telemetry-reviewers,firefox-style-system-reviewers,firefox-svg-reviewers,layout-reviewers,timhuang,gstoll,TravisLong,bytesized,mstange,karlt,robwu,pehrsons,m_kato,jari,jhirsch
It is replaced by a standard-conforming cast to (void) which is
understood the same by the compiler.

In some cases this could be replaced by `[[maybe_unused]]` but for
expression whose value is ignored, this requires storing to a temporary
variable first, so not going that way.

One notable change is that marking an object of type already_AddRefed as
unused used to implicitly leak memory. This is now made explicit.

Most of the heavy lifting was done through:

    $ git grep -l '\<Unused\> <<' | xargs sed -i -e 's/Unused << /(void)/g'
    $ git grep -l mozilla/Unused.h | xargs sed -i -e '/mozilla\/Unused.h/ d'

Differential Revision: https://phabricator.services.mozilla.com/D268706
2025-10-21 06:01:36 +00:00
Jan-Niklas Jaeschke 21f6983d04 Bug 1995312 - Navigation API: Pass FormData as pointer instead of already_AddRefed. r=farre
Passing it down as `already_AddRefed` crashes / leaks
if it's not moved because of early return conditions.

Differential Revision: https://phabricator.services.mozilla.com/D269232
2025-10-20 17:50:07 +00:00
Lando 4851a16d34 Bug 1991135: apply code formatting via Lando
# ignore-this-changeset
2025-10-17 16:58:57 +00:00
Benjamin VanderSloot 1f5d422cf8 Bug 1991135, part 1 - Add support for <meta name=rating> behind a pref - r=dom-core,firefox-desktop-core-reviewers ,fluent-reviewers,bolsson,smaug,frontend-codestyle-reviewers,Gijs
Differential Revision: https://phabricator.services.mozilla.com/D266422
2025-10-17 16:58:37 +00:00
Adam Vandolder e08316caef Bug 1994556 - Remove redundant null check for navigationAPIStateForFiring. r=dom-core,farre
Differential Revision: https://phabricator.services.mozilla.com/D268799
2025-10-16 14:35:10 +00:00
Adam Vandolder 0f1dde9516 Bug 1966674 - Part 9: Make Navigation API State-related naming and types more consistent. r=jjaschke
Differential Revision: https://phabricator.services.mozilla.com/D268182
2025-10-14 15:16:18 +00:00
Adam Vandolder 3389f23099 Bug 1966674 - Part 7: Add the destinationNavigationAPIState to the newly-created session history entry. r=dom-core,jjaschke
Differential Revision: https://phabricator.services.mozilla.com/D268077
2025-10-14 15:16:12 +00:00
Adam Vandolder b03115e1a3 Bug 1966674 - Part 3: Copy the NavigationAPIState to the new loadState when retargeting. r=dom-core,jjaschke
Differential Revision: https://phabricator.services.mozilla.com/D268073
2025-10-14 15:16:01 +00:00
serge-sans-paille dddfa6d699 Bug 1769188 - Replace all instances of MOZ_TRY_VAR by MOZ_TRY r=emilio,profiler-reviewers,win-reviewers,firefox-style-system-reviewers,layout-reviewers,dom-worker-reviewers,canaltinova,gstoll
According to the doc of mfbt/Try.h, MOZ_TRY_VAR is obsolete. Yet it was
used a lot across the code base.

Solely relying on MOZ_TRY is both nicer to the eye and more generic, as
it allows setting variable that don't have a default constructor, and
event sometimes more efficient, if the default constructor is
non-trivial.

Differential Revision: https://phabricator.services.mozilla.com/D268466
2025-10-14 15:15:14 +00:00
serge-sans-paille 274b221ad9 Bug 1993940 - Remove unused includes for mozilla/ResultExtensions.h r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D268360
2025-10-14 15:14:02 +00:00
Andreas Farre f3e6a0d058 Bug 1991265 - Make push to replace load conversion follow spec. r=smaug,webdriver-reviewers
Make sure that navigations from Location and Window.open perform correct
conversion of history handling when passed "auto".

Differential Revision: https://phabricator.services.mozilla.com/D266519
2025-10-13 07:25:01 +00:00
Cristina Horotan 2b88ccd9ac Revert "Bug 1991265 - Make push to replace load conversion follow spec. r=smaug,webdriver-reviewers" for causing wpt failures on location-setter-user-mouseup.html
This reverts commit 310a6f3939.
2025-10-08 17:45:53 +00:00
Andreas Farre 310a6f3939 Bug 1991265 - Make push to replace load conversion follow spec. r=smaug,webdriver-reviewers
Make sure that navigations from Location and Window.open perform correct
conversion of history handling when passed "auto".

Differential Revision: https://phabricator.services.mozilla.com/D266519
2025-10-08 16:15:45 +00:00
owlishDeveloper 0f725335a0 Bug 1992521 - Avoid bfcaching of blank document when loading with EXTERNAL flag r=smaug,farre
Differential Revision: https://phabricator.services.mozilla.com/D267499
2025-10-08 02:13:41 +00:00
Keith Cirkel 451168ca30 Bug 1955947 - Part 2: Implement RestoreScrollPositionData r=farre,dom-core
This implements the basics of RestoreScrollPositionData.
It introduces the new method nsDocShell::RestoreScrollPosFromActiveSHE
which will set the scroll position to the position stored by the active
session history entry.

One could say this deviates slightly from the stated spec because the
spec suggests "HasBeenScrolledByUser" should be true/false if the "user"
has scrolled the document. This however, is a little ambiguous and
doesn't seem to correlate with behaviour from other browsers. Instead we
simply check if the scroll generation has changed since the navigation
event was fired.

It does not pass all scroll-behavior tests, as some rely on an unspecced
behaviour whereby the scroll restoration is deferred until the active
navigation interception promise has settled. We can resolve this in
another bug because this behaviour is not detailed in the spec.

Differential Revision: https://phabricator.services.mozilla.com/D266431
2025-10-03 12:28:09 +00:00
Serban Stanca c8e38a7f68 Revert "Bug 1991265 - Make push to replace load conversion follow spec. r=smaug" for causing wpt failures.
This reverts commit 91a14bd037.
2025-10-03 11:27:03 +00:00