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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 m_innerBlock = createAnonymousBlock(); | 97 m_innerBlock = createAnonymousBlock(); |
98 adjustInnerStyle(); | 98 adjustInnerStyle(); |
99 LayoutFlexibleBox::addChild(m_innerBlock); | 99 LayoutFlexibleBox::addChild(m_innerBlock); |
100 } | 100 } |
101 | 101 |
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. |
| 108 innerStyle.setMinWidth(Length(0, Fixed)); |
107 // 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. |
108 // 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. |
109 // 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. |
110 if (style()->alignItems() == ItemPositionCenter) { | 112 if (style()->alignItems() == ItemPositionCenter) { |
111 innerStyle.setMarginTop(Length()); | 113 innerStyle.setMarginTop(Length()); |
112 innerStyle.setMarginBottom(Length()); | 114 innerStyle.setMarginBottom(Length()); |
113 innerStyle.setAlignSelf(ItemPositionFlexStart); | 115 innerStyle.setAlignSelf(ItemPositionFlexStart); |
114 } | 116 } |
115 | 117 |
116 innerStyle.setPaddingLeft(Length(LayoutTheme::theme().popupInternalPaddingLe
ft(styleRef()), Fixed)); | 118 innerStyle.setPaddingLeft(Length(LayoutTheme::theme().popupInternalPaddingLe
ft(styleRef()), Fixed)); |
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
611 return isHTMLOptionElement(*element) && toHTMLOptionElement(*element).select
ed(); | 613 return isHTMLOptionElement(*element) && toHTMLOptionElement(*element).select
ed(); |
612 } | 614 } |
613 | 615 |
614 void LayoutMenuList::provisionalSelectionChanged(unsigned listIndex) | 616 void LayoutMenuList::provisionalSelectionChanged(unsigned listIndex) |
615 { | 617 { |
616 m_indexToSelectOnCancel = listIndex; | 618 m_indexToSelectOnCancel = listIndex; |
617 setTextFromOption(selectElement()->listToOptionIndex(m_indexToSelectOnCancel
)); | 619 setTextFromOption(selectElement()->listToOptionIndex(m_indexToSelectOnCancel
)); |
618 } | 620 } |
619 | 621 |
620 } // namespace blink | 622 } // namespace blink |
OLD | NEW |