Bug 139629

Summary: Unnecessary scroll bars when child is resized manually.
Product: WebKit Reporter: Etheryte <karl.tarvas>
Component: Layout and RenderingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: karl.tarvas
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   

Description Etheryte 2014-12-14 15:55:13 PST
Given a parent element <div> with set width, height and overflow: auto, containing a child element <div> with larger set dimensions, when the child element is manually resized (through class addition, Javascript etc.) to be equal the parent's dimensions, the scroll bars are not hidden (as they should be).

Sample on Jsfiddle: http://jsfiddle.net/rktvybb0/
Related discussion on Stack Overflow: http://stackoverflow.com/questions/27474930/avoid-triggering-overflow-auto-after-resizing-a-child-element-to-matching-size/
Comment 1 Etheryte 2014-12-14 22:41:25 PST
Forcing a redraw with a workaround as seen on the following Stack Overflow thread removes the scrollbars: http://stackoverflow.com/a/3485654/1470607

Javascript:

    this.style.display='none';
    this.offsetHeight; //Won't work without this
    this.style.display='';

While this works as a workaround, it would still be nice to see this fixed.
Comment 2 Etheryte 2014-12-21 14:45:31 PST
The problem only occurs when the new dimensions for the child element are given in pixels, when percentage values are used, the issue isn't present.
Comment 3 Etheryte 2018-02-12 02:12:35 PST
As of version 63.0.3239.132, this issue is still present.
Comment 4 Etheryte 2022-04-09 07:15:16 PDT
The issue is no longer reproducible in version 100.0.4896.75. I haven't kept track in what version it got fixed in specifically.