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

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

Issue 820203002: Support html br element in AX Tree. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: LineBreakRole Created 5 years, 11 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
« no previous file with comments | « Source/modules/accessibility/AXObject.h ('k') | Source/web/AssertMatchingEnums.cpp » ('j') | 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 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 if ((m_ariaRole = determineAriaRoleAttribute()) != UnknownRole) 272 if ((m_ariaRole = determineAriaRoleAttribute()) != UnknownRole)
273 return m_ariaRole; 273 return m_ariaRole;
274 274
275 Node* node = m_renderer->node(); 275 Node* node = m_renderer->node();
276 RenderBoxModelObject* cssBox = renderBoxModelObject(); 276 RenderBoxModelObject* cssBox = renderBoxModelObject();
277 277
278 if ((cssBox && cssBox->isListItem()) || isHTMLLIElement(node)) 278 if ((cssBox && cssBox->isListItem()) || isHTMLLIElement(node))
279 return ListItemRole; 279 return ListItemRole;
280 if (m_renderer->isListMarker()) 280 if (m_renderer->isListMarker())
281 return ListMarkerRole; 281 return ListMarkerRole;
282 if (m_renderer->isBR())
283 return LineBreakRole;
282 if (isHTMLLegendElement(node)) 284 if (isHTMLLegendElement(node))
283 return LegendRole; 285 return LegendRole;
284 if (m_renderer->isText()) 286 if (m_renderer->isText())
285 return StaticTextRole; 287 return StaticTextRole;
286 if (cssBox && isImageOrAltText(cssBox, node)) { 288 if (cssBox && isImageOrAltText(cssBox, node)) {
287 if (node && node->isLink()) 289 if (node && node->isLink())
288 return ImageMapRole; 290 return ImageMapRole;
289 if (isHTMLInputElement(node)) 291 if (isHTMLInputElement(node))
290 return ariaHasPopup() ? PopUpButtonRole : ButtonRole; 292 return ariaHasPopup() ? PopUpButtonRole : ButtonRole;
291 if (isSVGImage()) 293 if (isSVGImage())
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
577 if (parent->isBoxModelObject() && toRenderBoxModelObject(parent)->isMenu List()) 579 if (parent->isBoxModelObject() && toRenderBoxModelObject(parent)->isMenu List())
578 return true; 580 return true;
579 } 581 }
580 582
581 // find out if this element is inside of a label element. 583 // 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 584 // if so, it may be ignored because it's the label for a checkbox or radio b utton
583 AXObject* controlObject = correspondingControlForLabelElement(); 585 AXObject* controlObject = correspondingControlForLabelElement();
584 if (controlObject && !controlObject->exposesTitleUIElement() && controlObjec t->isCheckboxOrRadio()) 586 if (controlObject && !controlObject->exposesTitleUIElement() && controlObjec t->isCheckboxOrRadio())
585 return true; 587 return true;
586 588
589 if (m_renderer->isBR())
590 return false;
591
587 // NOTE: BRs always have text boxes now, so the text box check here can be r emoved 592 // NOTE: BRs always have text boxes now, so the text box check here can be r emoved
588 if (m_renderer->isText()) { 593 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 594 // static text beneath MenuItems and MenuButtons are just reported along with the menu item, so it's ignored on an individual level
590 AXObject* parent = parentObjectUnignored(); 595 AXObject* parent = parentObjectUnignored();
591 if (parent && (parent->ariaRoleAttribute() == MenuItemRole || parent->ar iaRoleAttribute() == MenuButtonRole)) 596 if (parent && (parent->ariaRoleAttribute() == MenuItemRole || parent->ar iaRoleAttribute() == MenuButtonRole))
592 return true; 597 return true;
593 RenderText* renderText = toRenderText(m_renderer); 598 RenderText* renderText = toRenderText(m_renderer);
594 if (m_renderer->isBR() || !renderText->firstTextBox()) 599 if (m_renderer->isBR() || !renderText->firstTextBox())
595 return true; 600 return true;
596 601
(...skipping 1811 matching lines...) Expand 10 before | Expand all | Expand 10 after
2408 if (label && label->renderer()) { 2413 if (label && label->renderer()) {
2409 LayoutRect labelRect = axObjectCache()->getOrCreate(label)->elementR ect(); 2414 LayoutRect labelRect = axObjectCache()->getOrCreate(label)->elementR ect();
2410 result.unite(labelRect); 2415 result.unite(labelRect);
2411 } 2416 }
2412 } 2417 }
2413 2418
2414 return result; 2419 return result;
2415 } 2420 }
2416 2421
2417 } // namespace blink 2422 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/accessibility/AXObject.h ('k') | Source/web/AssertMatchingEnums.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698