Skip to main content

Bug Tracker

Side navigation

#9106 closed bug (wontfix)

Opened May 04, 2011 09:40PM UTC

Closed June 06, 2011 05:55PM UTC

Last modified August 01, 2012 10:46PM UTC

$('html').show(); does not work in firefox 3.6

Reported by: kharlamov@gmail.com Owned by: rwaldron
Priority: low Milestone: 1.7
Component: effects Version: 1.6
Keywords: Cc:
Blocked by: Blocking:
Description

With jquery 1.6 on firefox 3.6.17, .show(); does not seem to work on the html tag.

I have made a quick demo here:

demo: http://jsfiddle.net/UHEEm/


html:

<html>
    <body>
        test
    </body>
</html>

css:

html {
    display: none;
}

jquery:

$('html').show();

//$('html').css('display', 'block'); //this works though.



Attachments (0)
Change History (22)

Changed May 04, 2011 09:45PM UTC by vyrak.bunleang@gmail.com comment:1

Seems like this is an issue if Firefox 4.0 as well

Changed May 04, 2011 09:51PM UTC by anonymous comment:2

The body tag looks like the only other tag that is affected by this bug.

Changed May 07, 2011 07:59PM UTC by rwaldron comment:3

component: unfiledeffects
priority: undecidedblocker
status: newopen

IMHO, like #8099 and this ticket, modifying the display property directly instead of via a class is flat out wrong. I'm going to recommend, for simplicity sake, that we just pre-define html & body in the in the elementdisplay object, something like this:

https://github.com/rwldrn/jquery/commit/435536606f8f5f341f6d923ea8c5a2084fbc41c7

While I don't think this is right, nor do I really think we should be making iframes to account for what amounts to BAD markup and styles, I guess people are doing it, so we need to address the issue.

Nearly a duplicate of #8099

Changed May 07, 2011 07:59PM UTC by rwaldron comment:4

owner: → rwaldron
status: openassigned

Changed May 22, 2011 07:27PM UTC by john comment:5

keywords: → 1.7-discuss

Nominating ticket for 1.7 discussion.

Changed May 22, 2011 09:06PM UTC by rwaldron comment:6

description: With jquery 1.6 on firefox 3.6.17, .show(); does not seem to work on the html tag. \ \ I have made a quick demo here: \ \ demo: http://jsfiddle.net/UHEEm/ \ \ \ {{{ \ \ html: \ \ <html> \ <body> \ test \ </body> \ </html> \ \ css: \ \ html { \ display: none; \ } \ \ jquery: \ \ $('html').show(); \ \ //$('html').css('display', 'block'); //this works though. \ \ \ \ }}} \ With jquery 1.6 on firefox 3.6.17, .show(); does not seem to work on the html tag.\ \ I have made a quick demo here:\ \ demo: http://jsfiddle.net/UHEEm/\ \ \ {{{\ \ html:\ \ <html>\ <body>\ test\ </body>\ </html>\ \ css:\ \ html {\ display: none;\ }\ \ jquery:\ \ $('html').show();\ \ //$('html').css('display', 'block'); //this works though.\ \ \ \ }}}\

+0, Not fond of this issue, but it might be a bug

Changed May 23, 2011 12:46AM UTC by jaubourg comment:7

+1, I'd say bug

Changed May 23, 2011 04:34AM UTC by timmywil comment:8

+1,

Changed May 24, 2011 09:45PM UTC by dmethvin comment:9

description: With jquery 1.6 on firefox 3.6.17, .show(); does not seem to work on the html tag.\ \ I have made a quick demo here:\ \ demo: http://jsfiddle.net/UHEEm/\ \ \ {{{\ \ html:\ \ <html>\ <body>\ test\ </body>\ </html>\ \ css:\ \ html {\ display: none;\ }\ \ jquery:\ \ $('html').show();\ \ //$('html').css('display', 'block'); //this works though.\ \ \ \ }}}\ With jquery 1.6 on firefox 3.6.17, .show(); does not seem to work on the html tag. \ \ I have made a quick demo here: \ \ demo: http://jsfiddle.net/UHEEm/ \ \ \ {{{ \ \ html: \ \ <html> \ <body> \ test \ </body> \ </html> \ \ css: \ \ html { \ display: none; \ } \ \ jquery: \ \ $('html').show(); \ \ //$('html').css('display', 'block'); //this works though. \ \ \ \ }}} \

+1, rwaldron's solution is an enabler of lame code but his heart is in the right place! :-)

Changed May 25, 2011 03:20PM UTC by timmywil comment:10

milestone: 1.next1.6.2

Changed May 25, 2011 07:14PM UTC by rwaldron comment:11

FYI Guys, this is in the same ballpark as the defaultDisplay bug #8099

We may need to draw the line somewhere

Changed June 03, 2011 01:59PM UTC by john comment:12

description: With jquery 1.6 on firefox 3.6.17, .show(); does not seem to work on the html tag. \ \ I have made a quick demo here: \ \ demo: http://jsfiddle.net/UHEEm/ \ \ \ {{{ \ \ html: \ \ <html> \ <body> \ test \ </body> \ </html> \ \ css: \ \ html { \ display: none; \ } \ \ jquery: \ \ $('html').show(); \ \ //$('html').css('display', 'block'); //this works though. \ \ \ \ }}} \ With jquery 1.6 on firefox 3.6.17, .show(); does not seem to work on the html tag.\ \ I have made a quick demo here:\ \ demo: http://jsfiddle.net/UHEEm/\ \ \ {{{\ \ html:\ \ <html>\ <body>\ test\ </body>\ </html>\ \ css:\ \ html {\ display: none;\ }\ \ jquery:\ \ $('html').show();\ \ //$('html').css('display', 'block'); //this works though.\ \ \ \ }}}\

+0, Ugh... why?

Changed June 03, 2011 02:30PM UTC by anonymous comment:13

Replying to [comment:12 john]:

+0, Ugh... why?

This is important for people who are using any type of notion of modules.

For example: those who use requirejs could need to wait until all of their required scripts are loaded. When all of those required scripts preform all their actions to alter the DOM on the page, then only do you want to show the entire page. Otherwise the page could look like a tetris while it loads.

This is common in many enterprise applications.

Changed June 03, 2011 02:39PM UTC by rwaldron comment:14

description: With jquery 1.6 on firefox 3.6.17, .show(); does not seem to work on the html tag.\ \ I have made a quick demo here:\ \ demo: http://jsfiddle.net/UHEEm/\ \ \ {{{\ \ html:\ \ <html>\ <body>\ test\ </body>\ </html>\ \ css:\ \ html {\ display: none;\ }\ \ jquery:\ \ $('html').show();\ \ //$('html').css('display', 'block'); //this works though.\ \ \ \ }}}\ With jquery 1.6 on firefox 3.6.17, .show(); does not seem to work on the html tag. \ \ I have made a quick demo here: \ \ demo: http://jsfiddle.net/UHEEm/ \ \ \ {{{ \ \ html: \ \ <html> \ <body> \ test \ </body> \ </html> \ \ css: \ \ html { \ display: none; \ } \ \ jquery: \ \ $('html').show(); \ \ //$('html').css('display', 'block'); //this works though. \ \ \ \ }}} \

@anonymous the problem with this is that when an end developer changes the _default_ display style property of an element, there is _NO_WAY_ to find out what it should really be without creating an iframe and appending a temporary test element to that iframe. We've been down this road and explored a breadth of potential solutions.

The fact is that changing the default display of an element as shown in the given example is a broken approach and in general a bad practice.

You could achieve exactly the same effect by using a class:

html:

<html class="toggler">
    <body>
        test
    </body>
</html>

css:

.toggler {
    display: none;
}

jquery:

$('html').show();

See: http://jsbin.com/udaso4

I move to close as invalid.

Changed June 04, 2011 10:16PM UTC by addyosmani comment:15

description: With jquery 1.6 on firefox 3.6.17, .show(); does not seem to work on the html tag. \ \ I have made a quick demo here: \ \ demo: http://jsfiddle.net/UHEEm/ \ \ \ {{{ \ \ html: \ \ <html> \ <body> \ test \ </body> \ </html> \ \ css: \ \ html { \ display: none; \ } \ \ jquery: \ \ $('html').show(); \ \ //$('html').css('display', 'block'); //this works though. \ \ \ \ }}} \ With jquery 1.6 on firefox 3.6.17, .show(); does not seem to work on the html tag.\ \ I have made a quick demo here:\ \ demo: http://jsfiddle.net/UHEEm/\ \ \ {{{\ \ html:\ \ <html>\ <body>\ test\ </body>\ </html>\ \ css:\ \ html {\ display: none;\ }\ \ jquery:\ \ $('html').show();\ \ //$('html').css('display', 'block'); //this works though.\ \ \ \ }}}\

+0

Changed June 05, 2011 01:20PM UTC by rpflorence@gmail.com comment:16

+0

Use CSS to hide the content, add classes to the HTML or BODY elements to show them when you want to.

Changed June 05, 2011 09:41PM UTC by ajpiano comment:17

description: With jquery 1.6 on firefox 3.6.17, .show(); does not seem to work on the html tag.\ \ I have made a quick demo here:\ \ demo: http://jsfiddle.net/UHEEm/\ \ \ {{{\ \ html:\ \ <html>\ <body>\ test\ </body>\ </html>\ \ css:\ \ html {\ display: none;\ }\ \ jquery:\ \ $('html').show();\ \ //$('html').css('display', 'block'); //this works though.\ \ \ \ }}}\ With jquery 1.6 on firefox 3.6.17, .show(); does not seem to work on the html tag. \ \ I have made a quick demo here: \ \ demo: http://jsfiddle.net/UHEEm/ \ \ \ {{{ \ \ html: \ \ <html> \ <body> \ test \ </body> \ </html> \ \ css: \ \ html { \ display: none; \ } \ \ jquery: \ \ $('html').show(); \ \ //$('html').css('display', 'block'); //this works though. \ \ \ \ }}} \

-1, How deep does the rabbithole go?

Changed June 06, 2011 02:52PM UTC by scottgonzalez comment:18

description: With jquery 1.6 on firefox 3.6.17, .show(); does not seem to work on the html tag. \ \ I have made a quick demo here: \ \ demo: http://jsfiddle.net/UHEEm/ \ \ \ {{{ \ \ html: \ \ <html> \ <body> \ test \ </body> \ </html> \ \ css: \ \ html { \ display: none; \ } \ \ jquery: \ \ $('html').show(); \ \ //$('html').css('display', 'block'); //this works though. \ \ \ \ }}} \ With jquery 1.6 on firefox 3.6.17, .show(); does not seem to work on the html tag.\ \ I have made a quick demo here:\ \ demo: http://jsfiddle.net/UHEEm/\ \ \ {{{\ \ html:\ \ <html>\ <body>\ test\ </body>\ </html>\ \ css:\ \ html {\ display: none;\ }\ \ jquery:\ \ $('html').show();\ \ //$('html').css('display', 'block'); //this works though.\ \ \ \ }}}\

-1, seems extremely rare and unnecessary to support

Changed June 06, 2011 04:48PM UTC by cowboy comment:19

description: With jquery 1.6 on firefox 3.6.17, .show(); does not seem to work on the html tag.\ \ I have made a quick demo here:\ \ demo: http://jsfiddle.net/UHEEm/\ \ \ {{{\ \ html:\ \ <html>\ <body>\ test\ </body>\ </html>\ \ css:\ \ html {\ display: none;\ }\ \ jquery:\ \ $('html').show();\ \ //$('html').css('display', 'block'); //this works though.\ \ \ \ }}}\ With jquery 1.6 on firefox 3.6.17, .show(); does not seem to work on the html tag. \ \ I have made a quick demo here: \ \ demo: http://jsfiddle.net/UHEEm/ \ \ \ {{{ \ \ html: \ \ <html> \ <body> \ test \ </body> \ </html> \ \ css: \ \ html { \ display: none; \ } \ \ jquery: \ \ $('html').show(); \ \ //$('html').css('display', 'block'); //this works though. \ \ \ \ }}} \

MINUS ONE!!!

Changed June 06, 2011 05:55PM UTC by rwaldron comment:20

resolution: → wontfix
status: assignedclosed

Changed June 06, 2011 06:01PM UTC by rwaldron comment:21

keywords: 1.7-discuss
milestone: 1.6.21.7
priority: blockerlow

Changed August 01, 2012 10:46PM UTC by mikesherov comment:22

#12179 is a duplicate of this ticket.