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 1491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1502 return 0; | 1502 return 0; |
1503 } | 1503 } |
1504 | 1504 |
1505 void AXNodeObject::setFocused(bool on) | 1505 void AXNodeObject::setFocused(bool on) |
1506 { | 1506 { |
1507 if (!canSetFocusAttribute()) | 1507 if (!canSetFocusAttribute()) |
1508 return; | 1508 return; |
1509 | 1509 |
1510 Document* document = this->document(); | 1510 Document* document = this->document(); |
1511 if (!on) { | 1511 if (!on) { |
1512 document->setFocusedElement(0); | 1512 document->setFocusedElement(nullptr); |
1513 } else { | 1513 } else { |
1514 Node* node = this->node(); | 1514 Node* node = this->node(); |
1515 if (node && node->isElementNode()) { | 1515 if (node && node->isElementNode()) { |
1516 // If this node is already the currently focused node, then calling
focus() won't do anything. | 1516 // If this node is already the currently focused node, then calling
focus() won't do anything. |
1517 // That is a problem when focus is removed from the webpage to chrom
e, and then returns. | 1517 // That is a problem when focus is removed from the webpage to chrom
e, and then returns. |
1518 // In these cases, we need to do what keyboard and mouse focus do, w
hich is reset focus first. | 1518 // In these cases, we need to do what keyboard and mouse focus do, w
hich is reset focus first. |
1519 if (document->focusedElement() == node) | 1519 if (document->focusedElement() == node) |
1520 document->setFocusedElement(0); | 1520 document->setFocusedElement(nullptr); |
1521 | 1521 |
1522 toElement(node)->focus(); | 1522 toElement(node)->focus(); |
1523 } else { | 1523 } else { |
1524 document->setFocusedElement(0); | 1524 document->setFocusedElement(nullptr); |
1525 } | 1525 } |
1526 } | 1526 } |
1527 } | 1527 } |
1528 | 1528 |
1529 void AXNodeObject::increment() | 1529 void AXNodeObject::increment() |
1530 { | 1530 { |
1531 UserGestureIndicator gestureIndicator(DefinitelyProcessingNewUserGesture); | 1531 UserGestureIndicator gestureIndicator(DefinitelyProcessingNewUserGesture); |
1532 alterSliderValue(true); | 1532 alterSliderValue(true); |
1533 } | 1533 } |
1534 | 1534 |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1804 useTextUnderElement = true; | 1804 useTextUnderElement = true; |
1805 | 1805 |
1806 if (useTextUnderElement) { | 1806 if (useTextUnderElement) { |
1807 String text = textUnderElement(); | 1807 String text = textUnderElement(); |
1808 if (!text.isEmpty()) | 1808 if (!text.isEmpty()) |
1809 textOrder.append(AccessibilityText(text, ChildrenText)); | 1809 textOrder.append(AccessibilityText(text, ChildrenText)); |
1810 } | 1810 } |
1811 } | 1811 } |
1812 | 1812 |
1813 } // namespace WebCore | 1813 } // namespace WebCore |
OLD | NEW |