[Webkit-unassigned] [Bug 283645] New: AX: content of <script> elements announced by VoiceOver inside containers with display: contents

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Nov 24 01:27:08 PST 2024


https://bugs.webkit.org/show_bug.cgi?id=283645

            Bug ID: 283645
           Summary: AX: content of <script> elements announced by
                    VoiceOver inside containers with display: contents
           Product: WebKit
           Version: Safari 18
          Hardware: All
                OS: macOS 15
            Status: NEW
          Severity: Major
          Priority: P2
         Component: Accessibility
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: swithinbank at gmail.com
                CC: andresg_22 at apple.com,
                    webkit-bug-importer at group.apple.com

If an HTML<script> is placed inside a container which has the display: contents; CSS rule applied to it, VoiceOver unexpectedly announces the script's content when the page is viewed in Safari. 

For example, imagine  an HTML document with the following contents:

```html
<div class="contents">
  <script>
    // Should not be announced
    console.log("Hello, world");
  </script>
  <p>Should be announced</p>
</div>

<style>
.contents {
  display: contents; 
}
</style>
```

Navigating to this page in Safari using VoiceOver will announce "slash slash should not be announced..." and so forth even though a <script> element is not intended to be exposed in this way. Other browsers correctly avoid announcing the script element.

In Safari, removing the display: contents; rule stops the script from being announced, so it seems to be related to how that rule effects child elements in the accessibility tree.

Related GitHub PR where we encountered this: https://github.com/withastro/starlight/pull/2633

Versions tested (the bug occurs in both cases): 
- macOS 14.6 + Safari 17.6
- macOS 15.1 + Safari 18.1

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20241124/ec1f2faa/attachment.htm>


More information about the webkit-unassigned mailing list