зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1544170 Part 3 - Inspector changes to fetch style sheets from replaying process, r=pbro.
Differential Revision: https://phabricator.services.mozilla.com/D27410 --HG-- extra : rebase_source : a70fc90d042f7b9d0fdec65aadff911c90f8edf7
This commit is contained in:
Родитель
a151fd40c6
Коммит
ee403cec34
|
@ -19,6 +19,10 @@ loader.lazyRequireGetter(this, "addPseudoClassLock",
|
||||||
loader.lazyRequireGetter(this, "removePseudoClassLock",
|
loader.lazyRequireGetter(this, "removePseudoClassLock",
|
||||||
"devtools/server/actors/highlighters/utils/markup", true);
|
"devtools/server/actors/highlighters/utils/markup", true);
|
||||||
loader.lazyRequireGetter(this, "loadSheet", "devtools/shared/layout/utils", true);
|
loader.lazyRequireGetter(this, "loadSheet", "devtools/shared/layout/utils", true);
|
||||||
|
loader.lazyRequireGetter(this, "ReplayDebugger",
|
||||||
|
"devtools/server/actors/replay/debugger");
|
||||||
|
loader.lazyRequireGetter(this, "ReplayInspector",
|
||||||
|
"devtools/server/actors/replay/inspector");
|
||||||
|
|
||||||
var TRANSITION_PSEUDO_CLASS = ":-moz-styleeditor-transitioning";
|
var TRANSITION_PSEUDO_CLASS = ":-moz-styleeditor-transitioning";
|
||||||
var TRANSITION_DURATION_MS = 500;
|
var TRANSITION_DURATION_MS = 500;
|
||||||
|
@ -178,6 +182,13 @@ async function fetchStylesheet(sheet, consoleActor) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// When replaying, fetch the stylesheets from the replaying process, so that
|
||||||
|
// we get the same sheets which were used when recording.
|
||||||
|
if (isReplaying) {
|
||||||
|
const dbg = new ReplayDebugger();
|
||||||
|
return dbg.replayingContent(href);
|
||||||
|
}
|
||||||
|
|
||||||
const options = {
|
const options = {
|
||||||
loadFromCache: true,
|
loadFromCache: true,
|
||||||
policy: Ci.nsIContentPolicy.TYPE_INTERNAL_STYLESHEET,
|
policy: Ci.nsIContentPolicy.TYPE_INTERNAL_STYLESHEET,
|
||||||
|
@ -227,7 +238,7 @@ var StyleSheetActor = protocol.ActorClassWithSpec(styleSheetSpec, {
|
||||||
* Window of target
|
* Window of target
|
||||||
*/
|
*/
|
||||||
get window() {
|
get window() {
|
||||||
return this.parentActor.window;
|
return isReplaying ? ReplayInspector.window : this.parentActor.window;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -669,7 +680,8 @@ var StyleSheetsActor = protocol.ActorClassWithSpec(styleSheetsSpec, {
|
||||||
async getStyleSheets() {
|
async getStyleSheets() {
|
||||||
let actors = [];
|
let actors = [];
|
||||||
|
|
||||||
for (const win of this.parentActor.windows) {
|
const windows = isReplaying ? [ReplayInspector.window] : this.parentActor.windows;
|
||||||
|
for (const win of windows) {
|
||||||
const sheets = await this._addStyleSheets(win);
|
const sheets = await this._addStyleSheets(win);
|
||||||
actors = actors.concat(sheets);
|
actors = actors.concat(sheets);
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче