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 742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
753 AXNameFrom tmpNameFrom; | 753 AXNameFrom tmpNameFrom; |
754 return axObj.textAlternative(true, inAriaLabelledByTraversal, visited, tmpNa
meFrom, nullptr, nullptr); | 754 return axObj.textAlternative(true, inAriaLabelledByTraversal, visited, tmpNa
meFrom, nullptr, nullptr); |
755 } | 755 } |
756 | 756 |
757 bool AXObject::isHiddenForTextAlternativeCalculation() const | 757 bool AXObject::isHiddenForTextAlternativeCalculation() const |
758 { | 758 { |
759 if (equalIgnoringCase(getAttribute(aria_hiddenAttr), "false")) | 759 if (equalIgnoringCase(getAttribute(aria_hiddenAttr), "false")) |
760 return false; | 760 return false; |
761 | 761 |
762 if (getLayoutObject()) | 762 if (getLayoutObject()) |
763 return getLayoutObject()->style()->visibility() != VISIBLE; | 763 return getLayoutObject()->style()->visibility() != EVisibility::Visible; |
764 | 764 |
765 // This is an obscure corner case: if a node has no LayoutObject, that means
it's not rendered, | 765 // This is an obscure corner case: if a node has no LayoutObject, that means
it's not rendered, |
766 // but we still may be exploring it as part of a text alternative calculatio
n, for example if it | 766 // but we still may be exploring it as part of a text alternative calculatio
n, for example if it |
767 // was explicitly referenced by aria-labelledby. So we need to explicitly ca
ll the style resolver | 767 // was explicitly referenced by aria-labelledby. So we need to explicitly ca
ll the style resolver |
768 // to check whether it's invisible or display:none, rather than relying on t
he style cached in the | 768 // to check whether it's invisible or display:none, rather than relying on t
he style cached in the |
769 // LayoutObject. | 769 // LayoutObject. |
770 Document* doc = getDocument(); | 770 Document* doc = getDocument(); |
771 if (doc && doc->frame() && getNode() && getNode()->isElementNode()) { | 771 if (doc && doc->frame() && getNode() && getNode()->isElementNode()) { |
772 RefPtr<ComputedStyle> style = doc->ensureStyleResolver().styleForElement
(toElement(getNode())); | 772 RefPtr<ComputedStyle> style = doc->ensureStyleResolver().styleForElement
(toElement(getNode())); |
773 return style->display() == NONE || style->visibility() != VISIBLE; | 773 return style->display() == NONE || style->visibility() != EVisibility::V
isible; |
774 } | 774 } |
775 | 775 |
776 return false; | 776 return false; |
777 } | 777 } |
778 | 778 |
779 String AXObject::ariaTextAlternative(bool recursive, bool inAriaLabelledByTraver
sal, AXObjectSet& visited, AXNameFrom& nameFrom, AXRelatedObjectVector* relatedO
bjects, NameSources* nameSources, bool* foundTextAlternative) const | 779 String AXObject::ariaTextAlternative(bool recursive, bool inAriaLabelledByTraver
sal, AXObjectSet& visited, AXNameFrom& nameFrom, AXRelatedObjectVector* relatedO
bjects, NameSources* nameSources, bool* foundTextAlternative) const |
780 { | 780 { |
781 String textAlternative; | 781 String textAlternative; |
782 bool alreadyVisited = visited.contains(this); | 782 bool alreadyVisited = visited.contains(this); |
783 visited.add(this); | 783 visited.add(this); |
(...skipping 965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1749 | 1749 |
1750 DEFINE_TRACE(AXObject) | 1750 DEFINE_TRACE(AXObject) |
1751 { | 1751 { |
1752 visitor->trace(m_children); | 1752 visitor->trace(m_children); |
1753 visitor->trace(m_parent); | 1753 visitor->trace(m_parent); |
1754 visitor->trace(m_cachedLiveRegionRoot); | 1754 visitor->trace(m_cachedLiveRegionRoot); |
1755 visitor->trace(m_axObjectCache); | 1755 visitor->trace(m_axObjectCache); |
1756 } | 1756 } |
1757 | 1757 |
1758 } // namespace blink | 1758 } // namespace blink |
OLD | NEW |