Commit graph

82 commits

Author SHA1 Message Date
Gijs Kruitbosch
fefe6083a2 Bug 1803800 - load browserPlacesViews.js only once and immediately from browser scripts, r=mak,florian,Standard8
Unfortunately lazy script getters load the file once for each accessed symbol, which
redeclares "let" and "const" and "class" variables, which was a problem here. But also,
loading the file multiple times is bad for performance (it is not a module so we
actually reload it) and the "lazy" variables get dereferenced immediately from
markup that is present both in browser.xhtml and the hidden window on macOS, so I
doubt lazy loading was getting us anything performance-wise.

This patch simplifies things by 'just' loading the file from the markup.

Differential Revision: https://phabricator.services.mozilla.com/D163934
2022-12-12 17:44:15 +00:00
Tooru Fujisawa
52c95734e7 Bug 1667455 - Part 9: Stop importing Services.jsm from chrome-priv HTML code, single-line cases. r=kmag,necko-reviewers,geckoview-reviewers,extension-reviewers,m_kato,dragana
Differential Revision: https://phabricator.services.mozilla.com/D150898
2022-07-11 12:41:52 +00:00
Brian Grinstead
402bc3a970 Bug 1553188 - Part 4 - Update remaining references to browser.xul;r=bdahl
These are generally:
- Code comments to browser.xhtml
- Testcases, assertions that were mostly using browser.xul as a generic chrome URL
- References to the browser.xul path in tree

Differential Revision: https://phabricator.services.mozilla.com/D33208
2019-05-28 16:40:42 -07:00
Brian Grinstead
8917b90c82 Bug 1553188 - Part 3 - Support eslint for browser.xhtml;r=Standard8
Since it's not a xul document anymore we can't rely on the xul.js lint preprocessor.
This means we need to remove preprocessor attributes from inline scripts, and tell
lint about the browser window environment.

Differential Revision: https://phabricator.services.mozilla.com/D33207
2019-05-30 09:30:21 -07:00
Brian Grinstead
a797a66d25 Bug 1531119 - Remove editMenuCommands.inc.xul and make editMenuOverlay.js in charge of constructing the relevant commandset DOM r=bdahl,NeilDeakin
This allows us to drop preprocessing and makes it simpler to add edit menu functionality to any type of document.

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

--HG--
extra : moz-landing-system : lando
2019-03-21 14:18:48 +00:00
Brendan Dahl
7ebaf1cd2b Bug 1527977 - Share XUL prototype cache with XUL and XHTML. r=smaug
Create a new parser (PrototypeDocumentParser) and content sink
(PrototypeDocumentContentSink) that can be used by both XUL and XHTML.

The new parser moves the code from XULDocument that handles creating and
loading a nsXULPrototypeDocument from either the cache or the source
file. Once the parser has finished loading the prototype it notifies the
content sink. The parser is largely a stub and would be better suited
for use as a nsBaseParser, but nsHTMLDocument unfortunately needs an
nsIParser.

The new content sink has the XULDocument code responsible for the
prototype traversal that creates the DOM (XULDocument::ResumeWalk and
friends) and fires off various events.

To unify XUL and XHTML, the XHTML readystate event sequence is used in
XUL. However, the layout path of XHTML loaded from the prototype cache
more closely follows XUL, where frame initializers and layout don't
start until the entire DOM is built.

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

--HG--
rename : dom/xul/XULDocument.cpp => dom/prototype/PrototypeDocumentContentSink.cpp
rename : parser/moz.build => dom/prototype/moz.build
rename : parser/moz.build => parser/prototype/moz.build
extra : moz-landing-system : lando
2019-03-09 01:00:23 +00:00
Kris Maglione
e930b89c34 Bug 1514594: Part 3 - Change ChromeUtils.import API.
***
Bug 1514594: Part 3a - Change ChromeUtils.import to return an exports object; not pollute global. r=mccr8

This changes the behavior of ChromeUtils.import() to return an exports object,
rather than a module global, in all cases except when `null` is passed as a
second argument, and changes the default behavior not to pollute the global
scope with the module's exports. Thus, the following code written for the old
model:

  ChromeUtils.import("resource://gre/modules/Services.jsm");

is approximately the same as the following, in the new model:

  var {Services} = ChromeUtils.import("resource://gre/modules/Services.jsm");

Since the two behaviors are mutually incompatible, this patch will land with a
scripted rewrite to update all existing callers to use the new model rather
than the old.
***
Bug 1514594: Part 3b - Mass rewrite all JS code to use the new ChromeUtils.import API. rs=Gijs

This was done using the followng script:

https://bitbucket.org/kmaglione/m-c-rewrites/src/tip/processors/cu-import-exports.jsm
***
Bug 1514594: Part 3c - Update ESLint plugin for ChromeUtils.import API changes. r=Standard8

Differential Revision: https://phabricator.services.mozilla.com/D16747
***
Bug 1514594: Part 3d - Remove/fix hundreds of duplicate imports from sync tests. r=Gijs

Differential Revision: https://phabricator.services.mozilla.com/D16748
***
Bug 1514594: Part 3e - Remove no-op ChromeUtils.import() calls. r=Gijs

Differential Revision: https://phabricator.services.mozilla.com/D16749
***
Bug 1514594: Part 3f.1 - Cleanup various test corner cases after mass rewrite. r=Gijs
***
Bug 1514594: Part 3f.2 - Cleanup various non-test corner cases after mass rewrite. r=Gijs

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

--HG--
extra : rebase_source : 359574ee3064c90f33bf36c2ebe3159a24cc8895
extra : histedit_source : b93c8f42808b1599f9122d7842d2c0b3e656a594%2C64a3a4e3359dc889e2ab2b49461bab9e27fc10a7
2019-01-17 10:18:31 -08:00
Dão Gottwald
859de3e25b Bug 1510579 - Load scripts in global-scripts.inc the same way browser.xul does. r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D13237

--HG--
extra : moz-landing-system : lando
2018-11-28 16:13:16 +00:00
Dão Gottwald
0f23fd4558 Bug 1509309 - Move most browser-*.js scripts from global-scripts.inc to browser.xul. r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D13064

--HG--
extra : moz-landing-system : lando
2018-11-27 21:55:21 +00:00
Dão Gottwald
12feb645b8 Bug 1508963 - Load browser-siteIdentity.js lazily. r=johannh
Differential Revision: https://phabricator.services.mozilla.com/D12521

--HG--
extra : moz-landing-system : lando
2018-11-21 17:09:23 +00:00
Dão Gottwald
1b9bb473b9 Bug 1508590 - Load searchbar.js from browser.xul rather than global-scripts.inc. r=adw
Differential Revision: https://phabricator.services.mozilla.com/D12406

--HG--
extra : moz-landing-system : lando
2018-11-21 02:18:32 +00:00
Dão Gottwald
5b9912f43e Bug 1506261 - Convert search-one-offs from a custom element to a plain JS class and initialize it lazily. r=bgrins
Differential Revision: https://phabricator.services.mozilla.com/D11889

--HG--
extra : moz-landing-system : lando
2018-11-17 08:46:35 +00:00
Cosmin Sabou
55394c287c Backed out changeset 10a5af6d30df (bug 1506261) for causing window leaks on OSX debug. CLOSED TREE 2018-11-15 10:53:29 +02:00
Dão Gottwald
6c78bc8bfd Bug 1506261 - Convert search-one-offs from a custom element to a plain JS class and initialize it lazily. r=bgrins
Differential Revision: https://phabricator.services.mozilla.com/D11889

--HG--
extra : moz-landing-system : lando
2018-11-15 00:55:31 +00:00
Brian Grinstead
a1b87b1887 Bug 1493536 - Convert search-one-offs binding to custom element;r=dao
Differential Revision: https://phabricator.services.mozilla.com/D9710

--HG--
rename : browser/components/search/content/search.xml => browser/components/search/content/search-one-offs.js
extra : moz-landing-system : lando
2018-10-25 09:36:15 +00:00
Gijs Kruitbosch
9048f58f8f Bug 1477669 - remove feed preview code and associated files/code, r=flod,mak,nika
Differential Revision: https://phabricator.services.mozilla.com/D8524

--HG--
extra : moz-landing-system : lando
2018-10-16 12:47:36 +00:00
Brian Grinstead
eaaac5ca03 Bug 1460982 - Convert <searchbar> to a Custom Element;r=adw
Differential Revision: https://phabricator.services.mozilla.com/D5912

--HG--
rename : browser/components/search/content/search.xml => browser/components/search/content/searchbar.js
extra : moz-landing-system : lando
2018-09-27 23:09:55 +00:00
Brendan Dahl
195f739823 Bug 1482256 - Support switching to browser.xul to browser.xhtml. r=mossop
Adds a new environment variable MOZ_BROWSER_XHTML to change Firefox to load
a modified version of browser.xul as browser.xhtml. Adds the xhtml
namespace to the script tags to make them work.

MozReview-Commit-ID: 2adtOVzXHKd
2018-08-14 13:13:38 -07:00
Dorel Luca
fbc665b6b3 Backed out changeset 9aae17d0e090 (bug 1482256) for browser-chrome failures on browser/base/content/test/static/browser_all_files_referenced.js. CLOSED TREE 2018-08-14 05:33:44 +03:00
Brendan Dahl
143db4e31d Bug 1482256 - Support switching to browser.xul to browser.xhtml. r=mossop
Adds a new environment variable MOZ_BROWSER_XHTML to change Firefox to load
a modified version of browser.xul as browser.xhtml. Adds the xhtml
namespace to the script tags to make them work.

MozReview-Commit-ID: 2adtOVzXHKd
2018-08-13 14:39:47 -07:00
Johann Hofmann
29edd41fd0 Bug 1476218 - Part 1 - Update Tracking Protection section in the identity popup for Content Blocking. r=nhnt11
This commit switches the identity popup to use "Content Blocking" as a top-level section
instead of Tracking Protection, which is now demoted to a category of Content Blocking.

To keep this change halfway reviewable, I avoided renaming variables, classNames, ids, etc.
that use the term trackingProtection if they were otherwise unaffected by this patch. There
will be other patches that can do this in the future

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

--HG--
rename : browser/base/content/browser-trackingprotection.js => browser/base/content/browser-contentblocking.js
extra : rebase_source : 0dd57d6142c971617e9f47d32ce76a4a028d98eb
2018-08-06 12:43:59 +02:00
Prathiksha
37f7945106 Bug 1440247 - Move gIdentityHandler into its own file (browser-siteIdentity.js). r=johannh
MozReview-Commit-ID: CsOzYthmrgl

--HG--
rename : browser/base/content/browser.js => browser/base/content/browser-siteIdentity.js
extra : rebase_source : c531999d7713e7b6731a725ab909b707578488e2
2018-03-29 19:21:50 +05:30
Brendan Dahl
8a6f97c45c Bug 1442302 - Remove placesOverlay.xul. r=Gijs,mak,standard8
The overlay was responsible for script loading and defining three elements
(bhTooltip, placesCommands, placesContext). In the majority of places where
the overlay was included only part of it was used. To remove the overlay, the
elements were each split into include files and moved into where they
were used. For the scripts, a JS file was added that defines all the lazy
modules and then this script, globalOverlay.js and utilityOverlay.js were
inlined to everywhere that would have included them from the overlay.

MozReview-Commit-ID: 8T5D46oYWLn

--HG--
rename : browser/components/places/content/placesOverlay.xul => browser/components/places/content/placesCommands.inc.xul
rename : browser/components/places/content/placesOverlay.xul => browser/components/places/content/placesContextMenu.inc.xul
extra : rebase_source : c1071af4ea264a95183cbc65caae98feb23d58e5
2018-03-12 10:43:35 -07:00
Dão Gottwald
732eeec0ab Bug 1442651 - Remove the tabbrowser element and binding. r=bgrins
MozReview-Commit-ID: 2IXukkFq5C2

--HG--
extra : rebase_source : 4fd817951e19b39b5b06e75614031302177e86b2
2018-03-05 20:33:36 +01:00
Brendan Dahl
77ac1fd5c8 Bug 1441378 - Replace baseMenuOverlay.xul with inlining and preprocessing. r=Gijs
The overlay defined two elements (helpMenu, menu_ToolsPopup) for all
platforms and three others (windowMenu, baseMenuCommandSet, baseMenuKeyset)
that were MacOS only. The two all platform elements and windowMenu were only
used once and inlined into browser-menubar.inc. The rest of the MacOS only
elements were conditionally inlined into browser-sets.inc.

MozReview-Commit-ID: D2uyCrnepuH

--HG--
extra : rebase_source : a3f7ecaf70c55574ee87091027a651ce429c6876
2018-02-26 16:49:34 -08:00
Brian Grinstead
18bb37dcc8 Bug 1392352 - Part 2 - Translate the tabbrowser implementation into a JS class;r=mconley,r=dao CLOSED TREE
We keep the XBL binding around for <content>, <constructor>, and <destructor>. This can
eventually be migrated to a Custom Element once we have platform support, but in the meantime
this is a way to get the many thousands of LOC into a JS class.

MozReview-Commit-ID: 1dCQp527yF9

--HG--
extra : rebase_source : 26b833413bab71168aa15e03f0f3803884be3f6b
extra : amend_source : 150cef6748ca8a9e819de0c674fac5966dd574cf
2018-02-27 10:04:14 -08:00
Kris Maglione
b744ab0807 Bug 1384714: Use subscript loader to load browser.xul scripts. r=Mossop
There's a lot of overhead to loading scripts from <script> tags in
browser.xul. They're loaded asynchronously, and can't begin loading until
after we begin loading browser.xul. They're loaded using off-main-thread
compilation, which means we need to create and merge a new JS zone for each
script we load that way. They don't benefit from the startup cache at all.

If we load those scripts using the subscript loader, they're loaded from the
preloader cache, and begin loading as early as possible. And they're all
loaded into a single off-thread zone, which means there are less zones to
create and merge. From a quick test, this seems to save about 20-40ms on
Windows ts_paint talos runs.

The main downside is that subscript loader scripts don't benefit from lazy
parsing, so we might wind up increasing memory usage if most of the functions
in those scripts aren't used very often. But we should hopefully be able to
fix that by migrating more browser JS to lazy loading.

MozReview-Commit-ID: Lozb0d0QweC

--HG--
extra : rebase_source : 069a003dfd1d6d66540da814a1fd19742c4fca26
extra : amend_source : b93e0ef7b320c99f4a27ddf6e8af6a681b6dba0f
2017-07-25 20:56:37 -07:00
Brian Grinstead
74f3a35a6d Bug 1385452 - Add a keyboard shortcut in local builds to restart the browser;r=mossop
MozReview-Commit-ID: Du4PTPawzhm

--HG--
extra : rebase_source : fbfca40a61b21fd06463e7075b9e1c8f758cc52d
2017-08-08 11:35:47 -07:00
Drew Willcoxon
6f9f704b57 Bug 1374477 - Add browser-pageActions.js for Photon page actions. r=Gijs
MozReview-Commit-ID: DUl7WlSnk4k

--HG--
extra : rebase_source : 2f7f39fc30216f330a1488c574cad856189fbe8d
2017-07-29 20:24:58 -07:00
Florian Quèze
2e4c2cc726 Bug 1381853 - lazy load browser-thumbnails.js into the browser window, r=mconley. 2017-07-23 00:17:59 +02:00
Florian Quèze
d05f708f77 Bug 1381853 - lazy load browser-sync.js into the browser window, r=mconley. 2017-07-23 00:17:59 +02:00
Florian Quèze
d65f4676a6 Bug 1381853 - lazy load browser-social.js into the browser window, r=mconley. 2017-07-23 00:17:59 +02:00
Florian Quèze
22b404db62 Bug 1381853 - lazy load browser-safebrowsing.js into the browser window, r=mconley. 2017-07-23 00:17:58 +02:00
Florian Quèze
cfb8e478a5 Bug 1381853 - Remove browser-refreshblocker.js and move its code to tabbrowser.xml, avoiding the RefreshBlocked event completely, r=mconley. 2017-07-23 00:17:58 +02:00
Florian Quèze
7dddee4b69 Bug 1381853 - lazy load browser-gestureSupport.js into the browser window, r=mconley. 2017-07-23 00:17:58 +02:00
Florian Quèze
839c58b538 Bug 1381853 - lazy load browser-fullScreenAndPointerLock.js into the browser window, r=mconley. 2017-07-23 00:17:57 +02:00
Florian Quèze
9422b19f8d Bug 1381853 - lazy load browser-customization.js into the browser window, r=mconley. 2017-07-23 00:17:57 +02:00
Florian Quèze
8a99c9ce27 Bug 1381853 - lazy load browser-ctrlTab.js into the browser window, r=mconley. 2017-07-23 00:17:57 +02:00
Florian Quèze
71d8831567 Bug 1381853 - lazy load browser-addons.js into the browser window, r=mconley. 2017-07-23 00:17:57 +02:00
Florian Quèze
f2657d6151 Bug 1381853 - lazy load viewSourceUtils.js into the browser window, r=mconley. 2017-07-23 00:17:56 +02:00
Florian Quèze
5aa184f945 Bug 1381853 - lazy load panelUI.js into the browser window, r=mconley. 2017-07-23 00:17:56 +02:00
Florian Quèze
c41a960d40 Bug 1381853 - lazy load browserPlacesViews.js into the browser window, r=mconley. 2017-07-23 00:17:56 +02:00
Florian Quèze
10acf21200 Bug 1381853 - load viewZoomOverlay.js and browser-fullZoom.js into the browser window lazily, r=mconley. 2017-07-23 00:17:55 +02:00
Florian Quèze
359a6563f2 Bug 1381853 - load printUtils.js into the browser window lazily, r=mconley. 2017-07-23 00:17:55 +02:00
Edouard Oger
b3b3ff9cc5 Bug 1353571 part 3 - Refactor browser-syncui and browser-fxaccounts. r=markh
MozReview-Commit-ID: K790Ag8WZgv

--HG--
rename : browser/base/content/test/general/accounts_testRemoteCommands.html => browser/base/content/test/sync/accounts_testRemoteCommands.html
rename : browser/base/content/test/general/browser_fxa_web_channel.html => browser/base/content/test/sync/browser_fxa_web_channel.html
rename : browser/base/content/test/general/content_aboutAccounts.js => browser/base/content/test/sync/content_aboutAccounts.js
extra : rebase_source : dcba087df94d06b15c9f073ff2df3324fd646c57
2017-04-18 14:15:43 -04:00
Sebastian Hengst
18253e3fa2 Backed out changeset 0a0138825fb5 (bug 1353571)
--HG--
rename : browser/base/content/test/sync/accounts_testRemoteCommands.html => browser/base/content/test/general/accounts_testRemoteCommands.html
rename : browser/base/content/test/sync/browser_fxa_web_channel.html => browser/base/content/test/general/browser_fxa_web_channel.html
rename : browser/base/content/test/sync/content_aboutAccounts.js => browser/base/content/test/general/content_aboutAccounts.js
2017-05-03 21:56:44 +02:00
Edouard Oger
c11e66021d Bug 1353571 part 3 - Refactor browser-syncui and browser-fxaccounts. r=markh
MozReview-Commit-ID: K790Ag8WZgv

--HG--
rename : browser/base/content/test/general/accounts_testRemoteCommands.html => browser/base/content/test/sync/accounts_testRemoteCommands.html
rename : browser/base/content/test/general/browser_fxa_web_channel.html => browser/base/content/test/sync/browser_fxa_web_channel.html
rename : browser/base/content/test/general/content_aboutAccounts.js => browser/base/content/test/sync/content_aboutAccounts.js
extra : rebase_source : aa6cb209d312c6ef3f45589b0fd8fa8a39c612e3
2017-04-18 14:15:43 -04:00
Mark Banner
1087fc1884 Bug 1352969 - Fix various ESLint no-undef issues in browser/base (no-undef is not enabled yet). r=mossop
MozReview-Commit-ID: BuTyJAfUoWR

--HG--
extra : rebase_source : 482bdc039362347f35aec9fd15e07a143dccb860
2017-02-22 17:02:59 +00:00
Nihanth Subramanya
f2ba2936d1 Bug 1313568 - Handle captive portal UI in per-window script. r=MattN
MozReview-Commit-ID: FxjE2NblJe4

--HG--
rename : browser/modules/CaptivePortalWatcher.jsm => browser/base/content/browser-captivePortal.js
extra : rebase_source : c6c1321b591fdbd870ff40374477bbc05fbcb27c
2017-01-08 03:23:09 +01:00
Brian Grinstead
91605663d0 Bug 1314091 - Rename devedition.* to compacttheme.*;r=Gijs
MozReview-Commit-ID: 9y9BTK2TeAr

--HG--
rename : browser/base/content/browser-devedition.js => browser/base/content/browser-compacttheme.js
rename : browser/base/content/test/general/browser_devedition.js => browser/base/content/test/general/browser_compacttheme.js
rename : browser/themes/linux/devedition.css => browser/themes/linux/compacttheme.css
rename : browser/themes/osx/devedition.css => browser/themes/osx/compacttheme.css
rename : browser/themes/shared/devedition.inc.css => browser/themes/shared/compacttheme.inc.css
rename : browser/themes/windows/devedition.css => browser/themes/windows/compacttheme.css
2017-01-13 11:53:58 -08:00