Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 836cb999ce8c37075ae7c05ef485328a4b96e73c
      
https://github.com/WebKit/WebKit/commit/836cb999ce8c37075ae7c05ef485328a4b96e73c
  Author: Vitaly Dyachkov <[email protected]>
  Date:   2024-04-03 (Wed, 03 Apr 2024)

  Changed paths:
    M LayoutTests/platform/gtk/TestExpectations
    M LayoutTests/platform/wk2/TestExpectations
    M Source/WebCore/rendering/RenderDescendantIterator.h
    M Source/WebCore/rendering/RenderElement.cpp
    M Source/WebCore/rendering/RenderIterator.h

  Log Message:
  -----------
  [content-visibility] ASSERTION FAILED: !renderer.needsLayout() causing 
imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-video.html
 to constantly crash
https://bugs.webkit.org/show_bug.cgi?id=262157

Reviewed by Darin Adler.

Normally, when we do `RenderElement::layout()`, we first lay out its
children and then clear the `needsLayout` flag. When assertions are
enabled, in `RenderObject::clearNeedsLayout()` we check that
block-positioned children don't need layout.

But if the element is skipped for layout, we call
`RenderElement::clearNeedsLayoutForSkippedContent()` instead.

As the first step, this method calls `RenderObject::clearNeedsLayout()`
on every descendent. Note that it won't lay out the descendant's
children but will still check that the block-positioned children of the
descendent don't need layout, which might be false and cause the
assertion to fail.

This patch implements `descendantsOfTypePostOrder<T>()` function which
is then used to guarantee that `RenderElement`'s needs-layout flag is
always cleared after its children.

* LayoutTests/platform/gtk/TestExpectations:
* LayoutTests/platform/wk2/TestExpectations:
* Source/WebCore/rendering/RenderDescendantIterator.h:
(WebCore::RenderDescendantPostOrderIterator<T>::RenderDescendantPostOrderIterator):
(WebCore::RenderDescendantPostOrderIterator<T>::operator):
(WebCore::RenderDescendantPostOrderConstIterator<T>::RenderDescendantPostOrderConstIterator):
(WebCore::RenderDescendantPostOrderConstIterator<T>::operator):
(WebCore::RenderDescendantPostOrderIteratorAdapter<T>::RenderDescendantPostOrderIteratorAdapter):
(WebCore::RenderDescendantPostOrderIteratorAdapter<T>::begin):
(WebCore::RenderDescendantPostOrderIteratorAdapter<T>::end):
(WebCore::RenderDescendantPostOrderIteratorAdapter<T>::at):
(WebCore::RenderDescendantPostOrderConstIteratorAdapter<T>::RenderDescendantPostOrderConstIteratorAdapter):
(WebCore::RenderDescendantPostOrderConstIteratorAdapter<T>::begin const):
(WebCore::RenderDescendantPostOrderConstIteratorAdapter<T>::end const):
(WebCore::RenderDescendantPostOrderConstIteratorAdapter<T>::at const):
(WebCore::descendantsOfTypePostOrder):
* Source/WebCore/rendering/RenderElement.cpp:
(WebCore::RenderElement::clearNeedsLayoutForSkippedContent):
* Source/WebCore/rendering/RenderIterator.h:
(WebCore::RenderPostOrderIterator::operator bool const):
(WebCore::RenderPostOrderConstIterator::operator bool const):
(WebCore::RenderObjectPostOrderTraversal::next):
(WebCore::RenderPostOrderTraversal::firstWithin):
(WebCore::RenderPostOrderTraversal::next):
(WebCore::RenderPostOrderIterator<T>::RenderPostOrderIterator):
(WebCore::RenderPostOrderIterator<T>::traverseNext):
(WebCore::RenderPostOrderIterator<T>::operator):
(WebCore::= const):
(WebCore::RenderPostOrderConstIterator<T>::RenderPostOrderConstIterator):
(WebCore::RenderPostOrderConstIterator<T>::traverseNext):
(WebCore::RenderPostOrderConstIterator<T>::operator const):
(WebCore:: const):

Canonical link: https://commits.webkit.org/277019@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to