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

Side by Side Diff: Source/WebCore/rendering/RenderMenuList.cpp

Issue 12703031: Revert 146726 "AXObjectCache gets recreated during document tear..." (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1453/
Patch Set: Created 7 years, 8 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
« no previous file with comments | « Source/WebCore/rendering/RenderListBox.cpp ('k') | Source/WebCore/rendering/RenderObject.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of the select element renderer in WebCore. 2 * This file is part of the select element renderer in WebCore.
3 * 3 *
4 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 4 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
5 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed. 5 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed.
6 * 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 6 * 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 { 135 {
136 return toHTMLSelectElement(node()); 136 return toHTMLSelectElement(node());
137 } 137 }
138 138
139 void RenderMenuList::addChild(RenderObject* newChild, RenderObject* beforeChild) 139 void RenderMenuList::addChild(RenderObject* newChild, RenderObject* beforeChild)
140 { 140 {
141 createInnerBlock(); 141 createInnerBlock();
142 m_innerBlock->addChild(newChild, beforeChild); 142 m_innerBlock->addChild(newChild, beforeChild);
143 ASSERT(m_innerBlock == firstChild()); 143 ASSERT(m_innerBlock == firstChild());
144 144
145 if (AXObjectCache* cache = document()->existingAXObjectCache()) 145 if (AXObjectCache::accessibilityEnabled())
146 cache->childrenChanged(this); 146 document()->axObjectCache()->childrenChanged(this);
147 } 147 }
148 148
149 void RenderMenuList::removeChild(RenderObject* oldChild) 149 void RenderMenuList::removeChild(RenderObject* oldChild)
150 { 150 {
151 if (oldChild == m_innerBlock || !m_innerBlock) { 151 if (oldChild == m_innerBlock || !m_innerBlock) {
152 RenderFlexibleBox::removeChild(oldChild); 152 RenderFlexibleBox::removeChild(oldChild);
153 m_innerBlock = 0; 153 m_innerBlock = 0;
154 } else 154 } else
155 m_innerBlock->removeChild(oldChild); 155 m_innerBlock->removeChild(oldChild);
156 } 156 }
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 return selectElement()->multiple(); 371 return selectElement()->multiple();
372 } 372 }
373 373
374 void RenderMenuList::didSetSelectedIndex(int listIndex) 374 void RenderMenuList::didSetSelectedIndex(int listIndex)
375 { 375 {
376 didUpdateActiveOption(selectElement()->listToOptionIndex(listIndex)); 376 didUpdateActiveOption(selectElement()->listToOptionIndex(listIndex));
377 } 377 }
378 378
379 void RenderMenuList::didUpdateActiveOption(int optionIndex) 379 void RenderMenuList::didUpdateActiveOption(int optionIndex)
380 { 380 {
381 if (!AXObjectCache::accessibilityEnabled() || !document()->existingAXObjectC ache()) 381 if (!AXObjectCache::accessibilityEnabled())
382 return; 382 return;
383 383
384 if (m_lastActiveIndex == optionIndex) 384 if (m_lastActiveIndex == optionIndex)
385 return; 385 return;
386 m_lastActiveIndex = optionIndex; 386 m_lastActiveIndex = optionIndex;
387 387
388 HTMLSelectElement* select = selectElement(); 388 HTMLSelectElement* select = selectElement();
389 int listIndex = select->optionToListIndex(optionIndex); 389 int listIndex = select->optionToListIndex(optionIndex);
390 if (listIndex < 0 || listIndex >= static_cast<int>(select->listItems().size( ))) 390 if (listIndex < 0 || listIndex >= static_cast<int>(select->listItems().size( )))
391 return; 391 return;
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
612 { 612 {
613 setTextFromOption(selectElement()->listToOptionIndex(listIndex)); 613 setTextFromOption(selectElement()->listToOptionIndex(listIndex));
614 } 614 }
615 615
616 FontSelector* RenderMenuList::fontSelector() const 616 FontSelector* RenderMenuList::fontSelector() const
617 { 617 {
618 return document()->styleResolver()->fontSelector(); 618 return document()->styleResolver()->fontSelector();
619 } 619 }
620 620
621 } 621 }
OLDNEW
« no previous file with comments | « Source/WebCore/rendering/RenderListBox.cpp ('k') | Source/WebCore/rendering/RenderObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698