Bug Tracker

Modify

Ticket #8099 (closed bug: fixed)

Opened 3 years ago

Last modified 2 years ago

SPAN element becomes block level on show()

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

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

comment:1 Changed 3 years ago by rwaldron

  • Priority changed from undecided to blocker
  • Status changed from new to open
  • Component changed from unfiled to effects
  • Milestone changed from 1.next to 1.5.1

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 3 years ago by rwaldron (previous) (diff)

comment:2 Changed 3 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 3 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 3 years ago by rwaldron

  • Owner set to rwaldron
  • Status changed from open to assigned

comment:6 Changed 3 years ago by jitter

#8213 is a duplicate of this ticket.

comment:7 Changed 3 years ago by jitter

  • Version changed from 1.4.4 to 1.5

comment:8 Changed 3 years ago by john

  • Status changed from assigned to closed
  • Resolution set to fixed

Landed.

comment:9 Changed 3 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 3 years ago by jitter (previous) (diff)

comment:10 Changed 3 years ago by jitter

  • Status changed from closed to reopened
  • Resolution fixed deleted
  • Milestone changed from 1.5.1 to 1.6

Reverted commit  faa6fe32f72900d7b31000caead2794a8346f6d8

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

comment:11 Changed 3 years ago by rwaldron

</3

comment:12 Changed 3 years ago by snover

  • Status changed from reopened to open

comment:13 Changed 3 years ago by rwaldron

#8414 is a duplicate of this ticket.

comment:14 Changed 3 years ago by rwaldron

  • Status changed from open to assigned

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 3 years ago by lrbabe

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

comment:16 Changed 3 years ago by jeresig

  • Status changed from assigned to closed
  • Resolution set to fixed

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

Conflicts:

test/data/testsuite.css

Changeset: 1dda994c463f01977c7126407998d61efed218a5

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.