Skip to main content

Bug Tracker

Side navigation

#13132 closed bug (fixed)

Opened December 28, 2012 05:51PM UTC

Closed July 18, 2014 12:32AM UTC

:visible inconsistent across browsers for empty tags

Reported by: drshaffopolis@gmail.com 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/

Attachments (0)
Change History (11)

Changed December 28, 2012 06:04PM UTC by dmethvin comment:1

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/

Changed January 21, 2013 10:13PM UTC by Timmy Willison comment:2

resolution: → fixed
status: newclosed

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

Changeset: 3015ee0b5a3cae399b53314bd9a859f61de3b94a

Changed January 21, 2013 10:13PM UTC by Timmy Willison comment:3

resolution: → fixed
status: newclosed

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

Changeset: 372e04e78e81cc8eb868c5fc97f271a695569aa5

Changed January 24, 2013 08:56AM UTC by xing_kenny comment:4

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 ?

Changed January 31, 2013 03:23AM UTC by timmywil comment:5

component: unfiledcss
milestone: None1.next
priority: undecidedhigh
resolution: fixed
status: closedreopened
version: git1.9.0

Changed January 31, 2013 03:23AM UTC by timmywil comment:6

owner: → timmywil
status: reopenedassigned

Changed March 05, 2013 03:27PM UTC by dmethvin comment:7

#13453 is a duplicate of this ticket.

Changed April 04, 2013 08:41PM UTC by dmethvin comment:8

See also #10406 which is similar.

Changed May 06, 2013 07:59PM UTC by timmywil comment:9

milestone: 1.next1.11/2.1

Changed December 16, 2013 06:52PM UTC by timmywil comment:10

milestone: 1.11/2.11.12/2.2

Changed July 18, 2014 12:32AM UTC by Timmy Willison comment:11

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