Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Issue 5849: HTML panel visibility updates should affect children

  • Loading branch information...
commit ca693d45350769df770903a86878c0d54474c34c 1 parent c35f687
Simon Lindholm simonlindholm authored
29 extension/content/firebug/html/htmlPanel.js
View
@@ -346,6 +346,30 @@ Firebug.HTMLPanel.prototype = Obj.extend(WalkingPanel,
null : ["link", "script", "style"]);
},
+ updateNodeVisibility: function(node)
+ {
+ var wasHidden = node.classList.contains("nodeHidden");
+ if (!Xml.isVisible(node.repObject))
+ {
+ // Hide this node and, through CSS, every descendant.
+ node.classList.add("nodeHidden");
+ }
+ else if (wasHidden)
+ {
+ // The node has changed state from hidden to shown. While in the
+ // hidden state, some descendants may have been explicitly marked
+ // with .nodeHidden (not just through CSS inheritance), so we need
+ // to recheck the visibility of those.
+ node.classList.remove("nodeHidden");
+ var desc = Arr.cloneArray(node.getElementsByClassName("nodeHidden"));
+ for (var i = 0; i < desc.length; ++i)
+ {
+ if (Xml.isVisible(desc[i].repObject))
+ desc[i].classList.remove("nodeHidden");
+ }
+ }
+ },
+
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
getElementSourceText: function(node)
@@ -479,10 +503,7 @@ Firebug.HTMLPanel.prototype = Obj.extend(WalkingPanel,
if (!objectNodeBox)
return;
- if (Xml.isVisible(objectNodeBox.repObject))
- Css.removeClass(objectNodeBox, "nodeHidden");
- else
- Css.setClass(objectNodeBox, "nodeHidden");
+ this.updateNodeVisibility(objectNodeBox);
if (attrChange == MODIFICATION || attrChange == ADDITION)
{
6 extension/content/firebug/lib/array.js
View
@@ -91,13 +91,13 @@ Arr.sliceArray = function(array, index)
Arr.cloneArray = function(array, fn)
{
- var newArray = [];
+ var newArray = [], len = array.length;
if (fn)
- for (var i = 0; i < array.length; ++i)
+ for (var i = 0; i < len; ++i)
newArray.push(fn(array[i]));
else
- for (var i = 0; i < array.length; ++i)
+ for (var i = 0; i < len; ++i)
newArray.push(array[i]);
return newArray;
Please sign in to comment.
Something went wrong with that request. Please try again.