Opened 10 years ago
Closed 9 years ago
#13132 closed bug (fixed)
:visible inconsistent across browsers for empty tags
Reported by: | Owned by: | timmywil | |
---|---|---|---|
Priority: | high | Milestone: | 1.12/2.2 |
Component: | css | Version: | 1.9.0 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
For an empty span tag (or one with a regular space in it), :visible returns true in Firefox and IE, false in Chrome. (See first jsfiddle)
The definition here, combined with the fact that the regular space begins returning true in Chrome when it's between other elements (and thus takes up space; see second jsfiddle), would lead me to believe that Chrome is behaving properly and Firefox/IE are wrong.
"Elements are considered visible if they consume space in the document. Visible elements have a width or height that is greater than zero." http://api.jquery.com/visible-selector/
Change History (11)
comment:1 Changed 10 years ago by
comment:2 Changed 10 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Treat elements as hidden when either offsetWidth OR offsetHeight is 0. Fixes #13132, #10406.
Changeset: 3015ee0b5a3cae399b53314bd9a859f61de3b94a
comment:2 Changed 10 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Treat an element as hidden if either offsetWidth or offsetHeight is 0. Fixes #13132, #10406.
Changeset: 372e04e78e81cc8eb868c5fc97f271a695569aa5
comment:3 Changed 10 years ago by
I run 'first jsfiddle' in FF19 and chrome24. FF's result is TTT, chrome's result is FFT. But when I run codes local with src="http://code.jquery.com/jquery-1.8.3.js", FF's result is FFT too! Is there anything wrong I make ?
comment:4 Changed 10 years ago by
Component: | unfiled → css |
---|---|
Milestone: | None → 1.next |
Priority: | undecided → high |
Resolution: | fixed |
Status: | closed → reopened |
Version: | git → 1.9.0 |
comment:5 Changed 10 years ago by
Owner: | set to timmywil |
---|---|
Status: | reopened → assigned |
comment:8 Changed 10 years ago by
Milestone: | 1.next → 1.11/2.1 |
---|
comment:9 Changed 9 years ago by
Milestone: | 1.11/2.1 → 1.12/2.2 |
---|
comment:11 Changed 9 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
CSS: elements are hidden when either offsetWidth or offsetHeight is zero
- Note: this is a breaking change that has been delayed for several versions.
Changeset: 10399ddcf8a239acc27bdec9231b996b178224d3
In IE and Firefox those empty spans are actually returning a height, even when they're contained in a div with no height.
http://jsfiddle.net/dmethvin/tFuSL/4/