[FIX ATTACHED] Iframe in table paints in wrong place when resizing window

RESOLVED WORKSFORME

Status

()

Core
Layout
P3
normal
RESOLVED WORKSFORME
18 years ago
18 years ago

People

(Reporter: Eric Pollmann, Assigned: karnaze (gone))

Tracking

({testcase})

Trunk
testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

(Reporter)

Description

18 years ago
Steps to reproduce:

1) Load the test case above.
2) Drag the bottom edge of the window down to resize it larger vertically

You will see:

The iframe is painted above where it should be (30,30 in the table cell), then 
painted again in the correct place (vertically centered). This happens on all 
platforms, viewer or apprunner, gfx scrollbars on or off

You should see:

The iframe is painted in the correct place only

The problem appears to be in pass 2 reflow of table cells.  Here's the offending 
stack:

nsTableCellFrame::VerticallyAlignChild(nsIPresContext * 0x02ae9dd0, const 
nsHTMLReflowState & {...}) line 545
nsTableRowFrame::DidResize(nsIPresContext * 0x02ae9dd0, const nsHTMLReflowState 
& {...}) line 299
nsTableRowGroupFrame::CalculateRowHeights(nsIPresContext * 0x02ae9dd0, 
nsHTMLReflowMetrics & {...}, const nsHTMLReflowState & {...}) line 796
nsTableRowGroupFrame::Reflow(nsTableRowGroupFrame * const 0x00dfebdc, 
nsIPresContext * 0x02ae9dd0, nsHTMLReflowMetrics & {...}, const 
nsHTMLReflowState & {...}, unsigned int & 0) line 1110
nsContainerFrame::ReflowChild(nsIFrame * 0x00dfebdc, nsIPresContext * 
0x02ae9dd0, nsHTMLReflowMetrics & {...}, const nsHTMLReflowState & {...}, int 
15, int 15, unsigned int 0, unsigned int & 0) line 643 + 31 bytes
nsTableFrame::ReflowMappedChildren(nsTableFrame * const 0x00dfeb70, 
nsIPresContext * 0x02ae9dd0, nsHTMLReflowMetrics & {...}, InnerTableReflowState 
& {...}, unsigned int & 0) line 2954 + 41 bytes
nsTableFrame::ResizeReflowPass2(nsTableFrame * const 0x00dfeb70, nsIPresContext 
* 0x02ae9dd0, nsHTMLReflowMetrics & {...}, const nsHTMLReflowState & {...}, 
unsigned int & 0) line 1965 + 31 bytes
nsTableFrame::Reflow(nsTableFrame * const 0x00dfeb70, nsIPresContext * 
0x02ae9dd0, nsHTMLReflowMetrics & {...}, const nsHTMLReflowState & {...}, 
unsigned int & 0) line 1609 + 34 bytes
nsContainerFrame::ReflowChild(nsIFrame * 0x00dfeb70, nsIPresContext * 
0x02ae9dd0, nsHTMLReflowMetrics & {...}, const nsHTMLReflowState & {...}, int 0, 
int 0, unsigned int 0, unsigned int & 0) line 643 + 31 bytes
nsTableOuterFrame::Reflow(nsTableOuterFrame * const 0x00dfeb1c, nsIPresContext * 
0x02ae9dd0, nsHTMLReflowMetrics & {...}, const nsHTMLReflowState & {...}, 
unsigned int & 0) line 1014 + 43 bytes
nsBlockReflowContext::ReflowBlock(nsIFrame * 0x00dfeb1c, const nsRect & {...}, 
int 0, int 0, int 1, nsMargin & {...}, unsigned int & 0) line 467 + 45 bytes
nsBlockFrame::ReflowBlockFrame(nsBlockReflowState & {...}, nsLineBox * 
0x00dfeeb8, int * 0x0012e8b8) line 3648 + 56 bytes
nsBlockFrame::ReflowLine(nsBlockReflowState & {...}, nsLineBox * 0x00dfeeb8, int 
* 0x0012e8b8, int 1) line 2935 + 23 bytes
nsBlockFrame::ReflowDirtyLines(nsBlockReflowState & {...}) line 2742 + 27 bytes
nsBlockFrame::Reflow(nsBlockFrame * const 0x00dfea48, nsIPresContext * 
0x02ae9dd0, nsHTMLReflowMetrics & {...}, const nsHTMLReflowState & {...}, 
unsigned int & 0) line 1611 + 15 bytes
nsBlockReflowContext::ReflowBlock(nsIFrame * 0x00dfea48, const nsRect & {...}, 
int 1, int 0, int 1, nsMargin & {...}, unsigned int & 0) line 467 + 45 bytes
nsBlockFrame::ReflowBlockFrame(nsBlockReflowState & {...}, nsLineBox * 
0x00dfeab8, int * 0x0012f240) line 3648 + 56 bytes
nsBlockFrame::ReflowLine(nsBlockReflowState & {...}, nsLineBox * 0x00dfeab8, int 
* 0x0012f240, int 1) line 2935 + 23 bytes
nsBlockFrame::ReflowDirtyLines(nsBlockReflowState & {...}) line 2742 + 27 bytes
nsBlockFrame::Reflow(nsBlockFrame * const 0x00dfe9c0, nsIPresContext * 
0x02ae9dd0, nsHTMLReflowMetrics & {...}, const nsHTMLReflowState & {...}, 
unsigned int & 0) line 1611 + 15 bytes
nsAreaFrame::Reflow(nsAreaFrame * const 0x00dfe9c0, nsIPresContext * 0x02ae9dd0, 
nsHTMLReflowMetrics & {...}, const nsHTMLReflowState & {...}, unsigned int & 0) 
line 273 + 25 bytes
nsContainerFrame::ReflowChild(nsIFrame * 0x00dfe9c0, nsIPresContext * 
0x02ae9dd0, nsHTMLReflowMetrics & {...}, const nsHTMLReflowState & {...}, int 0, 
int 0, unsigned int 0, unsigned int & 0) line 643 + 31 bytes
CanvasFrame::Reflow(CanvasFrame * const 0x00dfe94c, nsIPresContext * 0x02ae9dd0, 
nsHTMLReflowMetrics & {...}, const nsHTMLReflowState & {...}, unsigned int & 0) 
line 300
nsContainerFrame::ReflowChild(nsIFrame * 0x00dfe94c, nsIPresContext * 
0x02ae9dd0, nsHTMLReflowMetrics & {...}, const nsHTMLReflowState & {...}, int 0, 
int 0, unsigned int 1, unsigned int & 0) line 643 + 31 bytes
nsScrollFrame::Reflow(nsScrollFrame * const 0x00dfe984, nsIPresContext * 
0x02ae9dd0, nsHTMLReflowMetrics & {...}, const nsHTMLReflowState & {...}, 
unsigned int & 0) line 681
nsContainerFrame::ReflowChild(nsIFrame * 0x00dfe984, nsIPresContext * 
0x02ae9dd0, nsHTMLReflowMetrics & {...}, const nsHTMLReflowState & {...}, int 0, 
int 0, unsigned int 0, unsigned int & 0) line 643 + 31 bytes
ViewportFrame::Reflow(ViewportFrame * const 0x00dfe910, nsIPresContext * 
0x02ae9dd0, nsHTMLReflowMetrics & {...}, const nsHTMLReflowState & {...}, 
unsigned int & 0) line 546
nsHTMLReflowCommand::Dispatch(nsHTMLReflowCommand * const 0x02906eb0, 
nsIPresContext * 0x02ae9dd0, nsHTMLReflowMetrics & {...}, const nsSize & {...}, 
nsIRenderingContext & {...}) line 145
PresShell::ProcessReflowCommands(int 1) line 3567
ReflowEvent::HandleEvent() line 3459
HandlePLEvent(ReflowEvent * 0x02906e60) line 3469
PL_HandleEvent(PLEvent * 0x02906e60) line 575 + 10 bytes
PL_ProcessPendingEvents(PLEventQueue * 0x00c8dbd0) line 520 + 9 bytes
_md_EventReceiverProc(HWND__ * 0x007405ec, unsigned int 49346, unsigned int 0, 
long 13163472) line 1030 + 9 bytes
USER32! 77e71268()
00c8dbd0()

Pass 1 reflow correctly calculated the height of the iframe to be 200, pass 2 
reflow is (incorrectly?) calculating the height of the table cell to be 200 and 
placing the iframe at 30,30 (0,0 plus borders and padding).  Pass 2 is then 
correctly calculating the height again at some point and moving the iframe to 
the right place.  This means the iframe is placed a total of 3 times, one of 
which is wrong.

If you remove this line from the end of nsTableCellFrame::VerticallyAlignChild 
the bug is fixed:
    nsContainerFrame::PositionChildViews(aPresContext, firstKid);

I don't know if this is the right thing to do Chris - it makes this test case 
look a *lot* better on Linux, where the whole process is really slow.  Is view 
positioning needed here for other cases?
(Assignee)

Comment 1

18 years ago
Marking M16 and I'll look at the patch in a few days.
Status: NEW → ASSIGNED
Target Milestone: --- → M16
(Assignee)

Comment 2

18 years ago
I'm reluctant to remove that line without a lot of testing. Moving to M17.
Target Milestone: M16 → M17
(Assignee)

Comment 3

18 years ago
Created attachment 8729 [details]
test case from bug 22162
This bug can be fixed by caching the widget changes until reflow has completed.
Making this bug dependant on bug 39532 Widget caching bug
Depends on: 39532

Comment 5

18 years ago
Adding testcase keyword so this doesn't show up on the bugathon search page.
Keywords: testcase

Updated

18 years ago
Target Milestone: M17 → ---
(Assignee)

Comment 6

18 years ago
Eric, I'm not seeing the problem on Win32 and marking worksforme. If this is 
still a problem, please reassign to evaughan based on kmcclusk's comments.
Status: ASSIGNED → RESOLVED
Last Resolved: 18 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.