Bug 1837575 - Move Tabbed Browser related files to browser/components/tabbrowser/. r=mconley,desktop-theme-reviewers,zeid,tabbrowser-reviewers,frontend-codestyle-reviewers,Itiel

This is a start, there are more modules and scripts we can/should move, as well as tests.

Differential Revision: https://phabricator.services.mozilla.com/D210676
This commit is contained in:
Dão Gottwald 2024-05-17 13:25:23 +00:00
parent 96db3322cd
commit 2f419065da
28 changed files with 66 additions and 77 deletions

View File

@ -477,7 +477,6 @@ module.exports = {
"browser/actors/AboutPocketParent.sys.mjs",
"browser/actors/SpeechDispatcherParent.sys.mjs",
"browser/base/content/browser-sync.js",
"browser/base/content/tabbrowser.js",
"browser/components/BrowserContentHandler.sys.mjs",
"browser/components/enterprisepolicies/Policies.sys.mjs",
"browser/components/messagepreview/actors/AboutMessagePreviewChild.sys.mjs",
@ -486,6 +485,7 @@ module.exports = {
"browser/components/migration/SafariProfileMigrator.sys.mjs",
"browser/components/places/content/places-tree.js",
"browser/components/places/content/treeView.js",
"browser/components/tabbrowser/content/tabbrowser.js",
"browser/extensions/screenshots/build/shot.js",
"browser/extensions/webcompat/**",
"browser/modules/BackgroundTask_*.sys.mjs",
@ -561,6 +561,7 @@ module.exports = {
"browser/components/screenshots/**",
"browser/components/sessionstore/**",
"browser/components/storybook/.storybook/**",
"browser/components/tabbrowser/**",
"browser/components/tests/browser/**",
"browser/extensions/screenshots/**",
"browser/modules/**",
@ -679,6 +680,7 @@ module.exports = {
"browser/components/storybook/.storybook/**",
"browser/components/storybook/custom-elements-manifest.config.mjs",
"browser/components/syncedtabs/**",
"browser/components/tabbrowser/**",
"browser/components/tabpreview/tabpreview.mjs",
"browser/components/tests/browser/**",
"browser/components/textrecognition/**",

View File

@ -136,7 +136,7 @@ XPCOMUtils.defineLazyScriptGetter(
XPCOMUtils.defineLazyScriptGetter(
this,
"FullZoom",
"chrome://browser/content/browser-fullZoom.js"
"chrome://browser/content/tabbrowser/browser-fullZoom.js"
);
XPCOMUtils.defineLazyScriptGetter(
this,
@ -151,7 +151,7 @@ XPCOMUtils.defineLazyScriptGetter(
XPCOMUtils.defineLazyScriptGetter(
this,
"gTabsPanel",
"chrome://browser/content/browser-allTabsMenu.js"
"chrome://browser/content/tabbrowser/browser-allTabsMenu.js"
);
XPCOMUtils.defineLazyScriptGetter(
this,
@ -166,7 +166,7 @@ XPCOMUtils.defineLazyScriptGetter(
XPCOMUtils.defineLazyScriptGetter(
this,
"ctrlTab",
"chrome://browser/content/browser-ctrlTab.js"
"chrome://browser/content/tabbrowser/browser-ctrlTab.js"
);
XPCOMUtils.defineLazyScriptGetter(
this,

View File

@ -118,9 +118,9 @@
Services.scriptloader.loadSubScript("chrome://browser/content/sidebar/browser-sidebar.js", this);
Services.scriptloader.loadSubScript("chrome://browser/content/browser-tabsintitlebar.js", this);
Services.scriptloader.loadSubScript("chrome://browser/content/browser-unified-extensions.js", this);
Services.scriptloader.loadSubScript("chrome://browser/content/tabbrowser.js", this);
Services.scriptloader.loadSubScript("chrome://browser/content/tabbrowser-tab.js", this);
Services.scriptloader.loadSubScript("chrome://browser/content/tabbrowser-tabs.js", this);
Services.scriptloader.loadSubScript("chrome://browser/content/tabbrowser/tab.js", this);
Services.scriptloader.loadSubScript("chrome://browser/content/tabbrowser/tabbrowser.js", this);
Services.scriptloader.loadSubScript("chrome://browser/content/tabbrowser/tabs.js", this);
Services.scriptloader.loadSubScript("chrome://browser/content/places/places-menupopup.js", this);
Services.scriptloader.loadSubScript("chrome://browser/content/search/autocomplete-popup.js", this);
Services.scriptloader.loadSubScript("chrome://browser/content/search/searchbar.js", this);

View File

@ -11,7 +11,7 @@ At this point, ``<xul:tabbrowser>`` DOM element doesn't exist anymore, but we me
gBrowser
---------------
``gBrowser`` is a JavaScript object defined in :searchfox:`tabbrowser.js <browser/base/content/tabbrowser.js>`, that manages tabs, and the underlying infrastructure for switching tabs, adding tabs, removing tabs, knowing about tab switches, etc. ``gBrowser`` is available in the browser window scope and you get only one ``gBrowser`` per browser window.
``gBrowser`` is a JavaScript object defined in :searchfox:`tabbrowser.js <browser/components/tabbrowser/content/tabbrowser.js>`, that manages tabs, and the underlying infrastructure for switching tabs, adding tabs, removing tabs, knowing about tab switches, etc. ``gBrowser`` is available in the browser window scope and you get only one ``gBrowser`` per browser window.
What does the name gBrowser stand for?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -27,7 +27,7 @@ Relationship between tabbrowser, browser and gBrowser
Historically each Firefox window had one ``<xul:tabbrowser>``, that could be accessed using the ``gBrowser`` variable. It could contain multiple tabs each of which was associated with one ``<xul:browser>``.
Although the ``<xul:tabbrowser>`` DOM element was removed, you can still interact with all the browser's tabs using the ``gBrowser`` global. The ``gBrowser`` global is still defined in a file called :searchfox:`tabbrowser.js <browser/base/content/tabbrowser.js>` for the same historical reasons.
Although the ``<xul:tabbrowser>`` DOM element was removed, you can still interact with all the browser's tabs using the ``gBrowser`` global. The ``gBrowser`` global is still defined in a file called :searchfox:`tabbrowser.js <browser/components/tabbrowser/content/tabbrowser.js>` for the same historical reasons.
.. toctree::
:maxdepth: 1

View File

@ -139,9 +139,6 @@ with Files("*menu*"):
with Files("browser-customization.js"):
BUG_COMPONENT = ("Firefox", "Toolbars and Customization")
with Files("browser-fullZoom.js"):
BUG_COMPONENT = ("Firefox", "Tabbed Browser")
with Files("browser-gestureSupport.js"):
BUG_COMPONENT = ("Core", "Widget")
@ -172,15 +169,6 @@ with Files("macWindow.inc.xhtml"):
with Files("sanitize*"):
BUG_COMPONENT = ("Toolkit", "Data Sanitization")
with Files("tabbrowser*"):
BUG_COMPONENT = ("Firefox", "Tabbed Browser")
with Files("browser-allTabsMenu.js"):
BUG_COMPONENT = ("Firefox", "Tabbed Browser")
with Files("browser-ctrlTab.js"):
BUG_COMPONENT = ("Firefox", "Tabbed Browser")
with Files("webext-panels*"):
BUG_COMPONENT = ("WebExtensions", "Frontend")

View File

@ -12,10 +12,10 @@
const EXPECTED_REFLOWS = [
{
stack: [
"clientX@chrome://browser/content/tabbrowser-tabs.js",
"startTabDrag@chrome://browser/content/tabbrowser-tabs.js",
"on_dragstart@chrome://browser/content/tabbrowser-tabs.js",
"handleEvent@chrome://browser/content/tabbrowser-tabs.js",
"clientX@chrome://browser/content/tabbrowser/tabs.js",
"startTabDrag@chrome://browser/content/tabbrowser/tabs.js",
"on_dragstart@chrome://browser/content/tabbrowser/tabs.js",
"handleEvent@chrome://browser/content/tabbrowser/tabs.js",
"synthesizeMouseAtPoint@chrome://mochikit/content/tests/SimpleTest/EventUtils.js",
"synthesizeMouse@chrome://mochikit/content/tests/SimpleTest/EventUtils.js",
"synthesizePlainDragAndDrop@chrome://mochikit/content/tests/SimpleTest/EventUtils.js",
@ -25,9 +25,9 @@ const EXPECTED_REFLOWS = [
{
stack: [
"startTabDrag@chrome://browser/content/tabbrowser-tabs.js",
"on_dragstart@chrome://browser/content/tabbrowser-tabs.js",
"handleEvent@chrome://browser/content/tabbrowser-tabs.js",
"startTabDrag@chrome://browser/content/tabbrowser/tabs.js",
"on_dragstart@chrome://browser/content/tabbrowser/tabs.js",
"handleEvent@chrome://browser/content/tabbrowser/tabs.js",
"synthesizeMouseAtPoint@chrome://mochikit/content/tests/SimpleTest/EventUtils.js",
"synthesizeMouse@chrome://mochikit/content/tests/SimpleTest/EventUtils.js",
"synthesizePlainDragAndDrop@chrome://mochikit/content/tests/SimpleTest/EventUtils.js",

View File

@ -38,17 +38,14 @@ browser.jar:
* content/browser/browser.xhtml (content/browser.xhtml)
content/browser/browser-a11yUtils.js (content/browser-a11yUtils.js)
content/browser/browser-addons.js (content/browser-addons.js)
content/browser/browser-allTabsMenu.js (content/browser-allTabsMenu.js)
content/browser/browser-captivePortal.js (content/browser-captivePortal.js)
content/browser/browser-commands.js (content/browser-commands.js)
content/browser/browser-ctrlTab.js (content/browser-ctrlTab.js)
content/browser/browser-customization.js (content/browser-customization.js)
content/browser/browser-data-submission-info-bar.js (content/browser-data-submission-info-bar.js)
#ifndef MOZILLA_OFFICIAL
content/browser/browser-development-helpers.js (content/browser-development-helpers.js)
#endif
content/browser/browser-fullScreenAndPointerLock.js (content/browser-fullScreenAndPointerLock.js)
content/browser/browser-fullZoom.js (content/browser-fullZoom.js)
content/browser/browser-gestureSupport.js (content/browser-gestureSupport.js)
content/browser/browser-init.js (content/browser-init.js)
content/browser/browser-pageActions.js (content/browser-pageActions.js)
@ -80,9 +77,6 @@ browser.jar:
content/browser/sanitize_v2.xhtml (content/sanitize_v2.xhtml)
content/browser/sanitizeDialog.js (content/sanitizeDialog.js)
content/browser/sanitizeDialog.css (content/sanitizeDialog.css)
content/browser/tabbrowser.js (content/tabbrowser.js)
content/browser/tabbrowser-tab.js (content/tabbrowser-tab.js)
content/browser/tabbrowser-tabs.js (content/tabbrowser-tabs.js)
content/browser/utilityOverlay.js (content/utilityOverlay.js)
content/browser/webext-panels.js (content/webext-panels.js)
* content/browser/webext-panels.xhtml (content/webext-panels.xhtml)

View File

@ -64,6 +64,7 @@ DIRS += [
"shopping",
"sidebar",
"syncedtabs",
"tabbrowser",
"tabpreview",
"tabunloader",
"textrecognition",

View File

@ -0,0 +1,11 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
browser.jar:
content/browser/tabbrowser/browser-allTabsMenu.js (content/browser-allTabsMenu.js)
content/browser/tabbrowser/browser-ctrlTab.js (content/browser-ctrlTab.js)
content/browser/tabbrowser/browser-fullZoom.js (content/browser-fullZoom.js)
content/browser/tabbrowser/tab.js (content/tab.js)
content/browser/tabbrowser/tabbrowser.js (content/tabbrowser.js)
content/browser/tabbrowser/tabs.js (content/tabs.js)

View File

@ -0,0 +1,16 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
with Files("**"):
BUG_COMPONENT = ("Firefox", "Tabbed Browser")
JAR_MANIFESTS += ["jar.mn"]
EXTRA_JS_MODULES += [
"AsyncTabSwitcher.sys.mjs",
"NewTabPagePreloading.sys.mjs",
"OpenInTabsUtils.sys.mjs",
"TabsList.sys.mjs",
"TabUnloader.sys.mjs",
]

View File

@ -46,12 +46,6 @@ with Files("test/unit/test_SitePermissions.js"):
with Files("AboutNewTab.sys.mjs"):
BUG_COMPONENT = ("Firefox", "New Tab Page")
with Files("AsyncTabSwitcher.sys.mjs"):
BUG_COMPONENT = ("Firefox", "Tabbed Browser")
with Files("NewTabPagePreloading.sys.mjs"):
BUG_COMPONENT = ("Firefox", "Tabbed Browser")
with Files("BrowserWindowTracker.sys.mjs"):
BUG_COMPONENT = ("Firefox", "General")
@ -70,9 +64,6 @@ with Files("ExtensionsUI.sys.mjs"):
with Files("LaterRun.sys.mjs"):
BUG_COMPONENT = ("Firefox", "Tours")
with Files("OpenInTabsUtils.sys.mjs"):
BUG_COMPONENT = ("Firefox", "Tabbed Browser")
with Files("PartnerLinkAttribution.sys.mjs"):
BUG_COMPONENT = ("Firefox", "Search")
@ -94,12 +85,6 @@ with Files("SiteDataManager.sys.mjs"):
with Files("SitePermissions.sys.mjs"):
BUG_COMPONENT = ("Firefox", "Site Permissions")
with Files("TabsList.sys.mjs"):
BUG_COMPONENT = ("Firefox", "Tabbed Browser")
with Files("TabUnloader.sys.mjs"):
BUG_COMPONENT = ("Firefox", "Tabbed Browser")
with Files("TransientPrefs.sys.mjs"):
BUG_COMPONENT = ("Firefox", "Settings UI")
@ -125,7 +110,6 @@ XPCSHELL_TESTS_MANIFESTS += ["test/unit/xpcshell.toml"]
EXTRA_JS_MODULES += [
"AboutNewTab.sys.mjs",
"AsyncTabSwitcher.sys.mjs",
"BrowserUIUtils.sys.mjs",
"BrowserUsageTelemetry.sys.mjs",
"BrowserWindowTracker.sys.mjs",
@ -137,8 +121,6 @@ EXTRA_JS_MODULES += [
"FirefoxBridgeExtensionUtils.sys.mjs",
"HomePage.sys.mjs",
"LaterRun.sys.mjs",
"NewTabPagePreloading.sys.mjs",
"OpenInTabsUtils.sys.mjs",
"PageActions.sys.mjs",
"PartnerLinkAttribution.sys.mjs",
"PermissionUI.sys.mjs",
@ -147,8 +129,6 @@ EXTRA_JS_MODULES += [
"SelectionChangedMenulist.sys.mjs",
"SiteDataManager.sys.mjs",
"SitePermissions.sys.mjs",
"TabsList.sys.mjs",
"TabUnloader.sys.mjs",
"TransientPrefs.sys.mjs",
"URILoadingHelper.sys.mjs",
"webrtcUI.sys.mjs",

View File

@ -2,9 +2,12 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@import url("chrome://browser/skin/downloads/indicator.css");
@import url("chrome://browser/content/tabpreview/tabpreview.css");
@import url("chrome://browser/skin/addons/extension-controlled.css");
@import url("chrome://browser/skin/addons/unified-extensions.css");
@import url("chrome://browser/skin/downloads/indicator.css");
@import url("chrome://browser/skin/tabbrowser/ctrlTab.css");
@import url("chrome://browser/skin/tabbrowser/tabs.css");
@import url("chrome://browser/skin/toolbarbuttons.css");
@import url("chrome://browser/skin/toolbarbutton-icons.css");
@import url("chrome://browser/skin/menupanel.css");
@ -17,10 +20,7 @@
@import url("chrome://browser/skin/autocomplete.css");
@import url("chrome://browser/skin/places/editBookmarkPanel.css");
@import url("chrome://browser/skin/sidebar.css");
@import url("chrome://browser/skin/tabs.css");
@import url("chrome://browser/content/tabpreview/tabpreview.css");
@import url("chrome://browser/skin/fullscreen/warning.css");
@import url("chrome://browser/skin/ctrlTab.css");
@import url("chrome://browser/skin/customizableui/customizeMode.css");
@import url("chrome://browser/skin/UITour.css");
@import url("chrome://browser/skin/formautofill-notification.css");

View File

@ -17,7 +17,6 @@
skin/classic/browser/autocomplete.css (../shared/autocomplete.css)
skin/classic/browser/blockedSite.css (../shared/blockedSite.css)
skin/classic/browser/browser-shared.css (../shared/browser-shared.css)
skin/classic/browser/ctrlTab.css (../shared/ctrlTab.css)
skin/classic/browser/formautofill-notification.css (../shared/formautofill-notification.css)
skin/classic/browser/identity-credential-notification.css (../shared/identity-credential-notification.css)
skin/classic/browser/light-dark-overrides.css (../shared/light-dark-overrides.css)
@ -28,7 +27,6 @@
skin/classic/browser/searchbar.css (../shared/searchbar.css)
skin/classic/browser/setDesktopBackground.css (../shared/setDesktopBackground.css)
skin/classic/browser/sidebar.css (../shared/sidebar.css)
skin/classic/browser/tabs.css (../shared/tabs.css)
skin/classic/browser/toolbarbuttons.css (../shared/toolbarbuttons.css)
skin/classic/browser/toolbarbutton-icons.css (../shared/toolbarbutton-icons.css)
skin/classic/browser/urlbar-dynamic-results.css (../shared/urlbar-dynamic-results.css)
@ -222,6 +220,7 @@
skin/classic/browser/search-indicator-badge-add.svg (../shared/search/search-indicator-badge-add.svg)
skin/classic/browser/tabbrowser/crashed.svg (../shared/tabbrowser/crashed.svg)
skin/classic/browser/tabbrowser/ctrlTab.css (../shared/tabbrowser/ctrlTab.css)
skin/classic/browser/tabbrowser/hourglass.svg (../shared/tabbrowser/hourglass.svg)
skin/classic/browser/tabbrowser/loading.svg (../shared/tabbrowser/loading.svg)
skin/classic/browser/tabbrowser/loading-burst.svg (../shared/tabbrowser/loading-burst.svg)
@ -236,6 +235,7 @@
skin/classic/browser/tabbrowser/tab-loading@2x.png (../shared/tabbrowser/tab-loading@2x.png)
skin/classic/browser/tabbrowser/tab-loading-inverted.png (../shared/tabbrowser/tab-loading-inverted.png)
skin/classic/browser/tabbrowser/tab-loading-inverted@2x.png (../shared/tabbrowser/tab-loading-inverted@2x.png)
skin/classic/browser/tabbrowser/tabs.css (../shared/tabbrowser/tabs.css)
skin/classic/browser/translations/beta.svg (../shared/translations/beta.svg)

View File

@ -8,7 +8,7 @@
# documentation and how to modify this file.
repo: mozilla-central
created_at: '2021-10-14T12:50:40.073465'
updated_at: '2024-05-10T16:56:31.242839+00:00'
updated_at: '2024-05-16T14:45:06.160796+00:00'
export:
path: ./docs/mots/index.rst
format: rst
@ -3697,15 +3697,8 @@ modules:
- name: Tabbed Browser
description: The UI component controlling browser tabs.
includes:
- browser/base/content/tabbrowser*
- browser/base/content/browser-allTabsMenu.js
- browser/base/content/browser-ctrlTab.js
- browser/base/content/browser-fullZoom.js
- browser/modules/AsyncTabSwitcher.sys.mjs
- browser/modules/NewTabPagePreloading.sys.mjs
- browser/modules/OpenInTabsUtils.sys.mjs
- browser/modules/TabsList.sys.mjs
- browser/modules/TabUnloader.sys.mjs
- browser/components/tabbrowser/**/*
- browser/themes/shared/tabbrowser/*
meta:
components:
- Firefox::Tabbed Browser
@ -4341,5 +4334,5 @@ modules:
- Ryan Tilder
group: dev-platform
hashes:
config: a84fae16ad73576d8d936341852994d1eed488a0
export: 8ffcfde8bf1cfdadc4753a90765c0e52e487064c
config: 611fc859adea1938ca1f58fff06f810b74b4c3cf
export: dd8ae72f677a4e255fbcf78f91d04482956d8c12

View File

@ -46,18 +46,18 @@ const extraDefinitions = [
// Some files in global-scripts.inc need mapping to specific locations.
const MAPPINGS = {
"printUtils.js": "toolkit/components/printing/content/printUtils.js",
"panelUI.js": "browser/components/customizableui/content/panelUI.js",
"viewSourceUtils.js":
"toolkit/components/viewsource/content/viewSourceUtils.js",
"browserPlacesViews.js":
"browser/components/places/content/browserPlacesViews.js",
"browser-sidebar.js": "browser/components/sidebar/browser-sidebar.js",
"panelUI.js": "browser/components/customizableui/content/panelUI.js",
"printUtils.js": "toolkit/components/printing/content/printUtils.js",
"places-tree.js": "browser/components/places/content/places-tree.js",
"places-menupopup.js":
"browser/components/places/content/places-menupopup.js",
"shopping-sidebar.js":
"browser/components/shopping/content/shopping-sidebar.js",
"browser-sidebar.js": "browser/components/sidebar/browser-sidebar.js",
"viewSourceUtils.js":
"toolkit/components/viewsource/content/viewSourceUtils.js",
};
const globalScriptsRegExp =
@ -88,6 +88,10 @@ function getGlobalScriptIncludes(scriptPath) {
"chrome://browser/content/screenshots/",
"browser/components/screenshots/content/"
)
.replace(
"chrome://browser/content/tabbrowser/",
"browser/components/tabbrowser/content/"
)
.replace("chrome://browser/content/", "browser/base/content/")
.replace("chrome://global/content/", "toolkit/content/");