[LayoutNG] Force legacy layout on the entire subtree when editable.
When we decide to switch over to legacy layout for a block formatting context (and the entire subtree) because there's something editable, we used to only set ForceLegacyLayout on those nodes that create layout objects, but that isn't enough. There may be descendants of box-less nodes that may create layout objects later on, and, since ForceLegacyLayout is an inherited "property", we need to set it on all potential parent nodes. Otherwise we risk inserting NG objects that participate in a legacy block formatting context, which isn't allowed [1]. This matters when we have display:contents (which is very common situation for shadow DOM slot elements, for instance). Checking with the layout parent's style whether to force legacy layout or not fixes the problem. [1] https://chromium-review.googlesource.com/c/chromium/src/+/1127027 enforces this. Bug: 863040 Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_layout_ng Change-Id: I6133c20493017b4648b153f2c7558c76589c3d89 Reviewed-on: https://chromium-review.googlesource.com/1136445Reviewed-by:Yoshifumi Inoue <yosin@chromium.org> Reviewed-by:
Emil A Eklund <eae@chromium.org> Reviewed-by:
Rune Lillesveen <futhark@chromium.org> Commit-Queue: Morten Stenshorne <mstensho@chromium.org> Cr-Commit-Position: refs/heads/master@{#579360}
Showing
Please register or sign in to comment