Project: chromium Issues People Development process History Sign in
New issue
Advanced search Search tips
Issue 50128 Incorrect offsetHeight() value
Starred by 3 users Reported by vdm196...@gmail.com, Jul 24 2010 Back to list
Status: IceBox
Owner: ----
Closed: Aug 2012
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug

Restricted
  • Only users with Commit permission may comment.



Sign in to add a comment
Chrome Version       : 5.0.375.99
URLs (if applicable) :
Other browsers tested:
Add OK or FAIL after other browsers where you have tested this issue:
     Safari 4: N/A
  Firefox 3.x: OK
         IE 7: OK
         IE 8: OK

What steps will reproduce the problem?
1. <div> contains image (without explicit size value) offsetHeight() returns 0

What is the expected result?
I expect height of the <div> should be equal image's height


here is the code for testing:
<?xml version="1.0" encoding="utf-8"?>
<!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">
<head>
    <title>Chromium test</title>
    <script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
    <script type="application/x-javascript">
    $(document).ready(function(){
        var elem = document.getElementById('first');
        var elemScnd = document.getElementById('second');
        alert(elem.offsetHeight);
        alert(elemScnd.offsetHeight);
        //alert($('#first').outerHeight());
    });
    </script>
   
</head>
<body style="background: #888;">
    <div id="wrapper" style="position: absolute; height: 100%; width: 100%;">
        <div id="first" style="position: absolute; top: 0; left: 0; width: 200px; background: #555;">
            <img src="spacer768.gif" alt="spacer768.gif" />
        </div>
        <div id="second" style="width: 400px; background: #666; position: absolute; top: 0px; left: 0px;">
            <img src="spacer488.gif" alt="spacer768.gif" height="488" />
        </div>
        <div id="third" style="position: absolute; width: 600px; background: #777;">
            &nbsp;
        </div>
    </div>
</body>
</html>


 
spacer488.gif
82 bytes View Download
spacer768.gif
88 bytes View Download
Project Member Comment 1 by bugdroid1@chromium.org, Aug 10 2012
Status: IceBox
Closing old bug as obsolete. Please file a new bug (with details) if this problem is still occurring for you.
Project Member Comment 2 by bugdroid1@chromium.org, Oct 13 2012
Labels: Restrict-AddIssueComment-Commit
This issue has been closed for some time. No one will pay attention to new comments.
If you are seeing this bug or have new data, please click New Issue to start a new bug.
Project Member Comment 3 by bugdroid1@chromium.org, Mar 11 2013
Labels: -Area-Undefined
Sign in to add a comment