Changeset 268206 in webkit
- Timestamp:
- Oct 8, 2020 1:20:09 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/accessibility/aria-modal-expected.txt
r268117 r268206 23 23 Dialog is displaying with opacity 1 24 24 PASS backgroundAccessible() is false 25 Dialog is not displaying with parent opacity 0 26 PASS backgroundAccessible() is true 27 Dialog is displaying with parent opacity .5 28 PASS backgroundAccessible() is false 25 29 Dialog is removed from DOM 26 30 PASS backgroundAccessible() is true … … 31 35 32 36 Display a dialog 37 38 -
trunk/LayoutTests/accessibility/aria-modal.html
r268117 r268206 13 13 </div> 14 14 15 <div role="dialog" aria-modal="true" aria-labelledby="myDialog" id="box" class="box-hidden" tabindex="-1"> 16 <h3 id="myDialog">Just an example.</h3> 17 <button id="ok" onclick="toggleDialog('hide');" class="close-button">OK</button> 18 <button onclick="toggleDialog('hide');" class="close-button">Cancel</button> 15 <div id="dialogParent" role="group"> 16 <div role="dialog" aria-modal="true" aria-labelledby="myDialog" id="box" class="box-hidden" tabindex="-1"> 17 <h3 id="myDialog">Just an example.</h3> 18 <button id="ok" onclick="toggleDialog('hide');" class="close-button">OK</button> 19 <button onclick="toggleDialog('hide');" class="close-button">Cancel</button> 20 </div> 19 21 </div> 20 22 … … 98 100 shouldBeFalse("backgroundAccessible()"); 99 101 102 // Set opacity of the dialog parent to 0 which should make the dialog invisible since opacity multiply. 103 document.getElementById("dialogParent").style.opacity = 0; 104 await waitFor(() => { 105 return backgroundAccessible(); 106 }); 107 debug("Dialog is not displaying with parent opacity 0"); 108 shouldBeTrue("backgroundAccessible()"); 109 110 // Set opacity of the dialog parent to .5 which should make the dialog visible again. 111 document.getElementById("dialogParent").style.opacity = .5; 112 await waitFor(() => { 113 return !backgroundAccessible(); 114 }); 115 debug("Dialog is displaying with parent opacity .5"); 116 shouldBeFalse("backgroundAccessible()"); 117 100 118 // Test modal dialog is removed from DOM tree. 101 119 var dialog = document.getElementById("box"); … … 129 147 } else { 130 148 dialog.style.display = 'none'; 131 //dialog.style.opacity = 0;132 149 dialog.setAttribute("aria-modal", "false"); 133 150 } -
trunk/Source/WebCore/ChangeLog
r268202 r268206 1 2020-10-08 Andres Gonzalez <andresg_22@apple.com> 2 3 Presidential Executive Order pages not accessible with Safari. 4 https://bugs.webkit.org/show_bug.cgi?id=217415 5 <rdar://problem/69922416> 6 7 Reviewed by Chris Fleizach and Simon Fraser. 8 9 Follow up to the previous change for this bug per Simon Fraser's comment. 10 Check not only the visibility and opacity of the object in question but 11 also of its ancestors. 12 Expanded the test accessibility/aria-modal.html to include the case 13 where the visibility of the modal dialog is determined by the opacity of 14 its parent object. 15 16 * accessibility/AXObjectCache.cpp: 17 (WebCore::AXObjectCache::isNodeVisible const): 18 1 19 2020-10-08 Zalan Bujtas <zalan@apple.com> 2 20 -
trunk/Source/WebCore/accessibility/AXObjectCache.cpp
r268117 r268206 89 89 #include "Range.h" 90 90 #include "RenderAttachment.h" 91 #include "RenderLayer.h" 91 92 #include "RenderLineBreak.h" 92 93 #include "RenderListBox.h" … … 301 302 return false; 302 303 303 const RenderStyle& style = renderer->style(); 304 if (style.display() == DisplayType::None 305 || style.visibility() != Visibility::Visible 306 || !style.opacity()) 304 const auto& style = renderer->style(); 305 if (style.display() == DisplayType::None) 307 306 return false; 307 308 auto* renderLayer = renderer->enclosingLayer(); 309 if (style.visibility() != Visibility::Visible && renderLayer && !renderLayer->hasVisibleContent()) 310 return false; 311 312 // Check whether this object or any of its ancestors has opacity 0. 313 // The resulting opacity of a RenderObject is computed as the multiplication 314 // of its opacity times the opacities of its ancestors. 315 for (auto* renderObject = renderer; renderObject; renderObject = renderObject->parent()) { 316 if (!renderObject->style().opacity()) 317 return false; 318 } 308 319 309 320 // We also need to consider aria hidden status.
Note: See TracChangeset
for help on using the changeset viewer.