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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 innerStyle->setAlignSelf(ItemPositionFlexStart); | 108 innerStyle->setAlignSelf(ItemPositionFlexStart); |
109 } | 109 } |
110 | 110 |
111 innerStyle->setPaddingLeft(Length(RenderTheme::theme().popupInternalPaddingL
eft(style()), Fixed)); | 111 innerStyle->setPaddingLeft(Length(RenderTheme::theme().popupInternalPaddingL
eft(style()), Fixed)); |
112 innerStyle->setPaddingRight(Length(RenderTheme::theme().popupInternalPadding
Right(style()), Fixed)); | 112 innerStyle->setPaddingRight(Length(RenderTheme::theme().popupInternalPadding
Right(style()), Fixed)); |
113 innerStyle->setPaddingTop(Length(RenderTheme::theme().popupInternalPaddingTo
p(style()), Fixed)); | 113 innerStyle->setPaddingTop(Length(RenderTheme::theme().popupInternalPaddingTo
p(style()), Fixed)); |
114 innerStyle->setPaddingBottom(Length(RenderTheme::theme().popupInternalPaddin
gBottom(style()), Fixed)); | 114 innerStyle->setPaddingBottom(Length(RenderTheme::theme().popupInternalPaddin
gBottom(style()), Fixed)); |
115 | 115 |
116 if (m_optionStyle) { | 116 if (m_optionStyle) { |
117 if ((m_optionStyle->direction() != innerStyle->direction() || m_optionSt
yle->unicodeBidi() != innerStyle->unicodeBidi())) | 117 if ((m_optionStyle->direction() != innerStyle->direction() || m_optionSt
yle->unicodeBidi() != innerStyle->unicodeBidi())) |
118 m_innerBlock->setNeedsLayoutAndPrefWidthsRecalcAndFullRepaint(); | 118 m_innerBlock->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidat
ion(); |
119 innerStyle->setTextAlign(style()->isLeftToRightDirection() ? LEFT : RIGH
T); | 119 innerStyle->setTextAlign(style()->isLeftToRightDirection() ? LEFT : RIGH
T); |
120 innerStyle->setDirection(m_optionStyle->direction()); | 120 innerStyle->setDirection(m_optionStyle->direction()); |
121 innerStyle->setUnicodeBidi(m_optionStyle->unicodeBidi()); | 121 innerStyle->setUnicodeBidi(m_optionStyle->unicodeBidi()); |
122 } | 122 } |
123 } | 123 } |
124 | 124 |
125 inline HTMLSelectElement* RenderMenuList::selectElement() const | 125 inline HTMLSelectElement* RenderMenuList::selectElement() const |
126 { | 126 { |
127 return toHTMLSelectElement(node()); | 127 return toHTMLSelectElement(node()); |
128 } | 128 } |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 } else if (!text.isEmpty()) | 185 } else if (!text.isEmpty()) |
186 maxOptionWidth = max(maxOptionWidth, style()->font().width(text)); | 186 maxOptionWidth = max(maxOptionWidth, style()->font().width(text)); |
187 } | 187 } |
188 | 188 |
189 int width = static_cast<int>(ceilf(maxOptionWidth)); | 189 int width = static_cast<int>(ceilf(maxOptionWidth)); |
190 if (m_optionsWidth == width) | 190 if (m_optionsWidth == width) |
191 return; | 191 return; |
192 | 192 |
193 m_optionsWidth = width; | 193 m_optionsWidth = width; |
194 if (parent()) | 194 if (parent()) |
195 setNeedsLayoutAndPrefWidthsRecalcAndFullRepaint(); | 195 setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(); |
196 } | 196 } |
197 | 197 |
198 void RenderMenuList::updateFromElement() | 198 void RenderMenuList::updateFromElement() |
199 { | 199 { |
200 if (m_optionsChanged) { | 200 if (m_optionsChanged) { |
201 updateOptionsWidth(); | 201 updateOptionsWidth(); |
202 m_optionsChanged = false; | 202 m_optionsChanged = false; |
203 } | 203 } |
204 | 204 |
205 if (m_popupIsVisible) { | 205 if (m_popupIsVisible) { |
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
604 HTMLElement* element = listItems[listIndex]; | 604 HTMLElement* element = listItems[listIndex]; |
605 return isHTMLOptionElement(*element) && toHTMLOptionElement(*element).select
ed(); | 605 return isHTMLOptionElement(*element) && toHTMLOptionElement(*element).select
ed(); |
606 } | 606 } |
607 | 607 |
608 void RenderMenuList::setTextFromItem(unsigned listIndex) | 608 void RenderMenuList::setTextFromItem(unsigned listIndex) |
609 { | 609 { |
610 setTextFromOption(selectElement()->listToOptionIndex(listIndex)); | 610 setTextFromOption(selectElement()->listToOptionIndex(listIndex)); |
611 } | 611 } |
612 | 612 |
613 } | 613 } |
OLD | NEW |