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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
112 innerStyle.setAlignSelf(ItemPositionFlexStart); | 112 innerStyle.setAlignSelf(ItemPositionFlexStart); |
113 } | 113 } |
114 | 114 |
115 innerStyle.setPaddingLeft(Length(LayoutTheme::theme().popupInternalPaddingLe ft(styleRef()), Fixed)); | 115 innerStyle.setPaddingLeft(Length(LayoutTheme::theme().popupInternalPaddingLe ft(styleRef()), Fixed)); |
116 innerStyle.setPaddingRight(Length(LayoutTheme::theme().popupInternalPaddingR ight(styleRef()), Fixed)); | 116 innerStyle.setPaddingRight(Length(LayoutTheme::theme().popupInternalPaddingR ight(styleRef()), Fixed)); |
117 innerStyle.setPaddingTop(Length(LayoutTheme::theme().popupInternalPaddingTop (styleRef()), Fixed)); | 117 innerStyle.setPaddingTop(Length(LayoutTheme::theme().popupInternalPaddingTop (styleRef()), Fixed)); |
118 innerStyle.setPaddingBottom(Length(LayoutTheme::theme().popupInternalPadding Bottom(styleRef()), Fixed)); | 118 innerStyle.setPaddingBottom(Length(LayoutTheme::theme().popupInternalPadding Bottom(styleRef()), Fixed)); |
119 | 119 |
120 if (m_optionStyle) { | 120 if (m_optionStyle) { |
121 if ((m_optionStyle->direction() != innerStyle.direction() || m_optionSty le->unicodeBidi() != innerStyle.unicodeBidi())) | 121 if ((m_optionStyle->direction() != innerStyle.direction() || m_optionSty le->unicodeBidi() != innerStyle.unicodeBidi())) |
122 m_innerBlock->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidat ion(); | 122 m_innerBlock->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidat ion(LayoutInvalidationReason::StyleChange); |
123 innerStyle.setTextAlign(style()->isLeftToRightDirection() ? LEFT : RIGHT ); | 123 innerStyle.setTextAlign(style()->isLeftToRightDirection() ? LEFT : RIGHT ); |
124 innerStyle.setDirection(m_optionStyle->direction()); | 124 innerStyle.setDirection(m_optionStyle->direction()); |
125 innerStyle.setUnicodeBidi(m_optionStyle->unicodeBidi()); | 125 innerStyle.setUnicodeBidi(m_optionStyle->unicodeBidi()); |
126 } | 126 } |
127 } | 127 } |
128 | 128 |
129 inline HTMLSelectElement* LayoutMenuList::selectElement() const | 129 inline HTMLSelectElement* LayoutMenuList::selectElement() const |
130 { | 130 { |
131 return toHTMLSelectElement(node()); | 131 return toHTMLSelectElement(node()); |
132 } | 132 } |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
190 maxOptionWidth = std::max(maxOptionWidth, style()->font().width(text )); | 190 maxOptionWidth = std::max(maxOptionWidth, style()->font().width(text )); |
191 } | 191 } |
192 } | 192 } |
193 | 193 |
194 int width = static_cast<int>(ceilf(maxOptionWidth)); | 194 int width = static_cast<int>(ceilf(maxOptionWidth)); |
195 if (m_optionsWidth == width) | 195 if (m_optionsWidth == width) |
196 return; | 196 return; |
197 | 197 |
198 m_optionsWidth = width; | 198 m_optionsWidth = width; |
199 if (parent()) | 199 if (parent()) |
200 setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(); | 200 setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(LayoutInvalida tionReason::Unknown); |
esprehn
2015/03/23 20:19:44
StyleChange
pdr.
2015/03/24 03:56:18
This can be called for other reasons such as updat
| |
201 } | 201 } |
202 | 202 |
203 void LayoutMenuList::updateFromElement() | 203 void LayoutMenuList::updateFromElement() |
204 { | 204 { |
205 if (m_optionsChanged) { | 205 if (m_optionsChanged) { |
206 updateOptionsWidth(); | 206 updateOptionsWidth(); |
207 m_optionsChanged = false; | 207 m_optionsChanged = false; |
208 } | 208 } |
209 | 209 |
210 if (m_popupIsVisible) | 210 if (m_popupIsVisible) |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
593 HTMLElement* element = listItems[listIndex]; | 593 HTMLElement* element = listItems[listIndex]; |
594 return isHTMLOptionElement(*element) && toHTMLOptionElement(*element).select ed(); | 594 return isHTMLOptionElement(*element) && toHTMLOptionElement(*element).select ed(); |
595 } | 595 } |
596 | 596 |
597 void LayoutMenuList::setTextFromItem(unsigned listIndex) | 597 void LayoutMenuList::setTextFromItem(unsigned listIndex) |
598 { | 598 { |
599 setTextFromOption(selectElement()->listToOptionIndex(listIndex)); | 599 setTextFromOption(selectElement()->listToOptionIndex(listIndex)); |
600 } | 600 } |
601 | 601 |
602 } // namespace blink | 602 } // namespace blink |
OLD | NEW |