Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Issue 5859 (Delete "element.style" is broken)

  • Loading branch information...
commit d82a7643780e691c26a2c3a15b828353364e54f9 1 parent 555d229
@SebastianZ SebastianZ authored
View
22 extension/content/firebug/css/cssModule.js
@@ -87,15 +87,27 @@ Firebug.CSSModule = Obj.extend(Obj.extend(Firebug.Module, Firebug.EditorSelector
return insertIndex;
},
- deleteRule: function(styleSheet, ruleIndex)
+ deleteRule: function(src, ruleIndex)
{
if (FBTrace.DBG_CSS)
- FBTrace.sysout("deleteRule: " + ruleIndex + " " + styleSheet.cssRules.length,
- styleSheet.cssRules);
+ {
+ if (src instanceof window.Element)
@simonlindholm Owner

Negate the logic here.

@SebastianZ Owner

Fixed that in ad1cfbc.

Sebastian

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ {
+ FBTrace.sysout("deleteRule: " + ruleIndex + " " + src.cssRules.length,
+ styleSheet.cssRules);
+ }
+ else
+ {
+ FBTrace.sysout("deleteRule: element.style", src);
+ }
+ }
- Events.dispatch(this.fbListeners, "onCSSDeleteRule", [styleSheet, ruleIndex]);
+ Events.dispatch(this.fbListeners, "onCSSDeleteRule", [src, ruleIndex]);
- styleSheet.deleteRule(ruleIndex);
+ if (src instanceof window.Element)
+ src.removeAttribute("style");
+ else
+ src.deleteRule(ruleIndex);
},
setProperty: function(rule, propName, propValue, propPriority)
View
14 extension/content/firebug/css/cssPanel.js
@@ -1582,17 +1582,9 @@ Firebug.CSSStyleSheetPanel.prototype = Obj.extend(Firebug.Panel,
CSSModule.deleteRule(styleSheet, ruleIndex);
- if (this.context.panelName == "stylesheet")
- {
- var rule = Dom.getAncestorByClass(cssSelector, "cssRule");
- if (rule)
- rule.parentNode.removeChild(rule);
- }
- else
- {
- var sidePanel = Firebug.chrome.getSelectedSidePanel();
- sidePanel.refresh();
- }
+ var rule = Dom.getAncestorByClass(cssSelector, "cssRule");
+ if (rule)
+ rule.parentNode.removeChild(rule);
},
copyStyleDeclaration: function(cssSelector)
View
17 extension/content/firebug/css/stylePanel.js
@@ -682,6 +682,23 @@ CSSStylePanel.prototype = Obj.extend(CSSStyleSheetPanel.prototype,
return CSSStyleSheetPanel.prototype.showInfoTip.call(this, infoTip, target, x, y, rangeParent, rangeOffset);
},
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+ // Extends stylesheet (CSS Panel)
+
+ deleteRuleDeclaration: function(cssSelector)
+ {
+ var repObject = Firebug.getRepObject(cssSelector);
+
+ if (repObject instanceof window.Element)
+ CSSModule.deleteRule(repObject);
+ else
+ CSSStyleSheetPanel.prototype.deleteRuleDeclaration(cssSelector);
+
+ this.refresh();
+ },
+
+ // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
hasPseudoClassLock: function(pseudoClass)
{
if (Dom.domUtils.hasPseudoClassLock)
Please sign in to comment.
Something went wrong with that request. Please try again.