<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>185679</bug_id>
          
          <creation_ts>2018-05-16 07:22:56 -0700</creation_ts>
          <short_desc>AX:  Element not exposed to accessibility tree when it is set to display: contents</short_desc>
          <delta_ts>2024-09-24 16:11:40 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Accessibility</component>
          <version>Safari 11</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>BrowserCompat, InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>188643</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Hidde">hidde</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>709922234</cc>
    
    <cc>benoit.rouleau</cc>
    
    <cc>caleb</cc>
    
    <cc>code</cc>
    
    <cc>hey</cc>
    
    <cc>hidde</cc>
    
    <cc>jcraig</cc>
    
    <cc>joss</cc>
    
    <cc>kyle.bavender</cc>
    
    <cc>me</cc>
    
    <cc>me</cc>
    
    <cc>m.goleb+bugzilla</cc>
    
    <cc>miriam</cc>
    
    <cc>nate.whittaker</cc>
    
    <cc>olestr</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>stewartm</cc>
    
    <cc>tobi</cc>
    
    <cc>twilco.o</cc>
    
    <cc>tyler_w</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>zcorpan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1424312</commentid>
    <comment_count>0</comment_count>
    <who name="Hidde">hidde</who>
    <bug_when>2018-05-16 07:22:56 -0700</bug_when>
    <thetext>CSS Grid works on direct children of the grid container. To be able to place ‘grand children’ onto a CSS Grid, one can set &apos;display: contents&apos; to a grid item. Its children can then be placed on the grid. 

When the  grid item is set to `display: contents` in CSS, its accessible role changes to ‘text leaf’.

Steps to reproduce:

1. Create a grid by setting &apos;display: grid&apos; on a div element
2. Place some HTML in it, and make on of the items a &lt;ul&gt; with a couple of &lt;li&gt; elements
3. Inspect the &lt;ul&gt; item in the accessibility tree and see that it has role=list
4. Set &apos;display: contents&apos; on the UL with CSS

Expected result: UL still has accessible role of &apos;list&apos;. The CSS only affects the layout.

Actual result: UL element now reports &apos;No accessibility information&apos; 

(Codepen example: https://codepen.io/hidde/pen/gzbMeL; blog post with use case: https://hiddedevries.nl/en/blog/2018-04-21-more-accessible-markup-with-display-contents)

The bug also occurs in Blink (https://bugs.chromium.org/p/chromium/issues/detail?id=835455); it has recently been fixed in Firefox (https://bugzilla.mozilla.org/show_bug.cgi?id=1455357).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1424313</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2018-05-16 07:23:19 -0700</bug_when>
    <thetext>&lt;rdar://problem/40293047&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1456024</commentid>
    <comment_count>2</comment_count>
    <who name="Simon Pieters (:zcorpan)">zcorpan</who>
    <bug_when>2018-09-02 01:27:01 -0700</bug_when>
    <thetext>https://github.com/web-platform-tests/wpt/pull/12691 also has a test for this for fieldset:

https://github.com/web-platform-tests/wpt/blob/8e12c9149bcc4a2122d5a3a699ea2abc5c90c4e6/html/semantics/forms/the-fieldset-element/accessibility/fieldset-display-contents-manual.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1456026</commentid>
    <comment_count>3</comment_count>
    <who name="Simon Pieters (:zcorpan)">zcorpan</who>
    <bug_when>2018-09-02 01:38:16 -0700</bug_when>
    <thetext>Test for display: contents on the legend (the legend is not used for the fieldset&apos;s accessible name).

https://github.com/web-platform-tests/wpt/blob/8e12c9149bcc4a2122d5a3a699ea2abc5c90c4e6/html/semantics/forms/the-fieldset-element/accessibility/legend-display-contents-manual.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1474134</commentid>
    <comment_count>4</comment_count>
    <who name="James Craig">jcraig</who>
    <bug_when>2018-11-01 09:41:17 -0700</bug_when>
    <thetext>*** Bug 191154 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1474964</commentid>
    <comment_count>5</comment_count>
      <attachid>353831</attachid>
    <who name="James Craig">jcraig</who>
    <bug_when>2018-11-04 23:08:34 -0800</bug_when>
    <thetext>Created attachment 353831
test case</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1742509</commentid>
    <comment_count>6</comment_count>
    <who name="Ole Strøm">olestr</who>
    <bug_when>2021-03-22 15:12:23 -0700</bug_when>
    <thetext>This was just fixed in Chrome / Edge / Blink: https://bugs.chromium.org/p/chromium/issues/detail?id=835455

https://caniuse.com/css-display-contents says it&apos;s fully supported in Safari since 13.1...

I remember thinking this would be so great to have until Subgrid arrives, but I could not use it due to accessibility issues in Chrome and Safari.

While I was developing plain stuff with CSS Grid today, I found myself at a typical problem that would have been solved easily with Subgrid... or &quot;display: contents;&quot;

So I crossed my fingers and checked https://caniuse.com/css-display-contents once again - and woah - it&apos;s now pretty much fully supported!?

It was just fixed in Chrome, but what happened to Safari? Did you guys backport a fix to the older versions, that I vaguely remember had issues with it?

So I checked the linked article again on caniuse, the one with the &quot;severe implementation bug&quot; that linked to the issues in Chrome and Safari, to see if the linked issues there had actually been solved.

But it seems not, unless I&apos;m missing something?

I&apos;m afraid that many people will use it now, as I was about to, causing issues for those in need of this being supported. And, based on a quick search on &quot;accessibility browser usage&quot;, a fair amount of them use Safari - especially on mobile.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1781623</commentid>
    <comment_count>7</comment_count>
    <who name="">hey</who>
    <bug_when>2021-08-03 08:56:43 -0700</bug_when>
    <thetext>Any update on this? Or can I upvote it? Display:contents is also a great feature to combine with CSS grid on tables, but without the accessible roles, it defeats the purpose.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1786077</commentid>
    <comment_count>8</comment_count>
    <who name="">stewartm</who>
    <bug_when>2021-08-20 18:50:54 -0700</bug_when>
    <thetext>I&apos;m also having issues with grid and accessibility related to this issue. Would love to see a fix implemented.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1808031</commentid>
    <comment_count>9</comment_count>
    <who name="Shannon Moeller">me</who>
    <bug_when>2021-10-22 21:17:40 -0700</bug_when>
    <thetext>I would also love to be able to use `display: contents` without negatively impacting accessibility, per the specification: https://drafts.csswg.org/css-display/#valdef-display-contents</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1830749</commentid>
    <comment_count>10</comment_count>
    <who name="">joss</who>
    <bug_when>2022-01-13 15:30:08 -0800</bug_when>
    <thetext>I would also love to be able to use `display: contents` without negatively impacting accessibility.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1851570</commentid>
    <comment_count>11</comment_count>
    <who name="James Craig">jcraig</who>
    <bug_when>2022-03-15 16:27:41 -0700</bug_when>
    <thetext>Work on this is progressing related to bug 237834. Forward duping the WebKit tracker.

*** This bug has been marked as a duplicate of bug 237834 ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1851600</commentid>
    <comment_count>12</comment_count>
    <who name="James Craig">jcraig</who>
    <bug_when>2022-03-15 17:52:35 -0700</bug_when>
    <thetext>Linked bug only covers a portion. Reopening this bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1894859</commentid>
    <comment_count>13</comment_count>
    <who name="Sam Sneddon [:gsnedders]">gsnedders</who>
    <bug_when>2022-08-30 10:06:09 -0700</bug_when>
    <thetext>(In reply to James Craig from comment #12)
&gt; Linked bug only covers a portion. Reopening this bug.

It&apos;s unclear to me what portion wasn&apos;t covered? Per its title, bug 237834 included display: contents elements in the AX tree, which sounds identical to what this bug is about?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1894869</commentid>
    <comment_count>14</comment_count>
    <who name="James Craig">jcraig</who>
    <bug_when>2022-08-30 10:35:43 -0700</bug_when>
    <thetext>Checking. That old comment may be superseded in recent builds.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1894876</commentid>
    <comment_count>15</comment_count>
    <who name="James Craig">jcraig</who>
    <bug_when>2022-08-30 11:05:37 -0700</bug_when>
    <thetext>Tyler confirmed majority is resolved. Other edge cases can be tracked individually. Thanks for following up.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1898330</commentid>
    <comment_count>16</comment_count>
    <who name="Tyler Wilcock">tyler_w</who>
    <bug_when>2022-09-13 13:51:55 -0700</bug_when>
    <thetext>(In reply to James Craig from comment #15)
&gt; Tyler confirmed majority is resolved. Other edge cases can be tracked
&gt; individually. Thanks for following up.

One known issue we are tracking:

https://bugs.webkit.org/show_bug.cgi?id=239479</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>353831</attachid>
            <date>2018-11-04 23:08:34 -0800</date>
            <delta_ts>2018-11-04 23:08:34 -0800</delta_ts>
            <desc>test case</desc>
            <filename>display_contents.html</filename>
            <type>text/html</type>
            <size>678</size>
            <attacher name="James Craig">jcraig</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxodG1sPgo8aGVhZD4KCTx0aXRsZT5kaXNwbGF5OiBjb250ZW50czs8
L3RpdGxlPgo8L2hlYWQ+Cjxib2R5PgoKPHA+Q29udGVudCBiZWZvcmUgbWFpbi48L3A+Cgo8bWFp
bj4KCjxoMT5ObyBzdHlsZSBjaGFuZ2VzPC9oMT4KPGRpdiByb2xlPSJ0b29sYmFyIj4KCTxkaXY+
CgkJPGJ1dHRvbj5Gb288L2J1dHRvbj4KCTwvZGl2Pgo8L2Rpdj4KCjxoMT5kaXNwbGF5OiBjb250
ZW50czsgb24gdGhlIHRvb2xiYXI8L2gxPgo8ZGl2IHJvbGU9InRvb2xiYXIiIHN0eWxlPSJkaXNw
bGF5OiBjb250ZW50czsiPgoJPGRpdj4KCQk8YnV0dG9uPkZvbzwvYnV0dG9uPgoJPC9kaXY+Cjwv
ZGl2PgoKPGgxPmRpc3BsYXk6IGNvbnRlbnRzOyBvbiB0aGUgZ2VuZXJpYyBkaXY8L2gxPgo8ZGl2
IHJvbGU9InRvb2xiYXIiPgoJPGRpdiBzdHlsZT0iZGlzcGxheTogY29udGVudHM7Ij4KCQk8YnV0
dG9uPkZvbzwvYnV0dG9uPgoJPC9kaXY+CjwvZGl2PgoKPGgxPmRpc3BsYXk6IGNvbnRlbnRzOyBv
biB0aGUgYnV0dG9uPC9oMT4KPGRpdiByb2xlPSJ0b29sYmFyIj4KCTxkaXY+CgkJPGJ1dHRvbiBz
dHlsZT0iZGlzcGxheTogY29udGVudHM7Ij5Gb288L2J1dHRvbj4KCTwvZGl2Pgo8L2Rpdj4KCjwv
bWFpbj4KCjxwPkNvbnRlbnQgYWZ0ZXIgbWFpbi48L3A+CgoKPC9ib2R5Pgo8L2h0bWw+
</data>

          </attachment>
      

    </bug>

</bugzilla>