OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2008, 2009, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008, 2009, 2011 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
569 if (getNode()->isInert()) { | 569 if (getNode()->isInert()) { |
570 if (ignoredReasons) { | 570 if (ignoredReasons) { |
571 HTMLDialogElement* dialog = getActiveDialogElement(getNode()); | 571 HTMLDialogElement* dialog = getActiveDialogElement(getNode()); |
572 if (dialog) { | 572 if (dialog) { |
573 AXObject* dialogObject = axObjectCache().getOrCreate(dialog) ; | 573 AXObject* dialogObject = axObjectCache().getOrCreate(dialog) ; |
574 if (dialogObject) | 574 if (dialogObject) |
575 ignoredReasons->append(IgnoredReason(AXActiveModalDialog , dialogObject)); | 575 ignoredReasons->append(IgnoredReason(AXActiveModalDialog , dialogObject)); |
576 else | 576 else |
577 ignoredReasons->append(IgnoredReason(AXInert)); | 577 ignoredReasons->append(IgnoredReason(AXInert)); |
578 } else { | 578 } else { |
579 // TODO(aboxhall): handle inert attribute if it eventuates | 579 const AXObject* inertRootEl = inertRoot(); |
580 ignoredReasons->append(IgnoredReason(AXInert)); | 580 if (inertRootEl == this) |
581 ignoredReasons->append(IgnoredReason(AXInert)); | |
582 else | |
583 ignoredReasons->append(IgnoredReason(AXInertRoot, inertR ootEl)); | |
581 } | 584 } |
582 } | 585 } |
583 return true; | 586 return true; |
584 } | 587 } |
585 } else { | 588 } else { |
586 AXObject* parent = parentObject(); | 589 AXObject* parent = parentObject(); |
587 if (parent && parent->isInertOrAriaHidden()) { | 590 if (parent && parent->isInertOrAriaHidden()) { |
588 if (ignoredReasons) | 591 if (ignoredReasons) |
589 parent->computeIsInertOrAriaHidden(ignoredReasons); | 592 parent->computeIsInertOrAriaHidden(ignoredReasons); |
590 return true; | 593 return true; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
626 const AXObject* AXObject::ariaHiddenRoot() const | 629 const AXObject* AXObject::ariaHiddenRoot() const |
627 { | 630 { |
628 for (const AXObject* object = this; object; object = object->parentObject()) { | 631 for (const AXObject* object = this; object; object = object->parentObject()) { |
629 if (equalIgnoringCase(object->getAttribute(aria_hiddenAttr), "true")) | 632 if (equalIgnoringCase(object->getAttribute(aria_hiddenAttr), "true")) |
630 return object; | 633 return object; |
631 } | 634 } |
632 | 635 |
633 return 0; | 636 return 0; |
634 } | 637 } |
635 | 638 |
639 const AXObject* AXObject::inertRoot() const | |
640 { | |
641 for (const AXObject* object = this; object; object = object->parentObject()) { | |
dmazzoni
2016/06/29 17:00:56
Since "inert" is a property of the DOM, and aria-o
| |
642 if (object->hasAttribute(inertAttr)) | |
643 return object; | |
644 } | |
645 | |
646 return 0; | |
647 } | |
648 | |
636 bool AXObject::isDescendantOfDisabledNode() const | 649 bool AXObject::isDescendantOfDisabledNode() const |
637 { | 650 { |
638 updateCachedAttributeValuesIfNeeded(); | 651 updateCachedAttributeValuesIfNeeded(); |
639 return m_cachedIsDescendantOfDisabledNode; | 652 return m_cachedIsDescendantOfDisabledNode; |
640 } | 653 } |
641 | 654 |
642 const AXObject* AXObject::disabledAncestor() const | 655 const AXObject* AXObject::disabledAncestor() const |
643 { | 656 { |
644 const AtomicString& disabled = getAttribute(aria_disabledAttr); | 657 const AtomicString& disabled = getAttribute(aria_disabledAttr); |
645 if (equalIgnoringCase(disabled, "true")) | 658 if (equalIgnoringCase(disabled, "true")) |
(...skipping 1104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1750 | 1763 |
1751 DEFINE_TRACE(AXObject) | 1764 DEFINE_TRACE(AXObject) |
1752 { | 1765 { |
1753 visitor->trace(m_children); | 1766 visitor->trace(m_children); |
1754 visitor->trace(m_parent); | 1767 visitor->trace(m_parent); |
1755 visitor->trace(m_cachedLiveRegionRoot); | 1768 visitor->trace(m_cachedLiveRegionRoot); |
1756 visitor->trace(m_axObjectCache); | 1769 visitor->trace(m_axObjectCache); |
1757 } | 1770 } |
1758 | 1771 |
1759 } // namespace blink | 1772 } // namespace blink |
OLD | NEW |