OLD | NEW |
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 Loading... |
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 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
606 { | 606 { |
607 setTextFromOption(selectElement()->listToOptionIndex(listIndex)); | 607 setTextFromOption(selectElement()->listToOptionIndex(listIndex)); |
608 } | 608 } |
609 | 609 |
610 FontSelector* RenderMenuList::fontSelector() const | 610 FontSelector* RenderMenuList::fontSelector() const |
611 { | 611 { |
612 return document()->styleResolver()->fontSelector(); | 612 return document()->styleResolver()->fontSelector(); |
613 } | 613 } |
614 | 614 |
615 } | 615 } |
OLD | NEW |