Bug 1789255: Anonymous children of elements with content-visibility should not be...
commit631f1807edfc7a156b9cedf50c5c16a39236aa19
authorMartin Robinson <mrobinson@igalia.com>
Thu, 15 Sep 2022 17:56:42 +0000 (15 17:56 +0000)
committerMartin Robinson <mrobinson@igalia.com>
Thu, 15 Sep 2022 17:56:42 +0000 (15 17:56 +0000)
treeeb8ae5677525a696c2d3c4d825991dd89d3d223d
parent99644a51e5ff60d790e1656a3e7fe9976677e4b3
Bug 1789255: Anonymous children of elements with content-visibility should not be skipped for layout r=emilio

Some anonymous children are important for properly sizing their parents
even when those parents hide content with `content-visibility`. This is
shown by regressions in the proper layout of some form elements with
`content-visibility`.

This change introduces a more conservative approach for avoiding layout
of hidden content. Instead of leaving all children dirty during reflow,
reflow anonymous frames (and nsComboboxDisplayFrame, a specialized kind
of anonymous frame). This change means that frames may only lay out some
of their children, so it must introduce some more changes to assumptions
during line layout.

In addition, this change renames `content-visibility` related methods in
nsIFrame in order to make it more obvious what they do.

Differential Revision: https://phabricator.services.mozilla.com/D157306
18 files changed:
dom/base/DOMIntersectionObserver.cpp
dom/base/Element.cpp
dom/base/nsRange.cpp
layout/base/PresShell.cpp
layout/generic/nsBlockFrame.cpp
layout/generic/nsFlexContainerFrame.cpp
layout/generic/nsGridContainerFrame.cpp
layout/generic/nsHTMLCanvasFrame.cpp
layout/generic/nsIFrame.cpp
layout/generic/nsIFrame.h
layout/generic/nsImageFrame.cpp
layout/generic/nsSubDocumentFrame.cpp
layout/generic/nsVideoFrame.cpp
layout/style/nsStyleStruct.cpp
testing/web-platform/meta/css/css-sizing/contain-intrinsic-size/auto-007.html.ini [deleted file]
testing/web-platform/tests/css/css-contain/content-visibility/content-visibility-fieldset-size-ref.html [new file with mode: 0644]
testing/web-platform/tests/css/css-contain/content-visibility/content-visibility-fieldset-size.html [new file with mode: 0644]
toolkit/components/find/nsFind.cpp