Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: a1d6057613b92c9954bc9948da88485062d9c2b5
      
https://github.com/WebKit/WebKit/commit/a1d6057613b92c9954bc9948da88485062d9c2b5
  Author: Karl Dubost <[email protected]>
  Date:   2026-08-16 (Sun, 16 Aug 2026)

  Changed paths:
    A 
LayoutTests/imported/w3c/web-platform-tests/css/CSS2/visufx/visibility-descendants-002-expected.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/CSS2/visufx/visibility-descendants-002-ref.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/CSS2/visufx/visibility-descendants-002.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/CSS2/visufx/visibility-descendants-003-expected.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/CSS2/visufx/visibility-descendants-003-ref.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/CSS2/visufx/visibility-descendants-003.html
    M Source/WebCore/rendering/RenderElement.cpp
    M Source/WebCore/rendering/RenderLayer.cpp
    M Source/WebCore/rendering/RenderLayer.h

  Log Message:
  -----------
  visibility:visible child stays hidden when it has non-visible overflow
https://bugs.webkit.org/show_bug.cgi?id=321588
rdar://184801325

Reviewed by Simon Fraser.

A visibility:visible child of a visibility:hidden element did not render
when the child had overflow:hidden and the hidden parent was positioned.
Firefox and Chrome render it.

overflow:hidden gives the child a layer, but a statically positioned one
does not paint itself, so the hidden parent is what paints it. Before
painting, the parent checks whether anything under it is visible, and
that check skipped any child with a layer, assuming such a child paints
itself.

Fix by skipping only children that really do paint themselves, which is
the test RenderBlock::paintChild already uses.

The check now reads styles it never read before, so it has to hear when
they change. A renderer owning a layer dirtied only that layer, leaving
a hidden ancestor that paints it with a stale answer. Add
dirtyVisibleContentStatusIncludingAncestors(), which dirties hidden
ancestors up to the first self-painting layer, where the check stops
looking.

Tests: 
imported/w3c/web-platform-tests/css/CSS2/visufx/visibility-descendants-002.html
       
imported/w3c/web-platform-tests/css/CSS2/visufx/visibility-descendants-003.html

* 
LayoutTests/imported/w3c/web-platform-tests/css/CSS2/visufx/visibility-descendants-002-expected.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/CSS2/visufx/visibility-descendants-002-ref.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/CSS2/visufx/visibility-descendants-002.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/CSS2/visufx/visibility-descendants-003-expected.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/CSS2/visufx/visibility-descendants-003-ref.html:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/CSS2/visufx/visibility-descendants-003.html:
 Added.
* Source/WebCore/rendering/RenderElement.cpp:
(WebCore::RenderElement::styleWillChange):
* Source/WebCore/rendering/RenderLayer.cpp:
(WebCore::RenderLayer::computeHasVisibleContent const):
(WebCore::RenderLayer::dirtyVisibleContentStatusIncludingAncestors):
(WebCore::RenderLayer::updateSelfPaintingLayer):
* Source/WebCore/rendering/RenderLayer.h:

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



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to