| OLD | NEW |
| 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 28 matching lines...) Expand all Loading... |
| 39 | 39 |
| 40 AXARIAGrid::AXARIAGrid(LayoutObject* layoutObject, AXObjectCacheImpl* axObjectCa
che) | 40 AXARIAGrid::AXARIAGrid(LayoutObject* layoutObject, AXObjectCacheImpl* axObjectCa
che) |
| 41 : AXTable(layoutObject, axObjectCache) | 41 : AXTable(layoutObject, axObjectCache) |
| 42 { | 42 { |
| 43 } | 43 } |
| 44 | 44 |
| 45 AXARIAGrid::~AXARIAGrid() | 45 AXARIAGrid::~AXARIAGrid() |
| 46 { | 46 { |
| 47 } | 47 } |
| 48 | 48 |
| 49 PassRefPtr<AXARIAGrid> AXARIAGrid::create(LayoutObject* layoutObject, AXObjectCa
cheImpl* axObjectCache) | 49 PassRefPtrWillBeRawPtr<AXARIAGrid> AXARIAGrid::create(LayoutObject* layoutObject
, AXObjectCacheImpl* axObjectCache) |
| 50 { | 50 { |
| 51 return adoptRef(new AXARIAGrid(layoutObject, axObjectCache)); | 51 return adoptRefWillBeNoop(new AXARIAGrid(layoutObject, axObjectCache)); |
| 52 } | 52 } |
| 53 | 53 |
| 54 bool AXARIAGrid::addTableCellChild(AXObject* child, HashSet<AXObject*>& appended
Rows, unsigned& columnCount) | 54 bool AXARIAGrid::addTableCellChild(AXObject* child, HashSet<AXObject*>& appended
Rows, unsigned& columnCount) |
| 55 { | 55 { |
| 56 if (!child || !child->isTableRow() || child->ariaRoleAttribute() != RowRole) | 56 if (!child || !child->isTableRow() || child->ariaRoleAttribute() != RowRole) |
| 57 return false; | 57 return false; |
| 58 | 58 |
| 59 AXTableRow* row = toAXTableRow(child); | 59 AXTableRow* row = toAXTableRow(child); |
| 60 if (appendedRows.contains(row)) | 60 if (appendedRows.contains(row)) |
| 61 return false; | 61 return false; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 90 | 90 |
| 91 m_haveChildren = true; | 91 m_haveChildren = true; |
| 92 if (!m_layoutObject) | 92 if (!m_layoutObject) |
| 93 return; | 93 return; |
| 94 | 94 |
| 95 AXObjectCacheImpl* axCache = axObjectCache(); | 95 AXObjectCacheImpl* axCache = axObjectCache(); |
| 96 | 96 |
| 97 // add only rows that are labeled as aria rows | 97 // add only rows that are labeled as aria rows |
| 98 HashSet<AXObject*> appendedRows; | 98 HashSet<AXObject*> appendedRows; |
| 99 unsigned columnCount = 0; | 99 unsigned columnCount = 0; |
| 100 for (RefPtr<AXObject> child = firstChild(); child; child = child->nextSiblin
g()) { | 100 for (RefPtrWillBeRawPtr<AXObject> child = firstChild(); child; child = child
->nextSibling()) { |
| 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 for (const auto& childObject : child->children()) | 110 for (const auto& childObject : child->children()) |
| (...skipping 10 matching lines...) Expand all Loading... |
| 121 if (!column->accessibilityIsIgnored()) | 121 if (!column->accessibilityIsIgnored()) |
| 122 m_children.append(column); | 122 m_children.append(column); |
| 123 } | 123 } |
| 124 | 124 |
| 125 AXObject* headerContainerObject = headerContainer(); | 125 AXObject* headerContainerObject = headerContainer(); |
| 126 if (headerContainerObject && !headerContainerObject->accessibilityIsIgnored(
)) | 126 if (headerContainerObject && !headerContainerObject->accessibilityIsIgnored(
)) |
| 127 m_children.append(headerContainerObject); | 127 m_children.append(headerContainerObject); |
| 128 } | 128 } |
| 129 | 129 |
| 130 } // namespace blink | 130 } // namespace blink |
| OLD | NEW |