Bug 251000

Summary: REGRESSION (255063@main): visibility:visible child of visibility:hidden button remains invisible
Product: WebKit Reporter: account+webkit-bugzilla <account+webkit-bugzilla>
Component: Layout and RenderingAssignee: zalan <zalan>
Status: RESOLVED FIXED    
Severity: Major CC: bfulgham, darin, koivisto, ntim, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: Safari Technology Preview   
Hardware: Mac (Apple Silicon)   
OS: macOS 13   
URL: https://jumpy-exciting-weeder.glitch.me/
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch none

Description account+webkit-bugzilla@boermans.name 2023-01-23 01:51:49 PST
When `visibility:hidden;` is applied to an element, I expect visibility of child elements with `visibility:visible` to be restored.

In Release 161 (Safari 16.4, WebKit 18615.1.17.6) this does not work as expected when the hidden parent element is a `<button>`, e.g.:

    <button style="visibility: hidden">
      <b style="visibility: visible">Remains hidden</b>
    </button>

Test page: 
https://jumpy-exciting-weeder.glitch.me/

Practical use case for this pattern: 
https://www.scottohara.me/blog/2022/11/07/responsive-accessibility.html
Comment 1 Radar WebKit Bug Importer 2023-01-23 11:26:45 PST
<rdar://problem/104565584>
Comment 2 zalan 2023-01-23 15:39:13 PST
Created attachment 464615 [details]
Patch
Comment 3 zalan 2023-01-23 15:41:29 PST
(In reply to account+webkit-bugzilla@boermans.name from comment #0)
> When `visibility:hidden;` is applied to an element, I expect visibility of
> child elements with `visibility:visible` to be restored.
> 
> In Release 161 (Safari 16.4, WebKit 18615.1.17.6) this does not work as
> expected when the hidden parent element is a `<button>`, e.g.:
> 
>     <button style="visibility: hidden">
>       <b style="visibility: visible">Remains hidden</b>
>     </button>
> 
> Test page: 
> https://jumpy-exciting-weeder.glitch.me/
> 
> Practical use case for this pattern: 
> https://www.scottohara.me/blog/2022/11/07/responsive-accessibility.html
Thank you for the detailed bug report and test reduction!
Comment 4 zalan 2023-01-23 19:01:24 PST
Created attachment 464623 [details]
Patch
Comment 5 zalan 2023-01-24 07:20:10 PST
Created attachment 464632 [details]
Patch
Comment 6 Darin Adler 2023-01-24 08:58:18 PST
Comment on attachment 464623 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=464623&action=review

> Source/WebCore/layout/integration/inline/LayoutIntegrationInlineContentPainter.cpp:71
> +        // Fully truncated boxes are visually empty and they down show their descendants either (unlike visibility property). 

Typo here: "down" instead of "don't".
Comment 7 zalan 2023-01-24 11:09:13 PST
Created attachment 464634 [details]
Patch
Comment 8 EWS 2023-01-24 13:02:10 PST
Committed 259306@main (7a1613fa8b15): <https://commits.webkit.org/259306@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 464634 [details].