Last Comment Bug 223394 - [FIXr]Replaced element with "height: n%;" and "position: absolute;" is not correctly height.
: [FIXr]Replaced element with "height: n%;" and "position: absolute;" is not co...
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Layout: Block and Inline (show other bugs)
: Trunk
: All All
: P1 normal (vote)
: mozilla1.6alpha
Assigned To: Boris Zbarsky [:bz]
: Hixie (not reading bugmail)
Mentors:
http://bugzilla.mozilla.gr.jp/attachm...
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2003-10-23 07:13 PDT by Masayuki Nakano [:masayuki] (Mozilla Japan) (working slowly due to injured)
Modified: 2003-10-24 00:36 PDT (History)
0 users
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch (2.65 KB, patch)
2003-10-23 10:09 PDT, Boris Zbarsky [:bz]
roc: review+
roc: superreview+
asa: approval1.6a+
Details | Diff | Review

Description Masayuki Nakano [:masayuki] (Mozilla Japan) (working slowly due to injured) 2003-10-23 07:13:23 PDT
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6a) Gecko/20031022
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6a) Gecko/20031022

div{
    position: absolute;
    /* height: auto; */
}
img{
    height: 100%;
}

<div>
    <img>
</div>

In this case, the image height is computed intrinsic height of img.
because img element is replaced element.
But img height is computed 0.

Reproducible: Always

Steps to Reproduce:
1.See http://bugzilla.mozilla.gr.jp/attachment.cgi?id=1835&action=view

Actual Results:  
img height is computed 0.

Expected Results:  
img height is computed intrinsic height of img.

See http://bugzilla.mozilla.gr.jp/attachment.cgi?id=1837&action=view
this case is img element having "height:auto;".

this case and above case should be same computed value of height.

this problem is reproduced with after 2003101804.
before 2003101704 build are not reproduce it.

and not reproduce on normal flow(position: static;).
Comment 1 Masayuki Nakano [:masayuki] (Mozilla Japan) (working slowly due to injured) 2003-10-23 07:20:28 PDT
> Expected Results:  
> img height is computed intrinsic height of img.

sorry.

Expected Results:  
img height is computed _30%_ of intrinsic height of img.
Comment 2 Masayuki Nakano [:masayuki] (Mozilla Japan) (working slowly due to injured) 2003-10-23 07:24:13 PDT
>> Expected Results:  
>> img height is computed intrinsic height of img.
> 
> sorry.
> 
> Expected Results:  
> img height is computed _30%_ of intrinsic height of img.

sorry. it is mistake. 
"img height is computed intrinsic height of img." is correctly.
Comment 3 Boris Zbarsky [:bz] 2003-10-23 10:08:35 PDT
Mine.  This is fallout with my mucking with percent heights in quirks mode...
We're now coming out with an auto-height for the image instead of making up a
number like we used to... except this code will computed auto to 0 because
that's what ComputeVerticalValue() does.  So we need to explicitly change the
height unit from percent to auto if we want it handled as auto.
Comment 4 Boris Zbarsky [:bz] 2003-10-23 10:09:19 PDT
Created attachment 133950 [details] [diff] [review]
Patch

Also removes some no longer relevant comments.
Comment 5 Boris Zbarsky [:bz] 2003-10-23 10:10:01 PDT
Comment on attachment 133950 [details] [diff] [review]
Patch

roc, would you review?
Comment 6 David Baron :dbaron: ⌚️UTC-7 (review requests must explain patch) 2003-10-23 11:02:59 PDT
It's worth adding the testcase to the regression tests.
Comment 7 Boris Zbarsky [:bz] 2003-10-23 11:11:43 PDT
Yeah, I was going to add all four testcases (percent and auto height, strict and
quirks).
Comment 8 Boris Zbarsky [:bz] 2003-10-23 21:51:46 PDT
Comment on attachment 133950 [details] [diff] [review]
Patch

Could this be approved for 1.6a?  This is a very safe regression fix....
Comment 9 Asa Dotzler [:asa] 2003-10-23 23:15:09 PDT
Comment on attachment 133950 [details] [diff] [review]
Patch

a=asa (on behalf of drivers) for checkin to 1.6alpha
Comment 10 Boris Zbarsky [:bz] 2003-10-24 00:36:38 PDT
Fix checked in for 1.6a.  Testcases checked in as well.

Note You need to log in before you can comment on or make changes to this bug.