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

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Aug 1 12:00:44 PDT 2012


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





--- Comment #3 from Justin Novosad <junov at chromium.org>  2012-08-01 12:00:45 PST ---
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.

-- 
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