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 1787 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1798 } | 1798 } |
1799 | 1799 |
1800 // | 1800 // |
1801 // New AX name calculation. | 1801 // New AX name calculation. |
1802 // | 1802 // |
1803 | 1803 |
1804 String AXNodeObject::textAlternative(bool recursive, bool inAriaLabelledByTraver
sal, AXObjectSet& visited, AXNameFrom& nameFrom, AXObjectVector* nameObjects, Na
meSources* nameSources) const | 1804 String AXNodeObject::textAlternative(bool recursive, bool inAriaLabelledByTraver
sal, AXObjectSet& visited, AXNameFrom& nameFrom, AXObjectVector* nameObjects, Na
meSources* nameSources) const |
1805 { | 1805 { |
1806 // If nameSources is non-null, nameObjects is used in filling it in, so it m
ust be non-null as well. | 1806 // If nameSources is non-null, nameObjects is used in filling it in, so it m
ust be non-null as well. |
1807 if (nameSources) | 1807 if (nameSources) |
1808 assert(nameObjects); | 1808 ASSERT(nameObjects); |
1809 | 1809 |
1810 bool alreadyVisited = visited.contains(this); | 1810 bool alreadyVisited = visited.contains(this); |
1811 bool foundTextAlternative = false; | 1811 bool foundTextAlternative = false; |
1812 visited.add(this); | 1812 visited.add(this); |
1813 String textAlternative; | 1813 String textAlternative; |
1814 | 1814 |
1815 if (!node() && !layoutObject()) | 1815 if (!node() && !layoutObject()) |
1816 return String(); | 1816 return String(); |
1817 | 1817 |
1818 // Step 2A from: http://www.w3.org/TR/accname-aam-1.1 | 1818 // Step 2A from: http://www.w3.org/TR/accname-aam-1.1 |
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2509 } | 2509 } |
2510 | 2510 |
2511 // Based on http://rawgit.com/w3c/aria/master/html-aam/html-aam.html#accessible-
name-and-description-calculation | 2511 // Based on http://rawgit.com/w3c/aria/master/html-aam/html-aam.html#accessible-
name-and-description-calculation |
2512 String AXNodeObject::nativeTextAlternative(AXObjectSet& visited, AXNameFrom& nam
eFrom, AXObjectVector* nameObjects, NameSources* nameSources, bool* foundTextAlt
ernative) const | 2512 String AXNodeObject::nativeTextAlternative(AXObjectSet& visited, AXNameFrom& nam
eFrom, AXObjectVector* nameObjects, NameSources* nameSources, bool* foundTextAlt
ernative) const |
2513 { | 2513 { |
2514 if (!node()) | 2514 if (!node()) |
2515 return String(); | 2515 return String(); |
2516 | 2516 |
2517 // If nameSources is non-null, nameObjects is used in filling it in, so it m
ust be non-null as well. | 2517 // If nameSources is non-null, nameObjects is used in filling it in, so it m
ust be non-null as well. |
2518 if (nameSources) | 2518 if (nameSources) |
2519 assert(nameObjects); | 2519 ASSERT(nameObjects); |
2520 | 2520 |
2521 String textAlternative; | 2521 String textAlternative; |
2522 AXObjectVector localNameObjects; | 2522 AXObjectVector localNameObjects; |
2523 | 2523 |
2524 const HTMLInputElement* inputElement = nullptr; | 2524 const HTMLInputElement* inputElement = nullptr; |
2525 if (isHTMLInputElement(node())) | 2525 if (isHTMLInputElement(node())) |
2526 inputElement = toHTMLInputElement(node()); | 2526 inputElement = toHTMLInputElement(node()); |
2527 | 2527 |
2528 // 5.1/5.5 Text inputs, Other labelable Elements | 2528 // 5.1/5.5 Text inputs, Other labelable Elements |
2529 HTMLElement* htmlElement = nullptr; | 2529 HTMLElement* htmlElement = nullptr; |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2784 return textAlternative; | 2784 return textAlternative; |
2785 } | 2785 } |
2786 | 2786 |
2787 DEFINE_TRACE(AXNodeObject) | 2787 DEFINE_TRACE(AXNodeObject) |
2788 { | 2788 { |
2789 visitor->trace(m_node); | 2789 visitor->trace(m_node); |
2790 AXObject::trace(visitor); | 2790 AXObject::trace(visitor); |
2791 } | 2791 } |
2792 | 2792 |
2793 } // namespace blink | 2793 } // namespace blink |
OLD | NEW |