[Webkit-unassigned] [Bug 107361] New: Don't recalcStyle and layout when changing page scale.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jan 18 22:55:31 PST 2013


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

           Summary: Don't recalcStyle and layout when changing page scale.
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Unspecified
        OS/Version: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Layout and Rendering
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: luxtella at company100.net


When we do pinch zoom, WebCore recalculates style and re-layouts. It affects user experience badly.
void Page::setPageScaleFactor(float scale, const IntPoint& origin)
{
    ...
    if (document->renderer())
        document->renderer()->setNeedsLayout(true);

    document->recalcStyle(Node::Force);
    ...
}

It is originated from Bug 48385, which created Frame::scalePage.
AFAIK, Bug 48385 made Frame::scalePage recalcStyle and layout, because it want to apply pageScale to transform.
However, I concern why we should apply pageScale to transform.
GraphicsLayer can know pageScale. GraphicsLayer can handle pageScale without scaled transform.

On the other hands, near past, deviceScaleFactor was born, but we don't apply deviceScaleFactor to transform. I think it is a bit weird.
When we work near device screen, we must consider pageScale * deviceScaleFactor.
It forces us to apply deviceScaleFactor to transform before drawing contents on device. And we must remember it is not allowed to apply pageScale to transform at that time.

In my opinion, StyleResolver should not slightly apply pageScale to transform, and we apply pageScale when it is needed. (e.g. r73525)
It will be more clear as well as performance benefit.
I wish Page::setPageScaleFactor not to cause recalcStyle and layout. I need your opinion.

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