Set up inline continuations correctly when not inserting a new child.
LayoutInline::ChildBecameNonInline() is called when a child of an inline becomes in-flow block-level (e.g. when its position changes from absolute to static) and we need to set up a continuation chain because of this. Part of this operation is to wrap the in-flow block-level child inside a new anonymous containing block. AddChildIgnoringContinuation(), which is what we call when inserting new children, did a few nice things to such anonymous containing blocks, which ChildBecameNonInline() didn't do, most crucially, setting the position of the anonymous containing block to relative if the inline is relatively positioned (to contain absolutely positioned descendants). So if the continuation was set up as a reaction to something becoming block-level, rather than being set up as part of inserting new children, the anonymous containing block of block-level children of the inline didn't get position:relative, which made any absolutely positioned children escape its relatively positioned inline parent, and find a containing block further up (the viewport, in the included testcase). To fix this, break out the code that sets up such an anonymous block into a separate method, and have ChildBecameNonInline() call it. Bug: 732397 Change-Id: I06b120c3173403ba6db3b93019e95a66575ba0e1 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1833581Reviewed-by:Emil A Eklund <eae@chromium.org> Reviewed-by:
Aleks Totic <atotic@chromium.org> Commit-Queue: Morten Stenshorne <mstensho@chromium.org> Cr-Commit-Position: refs/heads/master@{#701646}
Showing
Please register or sign in to comment