Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(277)

Side by Side Diff: third_party/WebKit/Source/modules/accessibility/AXImageMapLink.cpp

Issue 1207613004: Fix leaking AXNodeObjects when sub document detaches (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebased Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 HTMLMapElement* AXImageMapLink::mapElement() const 54 HTMLMapElement* AXImageMapLink::mapElement() const
55 { 55 {
56 HTMLAreaElement* area = areaElement(); 56 HTMLAreaElement* area = areaElement();
57 if (!area) 57 if (!area)
58 return nullptr; 58 return nullptr;
59 return Traversal<HTMLMapElement>::firstAncestor(*area); 59 return Traversal<HTMLMapElement>::firstAncestor(*area);
60 } 60 }
61 61
62 AXObject* AXImageMapLink::computeParent() const 62 AXObject* AXImageMapLink::computeParent() const
63 { 63 {
64 ASSERT(!isDetached());
64 if (m_parent) 65 if (m_parent)
65 return m_parent; 66 return m_parent;
66 67
67 if (!mapElement()) 68 if (!mapElement())
68 return nullptr; 69 return nullptr;
69 70
70 return axObjectCache().getOrCreate(mapElement()->layoutObject()); 71 return axObjectCache().getOrCreate(mapElement()->layoutObject());
71 } 72 }
72 73
73 AccessibilityRole AXImageMapLink::roleValue() const 74 AccessibilityRole AXImageMapLink::roleValue() const
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 145
145 return area->computeRect(layoutObject); 146 return area->computeRect(layoutObject);
146 } 147 }
147 148
148 DEFINE_TRACE(AXImageMapLink) 149 DEFINE_TRACE(AXImageMapLink)
149 { 150 {
150 AXNodeObject::trace(visitor); 151 AXNodeObject::trace(visitor);
151 } 152 }
152 153
153 } // namespace blink 154 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698