зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1586201 - Include ContentDomReference in Node grips. r=pbro.
This will allow us to retrieve the appropriate inspector (and thus walker, highlighter, ...) for a given element later, potentially from a different DebuggerServer. Differential Revision: https://phabricator.services.mozilla.com/D48807 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
d71aa730aa
Коммит
ac6ad6abfb
|
@ -34,6 +34,16 @@ loader.lazyRequireGetter(
|
|||
"devtools/server/actors/object/stringifiers"
|
||||
);
|
||||
|
||||
// ContentDOMReference requires ChromeUtils, which isn't available in worker context.
|
||||
if (!isWorker) {
|
||||
loader.lazyRequireGetter(
|
||||
this,
|
||||
"ContentDOMReference",
|
||||
"resource://gre/modules/ContentDOMReference.jsm",
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
const {
|
||||
getArrayLength,
|
||||
getPromiseState,
|
||||
|
@ -249,6 +259,17 @@ const proto = {
|
|||
this._populateGripPreview(g, raw);
|
||||
this.hooks.decrementGripDepth();
|
||||
|
||||
if (raw && Node.isInstance(raw) && ContentDOMReference) {
|
||||
// ContentDOMReference.get takes a DOM element and returns an object with
|
||||
// its browsing context id, as well as a unique identifier. We are putting it in
|
||||
// the grip here in order to be able to retrieve the node later, potentially from a
|
||||
// different DebuggerServer running in the same process.
|
||||
// If ContentDOMReference.get throws, we simply don't add the property to the grip.
|
||||
try {
|
||||
g.contentDomReference = ContentDOMReference.get(raw);
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
return g;
|
||||
},
|
||||
|
||||
|
|
|
@ -164,5 +164,6 @@ fail-if = fission
|
|||
[browser_webextension_inspected_window.js]
|
||||
[browser_dbg_promises-allocation-stack.js]
|
||||
[browser_dbg_promises-chrome-allocation-stack.js]
|
||||
skip-if = true # Bug 1589571
|
||||
[browser_dbg_promises-fulfillment-stack.js]
|
||||
[browser_dbg_promises-rejection-stack.js]
|
||||
|
|
Загрузка…
Ссылка в новой задаче