[Pkg-mozext-commits] [itsalltext] 220/459: Fixed the cascading hidden and visibility style problem. Added matching test cases.

David Prévot taffit at moszumanska.debian.org
Tue Feb 24 23:26:23 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository itsalltext.

commit e26b8bf94c747a5fc85408e2f2b7f73cf71415f6
Author: Christian Höltje <docwhat at gerf.org>
Date:   Sun Jun 3 21:47:57 2007 -0400

    Fixed the cascading hidden and visibility style problem. Added matching test cases.
---
 src/chrome/content/cacheobj.js | 6 +++++-
 tests/hidden.html              | 1 +
 tests/style.css                | 2 +-
 3 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/chrome/content/cacheobj.js b/src/chrome/content/cacheobj.js
index 89b0ad3..c2f4923 100644
--- a/src/chrome/content/cacheobj.js
+++ b/src/chrome/content/cacheobj.js
@@ -496,6 +496,8 @@ CacheObj.prototype.addGumDrop = function() {
 CacheObj.prototype.adjust = function() {
     var gumdrop  = this.button;
     var el       = this.node;
+    var doc      = el.ownerDocument;
+
     if (ItsAllText.getDisableGumdrops()) {
         if(gumdrop && gumdrop.style.display != 'none') {
             gumdrop.style.display = 'none';
@@ -506,7 +508,9 @@ CacheObj.prototype.adjust = function() {
     var style    = gumdrop.style;
     if (!gumdrop || !el) { return; }
     var display  = '';
-    if (el.style.display == 'none' ||
+    var cstyle = doc.defaultView.getComputedStyle(el, '');
+    if (cstyle.display == 'none' ||
+        cstyle.visibility == 'hidden' ||
         el.getAttribute('readonly') ||
         el.getAttribute('disabled')
         ) {
diff --git a/tests/hidden.html b/tests/hidden.html
index 4b9bc07..6141eed 100644
--- a/tests/hidden.html
+++ b/tests/hidden.html
@@ -38,6 +38,7 @@
     <style type="text/css">
       .nodis { display: none; }
       .novis { visibility: hidden; }
+      html, body { background: #faa; }
     </style>
   </head>
 
diff --git a/tests/style.css b/tests/style.css
index c8e62a6..a860121 100644
--- a/tests/style.css
+++ b/tests/style.css
@@ -11,4 +11,4 @@ tt { color: #080; font-weight: bold; font-size: 1.2em; }
 
 ol li, ul li, p { line-height: 1.2em; margin: 0.4em; }
 
-.boxed { border: 1px solid #228; }
+.boxed { border: 1px solid #228; min-height: 4em; }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/itsalltext.git



More information about the Pkg-mozext-commits mailing list