[Pkg-mozext-commits] [firebug] 20/28: Issue 5654: Style side panel doesn't display CSS rules after reload

David Prévot taffit at moszumanska.debian.org
Mon Mar 31 22:46:25 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to tag firebug-1.10.3
in repository firebug.

commit 7ad441fb4ab64bd9b2afda09f8dc2bcad6672cb9
Author: Jan Odvarko <odvarko at gmail.com>
Date:   Wed Aug 22 10:31:13 2012 +0200

    Issue 5654: 	Style side panel doesn't display CSS rules after reload
---
 extension/content/firebug/css/cssModule.js  | 14 +++++++++++---
 extension/content/firebug/css/stylePanel.js | 12 +++++++++++-
 2 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/extension/content/firebug/css/cssModule.js b/extension/content/firebug/css/cssModule.js
index 7e7dca5..ee157b5 100644
--- a/extension/content/firebug/css/cssModule.js
+++ b/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)
diff --git a/extension/content/firebug/css/stylePanel.js b/extension/content/firebug/css/stylePanel.js
index 8cf722a..f0c19f5 100644
--- a/extension/content/firebug/css/stylePanel.js
+++ b/extension/content/firebug/css/stylePanel.js
@@ -511,8 +511,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)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/firebug.git



More information about the Pkg-mozext-commits mailing list