| 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 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 } | 282 } |
| 283 } else { | 283 } else { |
| 284 if (m_buttonText && !m_buttonText->isBR()) | 284 if (m_buttonText && !m_buttonText->isBR()) |
| 285 m_buttonText->setText(s.impl(), true); | 285 m_buttonText->setText(s.impl(), true); |
| 286 else { | 286 else { |
| 287 // FIXME: We should not modify the structure of the render tree | 287 // FIXME: We should not modify the structure of the render tree |
| 288 // during layout. crbug.com/370462 | 288 // during layout. crbug.com/370462 |
| 289 DeprecatedDisableModifyRenderTreeStructureAsserts disabler; | 289 DeprecatedDisableModifyRenderTreeStructureAsserts disabler; |
| 290 if (m_buttonText) | 290 if (m_buttonText) |
| 291 m_buttonText->destroy(); | 291 m_buttonText->destroy(); |
| 292 m_buttonText = new RenderText(&document(), s.impl()); | 292 m_buttonText = new LayoutText(&document(), s.impl()); |
| 293 m_buttonText->setStyle(style()); | 293 m_buttonText->setStyle(style()); |
| 294 // We need to set the text explicitly though it was specified in the | 294 // We need to set the text explicitly though it was specified in the |
| 295 // constructor because RenderText doesn't refer to the text | 295 // constructor because LayoutText doesn't refer to the text |
| 296 // specified in the constructor in a case of re-transforming. | 296 // specified in the constructor in a case of re-transforming. |
| 297 m_buttonText->setText(s.impl(), true); | 297 m_buttonText->setText(s.impl(), true); |
| 298 addChild(m_buttonText); | 298 addChild(m_buttonText); |
| 299 } | 299 } |
| 300 adjustInnerStyle(); | 300 adjustInnerStyle(); |
| 301 } | 301 } |
| 302 } | 302 } |
| 303 | 303 |
| 304 String RenderMenuList::text() const | 304 String RenderMenuList::text() const |
| 305 { | 305 { |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 592 HTMLElement* element = listItems[listIndex]; | 592 HTMLElement* element = listItems[listIndex]; |
| 593 return isHTMLOptionElement(*element) && toHTMLOptionElement(*element).select
ed(); | 593 return isHTMLOptionElement(*element) && toHTMLOptionElement(*element).select
ed(); |
| 594 } | 594 } |
| 595 | 595 |
| 596 void RenderMenuList::setTextFromItem(unsigned listIndex) | 596 void RenderMenuList::setTextFromItem(unsigned listIndex) |
| 597 { | 597 { |
| 598 setTextFromOption(selectElement()->listToOptionIndex(listIndex)); | 598 setTextFromOption(selectElement()->listToOptionIndex(listIndex)); |
| 599 } | 599 } |
| 600 | 600 |
| 601 } // namespace blink | 601 } // namespace blink |
| OLD | NEW |