Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

  • Loading branch information...
commit c4dd557e187c9447470781078c62392e8cb4f72b 1 parent ab6f202
Sebastian Zartner authored May 24, 2012
45  extension/content/firebug/css/stylePanel.js
@@ -554,33 +554,28 @@ CSSStylePanel.prototype = Obj.extend(CSSStyleSheetPanel.prototype,
554 554
 
555 555
         if (Dom.domUtils && this.selection)
556 556
         {
557  
-            var state = safeGetContentState(this.selection);
558 557
             var self = this;
559 558
 
560  
-            ret.push("-");
561  
-
562 559
             ret.push(
  560
+                "-",
563 561
                 {
564  
-                    label: "style.option.label.active",
  562
+                    label: "style.option.label.hover",
565 563
                     type: "checkbox",
566  
-                    checked: state & STATE_ACTIVE,
567  
-                    tooltiptext: "style.option.tip.active",
  564
+                    checked: self.hasPseudoClassLock(":hover"),
  565
+                    tooltiptext: "style.option.tip.hover",
568 566
                     command: function()
569 567
                     {
570  
-                        self.updateContentState(STATE_ACTIVE, !this.getAttribute("checked"));
  568
+                        self.togglePseudoClassLock(":hover");
571 569
                     }
572  
-                }
573  
-            );
574  
-
575  
-            ret.push(
  570
+                },
576 571
                 {
577  
-                    label: "style.option.label.hover",
  572
+                    label: "style.option.label.active",
578 573
                     type: "checkbox",
579  
-                    checked: state & STATE_HOVER,
580  
-                    tooltiptext: "style.option.tip.hover",
  574
+                    checked: self.hasPseudoClassLock(":active"),
  575
+                    tooltiptext: "style.option.tip.active",
581 576
                     command: function()
582 577
                     {
583  
-                        self.updateContentState(STATE_HOVER, !this.getAttribute("checked"));
  578
+                        self.togglePseudoClassLock(":active");
584 579
                     }
585 580
                 }
586 581
             );
@@ -646,17 +641,29 @@ CSSStylePanel.prototype = Obj.extend(CSSStyleSheetPanel.prototype,
646 641
         return CSSStyleSheetPanel.prototype.showInfoTip.call(this, infoTip, target, x, y, rangeParent, rangeOffset);
647 642
     },
648 643
 
649  
-    updateContentState: function(state, remove)
  644
+    hasPseudoClassLock: function(pseudoClass)
  645
+    {
  646
+        return Dom.domUtils.hasPseudoClassLock(this.selection, pseudoClass);
  647
+    },
  648
+
  649
+    togglePseudoClassLock: function(pseudoClass)
650 650
     {
651 651
         if (FBTrace.DBG_CSS)
652  
-            FBTrace.sysout("css.updateContentState; state: " + state + ", remove: " + remove);
  652
+            FBTrace.sysout("css.togglePseudoClassLock; pseudo-class: " + pseudoClass);
653 653
 
654  
-        Dom.domUtils.setContentState(remove ? this.selection.ownerDocument.documentElement :
655  
-            this.selection, state);
  654
+        if (Dom.domUtils.hasPseudoClassLock(this.selection, pseudoClass))
  655
+            Dom.domUtils.removePseudoClassLock(this.selection, pseudoClass);
  656
+        else
  657
+            Dom.domUtils.addPseudoClassLock(this.selection, pseudoClass);
656 658
 
657 659
         this.refresh();
658 660
     },
659 661
 
  662
+    clearPseudoClassLocks: function()
  663
+    {
  664
+        Dom.domUtils.clearPseudoClassLocks(this.selection);
  665
+    },
  666
+
660 667
     addStateChangeHandlers: function(el)
661 668
     {
662 669
         this.removeStateChangeHandlers();
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
480 480
 Show_User_Agent_CSS=Show User Agent CSS
481 481
 style.option.tip.Show_User_Agent_CSS=Also show the CSS defined by the user agent
482 482
 
483  
-# LOCALIZATION NOTE (style.option.tip.active):
  483
+# LOCALIZATION NOTE (style.option.label.active, style.option.tip.active):
484 484
 # Style side panel option tooltip (located in tab's option menu). If the option is set to true,
485 485
 # the Style side panel will simulate the element being activated and therefore display
486 486
 # :active pseudo-class styles
487 487
 style.option.label.active=:active
488 488
 style.option.tip.active=Display :active pseudo-class styles
489 489
 
490  
-# LOCALIZATION NOTE (style.option.tip.hover):
  490
+# LOCALIZATION NOTE (style.option.label.hover, style.option.tip.hover):
491 491
 # Style side panel option tooltip (located in tab's option menu). If the option is set to true,
492 492
 # the Style side panel will simulate the element being hovered and therefore display
493 493
 # :hover pseudo-class styles

0 notes on commit c4dd557

Please sign in to comment.
Something went wrong with that request. Please try again.