Closed
Bug 369146
Opened 19 years ago
Closed 19 years ago
nsCanvasRenderingContext2D::DrawWindow should flush layout on child frames
Categories
(Core :: Graphics: Canvas2D, defect)
Core
Graphics: Canvas2D
Tracking
()
RESOLVED
FIXED
People
(Reporter: dbaron, Assigned: dbaron)
Details
(Whiteboard: [patch])
Attachments
(2 files, 1 obsolete file)
|
2.58 KB,
patch
|
Details | Diff | Splinter Review | |
|
9.02 KB,
patch
|
dbaron
:
review+
|
Details | Diff | Splinter Review |
A possible cause for the reftest failure in bug 1156 comment 78 is that nsCanvasRenderingContext2D::DrawWindow does not flush layout on subframes. I haven't been able to get the failure to happen again, though, so I can't really be sure.
| Assignee | ||
Comment 1•19 years ago
|
||
I'm not sure how much error handling and null-checking I need to do when using the doc shell API.
| Assignee | ||
Updated•19 years ago
|
Attachment #253802 -
Flags: review?(bzbarsky)
Comment 2•19 years ago
|
||
Comment on attachment 253802 [details] [diff] [review]
possible patch
>diff -r 77cf62b10152 content/canvas/src/nsCanvasRenderingContext2D.cpp
>+ if (domDoc) {
>+ nsCOMPtr<nsIDocument> doc = do_QueryInterface(domDoc);
Don't really need to null-check |domDoc|, since do_QI is null-safe.
>+ nsCOMPtr<nsIDocShellTreeNode> node =
>+ do_QueryInterface(piWin->GetDocShell());
Do need to null-check |node| here, though. If the flush tore down an ancestor nsSubDocumentFrame and it was a <xul:iframe> or <xul:browser>, the window won't have a docshell.
>+ if (shell) {
>+ nsCOMPtr<nsIDOMWindow> win = do_GetInterface(shell);
do_GetInterface is also null-safe.
And the other null-checks I think you do need.
Attachment #253802 -
Flags: superreview+
Attachment #253802 -
Flags: review?(bzbarsky)
Attachment #253802 -
Flags: review+
Comment 3•19 years ago
|
||
I should note that because FlushPendingNotifications flushes parents this is sorta O(N^2) in docshell tree depth. But the tree never gets all that deep, hopefully.... If we care about that, we should only flush on docshells which have no kids we flushed on.
| Assignee | ||
Comment 4•19 years ago
|
||
| Assignee | ||
Updated•19 years ago
|
OS: Linux → All
Hardware: PC → All
Whiteboard: [patch]
| Assignee | ||
Comment 5•19 years ago
|
||
Checked in to trunk.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Comment 6•19 years ago
|
||
If you happen to have a tree from before this change, does this testcase fail?
Attachment #253831 -
Flags: review?(dbaron)
| Assignee | ||
Comment 7•19 years ago
|
||
Comment on attachment 253831 [details] [diff] [review]
Testcase
I don't have a tree from before the change; probably the easiest way to get one is to comment out the bottom part of FlushLayoutToTree that makes the recursive calls. It would be good to double-check that the testcase fails pre-patch (could you comment on the bug if you do?), but probably good to get it checked in either way.
Attachment #253831 -
Flags: review?(dbaron) → review+
You need to log in
before you can comment on or make changes to this bug.
Description
•