Closed
Bug 349246
Opened 19 years ago
Closed 19 years ago
[reflow branch] Gmail compose textarea has a too small height
Categories
(Core :: Layout: Tables, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: martijn.martijn, Assigned: dbaron)
References
()
Details
(Keywords: testcase)
Attachments
(2 files)
In the reflow branch, the gmail compose textarea has a too small height compared to the normal builds.
I'll attach a testcase that shows the bug.
It uses the document.body.offsetHeight hack to trigger the bug.
| Reporter | ||
Comment 1•19 years ago
|
||
Comment 2•19 years ago
|
||
Comment 3•19 years ago
|
||
You can also get this by removing the <script> and just resizing the window after the load is done. I don't see a special height reflow happening in that case, so we never hit this code in nsTableCellFrame::Reflow:
if (aReflowState.mFlags.mSpecialHeightReflow) {
((nsHTMLReflowState&)aReflowState).mComputedHeight = mRect.height - topInset - bottomInset;
So we have an auto computed height when we reflow the block....
Comment 4•19 years ago
|
||
We do call nsTableFrame::RequestSpecialHeightReflow in this case. Not sure why we don't get one yet.
Comment 5•19 years ago
|
||
So in nsTableRowGroupFrame::ReflowChildren we end up with reflowAllKids false, so we skip reflowing the table row....
Comment 6•19 years ago
|
||
if ((reflowAllKids ||
(kidFrame->GetStateBits() &
(NS_FRAME_IS_DIRTY | NS_FRAME_HAS_DIRTY_CHILDREN))) &&
!(aReflowState.reflowState.mFlags.mSpecialHeightReflow &&
!isPaginated &&
!((nsTableRowFrame*)kidFrame)->NeedSpecialReflow())) {
That seems a little odd to me. Should that '&&' between the two parts of the condition be an '||'? It seems to me like we should reflow any kid that needs a special reflow...
| Assignee | ||
Comment 7•19 years ago
|
||
It's pretty much equivalent to what the old code did, assuming I didn't make a logic error:
- PRBool doReflowChild = PR_TRUE;
- if (aDirtyOnly && ((kidFrame->GetStateBits() & NS_FRAME_IS_DIRTY) == 0)) {
- doReflowChild = PR_FALSE;
- }
- nsIAtom* kidType = kidFrame->GetType();
- if (aReflowState.reflowState.mFlags.mSpecialHeightReflow) {
- if (!isPaginated && (nsLayoutAtoms::tableRowFrame == kidType &&
- !((nsTableRowFrame*)kidFrame)->NeedSpecialReflow()))- doReflowChild = PR_FALSE;
- }
}
(That said, I wonder if I can get rid of a lot of this special height reflow stuff by reusing my new height-dependent reflow optimizations.)
| Reporter | ||
Comment 8•19 years ago
|
||
I remember I had an in-between testcase that also showed the bug on normal trunk builds, so I guess the bug exists there too in some way. But on normal trunk builds, the bug doesn't manifest itself on gmail compose.
Comment 9•19 years ago
|
||
The logic does look the same if reflowAllKids == !aDirtyOnly... But conceptually it still looks wrong...
| Assignee | ||
Comment 10•19 years ago
|
||
For what it's worth, the following change:
- if ((reflowAllKids ||
- (kidFrame->GetStateBits() &
- (NS_FRAME_IS_DIRTY | NS_FRAME_HAS_DIRTY_CHILDREN))) &&
- !(aReflowState.reflowState.mFlags.mSpecialHeightReflow &&
- !isPaginated &&
- !((nsTableRowFrame*)kidFrame)->NeedSpecialReflow())) {
+ if (reflowAllKids ||
+ (kidFrame->GetStateBits() &
+ (NS_FRAME_IS_DIRTY | NS_FRAME_HAS_DIRTY_CHILDREN)) ||
+ (aReflowState.reflowState.mFlags.mSpecialHeightReflow &&
+ ((nsTableRowFrame*)kidFrame)->NeedSpecialReflow())) {
does NOT fix this bug.
| Assignee | ||
Comment 11•19 years ago
|
||
I needed changes in a bunch of places, but it's now fixed.
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
| Assignee | ||
Comment 12•19 years ago
|
||
Er, the smaller testcase is, but I need more work on the other one...
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
| Assignee | ||
Comment 13•19 years ago
|
||
OK, now I fixed the first testcase with this rather ugly change to nsHTMLReflowState::InitResizeFlags:
- if (((mStylePosition->mHeight.GetUnit() == eStyleUnit_Percent &&
- mComputedHeight != NS_AUTOHEIGHT) ||
+ // It would be nice to check that |mComputedHeight != NS_AUTOHEIGHT|
+ // &&ed with the percentage height check. However, this doesn't get
+ // along with table special height reflows, since a special height
+ // reflow (a quirk that makes such percentage heights work on children
+ // of table cells) can cause not just a single percentage height to
+ // become fixed, but an entire descendant chain of percentage heights
+ // to become fixed.
+ if ((mStylePosition->mHeight.GetUnit() == eStyleUnit_Percent ||
However, gmail itself is still broken.
Martijn, any chance you could come up with a reduced testcase for the remaining problem?
| Assignee | ||
Comment 14•19 years ago
|
||
A number of checkins later, actually fixed.
Status: REOPENED → RESOLVED
Closed: 19 years ago → 19 years ago
Resolution: --- → FIXED
| Reporter | ||
Comment 15•19 years ago
|
||
Sorry for not providing a testcase.
You need to log in
before you can comment on or make changes to this bug.
Description
•