Closed Bug 223394 Opened 21 years ago Closed 21 years ago

[FIXr]Replaced element with "height: n%;" and "position: absolute;" is not correctly height.

Categories

(Core :: Layout: Block and Inline, defect, P1)

defect

Tracking

()

RESOLVED FIXED
mozilla1.6alpha

People

(Reporter: masayuki, Assigned: bzbarsky)

References

()

Details

Attachments

(1 file)

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;).
> Expected Results:  
> img height is computed intrinsic height of img.

sorry.

Expected Results:  
img height is computed _30%_ of intrinsic height of img.
>> 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.
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.
Assignee: block-and-inline → bzbarsky
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows XP → All
Priority: -- → P1
Hardware: PC → All
Summary: Replaced element with "height: n%;" and "position: absolute;" is not correctly height. → [FIX]Replaced element with "height: n%;" and "position: absolute;" is not correctly height.
Target Milestone: --- → mozilla1.6alpha
Attached patch PatchSplinter Review
Also removes some no longer relevant comments.
Comment on attachment 133950 [details] [diff] [review]
Patch

roc, would you review?
Attachment #133950 - Flags: superreview?(roc)
Attachment #133950 - Flags: review?(roc)
It's worth adding the testcase to the regression tests.
Yeah, I was going to add all four testcases (percent and auto height, strict and
quirks).
Attachment #133950 - Flags: superreview?(roc)
Attachment #133950 - Flags: superreview+
Attachment #133950 - Flags: review?(roc)
Attachment #133950 - Flags: review+
Comment on attachment 133950 [details] [diff] [review]
Patch

Could this be approved for 1.6a?  This is a very safe regression fix....
Attachment #133950 - Flags: approval1.6a?
Summary: [FIX]Replaced element with "height: n%;" and "position: absolute;" is not correctly height. → [FIXr]Replaced element with "height: n%;" and "position: absolute;" is not correctly height.
Comment on attachment 133950 [details] [diff] [review]
Patch

a=asa (on behalf of drivers) for checkin to 1.6alpha
Attachment #133950 - Flags: approval1.6a? → approval1.6a+
Fix checked in for 1.6a.  Testcases checked in as well.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: