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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 | 45 |
46 | 46 |
47 namespace WebCore { | 47 namespace WebCore { |
48 | 48 |
49 using namespace HTMLNames; | 49 using namespace HTMLNames; |
50 | 50 |
51 AXNodeObject::AXNodeObject(Node* node) | 51 AXNodeObject::AXNodeObject(Node* node) |
52 : AXObject() | 52 : AXObject() |
53 , m_ariaRole(UnknownRole) | 53 , m_ariaRole(UnknownRole) |
54 , m_childrenDirty(false) | 54 , m_childrenDirty(false) |
55 #ifndef NDEBUG | 55 #if ENABLE(ASSERT) |
56 , m_initialized(false) | 56 , m_initialized(false) |
57 #endif | 57 #endif |
58 , m_node(node) | 58 , m_node(node) |
59 { | 59 { |
60 } | 60 } |
61 | 61 |
62 PassRefPtr<AXNodeObject> AXNodeObject::create(Node* node) | 62 PassRefPtr<AXNodeObject> AXNodeObject::create(Node* node) |
63 { | 63 { |
64 return adoptRef(new AXNodeObject(node)); | 64 return adoptRef(new AXNodeObject(node)); |
65 } | 65 } |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 | 147 |
148 value += increase ? step : -step; | 148 value += increase ? step : -step; |
149 | 149 |
150 setValue(String::number(value)); | 150 setValue(String::number(value)); |
151 | 151 |
152 axObjectCache()->postNotification(node(), AXObjectCache::AXValueChanged, tru
e); | 152 axObjectCache()->postNotification(node(), AXObjectCache::AXValueChanged, tru
e); |
153 } | 153 } |
154 | 154 |
155 bool AXNodeObject::computeAccessibilityIsIgnored() const | 155 bool AXNodeObject::computeAccessibilityIsIgnored() const |
156 { | 156 { |
157 #ifndef NDEBUG | 157 #if ENABLE(ASSERT) |
158 // Double-check that an AXObject is never accessed before | 158 // Double-check that an AXObject is never accessed before |
159 // it's been initialized. | 159 // it's been initialized. |
160 ASSERT(m_initialized); | 160 ASSERT(m_initialized); |
161 #endif | 161 #endif |
162 | 162 |
163 // If this element is within a parent that cannot have children, it should n
ot be exposed. | 163 // If this element is within a parent that cannot have children, it should n
ot be exposed. |
164 if (isDescendantOfBarrenParent()) | 164 if (isDescendantOfBarrenParent()) |
165 return true; | 165 return true; |
166 | 166 |
167 // Ignore labels that are already referenced by a control's title UI element
. | 167 // Ignore labels that are already referenced by a control's title UI element
. |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 // If the parent had a different role, then we don't need to continue se
arching up the chain. | 439 // If the parent had a different role, then we don't need to continue se
arching up the chain. |
440 if (parentAriaRole) | 440 if (parentAriaRole) |
441 break; | 441 break; |
442 } | 442 } |
443 | 443 |
444 return role; | 444 return role; |
445 } | 445 } |
446 | 446 |
447 void AXNodeObject::init() | 447 void AXNodeObject::init() |
448 { | 448 { |
449 #ifndef NDEBUG | 449 #if ENABLE(ASSERT) |
450 ASSERT(!m_initialized); | 450 ASSERT(!m_initialized); |
451 m_initialized = true; | 451 m_initialized = true; |
452 #endif | 452 #endif |
453 m_role = determineAccessibilityRole(); | 453 m_role = determineAccessibilityRole(); |
454 } | 454 } |
455 | 455 |
456 void AXNodeObject::detach() | 456 void AXNodeObject::detach() |
457 { | 457 { |
458 clearChildren(); | 458 clearChildren(); |
459 AXObject::detach(); | 459 AXObject::detach(); |
(...skipping 1241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1701 float range = maxValueForRange() - minValueForRange(); | 1701 float range = maxValueForRange() - minValueForRange(); |
1702 float value = valueForRange(); | 1702 float value = valueForRange(); |
1703 | 1703 |
1704 value += range * (percentChange / 100); | 1704 value += range * (percentChange / 100); |
1705 setValue(String::number(value)); | 1705 setValue(String::number(value)); |
1706 | 1706 |
1707 axObjectCache()->postNotification(node(), AXObjectCache::AXValueChanged, tru
e); | 1707 axObjectCache()->postNotification(node(), AXObjectCache::AXValueChanged, tru
e); |
1708 } | 1708 } |
1709 | 1709 |
1710 } // namespace WebCore | 1710 } // namespace WebCore |
OLD | NEW |