Bug 251000 - REGRESSION (255063@main): visibility:visible child of visibility:hidden button remains invisible
Summary: REGRESSION (255063@main): visibility:visible child of visibility:hidden butto...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: Safari Technology Preview
Hardware: Mac (Apple Silicon) macOS 13
: P2 Major
Assignee: zalan
URL: https://jumpy-exciting-weeder.glitch.me/
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-01-23 01:51 PST by account+webkit-bugzilla@boermans.name
Modified: 2023-01-24 13:02 PST (History)
7 users (show)

See Also:


Attachments
Patch (3.33 KB, patch)
2023-01-23 15:39 PST, zalan
no flags Details | Formatted Diff | Diff
Patch (4.59 KB, patch)
2023-01-23 19:01 PST, zalan
no flags Details | Formatted Diff | Diff
Patch (4.63 KB, patch)
2023-01-24 07:20 PST, zalan
no flags Details | Formatted Diff | Diff
Patch (4.65 KB, patch)
2023-01-24 11:09 PST, zalan
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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].