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

Side by Side Diff: Source/modules/accessibility/AXARIAGrid.cpp

Issue 991863003: Avoid unnecessary copies of AccessibilityChildrenVector (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 9 months 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
« no previous file with comments | « no previous file | Source/modules/accessibility/AXARIAGridCell.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 for (RefPtr<AXObject> child = firstChild(); child; child = child->nextSiblin g()) { 100 for (RefPtr<AXObject> child = firstChild(); child; child = child->nextSiblin g()) {
101 101
102 if (!addTableCellChild(child.get(), appendedRows, columnCount)) { 102 if (!addTableCellChild(child.get(), appendedRows, columnCount)) {
103 103
104 // in case the layout tree doesn't match the expected ARIA hierarchy , look at the children 104 // in case the layout tree doesn't match the expected ARIA hierarchy , look at the children
105 if (!child->hasChildren()) 105 if (!child->hasChildren())
106 child->addChildren(); 106 child->addChildren();
107 107
108 // The children of this non-row will contain all non-ignored element s (recursing to find them). 108 // The children of this non-row will contain all non-ignored element s (recursing to find them).
109 // This allows the table to dive arbitrarily deep to find the rows. 109 // This allows the table to dive arbitrarily deep to find the rows.
110 AccessibilityChildrenVector children = child->children(); 110 const AccessibilityChildrenVector& children = child->children();
111 size_t length = children.size(); 111 size_t length = children.size();
112 for (size_t i = 0; i < length; ++i) 112 for (size_t i = 0; i < length; ++i)
113 addTableCellChild(children[i].get(), appendedRows, columnCount); 113 addTableCellChild(children[i].get(), appendedRows, columnCount);
114 } 114 }
115 } 115 }
116 116
117 // make the columns based on the number of columns in the first body 117 // make the columns based on the number of columns in the first body
118 for (unsigned i = 0; i < columnCount; ++i) { 118 for (unsigned i = 0; i < columnCount; ++i) {
119 AXTableColumn* column = toAXTableColumn(axCache->getOrCreate(ColumnRole) ); 119 AXTableColumn* column = toAXTableColumn(axCache->getOrCreate(ColumnRole) );
120 column->setColumnIndex((int)i); 120 column->setColumnIndex((int)i);
121 column->setParent(this); 121 column->setParent(this);
122 m_columns.append(column); 122 m_columns.append(column);
123 if (!column->accessibilityIsIgnored()) 123 if (!column->accessibilityIsIgnored())
124 m_children.append(column); 124 m_children.append(column);
125 } 125 }
126 126
127 AXObject* headerContainerObject = headerContainer(); 127 AXObject* headerContainerObject = headerContainer();
128 if (headerContainerObject && !headerContainerObject->accessibilityIsIgnored( )) 128 if (headerContainerObject && !headerContainerObject->accessibilityIsIgnored( ))
129 m_children.append(headerContainerObject); 129 m_children.append(headerContainerObject);
130 } 130 }
131 131
132 } // namespace blink 132 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/modules/accessibility/AXARIAGridCell.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698