[Webkit-unassigned] [Bug 91007] Seams appear when zooming page with absolutely positioned canvas objects

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Aug 7 15:50:31 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=91007


Levi Weintraub <leviw at chromium.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|webkit-unassigned at lists.web |leviw at chromium.org
                   |kit.org                     |
                 CC|                            |eae at chromium.org,
                   |                            |eric at webkit.org




--- Comment #4 from Levi Weintraub <leviw at chromium.org>  2012-08-07 15:50:54 PST ---
(In reply to comment #3)
> I found that the problem has to do with the rounding of the zomed canvas size in WebCore::RenderHTMLCanvas::canvasSizeChanges.  It disagrees with the coordinate snapping.
> 
> The following way of computing intrinsic size seems to fix the bug on windows, but not quite on linux, so I think there is more to it that what I understand so far:
> 
> void RenderHTMLCanvas::canvasSizeChanged()
> {
>     IntSize canvasSize = static_cast<HTMLCanvasElement*>(node())->size();
>     IntSize zoomedSize;
> 
>     RenderStyle* styleToUse = style();
>     float effectiveZoom = styleToUse->effectiveZoom();
> 
>     if (styleToUse->isOutOfFlowPositioned()) {
>         // When positioning is out of flow, the zoomed size must be computed from the zoomed bounds,
>         // otherwise there is a risk of creating gaps between adjacent canvases due to integer coordinate
>         // snapping
>         float left = styleToUse->logicalLeft().getFloatValue();
>         float right = left + canvasSize.width() * effectiveZoom;
>         zoomedSize.setWidth(roundToInt(right) - roundToInt(left));
>         float top = styleToUse->top().getFloatValue();
>         float bottom = top + canvasSize.height() * effectiveZoom;
>         zoomedSize.setHeight(roundToInt(bottom) - roundToInt(top));
>     } else {
>         zoomedSize.setWidth(roundToInt(canvasSize.width() * effectiveZoom));
>         zoomedSize.setHeight(roundToInt(canvasSize.height() * effectiveZoom));
>     }
> 
>     if (zoomedSize == intrinsicSize())
>         return;
> (...)
> 
> (In reply to comment #2)
> > @leviw: any idea what may have caused this? It appears to be a recent regression.

Interesting! I'm not surprised this doesn't solve the problem in all cases since we use different snapping logic than what you implemented here. I've got another Layout issue in front of this, but it's on my list. Thanks for taking a preliminary look!

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list