void AXObjectCacheImpl::handleScrollPositionChanged(FrameView* frameView) { // Prefer to fire the scroll position changed event on the frame view's child web area, if possible. AXObject* targetAXObject = getOrCreate(frameView); if (targetAXObject && !targetAXObject->children().isEmpty()) targetAXObject = targetAXObject->children()[0].get(); postPlatformNotification(targetAXObject, AXScrollPositionChanged); }
void AXARIAGridCell::rowIndexRange(pair<unsigned, unsigned>& rowRange) { AXObject* parent = parentObjectUnignored(); if (!parent) return; if (parent->isTableRow()) { // We already got a table row, use its API. rowRange.first = toAXTableRow(parent)->rowIndex(); } else if (parent->isAXTable()) { // We reached the parent table, so we need to inspect its // children to determine the row index for the cell in it. unsigned columnCount = toAXTable(parent)->columnCount(); if (!columnCount) return; AccessibilityChildrenVector siblings = parent->children(); unsigned childrenSize = siblings.size(); for (unsigned k = 0; k < childrenSize; ++k) { if (siblings[k].get() == this) { rowRange.first = k / columnCount; break; } } } // as far as I can tell, grid cells cannot span rows rowRange.second = 1; }
AXObject* AXObjectCache::focusedImageMapUIElement(HTMLAreaElement* areaElement) { // Find the corresponding accessibility object for the HTMLAreaElement. This should be // in the list of children for its corresponding image. if (!areaElement) return 0; HTMLImageElement* imageElement = areaElement->imageElement(); if (!imageElement) return 0; AXObject* axRenderImage = areaElement->document().axObjectCache()->getOrCreate(imageElement); if (!axRenderImage) return 0; AXObject::AccessibilityChildrenVector imageChildren = axRenderImage->children(); unsigned count = imageChildren.size(); for (unsigned k = 0; k < count; ++k) { AXObject* child = imageChildren[k].get(); if (!child->isImageMapLink()) continue; if (toAXImageMapLink(child)->areaElement() == areaElement) return child; } return 0; }
void AXARIAGridCell::columnIndexRange(pair<unsigned, unsigned>& columnRange) { AXObject* parent = parentObjectUnignored(); if (!parent) return; if (!parent->isTableRow() && !parent->isAXTable()) return; AccessibilityChildrenVector siblings = parent->children(); unsigned childrenSize = siblings.size(); for (unsigned k = 0; k < childrenSize; ++k) { if (siblings[k].get() == this) { columnRange.first = k; break; } } // as far as I can tell, grid cells cannot span columns columnRange.second = 1; }