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

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

Issue 2393003002: reflow comments in modules/accessiblity (Closed)
Patch Set: Created 4 years, 2 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
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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 } 77 }
78 78
79 AXObject* AXTableCell::parentTable() const { 79 AXObject* AXTableCell::parentTable() const {
80 if (!m_layoutObject || !m_layoutObject->isTableCell()) 80 if (!m_layoutObject || !m_layoutObject->isTableCell())
81 return 0; 81 return 0;
82 82
83 // If the document no longer exists, we might not have an axObjectCache. 83 // If the document no longer exists, we might not have an axObjectCache.
84 if (isDetached()) 84 if (isDetached())
85 return 0; 85 return 0;
86 86
87 // Do not use getOrCreate. parentTable() can be called while the layout tree i s being modified 87 // Do not use getOrCreate. parentTable() can be called while the layout tree
88 // by javascript, and creating a table element may try to access the layout tr ee while in a bad state. 88 // is being modified by javascript, and creating a table element may try to
89 // By using only get() implies that the AXTable must be created before AXTable Cells. This should 89 // access the layout tree while in a bad state. By using only get() implies
90 // always be the case when AT clients access a table. 90 // that the AXTable must be created before AXTableCells. This should always be
91 // the case when AT clients access a table.
91 // https://bugs.webkit.org/show_bug.cgi?id=42652 92 // https://bugs.webkit.org/show_bug.cgi?id=42652
92 return axObjectCache().get(toLayoutTableCell(m_layoutObject)->table()); 93 return axObjectCache().get(toLayoutTableCell(m_layoutObject)->table());
93 } 94 }
94 95
95 bool AXTableCell::isTableCell() const { 96 bool AXTableCell::isTableCell() const {
96 AXObject* parent = parentObjectUnignored(); 97 AXObject* parent = parentObjectUnignored();
97 if (!parent || !parent->isTableRow()) 98 if (!parent || !parent->isTableRow())
98 return false; 99 return false;
99 100
100 return true; 101 return true;
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 } 153 }
153 154
154 void AXTableCell::rowIndexRange(std::pair<unsigned, unsigned>& rowRange) { 155 void AXTableCell::rowIndexRange(std::pair<unsigned, unsigned>& rowRange) {
155 if (!m_layoutObject || !m_layoutObject->isTableCell()) 156 if (!m_layoutObject || !m_layoutObject->isTableCell())
156 return; 157 return;
157 158
158 LayoutTableCell* layoutCell = toLayoutTableCell(m_layoutObject); 159 LayoutTableCell* layoutCell = toLayoutTableCell(m_layoutObject);
159 rowRange.first = layoutCell->rowIndex(); 160 rowRange.first = layoutCell->rowIndex();
160 rowRange.second = layoutCell->rowSpan(); 161 rowRange.second = layoutCell->rowSpan();
161 162
162 // since our table might have multiple sections, we have to offset our row app ropriately 163 // Since our table might have multiple sections, we have to offset our row
164 // appropriately.
163 LayoutTableSection* section = layoutCell->section(); 165 LayoutTableSection* section = layoutCell->section();
164 LayoutTable* table = layoutCell->table(); 166 LayoutTable* table = layoutCell->table();
165 if (!table || !section) 167 if (!table || !section)
166 return; 168 return;
167 169
168 LayoutTableSection* tableSection = table->topSection(); 170 LayoutTableSection* tableSection = table->topSection();
169 unsigned rowOffset = 0; 171 unsigned rowOffset = 0;
170 while (tableSection) { 172 while (tableSection) {
171 if (tableSection == section) 173 if (tableSection == section)
172 break; 174 break;
(...skipping 28 matching lines...) Expand all
201 if (equalIgnoringCase(ariaSort, "ascending")) 203 if (equalIgnoringCase(ariaSort, "ascending"))
202 return SortDirectionAscending; 204 return SortDirectionAscending;
203 if (equalIgnoringCase(ariaSort, "descending")) 205 if (equalIgnoringCase(ariaSort, "descending"))
204 return SortDirectionDescending; 206 return SortDirectionDescending;
205 if (equalIgnoringCase(ariaSort, "other")) 207 if (equalIgnoringCase(ariaSort, "other"))
206 return SortDirectionOther; 208 return SortDirectionOther;
207 return SortDirectionUndefined; 209 return SortDirectionUndefined;
208 } 210 }
209 211
210 } // namespace blink 212 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698