OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2012, Google Inc. All rights reserved. | 2 * Copyright (C) 2012, Google 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 1462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1473 | 1473 |
1474 HTMLLabelElement* AXNodeObject::labelElementContainer() const | 1474 HTMLLabelElement* AXNodeObject::labelElementContainer() const |
1475 { | 1475 { |
1476 if (!node()) | 1476 if (!node()) |
1477 return 0; | 1477 return 0; |
1478 | 1478 |
1479 // the control element should not be considered part of the label | 1479 // the control element should not be considered part of the label |
1480 if (isControl()) | 1480 if (isControl()) |
1481 return 0; | 1481 return 0; |
1482 | 1482 |
1483 // find if this has a parent that is a label | 1483 // find if this has a ancestor that is a label |
1484 for (Node* parentNode = node(); parentNode; parentNode = parentNode->parentN ode()) { | 1484 return isHTMLLabelElement(*node()) ? toHTMLLabelElement(node()) : Traversal< HTMLLabelElement>::firstAncestor(*node()); |
esprehn
2014/03/21 07:58:33
Can we use if statements here? I don't think all t
Inactive
2014/03/21 14:37:24
Done.
| |
1485 if (isHTMLLabelElement(*parentNode)) | |
1486 return toHTMLLabelElement(parentNode); | |
1487 } | |
1488 | |
1489 return 0; | |
1490 } | 1485 } |
1491 | 1486 |
1492 void AXNodeObject::setFocused(bool on) | 1487 void AXNodeObject::setFocused(bool on) |
1493 { | 1488 { |
1494 if (!canSetFocusAttribute()) | 1489 if (!canSetFocusAttribute()) |
1495 return; | 1490 return; |
1496 | 1491 |
1497 Document* document = this->document(); | 1492 Document* document = this->document(); |
1498 if (!on) { | 1493 if (!on) { |
1499 document->setFocusedElement(nullptr); | 1494 document->setFocusedElement(nullptr); |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1789 useTextUnderElement = true; | 1784 useTextUnderElement = true; |
1790 | 1785 |
1791 if (useTextUnderElement) { | 1786 if (useTextUnderElement) { |
1792 String text = textUnderElement(); | 1787 String text = textUnderElement(); |
1793 if (!text.isEmpty()) | 1788 if (!text.isEmpty()) |
1794 textOrder.append(AccessibilityText(text, ChildrenText)); | 1789 textOrder.append(AccessibilityText(text, ChildrenText)); |
1795 } | 1790 } |
1796 } | 1791 } |
1797 | 1792 |
1798 } // namespace WebCore | 1793 } // namespace WebCore |
OLD | NEW |