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

Side by Side Diff: Source/modules/accessibility/AXRenderObject.cpp

Issue 796223003: Revert of Ignore text elements for menu item related roles. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years 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
« no previous file with comments | « LayoutTests/accessibility/ignore-text-elements-for-menu-item-related-roles-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2008 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 569 matching lines...) Expand 10 before | Expand all | Expand 10 after
580 580
581 // find out if this element is inside of a label element. 581 // find out if this element is inside of a label element.
582 // if so, it may be ignored because it's the label for a checkbox or radio b utton 582 // if so, it may be ignored because it's the label for a checkbox or radio b utton
583 AXObject* controlObject = correspondingControlForLabelElement(); 583 AXObject* controlObject = correspondingControlForLabelElement();
584 if (controlObject && !controlObject->exposesTitleUIElement() && controlObjec t->isCheckboxOrRadio()) 584 if (controlObject && !controlObject->exposesTitleUIElement() && controlObjec t->isCheckboxOrRadio())
585 return true; 585 return true;
586 586
587 // NOTE: BRs always have text boxes now, so the text box check here can be r emoved 587 // NOTE: BRs always have text boxes now, so the text box check here can be r emoved
588 if (m_renderer->isText()) { 588 if (m_renderer->isText()) {
589 // static text beneath MenuItems and MenuButtons are just reported along with the menu item, so it's ignored on an individual level 589 // static text beneath MenuItems and MenuButtons are just reported along with the menu item, so it's ignored on an individual level
590 if (AXObject* parent = parentObjectUnignored()) { 590 AXObject* parent = parentObjectUnignored();
591 AccessibilityRole role = parent->ariaRoleAttribute(); 591 if (parent && (parent->ariaRoleAttribute() == MenuItemRole || parent->ar iaRoleAttribute() == MenuButtonRole))
592 if (role == MenuItemRole || role == MenuItemRadioRole || role == Men uItemCheckBoxRole || role == MenuButtonRole) 592 return true;
593 return true;
594 }
595 RenderText* renderText = toRenderText(m_renderer); 593 RenderText* renderText = toRenderText(m_renderer);
596 if (m_renderer->isBR() || !renderText->firstTextBox()) 594 if (m_renderer->isBR() || !renderText->firstTextBox())
597 return true; 595 return true;
598 596
599 // Don't ignore static text in editable text controls. 597 // Don't ignore static text in editable text controls.
600 for (AXObject* parent = parentObject(); parent; parent = parent->parentO bject()) { 598 for (AXObject* parent = parentObject(); parent; parent = parent->parentO bject()) {
601 if (parent->roleValue() == TextFieldRole || parent->roleValue() == T extAreaRole) 599 if (parent->roleValue() == TextFieldRole || parent->roleValue() == T extAreaRole)
602 return false; 600 return false;
603 } 601 }
604 602
(...skipping 1805 matching lines...) Expand 10 before | Expand all | Expand 10 after
2410 if (label && label->renderer()) { 2408 if (label && label->renderer()) {
2411 LayoutRect labelRect = axObjectCache()->getOrCreate(label)->elementR ect(); 2409 LayoutRect labelRect = axObjectCache()->getOrCreate(label)->elementR ect();
2412 result.unite(labelRect); 2410 result.unite(labelRect);
2413 } 2411 }
2414 } 2412 }
2415 2413
2416 return result; 2414 return result;
2417 } 2415 }
2418 2416
2419 } // namespace blink 2417 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/accessibility/ignore-text-elements-for-menu-item-related-roles-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698