Hi Steve/Stefan/layout-dev!
Consider this testcase:
http://plexode.com/eval3/#s=aekVQXANJVQMbAx1yAXgePQN5GwFHTUZZHJofPU+mAQGVl5kDn6EbT1BPRhwBeg5URk1Hna9ZuVVCU1W2hJ0UUVkBhwFDTVa1pKipqpaYmnydQlZVULaCnRMRyqMDpU/V1Tns7TnUqR0Qcujx8+jy9ANeAA==
The blue border does not include the scrollbar, because the height of
this container does not get updated once we relayout the overflow:auto
layout object.
(It fixes itself if you trigger any layout for the box, e.g. if you
change the width:20px to 30px in devtools)
This is because of a combination of two things:
- For any descendants of a flexbox, we delay the overflow:auto
relayout until later:
https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/Source/core/layout/LayoutBlock.cpp&l=830
https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp&rcl=1456332062&l=285
- Once we *do* the delayed layouts, we only layout the o:auto object *itself*:
https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.cpp&rcl=1456332062&l=688
That code is broken because, as the testcase illustrates, when we
add/remove scrollbars (=the only case where this code runs), we
usually have to relayout the ancestor chain.
As far as I can tell, this scroll update delaying is inherently broken
because of this issue, ever since it was checked in. However, it is
also an important performance optimization (as per szager's
investigations).
So, uh... any suggestions for how to fix this? I haven't thought of a
good solution yet.
-Christian