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

Unified Diff: third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp

Issue 2479593007: Expose images to accessibility (Closed)
Patch Set: A few more tests rebaselined. Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/inspector-protocol/accessibility/accessibility-ignoredNodes-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp
diff --git a/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp b/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp
index 6459cd9fcbfc63e057fbaf56dffd38da52028534..a7fbf9d1367de729d40d85bf6fc6a23c1e0b24bc 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp
+++ b/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp
@@ -697,52 +697,8 @@ bool AXLayoutObject::computeAccessibilityIsIgnored(
return true;
}
- // ignore images seemingly used as spacers
- if (isImage()) {
- // If the image can take focus, it should not be ignored, lest the user not
- // be able to interact with something important.
- if (canSetFocusAttribute())
- return false;
-
- if (node && node->isElementNode()) {
- Element* elt = toElement(node);
- const AtomicString& alt = elt->getAttribute(altAttr);
- // don't ignore an image that has an alt tag
- if (!alt.getString().containsOnlyWhitespace())
- return false;
- // informal standard is to ignore images with zero-length alt strings
- if (!alt.isNull()) {
- if (ignoredReasons)
- ignoredReasons->append(IgnoredReason(AXEmptyAlt));
- return true;
- }
- }
-
- if (isNativeImage() && m_layoutObject->isImage()) {
- // check for one-dimensional image
- LayoutImage* image = toLayoutImage(m_layoutObject);
- if (image->size().height() <= 1 || image->size().width() <= 1) {
- if (ignoredReasons)
- ignoredReasons->append(IgnoredReason(AXProbablyPresentational));
- return true;
- }
-
- // Check whether laid out image was stretched from one-dimensional file
- // image.
- if (image->cachedImage()) {
- LayoutSize imageSize = image->cachedImage()->imageSize(
- LayoutObject::shouldRespectImageOrientation(m_layoutObject),
- image->view()->zoomFactor());
- if (imageSize.height() <= 1 || imageSize.width() <= 1) {
- if (ignoredReasons)
- ignoredReasons->append(IgnoredReason(AXProbablyPresentational));
- return true;
- }
- return false;
- }
- }
+ if (isImage())
return false;
- }
if (isCanvas()) {
if (canvasHasFallbackContent())
« no previous file with comments | « third_party/WebKit/LayoutTests/inspector-protocol/accessibility/accessibility-ignoredNodes-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698