Scrollbar::~Scrollbar() { if (AXObjectCache::accessibilityEnabled() && axObjectCache()) axObjectCache()->remove(this); stopTimerIfNeeded(); m_theme->unregisterScrollbar(this); }
void AXSpinButton::addChildren() { m_haveChildren = true; AXSpinButtonPart* incrementor = toAXSpinButtonPart(axObjectCache()->getOrCreate(SpinButtonPartRole)); incrementor->setIsIncrementor(true); incrementor->setParent(this); m_children.append(incrementor); AXSpinButtonPart* decrementor = toAXSpinButtonPart(axObjectCache()->getOrCreate(SpinButtonPartRole)); decrementor->setIsIncrementor(false); decrementor->setParent(this); m_children.append(decrementor); }
void AccessibilitySpinButton::addChildren() { m_haveChildren = true; auto& incrementor = downcast<AccessibilitySpinButtonPart>(*axObjectCache()->getOrCreate(SpinButtonPartRole)); incrementor.setIsIncrementor(true); incrementor.setParent(this); m_children.append(&incrementor); auto& decrementor = downcast<AccessibilitySpinButtonPart>(*axObjectCache()->getOrCreate(SpinButtonPartRole)); decrementor.setIsIncrementor(false); decrementor.setParent(this); m_children.append(&decrementor); }
void AccessibilityMathMLElement::mathPostscripts(AccessibilityMathMultiscriptPairs& postscripts) { if (!isMathMultiscript() || !node()) return; // In Multiscripts, the post-script elements start after the first element (which is the base) // and continue until a <mprescripts> tag is found std::pair<AccessibilityObject*, AccessibilityObject*> postscriptPair; bool foundBaseElement = false; for (Node* child = node()->firstChild(); child; child = child->nextSibling()) { if (child->hasTagName(MathMLNames::mprescriptsTag)) break; AccessibilityObject* axChild = axObjectCache()->getOrCreate(child); if (axChild && axChild->isMathElement()) { if (!foundBaseElement) foundBaseElement = true; else if (!postscriptPair.first) postscriptPair.first = axChild; else { postscriptPair.second = axChild; postscripts.append(postscriptPair); postscriptPair.first = nullptr; postscriptPair.second = nullptr; } } } // Handle the odd number of post scripts case. if (postscriptPair.first) postscripts.append(postscriptPair); }
void AccessibilityMathMLElement::mathPrescripts(AccessibilityMathMultiscriptPairs& prescripts) { if (!isMathMultiscript() || !node()) return; bool foundPrescript = false; std::pair<AccessibilityObject*, AccessibilityObject*> prescriptPair; for (Node* child = node()->firstChild(); child; child = child->nextSibling()) { if (foundPrescript) { AccessibilityObject* axChild = axObjectCache()->getOrCreate(child); if (axChild && axChild->isMathElement()) { if (!prescriptPair.first) prescriptPair.first = axChild; else { prescriptPair.second = axChild; prescripts.append(prescriptPair); prescriptPair.first = nullptr; prescriptPair.second = nullptr; } } } else if (child->hasTagName(MathMLNames::mprescriptsTag)) foundPrescript = true; } // Handle the odd number of pre scripts case. if (prescriptPair.first) prescripts.append(prescriptPair); }
AXScrollbar* AXScrollView::addChildScrollbar(Scrollbar* scrollbar) { if (!scrollbar) return 0; AXScrollbar* scrollBarObject = toAXScrollbar(axObjectCache()->getOrCreate(scrollbar)); scrollBarObject->setParent(this); m_children.append(scrollBarObject); return scrollBarObject; }
AccessibilityScrollbar* AccessibilityScrollView::addChildScrollbar(Scrollbar* scrollbar) { if (!scrollbar) return 0; AccessibilityScrollbar* scrollBarObject = static_cast<AccessibilityScrollbar*>(axObjectCache()->getOrCreate(scrollbar)); scrollBarObject->setParent(this); m_children.append(scrollBarObject); return scrollBarObject; }
AccessibilityObject* AccessibilityScrollView::parentObject() const { if (!m_scrollView->isFrameView()) return 0; HTMLFrameOwnerElement* owner = static_cast<FrameView*>(m_scrollView.get())->frame()->ownerElement(); if (owner && owner->renderPart()) return axObjectCache()->getOrCreate(owner->renderPart()->parent()); return 0; }
AccessibilityObject* AccessibilityScrollView::webAreaObject() const { if (!m_scrollView->isFrameView()) return 0; Document* doc = static_cast<FrameView*>(m_scrollView.get())->frame()->document(); if (!doc || !doc->renderer()) return 0; return axObjectCache()->getOrCreate(doc->renderer()); }
AXObject* AXScrollView::parentObjectIfExists() const { if (!m_scrollView || !m_scrollView->isFrameView()) return 0; HTMLFrameOwnerElement* owner = toFrameView(m_scrollView)->frame().ownerElement(); if (owner && owner->renderer()) return axObjectCache()->get(owner); return 0; }
AXObject* AXScrollView::webAreaObject() const { if (!m_scrollView || !m_scrollView->isFrameView()) return 0; Document* doc = toFrameView(m_scrollView)->frame().document(); if (!doc || !doc->renderer()) return 0; return axObjectCache()->getOrCreate(doc); }
AXObject* AXScrollView::parentObject() const { if (!m_scrollView || !m_scrollView->isFrameView()) return 0; // FIXME: Broken for OOPI. HTMLFrameOwnerElement* owner = toFrameView(m_scrollView)->frame().deprecatedLocalOwner(); if (owner && owner->renderer()) return axObjectCache()->getOrCreate(owner); return 0; }
AccessibilityScrollbar* AccessibilityScrollView::addChildScrollbar(Scrollbar* scrollbar) { if (!scrollbar) return nullptr; AXObjectCache* cache = axObjectCache(); if (!cache) return nullptr; AccessibilityScrollbar* scrollBarObject = toAccessibilityScrollbar(cache->getOrCreate(scrollbar)); scrollBarObject->setParent(this); m_children.append(scrollBarObject); return scrollBarObject; }
AccessibilityObject* AccessibilityScrollView::webAreaObject() const { if (!is<FrameView>(m_scrollView)) return nullptr; Document* document = downcast<FrameView>(*m_scrollView).frame().document(); if (!document || !document->hasLivingRenderTree()) return nullptr; if (AXObjectCache* cache = axObjectCache()) return cache->getOrCreate(document); return nullptr; }
AccessibilityScrollbar* AccessibilityScrollView::addChildScrollbar(Scrollbar* scrollbar) { if (!scrollbar) return nullptr; AXObjectCache* cache = axObjectCache(); if (!cache) return nullptr; auto& scrollBarObject = downcast<AccessibilityScrollbar>(*cache->getOrCreate(scrollbar)); scrollBarObject.setParent(this); m_children.append(&scrollBarObject); return &scrollBarObject; }
AccessibilityObject* AccessibilityScrollView::webAreaObject() const { if (!m_scrollView || !m_scrollView->isFrameView()) return nullptr; Document* doc = toFrameView(m_scrollView)->frame().document(); if (!doc || !doc->hasLivingRenderTree()) return nullptr; if (AXObjectCache* cache = axObjectCache()) return cache->getOrCreate(doc); return nullptr; }
AccessibilityObject* AccessibilityScrollView::parentObject() const { if (!is<FrameView>(m_scrollView)) return nullptr; AXObjectCache* cache = axObjectCache(); if (!cache) return nullptr; HTMLFrameOwnerElement* owner = downcast<FrameView>(*m_scrollView).frame().ownerElement(); if (owner && owner->renderer()) return cache->getOrCreate(owner); return nullptr; }
AccessibilityObject* AccessibilityScrollView::parentObjectIfExists() const { if (!m_scrollView || !m_scrollView->isFrameView()) return nullptr; AXObjectCache* cache = axObjectCache(); if (!cache) return nullptr; HTMLFrameOwnerElement* owner = toFrameView(m_scrollView)->frame().ownerElement(); if (owner && owner->renderer()) return cache->get(owner); return nullptr; }
AccessibilityObject* AccessibilitySVGElement::targetForUseElement() const { if (!is<SVGUseElement>(element())) return nullptr; SVGUseElement& use = downcast<SVGUseElement>(*element()); String href = use.href(); if (href.isEmpty()) href = getAttribute(HTMLNames::hrefAttr); auto target = SVGURIReference::targetElementFromIRIString(href, use.treeScope()); if (!target.element) return nullptr; return axObjectCache()->getOrCreate(target.element.get()); }
void AccessibilitySpinButton::addChildren() { m_haveChildren = true; AccessibilitySpinButtonPart* incrementor = static_cast<AccessibilitySpinButtonPart*>(axObjectCache()->getOrCreate(SpinButtonPartRole)); incrementor->setIsIncrementor(true); incrementor->setParent(this); m_children.append(incrementor); AccessibilitySpinButtonPart* decrementor = static_cast<AccessibilitySpinButtonPart*>(axObjectCache()->getOrCreate(SpinButtonPartRole)); decrementor->setIsIncrementor(false); decrementor->setParent(this); m_children.append(decrementor); }