Пример #1
0
NS_IMETHODIMP
nsXULTabpanelAccessible::GetRelationByType(PRUint32 aRelationType,
                                           nsIAccessibleRelation **aRelation)
{
  nsresult rv = nsAccessibleWrap::GetRelationByType(aRelationType, aRelation);
  NS_ENSURE_SUCCESS(rv, rv);

  if (aRelationType != nsIAccessibleRelation::RELATION_LABELLED_BY)
    return NS_OK;

  // Expose 'LABELLED_BY' relation on tabpanel accessible for tab accessible.
  nsCOMPtr<nsIDOMXULRelatedElement> tabpanelsElm =
    do_QueryInterface(mContent->GetParent());
  if (!tabpanelsElm)
    return NS_OK;

  nsCOMPtr<nsIDOMNode> DOMNode(GetDOMNode());
  nsCOMPtr<nsIDOMNode> tabNode;
  tabpanelsElm->GetRelatedElement(DOMNode, getter_AddRefs(tabNode));
  if (!tabNode)
    return NS_OK;

  nsCOMPtr<nsIContent> tabContent(do_QueryInterface(tabNode));
  return nsRelUtils::AddTargetFromContent(aRelationType, aRelation,
                                          tabContent);
}
void nsAccEvent::CaptureIsFromUserInput(PRBool aIsAsynch)
{
  nsCOMPtr<nsIDOMNode> eventNode;
  GetDOMNode(getter_AddRefs(eventNode));
  if (!eventNode) {
    NS_NOTREACHED("There should always be a DOM node for an event");
    return;
  }

  if (!aIsAsynch) {
    PrepareForEvent(eventNode);
    mIsFromUserInput = gLastEventFromUserInput;
  }
  // For asynch, cannot calculate if from user input.
  // Don't reset global last input state here, do it
  // at the end of FlushPendingEvents()

  mIsFromUserInput = gLastEventFromUserInput;
}