| 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 25 matching lines...) Expand all Loading... |
| 36 AXObjectCacheImpl& ax_object_cache) | 36 AXObjectCacheImpl& ax_object_cache) |
| 37 : AXLayoutObject(layout_object, ax_object_cache) {} | 37 : AXLayoutObject(layout_object, ax_object_cache) {} |
| 38 | 38 |
| 39 AXSVGRoot::~AXSVGRoot() {} | 39 AXSVGRoot::~AXSVGRoot() {} |
| 40 | 40 |
| 41 AXSVGRoot* AXSVGRoot::Create(LayoutObject* layout_object, | 41 AXSVGRoot* AXSVGRoot::Create(LayoutObject* layout_object, |
| 42 AXObjectCacheImpl& ax_object_cache) { | 42 AXObjectCacheImpl& ax_object_cache) { |
| 43 return new AXSVGRoot(layout_object, ax_object_cache); | 43 return new AXSVGRoot(layout_object, ax_object_cache); |
| 44 } | 44 } |
| 45 | 45 |
| 46 void AXSVGRoot::SetParent(AXObject* parent) { | 46 void AXSVGRoot::SetParent(AXObjectImpl* 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 (!parent_ || !parent) | 51 if (!parent_ || !parent) |
| 52 parent_ = parent; | 52 parent_ = parent; |
| 53 } | 53 } |
| 54 | 54 |
| 55 AXObject* AXSVGRoot::ComputeParent() const { | 55 AXObjectImpl* AXSVGRoot::ComputeParent() const { |
| 56 DCHECK(!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 (parent_) | 59 if (parent_) |
| 60 return parent_; | 60 return 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 == kUnknownRole) | 68 if (role == kUnknownRole) |
| 69 role = kGroupRole; | 69 role = kGroupRole; |
| 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 |