OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2008 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 18 matching lines...) Expand all Loading... |
29 #include "config.h" | 29 #include "config.h" |
30 #include "modules/accessibility/AXImageMapLink.h" | 30 #include "modules/accessibility/AXImageMapLink.h" |
31 | 31 |
32 #include "modules/accessibility/AXObjectCacheImpl.h" | 32 #include "modules/accessibility/AXObjectCacheImpl.h" |
33 #include "modules/accessibility/AXRenderObject.h" | 33 #include "modules/accessibility/AXRenderObject.h" |
34 | 34 |
35 namespace blink { | 35 namespace blink { |
36 | 36 |
37 using namespace HTMLNames; | 37 using namespace HTMLNames; |
38 | 38 |
39 AXImageMapLink::AXImageMapLink() | 39 AXImageMapLink::AXImageMapLink(AXObjectCache* axObjectCache) |
40 : m_areaElement(nullptr) | 40 : AXMockObject(axObjectCache) |
| 41 , m_areaElement(nullptr) |
41 , m_mapElement(nullptr) | 42 , m_mapElement(nullptr) |
42 { | 43 { |
43 } | 44 } |
44 | 45 |
45 AXImageMapLink::~AXImageMapLink() | 46 AXImageMapLink::~AXImageMapLink() |
46 { | 47 { |
47 } | 48 } |
48 | 49 |
49 void AXImageMapLink::detachFromParent() | 50 void AXImageMapLink::detachFromParent() |
50 { | 51 { |
51 AXMockObject::detachFromParent(); | 52 AXMockObject::detachFromParent(); |
52 m_areaElement = nullptr; | 53 m_areaElement = nullptr; |
53 m_mapElement = nullptr; | 54 m_mapElement = nullptr; |
54 } | 55 } |
55 | 56 |
56 PassRefPtr<AXImageMapLink> AXImageMapLink::create() | 57 PassRefPtr<AXImageMapLink> AXImageMapLink::create(AXObjectCache* axObjectCache) |
57 { | 58 { |
58 return adoptRef(new AXImageMapLink()); | 59 return adoptRef(new AXImageMapLink(axObjectCache)); |
59 } | 60 } |
60 | 61 |
61 AXObject* AXImageMapLink::computeParent() const | 62 AXObject* AXImageMapLink::computeParent() const |
62 { | 63 { |
63 if (m_parent) | 64 if (m_parent) |
64 return m_parent; | 65 return m_parent; |
65 | 66 |
66 if (!m_mapElement.get() || !m_mapElement->renderer()) | 67 if (!m_mapElement.get() || !m_mapElement->renderer()) |
67 return 0; | 68 return 0; |
68 | 69 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 else | 135 else |
135 renderer = m_mapElement->renderer(); | 136 renderer = m_mapElement->renderer(); |
136 | 137 |
137 if (!renderer) | 138 if (!renderer) |
138 return LayoutRect(); | 139 return LayoutRect(); |
139 | 140 |
140 return m_areaElement->computeRect(renderer); | 141 return m_areaElement->computeRect(renderer); |
141 } | 142 } |
142 | 143 |
143 } // namespace blink | 144 } // namespace blink |
OLD | NEW |