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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 void LayoutMenuList::adjustInnerStyle() | 102 void LayoutMenuList::adjustInnerStyle() |
103 { | 103 { |
104 ComputedStyle& innerStyle = m_innerBlock->mutableStyleRef(); | 104 ComputedStyle& innerStyle = m_innerBlock->mutableStyleRef(); |
105 innerStyle.setFlexGrow(1); | 105 innerStyle.setFlexGrow(1); |
106 innerStyle.setFlexShrink(1); | 106 innerStyle.setFlexShrink(1); |
107 // min-width: 0; is needed for correct shrinking. | 107 // min-width: 0; is needed for correct shrinking. |
108 innerStyle.setMinWidth(Length(0, Fixed)); | 108 innerStyle.setMinWidth(Length(0, Fixed)); |
109 // Use margin:auto instead of align-items:center to get safe centering, i.e. | 109 // Use margin:auto instead of align-items:center to get safe centering, i.e. |
110 // when the content overflows, treat it the same as align-items: flex-start. | 110 // when the content overflows, treat it the same as align-items: flex-start. |
111 // But we only do that for the cases where html.css would otherwise use cent
er. | 111 // But we only do that for the cases where html.css would otherwise use cent
er. |
112 if (style()->alignItems() == ItemPositionCenter) { | 112 if (style()->alignItemsPosition() == ItemPositionCenter) { |
113 innerStyle.setMarginTop(Length()); | 113 innerStyle.setMarginTop(Length()); |
114 innerStyle.setMarginBottom(Length()); | 114 innerStyle.setMarginBottom(Length()); |
115 innerStyle.setAlignSelf(ItemPositionFlexStart); | 115 innerStyle.setAlignSelfPosition(ItemPositionFlexStart); |
116 } | 116 } |
117 | 117 |
118 innerStyle.setPaddingLeft(Length(LayoutTheme::theme().popupInternalPaddingLe
ft(styleRef()), Fixed)); | 118 innerStyle.setPaddingLeft(Length(LayoutTheme::theme().popupInternalPaddingLe
ft(styleRef()), Fixed)); |
119 innerStyle.setPaddingRight(Length(LayoutTheme::theme().popupInternalPaddingR
ight(styleRef()), Fixed)); | 119 innerStyle.setPaddingRight(Length(LayoutTheme::theme().popupInternalPaddingR
ight(styleRef()), Fixed)); |
120 innerStyle.setPaddingTop(Length(LayoutTheme::theme().popupInternalPaddingTop
(styleRef()), Fixed)); | 120 innerStyle.setPaddingTop(Length(LayoutTheme::theme().popupInternalPaddingTop
(styleRef()), Fixed)); |
121 innerStyle.setPaddingBottom(Length(LayoutTheme::theme().popupInternalPadding
Bottom(styleRef()), Fixed)); | 121 innerStyle.setPaddingBottom(Length(LayoutTheme::theme().popupInternalPadding
Bottom(styleRef()), Fixed)); |
122 | 122 |
123 if (m_optionStyle) { | 123 if (m_optionStyle) { |
124 if ((m_optionStyle->direction() != innerStyle.direction() || m_optionSty
le->unicodeBidi() != innerStyle.unicodeBidi())) | 124 if ((m_optionStyle->direction() != innerStyle.direction() || m_optionSty
le->unicodeBidi() != innerStyle.unicodeBidi())) |
125 m_innerBlock->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidat
ion(LayoutInvalidationReason::StyleChange); | 125 m_innerBlock->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidat
ion(LayoutInvalidationReason::StyleChange); |
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
623 HTMLElement* element = listItems[listIndex]; | 623 HTMLElement* element = listItems[listIndex]; |
624 return isHTMLOptionElement(*element) && toHTMLOptionElement(*element).select
ed(); | 624 return isHTMLOptionElement(*element) && toHTMLOptionElement(*element).select
ed(); |
625 } | 625 } |
626 | 626 |
627 void LayoutMenuList::provisionalSelectionChanged(unsigned listIndex) | 627 void LayoutMenuList::provisionalSelectionChanged(unsigned listIndex) |
628 { | 628 { |
629 setIndexToSelectOnCancel(listIndex); | 629 setIndexToSelectOnCancel(listIndex); |
630 } | 630 } |
631 | 631 |
632 } // namespace blink | 632 } // namespace blink |
OLD | NEW |