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

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

Issue 20231002: Replace RenderArena with PartitionAlloc (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase. Created 7 years, 4 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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 setText(text.stripWhiteSpace()); 229 setText(text.stripWhiteSpace());
230 didUpdateActiveOption(optionIndex); 230 didUpdateActiveOption(optionIndex);
231 } 231 }
232 232
233 void RenderMenuList::setText(const String& s) 233 void RenderMenuList::setText(const String& s)
234 { 234 {
235 if (s.isEmpty()) { 235 if (s.isEmpty()) {
236 if (!m_buttonText || !m_buttonText->isBR()) { 236 if (!m_buttonText || !m_buttonText->isBR()) {
237 if (m_buttonText) 237 if (m_buttonText)
238 m_buttonText->destroy(); 238 m_buttonText->destroy();
239 m_buttonText = new (renderArena()) RenderBR(document()); 239 m_buttonText = new RenderBR(document());
240 m_buttonText->setStyle(style()); 240 m_buttonText->setStyle(style());
241 addChild(m_buttonText); 241 addChild(m_buttonText);
242 } 242 }
243 } else { 243 } else {
244 if (m_buttonText && !m_buttonText->isBR()) 244 if (m_buttonText && !m_buttonText->isBR())
245 m_buttonText->setText(s.impl(), true); 245 m_buttonText->setText(s.impl(), true);
246 else { 246 else {
247 if (m_buttonText) 247 if (m_buttonText)
248 m_buttonText->destroy(); 248 m_buttonText->destroy();
249 m_buttonText = new (renderArena()) RenderText(document(), s.impl()); 249 m_buttonText = new RenderText(document(), s.impl());
250 m_buttonText->setStyle(style()); 250 m_buttonText->setStyle(style());
251 // We need to set the text explicitly though it was specified in the 251 // We need to set the text explicitly though it was specified in the
252 // constructor because RenderText doesn't refer to the text 252 // constructor because RenderText doesn't refer to the text
253 // specified in the constructor in a case of re-transforming. 253 // specified in the constructor in a case of re-transforming.
254 m_buttonText->setText(s.impl(), true); 254 m_buttonText->setText(s.impl(), true);
255 addChild(m_buttonText); 255 addChild(m_buttonText);
256 } 256 }
257 adjustInnerStyle(); 257 adjustInnerStyle();
258 } 258 }
259 } 259 }
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
611 { 611 {
612 setTextFromOption(selectElement()->listToOptionIndex(listIndex)); 612 setTextFromOption(selectElement()->listToOptionIndex(listIndex));
613 } 613 }
614 614
615 FontSelector* RenderMenuList::fontSelector() const 615 FontSelector* RenderMenuList::fontSelector() const
616 { 616 {
617 return document()->styleResolver()->fontSelector(); 617 return document()->styleResolver()->fontSelector();
618 } 618 }
619 619
620 } 620 }
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderListMarker.cpp ('k') | Source/core/rendering/RenderMultiColumnFlowThread.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698