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

Side by Side Diff: Source/modules/accessibility/AXNodeObject.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
OLDNEW
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 1635 matching lines...) Expand 10 before | Expand all | Expand 10 after
1646 { 1646 {
1647 if (!child) 1647 if (!child)
1648 return; 1648 return;
1649 1649
1650 // If the parent is asking for this child's children, then either it's the f irst time (and clearing is a no-op), 1650 // If the parent is asking for this child's children, then either it's the f irst time (and clearing is a no-op),
1651 // or its visibility has changed. In the latter case, this child may have a stale child cached. 1651 // or its visibility has changed. In the latter case, this child may have a stale child cached.
1652 // This can prevent aria-hidden changes from working correctly. Hence, whene ver a parent is getting children, ensure data is not stale. 1652 // This can prevent aria-hidden changes from working correctly. Hence, whene ver a parent is getting children, ensure data is not stale.
1653 child->clearChildren(); 1653 child->clearChildren();
1654 1654
1655 if (child->accessibilityIsIgnored()) { 1655 if (child->accessibilityIsIgnored()) {
1656 AccessibilityChildrenVector children = child->children(); 1656 const AccessibilityChildrenVector& children = child->children();
1657 size_t length = children.size(); 1657 size_t length = children.size();
1658 for (size_t i = 0; i < length; ++i) 1658 for (size_t i = 0; i < length; ++i)
1659 m_children.insert(index + i, children[i]); 1659 m_children.insert(index + i, children[i]);
1660 } else { 1660 } else {
1661 ASSERT(child->parentObject() == this); 1661 ASSERT(child->parentObject() == this);
1662 m_children.insert(index, child); 1662 m_children.insert(index, child);
1663 } 1663 }
1664 } 1664 }
1665 1665
1666 bool AXNodeObject::canHaveChildren() const 1666 bool AXNodeObject::canHaveChildren() const
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
1992 float range = maxValueForRange() - minValueForRange(); 1992 float range = maxValueForRange() - minValueForRange();
1993 float value = valueForRange(); 1993 float value = valueForRange();
1994 1994
1995 value += range * (percentChange / 100); 1995 value += range * (percentChange / 100);
1996 setValue(String::number(value)); 1996 setValue(String::number(value));
1997 1997
1998 axObjectCache()->postNotification(node(), AXObjectCacheImpl::AXValueChanged, true); 1998 axObjectCache()->postNotification(node(), AXObjectCacheImpl::AXValueChanged, true);
1999 } 1999 }
2000 2000
2001 } // namespace blink 2001 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/accessibility/AXLayoutObject.cpp ('k') | Source/modules/accessibility/AXObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698