| OLD | NEW |
| 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 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 583 | 583 |
| 584 // find out if this element is inside of a label element. | 584 // find out if this element is inside of a label element. |
| 585 // if so, it may be ignored because it's the label for a checkbox or radio b
utton | 585 // if so, it may be ignored because it's the label for a checkbox or radio b
utton |
| 586 AXObject* controlObject = correspondingControlForLabelElement(); | 586 AXObject* controlObject = correspondingControlForLabelElement(); |
| 587 if (controlObject && !controlObject->exposesTitleUIElement() && controlObjec
t->isCheckboxOrRadio()) | 587 if (controlObject && !controlObject->exposesTitleUIElement() && controlObjec
t->isCheckboxOrRadio()) |
| 588 return true; | 588 return true; |
| 589 | 589 |
| 590 if (m_layoutObject->isBR()) | 590 if (m_layoutObject->isBR()) |
| 591 return false; | 591 return false; |
| 592 | 592 |
| 593 // NOTE: BRs always have text boxes now, so the text box check here can be r
emoved | |
| 594 if (m_layoutObject->isText()) { | 593 if (m_layoutObject->isText()) { |
| 595 // 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 |
| 596 AXObject* parent = parentObjectUnignored(); | 595 AXObject* parent = parentObjectUnignored(); |
| 597 if (parent && (parent->ariaRoleAttribute() == MenuItemRole || parent->ar
iaRoleAttribute() == MenuButtonRole)) | 596 if (parent && (parent->ariaRoleAttribute() == MenuItemRole || parent->ar
iaRoleAttribute() == MenuButtonRole)) |
| 598 return true; | 597 return true; |
| 599 LayoutText* layoutText = toLayoutText(m_layoutObject); | 598 LayoutText* layoutText = toLayoutText(m_layoutObject); |
| 600 if (m_layoutObject->isBR() || !layoutText->firstTextBox()) | 599 if (!layoutText->firstTextBox()) |
| 601 return true; | 600 return true; |
| 602 | 601 |
| 603 // Don't ignore static text in editable text controls. | 602 // Don't ignore static text in editable text controls. |
| 604 for (AXObject* parent = parentObject(); parent; parent = parent->parentO
bject()) { | 603 for (AXObject* parent = parentObject(); parent; parent = parent->parentO
bject()) { |
| 605 if (parent->roleValue() == TextFieldRole) | 604 if (parent->roleValue() == TextFieldRole) |
| 606 return false; | 605 return false; |
| 607 } | 606 } |
| 608 | 607 |
| 609 // text elements that are just empty whitespace should not be returned | 608 // text elements that are just empty whitespace should not be returned |
| 610 // FIXME(dmazzoni): we probably shouldn't ignore this if the style is 'p
re', or similar... | 609 // FIXME(dmazzoni): we probably shouldn't ignore this if the style is 'p
re', or similar... |
| (...skipping 1725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2336 if (label && label->layoutObject()) { | 2335 if (label && label->layoutObject()) { |
| 2337 LayoutRect labelRect = axObjectCache()->getOrCreate(label)->elementR
ect(); | 2336 LayoutRect labelRect = axObjectCache()->getOrCreate(label)->elementR
ect(); |
| 2338 result.unite(labelRect); | 2337 result.unite(labelRect); |
| 2339 } | 2338 } |
| 2340 } | 2339 } |
| 2341 | 2340 |
| 2342 return result; | 2341 return result; |
| 2343 } | 2342 } |
| 2344 | 2343 |
| 2345 } // namespace blink | 2344 } // namespace blink |
| OLD | NEW |