Bug 118495 - Page zoom/scale causes javascript auto scroll not work
Summary: Page zoom/scale causes javascript auto scroll not work
Status: UNCONFIRMED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Major
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-07-09 01:10 PDT by Chen Zhixiang
Modified: 2013-07-09 01:12 PDT (History)
0 users

See Also:


Attachments
Testcase for this bug report (1.11 KB, text/html)
2013-07-09 01:12 PDT, Chen Zhixiang
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Chen Zhixiang 2013-07-09 01:10:12 PDT
When set page zoom/scale factor to a value < 1,
then the JS code `element.content.scrollTop++` will be affected by this
And the page auto scroll will not work.

This problem exists in both newest Chrome 27 and Firefox 22.

Reason for this:
(1)In fact, zoom/scale operator should NOT apply to the point/position type, but only to the length type;
(2)Or maybe we can change the internal DOM layput impl's type from int to double?
(3)I had to say, the testcase expects a "continuous" style changing behavor, while discretized int-type values should always give a gap;


void Element::setScrollTop(int newTop)
{
    document()->updateLayoutIgnorePendingStylesheets();
    if (RenderBox* rend = renderBox())
        rend->setScrollTop(static_cast<int>(newTop * rend->style()->effectiveZoom())); //<---
}
Comment 1 Chen Zhixiang 2013-07-09 01:12:12 PDT
Created attachment 206298 [details]
Testcase for this bug report

Load this page, and change the page zoom to <1 value, then the auto scroll will stop working