Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(88)

Side by Side Diff: third_party/WebKit/Source/modules/accessibility/AXObject.cpp

Issue 2181953004: Changed ComputedStyle's EVisibility to be an enum class and fixed naming (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@_move_computedstyle_around
Patch Set: Rebase Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698