Closed
Bug 653739
Opened 14 years ago
Closed 11 years ago
Incorrect intrinsic width computed for replaced element with intrinsic ratio and parent-dependent style height when ancestor is a scrollframe
Categories
(Core :: Layout, defect)
Tracking
()
RESOLVED
DUPLICATE
of bug 829958
People
(Reporter: bzbarsky, Unassigned)
References
Details
Attachments
(1 file)
457 bytes,
text/html
|
Details |
See attached testcase. The problem is that as we go up the tree in GetPercentHeight called from nsLayoutUtils::IntrinsicForContainer, we get to the scrolled frame, which is auto height. So we assume the image will have its intrinsic width, and make the containing inline-block too wide.
Reporter | ||
Comment 1•14 years ago
|
||
I would guess that button-content has similar issues, and maybe cell-content...
Reporter | ||
Comment 2•14 years ago
|
||
Ehsan, would your GetContainingBlock changes help here?
Comment 3•14 years ago
|
||
(In reply to comment #2)
> Ehsan, would your GetContainingBlock changes help here?
No, just tested, sorry.
Reporter | ||
Comment 4•14 years ago
|
||
Does that patch change GetPercentHeight in nsLayoutUtils.cpp?
Comment 5•14 years ago
|
||
Yes, it does. This is how the containing block for the frame is computed with my patch:
nsIFrame *f = aFrame->GetContainingBlock();
Comment 6•14 years ago
|
||
More specifically:
8 diff --git a/layout/base/nsLayoutUtils.cpp b/layout/base/nsLayoutUtils.cpp
9 --- a/layout/base/nsLayoutUtils.cpp
10 +++ b/layout/base/nsLayoutUtils.cpp
11 @@ -2046,20 +2046,17 @@ static PRBool GetAbsoluteCoord(const nsS
12 static PRBool
13 GetPercentHeight(const nsStyleCoord& aStyle,
14 nsIFrame* aFrame,
15 nscoord& aResult)
16 {
17 if (eStyleUnit_Percent != aStyle.GetUnit())
18 return PR_FALSE;
19 ·
20 - nsIFrame *f;
21 - for (f = aFrame->GetParent(); f && !f->IsContainingBlock();
22 - f = f->GetParent())
23 - ;
24 + nsIFrame *f = aFrame->GetContainingBlock();
25 if (!f) {
26 NS_NOTREACHED("top of frame tree not a containing block");
27 return PR_FALSE;
28 }
29 ·
30 const nsStylePosition *pos = f->GetStylePosition();
31 nscoord h;
32 if (!GetAbsoluteCoord(pos->mHeight, h) &&
Reporter | ||
Updated•11 years ago
|
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•