Bug Tracker

Opened 7 years ago

Closed 5 years ago

#13132 closed bug (fixed)

:visible inconsistent across browsers for empty tags

Reported by: drshaffopolis@… 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/

http://jsfiddle.net/tFuSL/ http://jsfiddle.net/jyCYF/

Change History (11)

comment:1 Changed 7 years ago by dmethvin

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/

comment:2 Changed 6 years ago by Timmy Willison

Resolution: fixed
Status: newclosed

Treat elements as hidden when either offsetWidth OR offsetHeight is 0. Fixes #13132, #10406.

Changeset: 3015ee0b5a3cae399b53314bd9a859f61de3b94a

comment:2 Changed 6 years ago by Timmy Willison

Resolution: fixed
Status: newclosed

Treat an element as hidden if either offsetWidth or offsetHeight is 0. Fixes #13132, #10406.

Changeset: 372e04e78e81cc8eb868c5fc97f271a695569aa5

comment:3 Changed 6 years ago by xing_kenny

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 6 years ago by timmywil

Component: unfiledcss
Milestone: None1.next
Priority: undecidedhigh
Resolution: fixed
Status: closedreopened
Version: git1.9.0

comment:5 Changed 6 years ago by timmywil

Owner: set to timmywil
Status: reopenedassigned

comment:6 Changed 6 years ago by dmethvin

#13453 is a duplicate of this ticket.

comment:7 Changed 6 years ago by dmethvin

See also #10406 which is similar.

comment:8 Changed 6 years ago by timmywil

Milestone: 1.next1.11/2.1

comment:9 Changed 6 years ago by timmywil

Milestone: 1.11/2.11.12/2.2

comment:11 Changed 5 years ago by Timmy Willison

Resolution: fixed
Status: assignedclosed

CSS: elements are hidden when either offsetWidth or offsetHeight is zero

  • Note: this is a breaking change that has been delayed for several versions.

Fixes #10406 Fixes #13132

Changeset: 10399ddcf8a239acc27bdec9231b996b178224d3

Note: See TracTickets for help on using tickets.