Changeset 291747 in webkit
- Timestamp:
- Mar 23, 2022, 10:00:33 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 8 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/accessibility/display-contents-search-traversal-expected.txt (added)
-
LayoutTests/accessibility/display-contents-search-traversal.html (added)
-
LayoutTests/platform/glib/TestExpectations (modified) (1 diff)
-
LayoutTests/platform/ios/TestExpectations (modified) (1 diff)
-
LayoutTests/platform/ios/accessibility/display-contents-search-traversal-expected.txt (added)
-
LayoutTests/platform/win/TestExpectations (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/accessibility/AXLogger.cpp (modified) (1 diff)
-
Source/WebCore/accessibility/AccessibilityObject.h (modified) (3 diffs)
-
Source/WebCore/accessibility/AccessibilityRenderObject.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r291746 r291747 1 2022-03-23 Tyler Wilcock <tyler_w@apple.com> 2 3 AccessibilityRenderObject::nextSibling should allow parent differences in the presence of display: contents 4 https://bugs.webkit.org/show_bug.cgi?id=238184 5 6 Reviewed by Andres Gonzalez. 7 8 * accessibility/display-contents-search-traversal-expected.txt: Added. 9 * accessibility/display-contents-search-traversal.html: Added. 10 * platform/glib/TestExpectations: Skip new test. 11 * platform/ios/TestExpectations: Enable new test. 12 * platform/ios/accessibility/display-contents-search-traversal-expected.txt: Added. 13 * platform/win/TestExpectations: Skip new test. 14 1 15 2022-03-23 Patrick Angle <pangle@apple.com> 2 16 -
trunk/LayoutTests/platform/glib/TestExpectations
r291600 r291747 343 343 344 344 # Missing AccessibilityUIElement::uiElementForSearchPredicate implementation. 345 accessibility/display-contents-search-traversal.html [ Skip ] 345 346 accessibility/table-search-traversal.html [ Skip ] 346 347 accessibility/dynamically-changing-iframe-remains-accessible.html [ Skip ] -
trunk/LayoutTests/platform/ios/TestExpectations
r291721 r291747 2115 2115 webkit.org/b/150366 accessibility/aria-table-attributes.html [ Pass ] 2116 2116 2117 accessibility/display-contents-search-traversal.html [ Pass ] 2117 2118 accessibility/table-search-traversal.html [ Pass ] 2118 2119 accessibility/dynamically-changing-iframe-remains-accessible.html [ Pass ] -
trunk/LayoutTests/platform/win/TestExpectations
r291737 r291747 479 479 480 480 # Missing AccessibilityUIElement::uiElementForSearchPredicate implementation. 481 accessibility/display-contents-search-traversal.html [ Skip ] 481 482 accessibility/table-search-traversal.html [ Skip ] 482 483 accessibility/dynamically-changing-iframe-remains-accessible.html [ Skip ] -
trunk/Source/WebCore/ChangeLog
r291744 r291747 1 2022-03-23 Tyler Wilcock <tyler_w@apple.com> 2 3 AccessibilityRenderObject::nextSibling should allow parent differences in the presence of display: contents 4 https://bugs.webkit.org/show_bug.cgi?id=238184 5 6 Reviewed by Andres Gonzalez. 7 8 AccessibilityRenderObject::nextSibling currently has this logic to 9 return nullptr if the computed sibling has a parent different from `this`: 10 11 auto* nextObject = objectCache->getOrCreate(nextSibling); 12 if (nextObject && nextObject->parentObject() != this->parentObject()) 13 return nullptr; 14 15 This is problematic in the presence of display: contents since we expect 16 parent object differences due to the way this property affects the render tree. 17 18 Concretely, this breaks the firstChild(), nextSibling() iteration we do throughout 19 WebKit (e.g. in AccessibilityRenderObject::addChildren), as when we get to an element 20 with display: contents we get a parent mismatch and iteration stops unnecessarily. 21 22 This patch fixes the issue by allowing a parent mismatch when either 23 object has display: contents, as we account for this difference in the 24 appropriate places (e.g. AccessibilityObject::insertChild). 25 26 Test: accessibility/display-contents-search-traversal.html 27 28 * accessibility/AXLogger.cpp: 29 (WebCore::operator<<): 30 Log when an object has display: contents. This property affects the 31 render tree and AX tree, so it's useful to log. 32 * accessibility/AccessibilityObject.h: 33 (WebCore::AccessibilityObject::hasDisplayContents const): Added. 34 * accessibility/AccessibilityRenderObject.cpp: 35 (WebCore::AccessibilityRenderObject::nextSibling const): 36 1 37 2022-03-23 Youenn Fablet <youenn@apple.com> 2 38 -
trunk/Source/WebCore/accessibility/AXLogger.cpp
r288963 r291747 533 533 stream.dumpProperty("outerHTML", objectWithInterestingHTML->outerHTML()); 534 534 535 if (auto* axObject = dynamicDowncast<AccessibilityObject>(&object); axObject && axObject->hasDisplayContents()) 536 stream.dumpProperty("hasDisplayContents", true); 535 537 stream.dumpProperty("address", &object); 536 538 stream.dumpProperty("wrapper", object.wrapper()); -
trunk/Source/WebCore/accessibility/AccessibilityObject.h
r291613 r291747 545 545 bool hasTagName(const QualifiedName&) const override; 546 546 String tagName() const override; 547 bool hasDisplayContents() const; 547 548 548 549 VisiblePositionRange visiblePositionRange() const override { return VisiblePositionRange(); } … … 860 861 861 862 #if ENABLE(ACCESSIBILITY) 863 inline bool AccessibilityObject::hasDisplayContents() const 864 { 865 return is<Element>(node()) && downcast<Element>(node())->hasDisplayContents(); 866 } 867 862 868 inline std::optional<BoundaryPoint> AccessibilityObject::lastBoundaryPointContainedInRect(const Vector<BoundaryPoint>& boundaryPoints, const BoundaryPoint& startBoundaryPoint, const FloatRect& targetRect) const 863 869 { … … 870 876 } 871 877 #else 878 inline bool AccessibilityObject::hasDisplayContents() const { return false; } 872 879 inline std::optional<BoundaryPoint> AccessibilityObject::lastBoundaryPointContainedInRect(const Vector<BoundaryPoint>&, const BoundaryPoint&, const FloatRect&) const { return std::nullopt; } 873 880 inline VisiblePosition AccessibilityObject::previousLineStartPosition(const VisiblePosition& position) const { return { }; } -
trunk/Source/WebCore/accessibility/AccessibilityRenderObject.cpp
r291613 r291747 422 422 return nullptr; 423 423 424 auto* nextObject = objectCache->getOrCreate(nextSibling); 425 auto* nextObjectParent = nextObject ? nextObject->parentObject() : nullptr; 426 auto* thisParent = parentObject(); 424 427 // Make sure next sibling has the same parent. 425 auto* nextObject = objectCache->getOrCreate(nextSibling); 426 if (nextObject && nextObject->parentObject() != this->parentObject()) 427 return nullptr; 428 428 if (nextObjectParent && nextObjectParent != thisParent) { 429 // Unless either object has a parent with display: contents, as display: contents can cause parent differences 430 // that we properly account for elsewhere. 431 if (nextObjectParent->hasDisplayContents() || (thisParent && thisParent->hasDisplayContents())) 432 return nextObject; 433 return nullptr; 434 } 429 435 return nextObject; 430 436 }
Note:
See TracChangeset
for help on using the changeset viewer.