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

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

Issue 267053002: ASSERT on renderer lifecycle (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
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 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 } 228 }
229 229
230 setText(text.stripWhiteSpace()); 230 setText(text.stripWhiteSpace());
231 didUpdateActiveOption(optionIndex); 231 didUpdateActiveOption(optionIndex);
232 } 232 }
233 233
234 void RenderMenuList::setText(const String& s) 234 void RenderMenuList::setText(const String& s)
235 { 235 {
236 if (s.isEmpty()) { 236 if (s.isEmpty()) {
237 if (!m_buttonText || !m_buttonText->isBR()) { 237 if (!m_buttonText || !m_buttonText->isBR()) {
238 // FIXME: We should not modify the structure of the render tree outs ide of
239 // recalc style. crbug.com/370462
240 DeprecatedDisableModifyRenderTreeStructureAsserts disabler;
238 if (m_buttonText) 241 if (m_buttonText)
239 m_buttonText->destroy(); 242 m_buttonText->destroy();
240 m_buttonText = new RenderBR(&document()); 243 m_buttonText = new RenderBR(&document());
241 m_buttonText->setStyle(style()); 244 m_buttonText->setStyle(style());
242 addChild(m_buttonText); 245 addChild(m_buttonText);
243 } 246 }
244 } else { 247 } else {
245 if (m_buttonText && !m_buttonText->isBR()) 248 if (m_buttonText && !m_buttonText->isBR())
246 m_buttonText->setText(s.impl(), true); 249 m_buttonText->setText(s.impl(), true);
247 else { 250 else {
251 // FIXME: We should not modify the structure of the render tree outs ide of
252 // recalc style. crbug.com/370462
253 DeprecatedDisableModifyRenderTreeStructureAsserts disabler;
248 if (m_buttonText) 254 if (m_buttonText)
249 m_buttonText->destroy(); 255 m_buttonText->destroy();
250 m_buttonText = new RenderText(&document(), s.impl()); 256 m_buttonText = new RenderText(&document(), s.impl());
251 m_buttonText->setStyle(style()); 257 m_buttonText->setStyle(style());
252 // We need to set the text explicitly though it was specified in the 258 // We need to set the text explicitly though it was specified in the
253 // constructor because RenderText doesn't refer to the text 259 // constructor because RenderText doesn't refer to the text
254 // specified in the constructor in a case of re-transforming. 260 // specified in the constructor in a case of re-transforming.
255 m_buttonText->setText(s.impl(), true); 261 m_buttonText->setText(s.impl(), true);
256 addChild(m_buttonText); 262 addChild(m_buttonText);
257 } 263 }
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
565 HTMLElement* element = listItems[listIndex]; 571 HTMLElement* element = listItems[listIndex];
566 return isHTMLOptionElement(*element) && toHTMLOptionElement(*element).select ed(); 572 return isHTMLOptionElement(*element) && toHTMLOptionElement(*element).select ed();
567 } 573 }
568 574
569 void RenderMenuList::setTextFromItem(unsigned listIndex) 575 void RenderMenuList::setTextFromItem(unsigned listIndex)
570 { 576 {
571 setTextFromOption(selectElement()->listToOptionIndex(listIndex)); 577 setTextFromOption(selectElement()->listToOptionIndex(listIndex));
572 } 578 }
573 579
574 } 580 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698