| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2012 Apple 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 void AXSVGRoot::setParent(AXObject* parent) { | 46 void AXSVGRoot::setParent(AXObject* parent) { |
| 47 // Only update the parent to another objcet if it wasn't already set to | 47 // Only update the parent to another objcet if it wasn't already set to |
| 48 // something. Multiple elements in an HTML document can reference | 48 // something. Multiple elements in an HTML document can reference |
| 49 // the same remote SVG document, and in that case the parent should just | 49 // the same remote SVG document, and in that case the parent should just |
| 50 // stay with the first one. | 50 // stay with the first one. |
| 51 if (!m_parent || !parent) | 51 if (!m_parent || !parent) |
| 52 m_parent = parent; | 52 m_parent = parent; |
| 53 } | 53 } |
| 54 | 54 |
| 55 AXObject* AXSVGRoot::computeParent() const { | 55 AXObject* AXSVGRoot::computeParent() const { |
| 56 ASSERT(!isDetached()); | 56 DCHECK(!isDetached()); |
| 57 // If a parent was set because this is a remote SVG resource, use that | 57 // If a parent was set because this is a remote SVG resource, use that |
| 58 // but otherwise, we should rely on the standard layout tree for the parent. | 58 // but otherwise, we should rely on the standard layout tree for the parent. |
| 59 if (m_parent) | 59 if (m_parent) |
| 60 return m_parent; | 60 return m_parent; |
| 61 | 61 |
| 62 return AXLayoutObject::computeParent(); | 62 return AXLayoutObject::computeParent(); |
| 63 } | 63 } |
| 64 | 64 |
| 65 // SVG AAM 1.0 S8.2: the default role for an SVG root is "group". | 65 // SVG AAM 1.0 S8.2: the default role for an SVG root is "group". |
| 66 AccessibilityRole AXSVGRoot::determineAccessibilityRole() { | 66 AccessibilityRole AXSVGRoot::determineAccessibilityRole() { |
| 67 AccessibilityRole role = AXLayoutObject::determineAccessibilityRole(); | 67 AccessibilityRole role = AXLayoutObject::determineAccessibilityRole(); |
| 68 if (role == UnknownRole) | 68 if (role == UnknownRole) |
| 69 role = GroupRole; | 69 role = GroupRole; |
| 70 return role; | 70 return role; |
| 71 } | 71 } |
| 72 | 72 |
| 73 // SVG elements are only ignored when a generic element would also be ignored. | 73 // SVG elements are only ignored when a generic element would also be ignored. |
| 74 bool AXSVGRoot::computeAccessibilityIsIgnored(IgnoredReasons* reasons) const { | 74 bool AXSVGRoot::computeAccessibilityIsIgnored(IgnoredReasons* reasons) const { |
| 75 return accessibilityIsIgnoredByDefault(reasons); | 75 return accessibilityIsIgnoredByDefault(reasons); |
| 76 } | 76 } |
| 77 | 77 |
| 78 } // namespace blink | 78 } // namespace blink |
| OLD | NEW |