| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012, Google Inc. All rights reserved. | 2 * Copyright (C) 2012, Google 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 1904 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1915 parentNode = toHTMLOptionElement(node)->ownerSelectElement(); | 1915 parentNode = toHTMLOptionElement(node)->ownerSelectElement(); |
| 1916 | 1916 |
| 1917 if (!parentNode) | 1917 if (!parentNode) |
| 1918 parentNode = node->parentNode(); | 1918 parentNode = node->parentNode(); |
| 1919 | 1919 |
| 1920 return parentNode; | 1920 return parentNode; |
| 1921 } | 1921 } |
| 1922 | 1922 |
| 1923 AXObject* AXNodeObject::computeParent() const | 1923 AXObject* AXNodeObject::computeParent() const |
| 1924 { | 1924 { |
| 1925 ASSERT(!isDetached()); |
| 1925 if (Node* parentNode = getParentNodeForComputeParent(node())) | 1926 if (Node* parentNode = getParentNodeForComputeParent(node())) |
| 1926 return axObjectCache().getOrCreate(parentNode); | 1927 return axObjectCache().getOrCreate(parentNode); |
| 1927 | 1928 |
| 1928 return nullptr; | 1929 return nullptr; |
| 1929 } | 1930 } |
| 1930 | 1931 |
| 1931 AXObject* AXNodeObject::computeParentIfExists() const | 1932 AXObject* AXNodeObject::computeParentIfExists() const |
| 1932 { | 1933 { |
| 1933 if (Node* parentNode = getParentNodeForComputeParent(node())) | 1934 if (Node* parentNode = getParentNodeForComputeParent(node())) |
| 1934 return axObjectCache().get(parentNode); | 1935 return axObjectCache().get(parentNode); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 1956 | 1957 |
| 1957 Node* nextSibling = node()->nextSibling(); | 1958 Node* nextSibling = node()->nextSibling(); |
| 1958 if (!nextSibling) | 1959 if (!nextSibling) |
| 1959 return 0; | 1960 return 0; |
| 1960 | 1961 |
| 1961 return axObjectCache().getOrCreate(nextSibling); | 1962 return axObjectCache().getOrCreate(nextSibling); |
| 1962 } | 1963 } |
| 1963 | 1964 |
| 1964 void AXNodeObject::addChildren() | 1965 void AXNodeObject::addChildren() |
| 1965 { | 1966 { |
| 1967 ASSERT(!isDetached()); |
| 1966 // If the need to add more children in addition to existing children arises, | 1968 // If the need to add more children in addition to existing children arises, |
| 1967 // childrenChanged should have been called, leaving the object with no child
ren. | 1969 // childrenChanged should have been called, leaving the object with no child
ren. |
| 1968 ASSERT(!m_haveChildren); | 1970 ASSERT(!m_haveChildren); |
| 1969 | 1971 |
| 1970 if (!m_node) | 1972 if (!m_node) |
| 1971 return; | 1973 return; |
| 1972 | 1974 |
| 1973 m_haveChildren = true; | 1975 m_haveChildren = true; |
| 1974 | 1976 |
| 1975 // The only time we add children from the DOM tree to a node with a layoutOb
ject is when it's a canvas. | 1977 // The only time we add children from the DOM tree to a node with a layoutOb
ject is when it's a canvas. |
| (...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2361 } | 2363 } |
| 2362 } | 2364 } |
| 2363 | 2365 |
| 2364 DEFINE_TRACE(AXNodeObject) | 2366 DEFINE_TRACE(AXNodeObject) |
| 2365 { | 2367 { |
| 2366 visitor->trace(m_node); | 2368 visitor->trace(m_node); |
| 2367 AXObject::trace(visitor); | 2369 AXObject::trace(visitor); |
| 2368 } | 2370 } |
| 2369 | 2371 |
| 2370 } // namespace blink | 2372 } // namespace blink |
| OLD | NEW |