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

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

Issue 1207613004: Fix leaking AXNodeObjects when sub document detaches (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebased Created 5 years, 1 month 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) 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2011 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 m_spinButtonElement = nullptr; 73 m_spinButtonElement = nullptr;
74 } 74 }
75 75
76 AccessibilityRole AXSpinButton::roleValue() const 76 AccessibilityRole AXSpinButton::roleValue() const
77 { 77 {
78 return m_spinButtonElement ? SpinButtonRole : UnknownRole; 78 return m_spinButtonElement ? SpinButtonRole : UnknownRole;
79 } 79 }
80 80
81 void AXSpinButton::addChildren() 81 void AXSpinButton::addChildren()
82 { 82 {
83 ASSERT(!isDetached());
83 m_haveChildren = true; 84 m_haveChildren = true;
84 85
85 AXSpinButtonPart* incrementor = toAXSpinButtonPart(axObjectCache().getOrCrea te(SpinButtonPartRole)); 86 AXSpinButtonPart* incrementor = toAXSpinButtonPart(axObjectCache().getOrCrea te(SpinButtonPartRole));
86 incrementor->setIsIncrementor(true); 87 incrementor->setIsIncrementor(true);
87 incrementor->setParent(this); 88 incrementor->setParent(this);
88 m_children.append(incrementor); 89 m_children.append(incrementor);
89 90
90 AXSpinButtonPart* decrementor = toAXSpinButtonPart(axObjectCache().getOrCrea te(SpinButtonPartRole)); 91 AXSpinButtonPart* decrementor = toAXSpinButtonPart(axObjectCache().getOrCrea te(SpinButtonPartRole));
91 decrementor->setIsIncrementor(false); 92 decrementor->setIsIncrementor(false);
92 decrementor->setParent(this); 93 decrementor->setParent(this);
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 AXSpinButton* spinButton = toAXSpinButton(parentObject()); 140 AXSpinButton* spinButton = toAXSpinButton(parentObject());
140 if (m_isIncrementor) 141 if (m_isIncrementor)
141 spinButton->step(1); 142 spinButton->step(1);
142 else 143 else
143 spinButton->step(-1); 144 spinButton->step(-1);
144 145
145 return true; 146 return true;
146 } 147 }
147 148
148 } // namespace blink 149 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698