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 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
595 // static text beneath MenuItems and MenuButtons are just reported along
with the menu item, so it's ignored on an individual level | 595 // 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(); | 596 AXObject* parent = parentObjectUnignored(); |
597 if (parent && (parent->ariaRoleAttribute() == MenuItemRole || parent->ar
iaRoleAttribute() == MenuButtonRole)) | 597 if (parent && (parent->ariaRoleAttribute() == MenuItemRole || parent->ar
iaRoleAttribute() == MenuButtonRole)) |
598 return true; | 598 return true; |
599 LayoutText* layoutText = toLayoutText(m_layoutObject); | 599 LayoutText* layoutText = toLayoutText(m_layoutObject); |
600 if (m_layoutObject->isBR() || !layoutText->firstTextBox()) | 600 if (m_layoutObject->isBR() || !layoutText->firstTextBox()) |
601 return true; | 601 return true; |
602 | 602 |
603 // Don't ignore static text in editable text controls. | 603 // Don't ignore static text in editable text controls. |
604 for (AXObject* parent = parentObject(); parent; parent = parent->parentO
bject()) { | 604 for (AXObject* parent = parentObject(); parent; parent = parent->parentO
bject()) { |
605 if (parent->roleValue() == TextFieldRole || parent->roleValue() == T
extAreaRole) | 605 if (parent->roleValue() == TextFieldRole) |
606 return false; | 606 return false; |
607 } | 607 } |
608 | 608 |
609 // text elements that are just empty whitespace should not be returned | 609 // 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... | 610 // FIXME(dmazzoni): we probably shouldn't ignore this if the style is 'p
re', or similar... |
611 return layoutText->text().impl()->containsOnlyWhitespace(); | 611 return layoutText->text().impl()->containsOnlyWhitespace(); |
612 } | 612 } |
613 | 613 |
614 if (isHeading()) | 614 if (isHeading()) |
615 return false; | 615 return false; |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
897 return Locale::defaultLocale().queryString(name); | 897 return Locale::defaultLocale().queryString(name); |
898 } | 898 } |
899 | 899 |
900 String AXLayoutObject::actionVerb() const | 900 String AXLayoutObject::actionVerb() const |
901 { | 901 { |
902 switch (roleValue()) { | 902 switch (roleValue()) { |
903 case ButtonRole: | 903 case ButtonRole: |
904 case ToggleButtonRole: | 904 case ToggleButtonRole: |
905 return queryString(WebLocalizedString::AXButtonActionVerb); | 905 return queryString(WebLocalizedString::AXButtonActionVerb); |
906 case TextFieldRole: | 906 case TextFieldRole: |
907 case TextAreaRole: | |
908 return queryString(WebLocalizedString::AXTextFieldActionVerb); | 907 return queryString(WebLocalizedString::AXTextFieldActionVerb); |
909 case RadioButtonRole: | 908 case RadioButtonRole: |
910 return queryString(WebLocalizedString::AXRadioButtonActionVerb); | 909 return queryString(WebLocalizedString::AXRadioButtonActionVerb); |
911 case CheckBoxRole: | 910 case CheckBoxRole: |
912 case SwitchRole: | 911 case SwitchRole: |
913 return queryString(isChecked() ? WebLocalizedString::AXCheckedCheckBoxAc
tionVerb : WebLocalizedString::AXUncheckedCheckBoxActionVerb); | 912 return queryString(isChecked() ? WebLocalizedString::AXCheckedCheckBoxAc
tionVerb : WebLocalizedString::AXUncheckedCheckBoxActionVerb); |
914 case LinkRole: | 913 case LinkRole: |
915 return queryString(WebLocalizedString::AXLinkActionVerb); | 914 return queryString(WebLocalizedString::AXLinkActionVerb); |
916 default: | 915 default: |
917 return emptyString(); | 916 return emptyString(); |
(...skipping 1419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2337 if (label && label->layoutObject()) { | 2336 if (label && label->layoutObject()) { |
2338 LayoutRect labelRect = axObjectCache()->getOrCreate(label)->elementR
ect(); | 2337 LayoutRect labelRect = axObjectCache()->getOrCreate(label)->elementR
ect(); |
2339 result.unite(labelRect); | 2338 result.unite(labelRect); |
2340 } | 2339 } |
2341 } | 2340 } |
2342 | 2341 |
2343 return result; | 2342 return result; |
2344 } | 2343 } |
2345 | 2344 |
2346 } // namespace blink | 2345 } // namespace blink |
OLD | NEW |