Bug 967156 - Adding class 'black-boxed' to blackboxed source after reload. r=fitzgen

This commit is contained in:
Piyush Waradpande 2014-07-08 10:41:00 +02:00
Родитель 768f713b65
Коммит 896b61ae2b
3 изменённых файлов: 13 добавлений и 1 удалений

Просмотреть файл

@ -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();