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 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 if (selectedCount == 1) { | 250 if (selectedCount == 1) { |
251 ASSERT(0 <= firstSelectedIndex); | 251 ASSERT(0 <= firstSelectedIndex); |
252 ASSERT(firstSelectedIndex < size); | 252 ASSERT(firstSelectedIndex < size); |
253 HTMLOptionElement* selectedOptionElement = toHTMLOptionElement(listI
tems[firstSelectedIndex]); | 253 HTMLOptionElement* selectedOptionElement = toHTMLOptionElement(listI
tems[firstSelectedIndex]); |
254 ASSERT(selectedOptionElement->selected()); | 254 ASSERT(selectedOptionElement->selected()); |
255 text = selectedOptionElement->textIndentedToRespectGroupLabel(); | 255 text = selectedOptionElement->textIndentedToRespectGroupLabel(); |
256 m_optionStyle = selectedOptionElement->renderStyle(); | 256 m_optionStyle = selectedOptionElement->renderStyle(); |
257 } else { | 257 } else { |
258 Locale& locale = select->locale(); | 258 Locale& locale = select->locale(); |
259 String localizedNumberString = locale.convertToLocalizedNumber(Strin
g::number(selectedCount)); | 259 String localizedNumberString = locale.convertToLocalizedNumber(Strin
g::number(selectedCount)); |
260 text = locale.queryString(blink::WebLocalizedString::SelectMenuListT
ext, localizedNumberString); | 260 text = locale.queryString(WebLocalizedString::SelectMenuListText, lo
calizedNumberString); |
261 ASSERT(!m_optionStyle); | 261 ASSERT(!m_optionStyle); |
262 } | 262 } |
263 } else { | 263 } else { |
264 const int i = select->optionToListIndex(optionIndex); | 264 const int i = select->optionToListIndex(optionIndex); |
265 if (i >= 0 && i < size) { | 265 if (i >= 0 && i < size) { |
266 Element* element = listItems[i]; | 266 Element* element = listItems[i]; |
267 if (isHTMLOptionElement(*element)) { | 267 if (isHTMLOptionElement(*element)) { |
268 text = toHTMLOptionElement(element)->textIndentedToRespectGroupL
abel(); | 268 text = toHTMLOptionElement(element)->textIndentedToRespectGroupL
abel(); |
269 m_optionStyle = element->renderStyle(); | 269 m_optionStyle = element->renderStyle(); |
270 } | 270 } |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
616 return false; | 616 return false; |
617 HTMLElement* element = listItems[listIndex]; | 617 HTMLElement* element = listItems[listIndex]; |
618 return isHTMLOptionElement(*element) && toHTMLOptionElement(*element).select
ed(); | 618 return isHTMLOptionElement(*element) && toHTMLOptionElement(*element).select
ed(); |
619 } | 619 } |
620 | 620 |
621 void RenderMenuList::setTextFromItem(unsigned listIndex) | 621 void RenderMenuList::setTextFromItem(unsigned listIndex) |
622 { | 622 { |
623 setTextFromOption(selectElement()->listToOptionIndex(listIndex)); | 623 setTextFromOption(selectElement()->listToOptionIndex(listIndex)); |
624 } | 624 } |
625 | 625 |
626 } | 626 } // namespace blink |
OLD | NEW |