Bug Tracker

Modify

Ticket #9106 (closed bug: wontfix)

Opened 2 years ago

Last modified 10 months ago

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

Reported by: kharlamov@… Owned by: rwaldron
Priority: low Milestone: 1.7
Component: effects Version: 1.6
Keywords: Cc:
Blocking: Blocked by:

Description (last modified by cowboy) (diff)

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.



Change History

comment:1 Changed 2 years ago by vyrak.bunleang@…

Seems like this is an issue if Firefox 4.0 as well

comment:2 Changed 2 years ago by anonymous

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

comment:3 Changed 2 years ago by rwaldron

  • Priority changed from undecided to blocker
  • Status changed from new to open
  • Component changed from unfiled to effects

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

comment:4 Changed 2 years ago by rwaldron

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

comment:5 Changed 2 years ago by john

  • Keywords 1.7-discuss added

Nominating ticket for 1.7 discussion.

comment:6 Changed 2 years ago by rwaldron

  • Description modified (diff)

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

comment:7 Changed 2 years ago by jaubourg

+1, I'd say bug

comment:8 Changed 2 years ago by timmywil

+1,

comment:9 Changed 2 years ago by dmethvin

  • Description modified (diff)

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

comment:10 Changed 2 years ago by timmywil

  • Milestone changed from 1.next to 1.6.2

comment:11 Changed 2 years ago by rwaldron

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

We may need to draw the line somewhere

comment:12 follow-up: ↓ 13 Changed 2 years ago by john

  • Description modified (diff)

+0, Ugh... why?

comment:13 in reply to: ↑ 12 Changed 2 years ago by anonymous

Replying to 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.

comment:14 Changed 2 years ago by rwaldron

  • Description modified (diff)

@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.

comment:15 Changed 2 years ago by addyosmani

  • Description modified (diff)

+0

comment:16 Changed 2 years ago by rpflorence@…

+0

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

comment:17 Changed 2 years ago by ajpiano

  • Description modified (diff)

-1, How deep does the rabbithole go?

comment:18 Changed 2 years ago by scott.gonzalez

  • Description modified (diff)

-1, seems extremely rare and unnecessary to support

comment:19 Changed 2 years ago by cowboy

  • Description modified (diff)

MINUS ONE!!!

comment:20 Changed 2 years ago by rwaldron

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

comment:21 Changed 2 years ago by rwaldron

  • Keywords 1.7-discuss removed
  • Priority changed from blocker to low
  • Milestone changed from 1.6.2 to 1.7

comment:22 Changed 10 months ago by mikesherov

#12179 is a duplicate of this ticket.

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.