⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 295307 in webkit


Ignore:
Timestamp:
Jun 6, 2022, 5:35:49 PM (4 years ago)
Author:
Alan Coon
Message:

Cherry-pick 077f4d227924. rdar://problem/94034984

AX: inert attribute doesn't cause display:contents element to be ignored
​https://bugs.webkit.org/show_bug.cgi?id=241022

Reviewed by Chris Fleizach.

Prior to this patch, the inert attribute didn't cause node-only objects
(like those with display:contents) to be ignored. This was because
AccessibilityObject::defaultObjectInclusion only checked effectiveInert
for elements with renderers, even though you only need an element to
have style (not a renderer).

This patch fixes this by adding a new AccessibilityObject::style()
method which uses AccessibilityObject::element() to get
Element::computedStyle() and checking effectiveInert on that, which
works for both renderer and renderer-less objects.

  • LayoutTests/accessibility/node-only-inert-object-expected.txt: Added.
  • LayoutTests/accessibility/node-only-inert-object.html: Added.
  • LayoutTests/platform/ios/TestExpectations: Enable new test.
  • LayoutTests/platform/mac-wk1/TestExpectations: Skip new test.
  • Source/WebCore/accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::style const): Added. (WebCore::AccessibilityObject::defaultObjectInclusion const):
  • Source/WebCore/accessibility/AccessibilityObject.h:

Canonical link: ​https://commits.webkit.org/251185@main
git-svn-id: ​https://svn.webkit.org/repository/webkit/trunk@295090 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Location:
branches/safari-613-branch
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-613-branch/LayoutTests/platform/ios/TestExpectations

    r293471 r295307  
    20942094fast/dom/linkify-phone-numbers.html [ Pass ]
    20952095
     2096accessibility/node-only-inert-object.html [ Pass ]
    20962097accessibility/video-element-url-attribute.html [ Pass ]
    20972098accessibility/visible-character-range.html [ Pass ]
  • branches/safari-613-branch/LayoutTests/platform/mac-wk1/TestExpectations

    r293375 r295307  
    606606editing/spelling/spelling-unified-emulation.html [ Failure ]
    607607
     608# The inert attribute isn't making objects inaccessible on WK1.
     609accessibility/node-only-inert-object.html [ Failure ]
     610
    608611# Skip due to lack of DumpRenderTree `AccessibilityUIElement::stringDescriptionOfAttributeValue` implementation.
    609612accessibility/visible-character-range.html [ Skip ]
  • branches/safari-613-branch/LayoutTests/platform/win/TestExpectations

    r294848 r295307  
    273273# TODO Accept header is handled by the browser
    274274http/tests/misc/image-checks-for-accept.html [ Skip ]
     275
     276# Failing since added in https://bugs.webkit.org/show_bug.cgi?id=241022.
     277accessibility/node-only-inert-object.html [ Failure ]
    275278
    276279# Need to implement AccessibilityUIElement::clearSelectedChildren()
  • branches/safari-613-branch/Source/WebCore/accessibility/AccessibilityObject.cpp

    r294848 r295307  
    26392639    return nullptr;
    26402640}
    2641    
     2641
     2642const RenderStyle* AccessibilityObject::style() const
     2643{
     2644    if (auto* element = this->element())
     2645        return element->computedStyle();
     2646    return nullptr;
     2647}
     2648
    26422649bool AccessibilityObject::isValueAutofillAvailable() const
    26432650{
    … …  
    35473554        return AccessibilityObjectInclusion::IgnoreObject;
    35483555
    3549     if (renderer() && renderer()->style().effectiveInert())
     3556    auto* style = this->style();
     3557    if (style && style->effectiveInert())
    35503558        return AccessibilityObjectInclusion::IgnoreObject;
    35513559
  • branches/safari-613-branch/Source/WebCore/accessibility/AccessibilityObject.h

    r293471 r295307  
    274274    Node* node() const override { return nullptr; }
    275275    RenderObject* renderer() const override { return nullptr; }
     276    const RenderStyle* style() const;
     277
    276278    // Note: computeAccessibilityIsIgnored does not consider whether an object is ignored due to presence of modals.
    277279    // Use accessibilityIsIgnored as the word of law when determining if an object is ignored.
Note: See TracChangeset for help on using the changeset viewer.