Bug Tracker

Ticket #8477 (closed bug: duplicate)

Opened 3 years ago

Last modified 3 years ago

No position() info in children on completing the ajax request filling a hidden div

Reported by: tomexero@… Owned by: tomexero@…
Priority: low Milestone: 1.next
Component: css Version: 1.5.1
Keywords: Cc:
Blocking: Blocked by:

Description

If we load some HTML into DIV that has the display CSS property set to none, the loaded children of that DIV do not get properly initialized - e.g. they lack position and parent info. This happens in Fx 3.6.x and does not happen in IE 8 (where all info is filled as it is supposed to).

Test files:

index.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="cache-control" content="max-age=600" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="http://code.jquery.com/jquery-1.5.1.min.js"></script>
</head>
<body>
<div style="position:relative;width:400px;height:400px;">
<div style="position:relative;width:400px;height:400px;">
<div id="box" style="display:none;position:absolute;top:60px;left:70px;width:60px;height:60px;background:red;"></div>
</div>
</div>
<script type="text/javascript">
$.ajax({
url: 'load.html', //local file
complete: function(data){
$('div#box').html(data.responseText);
var anchor = $('div#box .anchor').eq(0);
alert(anchor.css('width')+','+anchor.css('top')); 
// shows "60px,0px" in Fx and "60px,60px" in IE
return false;
},
dataType: 'html'
});
</script>
</body>
</html>

local.html:

<div style="position:relative;width:400px;height:400px;">
<div style="position:relative;width:400px;height:400px;">
<div class="anchor" style="position:absolute;top:60px;left:70px;width:60px;height:60px"></div>
</div>
</div>

Change History

comment:1 Changed 3 years ago by anonymous

There is a typo, sorry - the second file should be named "load.html", not "local.html".

comment:2 follow-up: ↓ 4 Changed 3 years ago by dmethvin

  • Owner set to tomexero@…
  • Status changed from new to pending

Please submit a test case in jsfiddle, as requested in the red box above. Thanks!

comment:3 Changed 3 years ago by tomexero@…

  • Status changed from pending to new

I am sorry, I tried, but I still have no idea how to precisely simulate this case - loading a separate HTML file into the existing code - in jsFiddle.

Could you please use the code provided in the ticked description to create both files neccessary to replicate the bug?

comment:4 in reply to: ↑ 2 Changed 3 years ago by anonymous

Replying to dmethvin:

Please submit a test case in jsfiddle, as requested in the red box above. Thanks!

Hi, what is the current status of this ticket? Is it going to be repaired?

comment:5 Changed 3 years ago by rwaldron

  • Priority changed from undecided to low
  • Resolution set to duplicate
  • Status changed from new to closed
  • Component changed from unfiled to css

comment:6 Changed 3 years ago by rwaldron

Duplicate of #7305.

Note: See TracTickets for help on using tickets.