Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Issue 5654: Style side panel doesn't display CSS rules after reload

  • Loading branch information...
commit 67cd674bb61be631d9b9dbf59468fdf8f8d0975f 1 parent b9f692e
@janodvarko janodvarko authored
View
14 extension/content/firebug/css/cssModule.js
@@ -192,7 +192,7 @@ Firebug.CSSModule = Obj.extend(Obj.extend(Firebug.Module, Firebug.EditorSelector
cleanupSheets: function(doc, context)
{
if (!context)
- return;
+ return false;
// Due to the manner in which the layout engine handles multiple
// references to the same sheet we need to kick it a little bit.
@@ -220,6 +220,8 @@ Firebug.CSSModule = Obj.extend(Obj.extend(Firebug.Module, Firebug.EditorSelector
}
}*/
+ var result = true;
+
// https://bugzilla.mozilla.org/show_bug.cgi?id=500365
// This voodoo touches each style sheet to force some Firefox internal change
// to allow edits.
@@ -238,11 +240,17 @@ Firebug.CSSModule = Obj.extend(Obj.extend(Firebug.Module, Firebug.EditorSelector
}
catch(e)
{
+ result = false;
+
if (FBTrace.DBG_ERRORS)
- FBTrace.sysout("css.show: sheet.cssRules FAILS for "+
- (styleSheets[i]?styleSheets[i].href:"null sheet")+e, e);
+ FBTrace.sysout("css.show: sheet.cssRules FAILS for " +
+ (styleSheets[i] ? styleSheets[i].href : "null sheet") + e, e);
}
}
+
+ // Return true only if all stylesheets are fully loaded and there is no
+ // excpetion when accessing them.
+ return result;
},
cleanupSheetHandler: function(event, context)
View
12 extension/content/firebug/css/stylePanel.js
@@ -510,8 +510,18 @@ CSSStylePanel.prototype = Obj.extend(CSSStyleSheetPanel.prototype,
updateView: function(element)
{
- CSSModule.cleanupSheets(element.ownerDocument, Firebug.currentContext);
+ var result = CSSModule.cleanupSheets(element.ownerDocument, Firebug.currentContext);
+ // If cleanupSheets returns false there was an exception thrown when accessing
+ // a styleshet (probably since it isn't fully loaded yet). So, delay the panel
+ // update and try it again a bit later (issue 5654).
+ if (!result)
+ {
+ this.context.setTimeout(Obj.bindFixed(this.updateView, this, element), 200);
+ return;
+ }
+
+ // All stylesheets should be ready now, update the view.
this.updateCascadeView(element);
if (Dom.domUtils)
Please sign in to comment.
Something went wrong with that request. Please try again.