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 0e4b1351fb3668bcc442bd37c5981f6b439e28fd 1 parent 9ea45e4
@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)
+ {
+ 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
@@ -1578,17 +1578,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
@@ -683,6 +683,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.