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

Side by Side Diff: third_party/WebKit/Source/modules/accessibility/AXTableColumn.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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 return false; 130 return false;
131 131
132 if (ignoredReasons) 132 if (ignoredReasons)
133 m_parent->computeAccessibilityIsIgnored(ignoredReasons); 133 m_parent->computeAccessibilityIsIgnored(ignoredReasons);
134 134
135 return true; 135 return true;
136 } 136 }
137 137
138 void AXTableColumn::addChildren() 138 void AXTableColumn::addChildren()
139 { 139 {
140 ASSERT(!isDetached());
140 ASSERT(!m_haveChildren); 141 ASSERT(!m_haveChildren);
141 142
142 m_haveChildren = true; 143 m_haveChildren = true;
143 if (!m_parent || !m_parent->isAXTable()) 144 if (!m_parent || !m_parent->isAXTable())
144 return; 145 return;
145 146
146 AXTable* parentTable = toAXTable(m_parent); 147 AXTable* parentTable = toAXTable(m_parent);
147 int numRows = parentTable->rowCount(); 148 int numRows = parentTable->rowCount();
148 149
149 for (int i = 0; i < numRows; i++) { 150 for (int i = 0; i < numRows; i++) {
150 AXTableCell* cell = parentTable->cellForColumnAndRow(m_columnIndex, i); 151 AXTableCell* cell = parentTable->cellForColumnAndRow(m_columnIndex, i);
151 if (!cell) 152 if (!cell)
152 continue; 153 continue;
153 154
154 // make sure the last one isn't the same as this one (rowspan cells) 155 // make sure the last one isn't the same as this one (rowspan cells)
155 if (m_children.size() > 0 && m_children.last() == cell) 156 if (m_children.size() > 0 && m_children.last() == cell)
156 continue; 157 continue;
157 158
158 m_children.append(cell); 159 m_children.append(cell);
159 m_columnRect.unite(cell->elementRect()); 160 m_columnRect.unite(cell->elementRect());
160 } 161 }
161 } 162 }
162 163
163 } // namespace blink 164 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698