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

174 Коммитов

Автор SHA1 Сообщение Дата
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
Alexandre Poirot a75ca7eaa0 Bug 1520773 - Prevent infinite loops in DebuggerClient.close. r=yulia
If any callback fired by DebuggerClient.close ends up calling close again, it will introduce an infinite loop.

Depends on D15826

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

--HG--
extra : moz-landing-system : lando
2019-01-21 11:04:08 +00:00
Alexandre Poirot 87bb1e2701 Bug 1513028 - Throw exception with stack and message when a module doesn't exists. r=jdescottes
loadSubScript throws a string, without any stack/location.
Consider all string exceptions as coming from loadSubScript and re-throw a real error
object, coming with the stack of the require call.
Also handle wrong require path with a more explicit error message.

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

--HG--
extra : moz-landing-system : lando
2018-12-18 13:35:42 +00:00
yulia 1cd5e24aeb Bug 1514197 - add clearEvents method to the event emitter and call from Front.destroy; r=jdescottes
details about what is going on here is in the bug thread

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

--HG--
extra : moz-landing-system : lando
2018-12-14 17:34:53 +00:00
Logan Smyth b03057f1e8 Bug 1513655 - Remove source-map module and usage from the debugger server. r=jlast
Differential Revision: https://phabricator.services.mozilla.com/D14296

--HG--
extra : moz-landing-system : lando
2018-12-14 19:49:08 +00:00
Cosmin Sabou f292d9f90e Backed out changeset 4d61e1b695c9 (bug 1513655) for ESlint failure on devtools/server/actors/thread.js. CLOSED TREE 2018-12-14 21:37:34 +02:00
Logan Smyth 432ea8fcdc Bug 1513655 - Remove source-map module and usage from the debugger server. r=jlast
Differential Revision: https://phabricator.services.mozilla.com/D14296

--HG--
extra : moz-landing-system : lando
2018-12-14 19:09:15 +00:00
Julian Descottes ff4d366afa Bug 1497457 - Allow to remove one time listeners on event-source;r=ochameau
Differential Revision: https://phabricator.services.mozilla.com/D11992

--HG--
extra : moz-landing-system : lando
2018-11-27 10:13:47 +00:00
Daniel Varga 2be7e87387 Backed out 7 changesets (bug 1497457) for devtools failure at devtools/client/aboutdebugging-new/test/browser/browser_aboutdebugging_sidebar_usb_runtime_refresh.js on a CLOSED TREE
Backed out changeset d3b46f3a0306 (bug 1497457)
Backed out changeset bd490139b395 (bug 1497457)
Backed out changeset b2830500918c (bug 1497457)
Backed out changeset 9923755ee205 (bug 1497457)
Backed out changeset f2a39a18f2f6 (bug 1497457)
Backed out changeset 95365a2d7470 (bug 1497457)
Backed out changeset 0e93acc09952 (bug 1497457)

--HG--
extra : amend_source : cc8af90091ef2da669704e6a56a893bd5c72e136
2018-11-27 00:59:34 +02:00
Julian Descottes 5998cb7718 Bug 1497457 - Allow to remove one time listeners on event-source;r=ochameau
Differential Revision: https://phabricator.services.mozilla.com/D11992

--HG--
extra : moz-landing-system : lando
2018-11-26 19:53:05 +00:00
Patrick Brosset bb2e382570 Bug 1114932 - Break after commas in CSS selectors r=tromey
Differential Revision: https://phabricator.services.mozilla.com/D9232

--HG--
extra : moz-landing-system : lando
2018-10-22 14:17:27 +00:00
Mark Banner ceaeb93550 Bug 1486741 - Enable ESLint rule comma-dangle for all of mozilla-central (automatic fixes). r=mossop
Differential Revision: https://phabricator.services.mozilla.com/D8389

--HG--
extra : moz-landing-system : lando
2018-10-19 12:55:39 +00:00
Julien Wajsberg 0e86c07238 Bug 1498331 - Supports the case where EventEmitter.off is called with more than 3 arguments r=jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D8445

--HG--
extra : moz-landing-system : lando
2018-10-12 08:39:32 +00:00
Alexandre Poirot 681faed609 Bug 1482070 - Move ConsoleAPIListener to its own file. r=Honza
Summary: Depends On D3598

Reviewers: Honza!

Tags: #secure-revision

Bug #: 1482070

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

MozReview-Commit-ID: k3KVzlmXOR


--HG--
rename : devtools/server/actors/webconsole/listeners.js => devtools/server/actors/webconsole/listeners/console-api.js
2018-08-20 09:06:21 -07:00
Boris Zbarsky 357b6b1348 Bug 1479570. Get Add a getter to get a docshell from nsIWindowlessBrowser. r=kmag
Differential Revision: https://phabricator.services.mozilla.com/D2669

--HG--
extra : moz-landing-system : lando
2018-08-03 00:05:07 +00:00
Julian Descottes 814b067b4a Bug 1078374 - Return empty string in getPath/Selector methods for nodes outside document;r=bgrins
MozReview-Commit-ID: 5hxtjz23vXh

--HG--
extra : rebase_source : be16034feeac2868938bc9a88ec30162f4d99433
2018-06-23 08:29:16 +02:00
Xidorn Quan 38a8db3cca Bug 1418874 part 3 - Remove CSSLexer and related stuff. r=emilio,tromey
MozReview-Commit-ID: 2DuHpc3HfmB

--HG--
extra : rebase_source : 9718a8fd7350e33c36fc2307caf49241050800c1
2018-06-14 18:12:02 -07:00
J. Ryan Stinnett eaa4969e77 Bug 1172897 - Rename TabActor to BrowsingContextTargetActor. r=ochameau
MozReview-Commit-ID: LPTEx2h4F1o

--HG--
rename : devtools/server/actors/tab.js => devtools/server/actors/targets/browsing-context.js
rename : devtools/shared/specs/tab.js => devtools/shared/specs/targets/browsing-context.js
extra : rebase_source : e62720693ad492cdfb68ab21af1f54d78e85123a
2018-05-25 18:20:28 -05:00
Xidorn Quan dd36c21b65 Bug 1465628 part 4 - Update test to check more stuff. r=tromey
This change adds a preferences check based on the change before.

It also removes the skipping of "all" because we generate subproperties
of "all" shorthand in a platform-neutral way. That list shouldn't be
affected by any preference.

MozReview-Commit-ID: LJyxGXJxvfW

--HG--
extra : rebase_source : f5bbff12a8d17bb242e6815936e2347364302050
2018-05-31 15:54:08 +10:00
Dorel Luca 6780acc0ad Backed out 4 changesets (bug 1465628) for Eslint failure. CLOSED TREE
Backed out changeset 04f276eb2f0e (bug 1465628)
Backed out changeset e9cdff122793 (bug 1465628)
Backed out changeset 6832baa28e3f (bug 1465628)
Backed out changeset e5ac0c7a9fb4 (bug 1465628)
2018-06-05 04:00:30 +03:00
Xidorn Quan 11844db553 Bug 1465628 part 4 - Update test to check more stuff. r=tromey
This change adds a preferences check based on the change before.

It also removes the skipping of "all" because we generate subproperties
of "all" shorthand in a platform-neutral way. That list shouldn't be
affected by any preference.

MozReview-Commit-ID: LJyxGXJxvfW

--HG--
extra : rebase_source : 4bf900109e9c8b4536211ace5e9cdf42fa45eb4b
2018-05-31 15:54:08 +10:00
Julian Descottes 7fdc2c153f Bug 1454696 - Fix leftover issues for prefer-const;r=yulia
MozReview-Commit-ID: JwOXoqw2mks

--HG--
extra : rebase_source : a3f07665a42c2779a85b7901a07206266a9d1616
extra : source : ae946f375e0d0f4f0f0fc859c54040fef42cbc2c
2018-06-01 12:19:35 +02:00
Julian Descottes 640fe52298 Bug 1454696 - Run eslint --fix for prefer-const;r=yulia
MozReview-Commit-ID: F6xUXCgdRE4

--HG--
extra : rebase_source : 65de1b0aba412d9044b5196115f74276caa058f2
2018-06-01 12:36:09 +02:00
Michael Ratcliffe 764c4c8578 Bug 1098374 - Telemetry: Stop all monkey patching in devtools telemetry tests r=yulia
Changes and notes:
  - Created `devtools/client/shared/test/telemetry-test-helpers.js`, which
    contains test helpers to aid in creating and running telemetry tests.
  - Removed any telemetry monkeypatching as it is not dependable and no longer
    needed (there is some left in GCLI but the test is now disabled because
    we are removing GCLI soon anyhow).
  - Because `telemetry-test-helpers.js` is imported by `shared-head.js` I
    have had to make it available everywhere that shared-head.js is used.
  - All telemetry tests have been rewritten to use the new helper.
  - shared-head.js cannot be imported by tests inside
    `devtools/client/performance/test/` because perf have custom `once` and
    `waitFor` implementations that act differently from the ones inside
    `shared-head.js`. This means I had to import the telemetry helpers into
    `devtools/client/performance/test/head.js`
  - Created `devtools/client/shared/test/browser_telemetry_misc.js` to be sure
    to catch `DEVTOOLS_SCREEN_RESOLUTION_ENUMERATED_PER_USER` (we catch a few
    others to be thorough).
  - Disabled `browser_inspector_menu-02-copy-items.js`, which was failing to
    test some expired scalars. I also corrected the way the scalars are logged
    because it was completely wrong.

MozReview-Commit-ID: JjQEGM6hT61

--HG--
extra : rebase_source : cd1214d01bd11908f69167839975cd93ecb83421
2018-05-01 18:06:14 +01:00
yulia 9da92b564a Bug 1382580 - Delete old event emitter; r=nchevobbe
MozReview-Commit-ID: 1g3ax7KP2vf

--HG--
extra : rebase_source : fbcdf4b6ea88c43c40447460238b5fb11f886cd8
2018-05-03 13:01:31 +02:00
Mark Banner f7f93b63da Bug 1456755 - Enable ESLint rule no-undef for devtools/{client/scratchpad/,shared/tests/unit}. r=jdescottes
MozReview-Commit-ID: 1GdQdf1y0gc

--HG--
extra : rebase_source : ce83f4ebc4dd66202651b061bcdaef7e9ca360ba
2018-04-24 21:46:01 +01:00
Kris Maglione 0f40271841 Bug 1453881: Part 1a - Automatically write add_task(function*) to add_task(async function) r=ochameau
This was done using the script at:

bc5629735d/processors/add-task-async.jsm?at=default&fileviewer=file-view-default

MozReview-Commit-ID: KxuS9Cen87

--HG--
extra : rebase_source : c0028e0cd55ba1643610cd30c55c6f4bca7d6e58
extra : histedit_source : ebc84fdec9c2db6176632d62de4e7bdad2a7829d
2018-04-12 21:10:04 -07:00
Alexandre Poirot 9b2fdcf8bb Bug 1453712 - Use a preference to set the testing flag. r=jryans
MozReview-Commit-ID: 1cjSQnXtc4h

--HG--
extra : rebase_source : 55c0c9fa81a8dc17b92cba721dcc5912b07d0fab
2018-04-12 09:22:42 -07:00
shindli 108a654fb8 Merge inbound to mozilla-central. a=merge 2018-04-12 02:45:34 +03:00
Trisha 54231b162c Bug 1444445 - Remove unsafeSetInnerHTML in browser_l10n_localizeMarkup.js. r=johannh
MozReview-Commit-ID: 1eaABunZe0B
2018-04-06 19:44:57 +08:00
Johann Hofmann e42b3061b5 Bug 1453279 - Include client/shared/test/shared-head.js in devtools/shared tests. r=jdescottes
MozReview-Commit-ID: LrVCfDb3xwh

--HG--
extra : rebase_source : fdea08db592b44f50a39565ada91ec727168e091
2018-04-11 12:58:44 +02:00
J. Ryan Stinnett 23ff4cc75d Bug 1443081 - Apply spacing via `eslint --fix` for DevTools. r=jdescottes
MozReview-Commit-ID: 2RVNt140Zte
2018-03-12 13:44:41 -05:00
Florian Quèze 8922be9c58 Bug 1433175 - enable the use-cc-etc eslint rule, r=Standard8. 2018-02-28 18:51:35 +01:00
Alexandre Poirot ae019f78bc Bug 1440320 - Convert Task.jsm to async/await in devtools/shared. r=jryans
MozReview-Commit-ID: IK8BzlYuOWm

--HG--
extra : rebase_source : f2ac7eee538490a3db18e7290f144037592b3f89
2018-02-22 00:49:06 -08:00
Alexandre Poirot 2d43f710c5 Bug 1440320 - Removed unused methods from async-utils module. r=jryans
MozReview-Commit-ID: 3ixJhRWeRpd

--HG--
extra : rebase_source : 55a274b88d94d6574ab71268ca054ad93561ef7e
2018-02-19 02:29:12 -08:00
Mark Banner 21e6e270a4 Bug 1438489 - Enable ESLint rule mozilla/use-services for devtools/. r=jdescottes
MozReview-Commit-ID: FZscEA6Q3Kb

--HG--
extra : rebase_source : b1b8699288a3595e52bcff3c7684bfe095f41dd1
2018-02-15 12:00:17 +00:00
Alexandre Poirot e563788ea7 Bug 1434374 - Auto-rewrite Cu.import into ChromeUtils.import or require calls. r=jdescottes
MozReview-Commit-ID: 7YyLu5q23Hs

--HG--
extra : rebase_source : bb2805652c85d74a3e888326f4afa4b6857afa64
2018-02-07 01:37:36 -08:00
Andrew McCreight 5dec0e0beb Bug 1432992, part 1 - Remove definitions of Ci, Cr, Cc, and Cu. r=florian
This patch was autogenerated by my decomponents.py

It covers almost every file with the extension js, jsm, html, py,
xhtml, or xul.

It removes blank lines after removed lines, when the removed lines are
preceded by either blank lines or the start of a new block. The "start
of a new block" is defined fairly hackily: either the line starts with
//, ends with */, ends with {, <![CDATA[, """ or '''. The first two
cover comments, the third one covers JS, the fourth covers JS embedded
in XUL, and the final two cover JS embedded in Python. This also
applies if the removed line was the first line of the file.

It covers the pattern matching cases like "var {classes: Cc,
interfaces: Ci, utils: Cu, results: Cr} = Components;". It'll remove
the entire thing if they are all either Ci, Cr, Cc or Cu, or it will
remove the appropriate ones and leave the residue behind. If there's
only one behind, then it will turn it into a normal, non-pattern
matching variable definition. (For instance, "const { classes: Cc,
Constructor: CC, interfaces: Ci, utils: Cu } = Components" becomes
"const CC = Components.Constructor".)

MozReview-Commit-ID: DeSHcClQ7cG

--HG--
extra : rebase_source : d9c41878036c1ef7766ef5e91a7005025bc1d72b
2018-02-06 09:36:57 -08:00
Florian Quèze 2b1c8dccb6 Bug 1339461 - script-generated patch to convert foo.indexOf(...) == -1 to foo.includes(), r=Mossop. 2018-02-01 20:45:22 +01:00
Kris Maglione b3cac601f6 Bug 1432966: Sanitize HTML fragments created for chrome-privileged documents. r=bz f=gijs
This is a short-term solution to our inability to apply CSP to
chrome-privileged documents.

Ideally, we should be preventing all inline script execution in
chrome-privileged documents, since the reprecussions of XSS in chrome
documents are much worse than in content documents. Unfortunately, that's not
possible in the near term because a) we don't support CSP in system principal
documents at all, and b) we rely heavily on inline JS in our static XUL.

This stop-gap solution at least prevents some of the most common vectors of
XSS attack, by automatically sanitizing any HTML fragment created for a
chrome-privileged document.

MozReview-Commit-ID: 5w17celRFr

--HG--
extra : rebase_source : 1c0a1448a06d5b65e548d9f5362d06cc6d865dbe
extra : amend_source : 7184593019f238b86fd1e261941d8e8286fa4006
2018-01-24 14:56:48 -08:00
Cameron McCormack 3f17a89ba7 Bug 1427419 - Part 23: Move inIDOMUtils.getCSSPseudoElementNames to InspectorUtils. r=bz
MozReview-Commit-ID: A6FhXc2mJm1
2018-01-11 12:38:01 +08:00
Cameron McCormack fc4a76fb7f Bug 1427419 - Part 5: Move nsIDOMUtils.getCSSLexer to InspectorUtils. r=bz
MozReview-Commit-ID: 4UGiS3I2V6B
2018-01-11 12:37:59 +08:00
Florian Quèze 0f55cd45be Bug 1421992 - script-generated patch to replace do_execute_soon, do_print and do_register_cleanup with executeSoon, info and registerCleanupFunction, rs=Gijs. 2017-12-21 11:10:23 +01:00
Florian Quèze 032c961e0a Bug 1421992 - script-generated patch to replace do_check_* functions with their Assert.* equivalents, rs=Gijs. 2017-12-21 11:08:17 +01:00
Patrick Brosset 2036033118 Bug 1419301 - Make HTML comments removal in prettifyCSS faster; r=tromey
MozReview-Commit-ID: LG8GKccRlXr

--HG--
extra : rebase_source : 86eb5612f8264bbe4f765ab5baaea4db8c7a84a3
2017-12-01 16:58:48 +01:00
Julian Descottes 3ec0b0ad0d Bug 1406311 - add unit test to cover sprintfjs;r=bgrins
We would like to optimize sprintfjs for performances.
To avoid regressions, add a basic unit test taken from the original
sprintfjs repository.

MozReview-Commit-ID: IKkDHpYfL4I

--HG--
extra : rebase_source : 39837c4c6039e77c189ce9db2e12d4b7b26171c7
extra : intermediate-source : 10683284fa0d1d7cbe4c10628b7ab90eb034c8de
extra : source : d7028aeaf4fbf8cd06285746269799a7a9cc7af5
2017-10-12 13:08:08 +02:00
Alexandre Poirot 76914dd9bc Bug 1399589 - Register all spec and front modules lazily in specs/index.js. r=jdescottes
MozReview-Commit-ID: 3U2D0PWivm2

--HG--
extra : rebase_source : bb087a66c0d946f684dbfa00e7dc96725d4eee30
2017-10-03 17:56:35 +02:00
Tom Tromey 762c2f58dd Bug 1403610 - update to source-map 0.6.1; r=bgrins
Import the source-map 0.6.1 bundle.

MozReview-Commit-ID: AkVLlBJRD1l

--HG--
extra : rebase_source : 882b2ef4b2c3b2eac8733f408a4ce7a6aaa403d2
2017-09-27 09:39:44 -06:00
Julian Descottes 86f9684361 Bug 1137935 - add support for wildcard event type in devtools event emitter;r=ochameau
This API is only implemented as a temporary measure to ease the migration out of
sdk APIs.

MozReview-Commit-ID: BBlhxclpWqJ

--HG--
extra : rebase_source : 4de2e6ec946634acaf638777aab2589eeb5125a2
2017-08-17 16:42:50 +02:00
ZER0 7dca53648e Bug 1381542 - refactored EventEmitter with old SDK event/core capabilities; r=ochameau
`EventEmitter` now can be used in the same way `sdk/event/core`, it also
integrates some of the SDK capabilities.
In addition the `emit` method is now unified in functionality, and is more
consistent with the nodejs counterpart (the listener doesn't receive the event
type anymore as first argument).

MozReview-Commit-ID: DNxnjwmcC4W
2017-08-11 22:21:28 +02:00