The async version of the mozPrintCallback API is working for printing output 
(it still has very rough edges, but it "works").

However, things don't work correctly for print-preview: As I open 
print-preview, I see the calls on the canvas, that are done immediately when 
the mozPrintCallback is called. The drawings performed against the canvas 
context with some delay don't show up in preview. If I scroll the preview 
window, the repainted area of the canvas show the updated/right content. Also, 
if the print preview loses focus, the canvas shows the actual content.

It looks like the "redraw this (part of the) canvas, as something in it 
changed" doesn't work.

I tried to figure out what's going wrong here, but I know to little about the 
Gecko layout/redraw code/handling and what I should look for :/

Here is what I got so far:
* nsCanvasRenderingContext2D.mIsEntireFrameInvalid doesn't seem to get reset to 
false
* I've forced to ignore `mIsEntireFrameInvalid` and let the call to  
`nsHTMLCanvasElement::InvalidateCanvasContent` happen. The `!GetPrimaryFrame()` 
evaluates to true and therefore the function returns early without telling the 
layer to update

 Can someone give me some pointers what to do here?

A way to get around this issue is to draw the nsPageFrame after all the canvas 
elements inside this page have finished the mozPrintCallback. Rendering the 
canvas progressive in print preview has the advantage to display other parts of 
the page (e.g. "normal" DOM content) to the user already and let him look at 
the drawings, while they build up.

Best,

Julian
_______________________________________________
dev-tech-layout mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-layout

Reply via email to