Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Issue 3230 (Pseudo-classes are not persistently shown in Style Side

  • Loading branch information...
commit c4dd557e187c9447470781078c62392e8cb4f72b 1 parent ab6f202
@SebastianZ SebastianZ authored
View
45 extension/content/firebug/css/stylePanel.js
@@ -554,33 +554,28 @@ CSSStylePanel.prototype = Obj.extend(CSSStyleSheetPanel.prototype,
if (Dom.domUtils && this.selection)
{
- var state = safeGetContentState(this.selection);
var self = this;
- ret.push("-");
-
ret.push(
+ "-",
{
- label: "style.option.label.active",
+ label: "style.option.label.hover",
type: "checkbox",
- checked: state & STATE_ACTIVE,
- tooltiptext: "style.option.tip.active",
+ checked: self.hasPseudoClassLock(":hover"),
+ tooltiptext: "style.option.tip.hover",
command: function()
{
- self.updateContentState(STATE_ACTIVE, !this.getAttribute("checked"));
+ self.togglePseudoClassLock(":hover");
}
- }
- );
-
- ret.push(
+ },
{
- label: "style.option.label.hover",
+ label: "style.option.label.active",
type: "checkbox",
- checked: state & STATE_HOVER,
- tooltiptext: "style.option.tip.hover",
+ checked: self.hasPseudoClassLock(":active"),
+ tooltiptext: "style.option.tip.active",
command: function()
{
- self.updateContentState(STATE_HOVER, !this.getAttribute("checked"));
+ self.togglePseudoClassLock(":active");
}
}
);
@@ -646,17 +641,29 @@ CSSStylePanel.prototype = Obj.extend(CSSStyleSheetPanel.prototype,
return CSSStyleSheetPanel.prototype.showInfoTip.call(this, infoTip, target, x, y, rangeParent, rangeOffset);
},
- updateContentState: function(state, remove)
+ hasPseudoClassLock: function(pseudoClass)
+ {
+ return Dom.domUtils.hasPseudoClassLock(this.selection, pseudoClass);
+ },
+
+ togglePseudoClassLock: function(pseudoClass)
{
if (FBTrace.DBG_CSS)
- FBTrace.sysout("css.updateContentState; state: " + state + ", remove: " + remove);
+ FBTrace.sysout("css.togglePseudoClassLock; pseudo-class: " + pseudoClass);
- Dom.domUtils.setContentState(remove ? this.selection.ownerDocument.documentElement :
- this.selection, state);
+ if (Dom.domUtils.hasPseudoClassLock(this.selection, pseudoClass))
+ Dom.domUtils.removePseudoClassLock(this.selection, pseudoClass);
+ else
+ Dom.domUtils.addPseudoClassLock(this.selection, pseudoClass);
this.refresh();
},
+ clearPseudoClassLocks: function()
+ {
+ Dom.domUtils.clearPseudoClassLocks(this.selection);
+ },
+
addStateChangeHandlers: function(el)
{
this.removeStateChangeHandlers();
View
4 extension/locale/en-US/firebug.properties
@@ -480,14 +480,14 @@ style.option.tip.Only_Show_Applied_Styles=Just show styles applied to the elemen
Show_User_Agent_CSS=Show User Agent CSS
style.option.tip.Show_User_Agent_CSS=Also show the CSS defined by the user agent
-# LOCALIZATION NOTE (style.option.tip.active):
+# LOCALIZATION NOTE (style.option.label.active, style.option.tip.active):
# Style side panel option tooltip (located in tab's option menu). If the option is set to true,
# the Style side panel will simulate the element being activated and therefore display
# :active pseudo-class styles
style.option.label.active=:active
style.option.tip.active=Display :active pseudo-class styles
-# LOCALIZATION NOTE (style.option.tip.hover):
+# LOCALIZATION NOTE (style.option.label.hover, style.option.tip.hover):
# Style side panel option tooltip (located in tab's option menu). If the option is set to true,
# the Style side panel will simulate the element being hovered and therefore display
# :hover pseudo-class styles
Please sign in to comment.
Something went wrong with that request. Please try again.