WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED INVALID
107361
Don't recalcStyle and layout when changing page scale.
https://bugs.webkit.org/show_bug.cgi?id=107361
Summary
Don't recalcStyle and layout when changing page scale.
Dongseong Hwang
Reported
2013-01-18 22:57:19 PST
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.
Attachments
Add attachment
proposed patch, testcase, etc.
Simon Fraser (smfr)
Comment 1
2013-01-19 11:02:58 PST
Page scale uses a transform on the root (RenderView), just like a CSS transform. Changing transforms requires layout, because it affects overflow; this is used to update the scrollbars when scaled.
Dongseong Hwang
Comment 2
2013-01-23 02:19:06 PST
(In reply to
comment #1
)
> Page scale uses a transform on the root (RenderView), just like a CSS transform. Changing transforms requires layout, because it affects overflow; this is used to update the scrollbars when scaled.
Thank you for your explanation. I can grasp how transform effects. Chromium avoids changing transform using Settings::applyPageScaleFactorInCompositorKey(). EFL and Qt will follows Chromium's way.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug