Bug Tracker

Opened 12 years ago

Closed 12 years ago

Last modified 11 years ago

#8099 closed bug (fixed)

SPAN element becomes block level on show()

Reported by: sime.vidas@… Owned by: Rick Waldron
Priority: blocker Milestone: 1.6
Component: effects Version: 1.5
Keywords: Cc:
Blocked by: Blocking:

Description

I created two demos:

Demo 1: http://jsfiddle.net/DqvTa/7/ Demo 2: http://jsfiddle.net/DqvTa/8/

The demos are almost identical. The only difference is that I set #span { display:none; } in demo 1 and span { display:none; } in demo 2.

Could someone explain why the SPAN element - in demo 2 - becomes a block-level element?

My assumption is that (during show()) jQuery internally creates a SPAN element to check whether it is naturally an inline or block-level element. But since I set all SPANs to display:none in demo 2, jQuery is unable to determine that.

Change History (16)

comment:1 Changed 12 years ago by Rick Waldron

Component: unfiledeffects
Milestone: 1.next1.5.1
Priority: undecidedblocker
Status: newopen

Confirmed:

http://jsfiddle.net/rwaldron/DqvTa/13/

However, it appears that by setting the display to "none" for all span tags, you've short-circuited the internal defaultDisplay function:

http://jsfiddle.net/rwaldron/DqvTa/15/

Last edited 12 years ago by Rick Waldron (previous) (diff)

comment:2 Changed 12 years ago by jquerybugs@…

The exact function where the undesired behaviour happens seems to be defaultDisplay where it adds the element to the page and checks for its display property and if it is none or "" then it assumes block.

comment:3 Changed 12 years ago by anonymous

Apologies for my comment. It was relevant when I typed it but not by the time I submitted it. I would delete if I could but I don't seem to have the option. Please delete it (and this one with it).

comment:4 Changed 12 years ago by Rick Waldron

Owner: set to Rick Waldron
Status: openassigned

comment:6 Changed 12 years ago by jitter

#8213 is a duplicate of this ticket.

comment:7 Changed 12 years ago by jitter

Version: 1.4.41.5

comment:8 Changed 12 years ago by john

Resolution: fixed
Status: assignedclosed

Landed.

comment:9 Changed 12 years ago by jitter

There you go. Proof of FOUC happens at least in Opera 10.63/11/11.01 on Windows XP. And a (maybe) subjective feeling that the first few effects test take way longer with the 8099 fix then without

http://www.vidup.de/v/uDVov/

Last edited 12 years ago by jitter (previous) (diff)

comment:10 Changed 12 years ago by jitter

Milestone: 1.5.11.6
Resolution: fixed
Status: closedreopened

Reverted commit faa6fe32f72900d7b31000caead2794a8346f6d8

Caused FOUC in Opera verified by me, mike and dave.

comment:11 Changed 12 years ago by Rick Waldron

</3

comment:12 Changed 12 years ago by snover

Status: reopenedopen

comment:13 Changed 12 years ago by Rick Waldron

#8414 is a duplicate of this ticket.

comment:14 Changed 12 years ago by Rick Waldron

Status: openassigned

Tested and passing in IE6, 7, 8; Chrome 9, 10, 12; Safari 3, 4, 5; Firefox 3.0.12, 3.6.16, 4: http://jsfiddle.net/rwaldron/6THBr/show/

Combined effort by louisremi (lrbabe) and myself. Patch & PR to follow

comment:15 Changed 12 years ago by lrbabe

Here is my PR, for the record: https://github.com/jquery/jquery/pull/320

comment:16 Changed 12 years ago by jeresig

Resolution: fixed
Status: assignedclosed

Merge branch '8099' of https://github.com/rwldrn/jquery. Fixes #8099.

Conflicts:

test/data/testsuite.css

Changeset: 1dda994c463f01977c7126407998d61efed218a5

Note: See TracTickets for help on using tickets.