Modify ↓
Ticket #4232 (closed bug: duplicate)
New :visible logic fails on hidden table rows in IE7
| Reported by: | cmlenz | Owned by: | john |
|---|---|---|---|
| Priority: | critical | Milestone: | 1.4 |
| Component: | selector | Version: | 1.3.2 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
The new :visible logic introduced in 1.3.2 doesn't work correctly for hidden table rows in IE7, and probably IE6. Haven't tested IE8.
The issue is that IE still reports a >0 offsetWidth for the rows, only the offsetHeight is ==0. I'll attach a simple HTML page that demonstrates the problem.
I think the fix would be:
Index: src/selector.js
===================================================================
--- src/selector.js (revision 6253)
+++ src/selector.js (working copy)
@@ -958,7 +958,7 @@
};
Sizzle.selectors.filters.visible = function(elem){
- return elem.offsetWidth > 0 || elem.offsetHeight > 0;
+ return elem.offsetWidth > 0 && elem.offsetHeight > 0;
};
Sizzle.selectors.filters.animated = function(elem){
Attachments
Change History
Changed 4 years ago by cmlenz
-
attachment
offset_visible.html
added
comment:1 Changed 4 years ago by dmethvin
I tried a simple test case and it seems to work correctly with 1.3.2 in IE8 (all I have on this PC). Can you attach a case that fails in IE7 just to be sure?
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.

HTML test page