OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 | 94 |
95 AccessibilityUIElement* AccessibilityController::findAccessibleElementByIdRecurs
ive(const WebAccessibilityObject& obj, const WebString& id) | 95 AccessibilityUIElement* AccessibilityController::findAccessibleElementByIdRecurs
ive(const WebAccessibilityObject& obj, const WebString& id) |
96 { | 96 { |
97 if (obj.isNull() || obj.isDetached()) | 97 if (obj.isNull() || obj.isDetached()) |
98 return 0; | 98 return 0; |
99 | 99 |
100 WebNode node = obj.node(); | 100 WebNode node = obj.node(); |
101 if (!node.isNull() && node.isElementNode()) { | 101 if (!node.isNull() && node.isElementNode()) { |
102 WebElement element = node.to<WebElement>(); | 102 WebElement element = node.to<WebElement>(); |
103 element.getAttribute("id"); | 103 element.getAttribute("id"); |
104 if (element.getAttribute("id") == id) | 104 if (element.getAttribute("id") == id) |
105 return m_elements.getOrCreate(obj); | 105 return m_elements.getOrCreate(obj); |
106 } | 106 } |
107 | 107 |
108 unsigned childCount = obj.childCount(); | 108 unsigned childCount = obj.childCount(); |
109 for (unsigned i = 0; i < childCount; i++) { | 109 for (unsigned i = 0; i < childCount; i++) { |
110 if (AccessibilityUIElement* result = findAccessibleElementByIdRecursive(
obj.childAt(i), id)) | 110 if (AccessibilityUIElement* result = findAccessibleElementByIdRecursive(
obj.childAt(i), id)) |
111 return result; | 111 return result; |
112 } | 112 } |
113 | 113 |
114 return 0; | 114 return 0; |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 result->set(*(foundElement->getAsCppVariant())); | 195 result->set(*(foundElement->getAsCppVariant())); |
196 } | 196 } |
197 | 197 |
198 void AccessibilityController::fallbackCallback(const CppArgumentList&, CppVarian
t* result) | 198 void AccessibilityController::fallbackCallback(const CppArgumentList&, CppVarian
t* result) |
199 { | 199 { |
200 m_delegate->printMessage("CONSOLE MESSAGE: JavaScript ERROR: unknown method
called on AccessibilityController\n"); | 200 m_delegate->printMessage("CONSOLE MESSAGE: JavaScript ERROR: unknown method
called on AccessibilityController\n"); |
201 result->setNull(); | 201 result->setNull(); |
202 } | 202 } |
203 | 203 |
204 } | 204 } |
OLD | NEW |