зеркало из https://github.com/mozilla/gecko-dev.git
Bug 967156 - Adding class 'black-boxed' to blackboxed source after reload. r=fitzgen
This commit is contained in:
Родитель
768f713b65
Коммит
896b61ae2b
|
@ -147,7 +147,7 @@ SourcesView.prototype = Heritage.extend(WidgetMethods, {
|
|||
contents.setAttribute("tooltiptext", unicodeUrl);
|
||||
|
||||
// Append a source item to this container.
|
||||
this.push([contents, fullUrl], {
|
||||
const item = this.push([contents, fullUrl], {
|
||||
staged: aOptions.staged, /* stage the item to be appended later? */
|
||||
attachment: {
|
||||
label: label,
|
||||
|
@ -157,6 +157,11 @@ SourcesView.prototype = Heritage.extend(WidgetMethods, {
|
|||
source: aSource
|
||||
}
|
||||
});
|
||||
|
||||
// If source is blackboxed, apply appropriate style
|
||||
if (gThreadClient.source(aSource).isBlackBoxed) {
|
||||
item.target.classList.add("black-boxed");
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
@ -39,7 +39,10 @@ function testBlackBoxSource() {
|
|||
function testBlackBoxReload() {
|
||||
return reloadActiveTab(gPanel, gDebugger.EVENTS.SOURCE_SHOWN).then(() => {
|
||||
const bbButton = getBlackBoxButton(gPanel);
|
||||
const selectedSource = getSelectedSourceElement(gPanel);
|
||||
ok(bbButton.checked, "Should still be black boxed.");
|
||||
ok(selectedSource.classList.contains("black-boxed"),
|
||||
"'black-boxed' class should still be applied");
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -752,6 +752,10 @@ function getBlackBoxButton(aPanel) {
|
|||
return aPanel.panelWin.document.getElementById("black-box");
|
||||
}
|
||||
|
||||
function getSelectedSourceElement(aPanel) {
|
||||
return gPanel.panelWin.DebuggerView.Sources.selectedItem.target;
|
||||
}
|
||||
|
||||
function toggleBlackBoxing(aPanel, aSource = null) {
|
||||
function clickBlackBoxButton() {
|
||||
getBlackBoxButton(aPanel).click();
|
||||
|
|
Загрузка…
Ссылка в новой задаче