| 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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 m_innerBlock = createAnonymousBlock(); | 96 m_innerBlock = createAnonymousBlock(); |
| 97 adjustInnerStyle(); | 97 adjustInnerStyle(); |
| 98 LayoutFlexibleBox::addChild(m_innerBlock); | 98 LayoutFlexibleBox::addChild(m_innerBlock); |
| 99 } | 99 } |
| 100 | 100 |
| 101 void LayoutMenuList::adjustInnerStyle() | 101 void LayoutMenuList::adjustInnerStyle() |
| 102 { | 102 { |
| 103 ComputedStyle& innerStyle = m_innerBlock->mutableStyleRef(); | 103 ComputedStyle& innerStyle = m_innerBlock->mutableStyleRef(); |
| 104 innerStyle.setFlexGrow(1); | 104 innerStyle.setFlexGrow(1); |
| 105 innerStyle.setFlexShrink(1); | 105 innerStyle.setFlexShrink(1); |
| 106 // min-width: 0; is needed for correct shrinking. |
| 107 innerStyle.setMinWidth(Length(0, Fixed)); |
| 106 // Use margin:auto instead of align-items:center to get safe centering, i.e. | 108 // Use margin:auto instead of align-items:center to get safe centering, i.e. |
| 107 // when the content overflows, treat it the same as align-items: flex-start. | 109 // when the content overflows, treat it the same as align-items: flex-start. |
| 108 // But we only do that for the cases where html.css would otherwise use cent
er. | 110 // But we only do that for the cases where html.css would otherwise use cent
er. |
| 109 if (style()->alignItems() == ItemPositionCenter) { | 111 if (style()->alignItems() == ItemPositionCenter) { |
| 110 innerStyle.setMarginTop(Length()); | 112 innerStyle.setMarginTop(Length()); |
| 111 innerStyle.setMarginBottom(Length()); | 113 innerStyle.setMarginBottom(Length()); |
| 112 innerStyle.setAlignSelf(ItemPositionFlexStart); | 114 innerStyle.setAlignSelf(ItemPositionFlexStart); |
| 113 } | 115 } |
| 114 | 116 |
| 115 innerStyle.setPaddingLeft(Length(LayoutTheme::theme().popupInternalPaddingLe
ft(styleRef()), Fixed)); | 117 innerStyle.setPaddingLeft(Length(LayoutTheme::theme().popupInternalPaddingLe
ft(styleRef()), Fixed)); |
| (...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 599 HTMLElement* element = listItems[listIndex]; | 601 HTMLElement* element = listItems[listIndex]; |
| 600 return isHTMLOptionElement(*element) && toHTMLOptionElement(*element).select
ed(); | 602 return isHTMLOptionElement(*element) && toHTMLOptionElement(*element).select
ed(); |
| 601 } | 603 } |
| 602 | 604 |
| 603 void LayoutMenuList::setTextFromItem(unsigned listIndex) | 605 void LayoutMenuList::setTextFromItem(unsigned listIndex) |
| 604 { | 606 { |
| 605 setTextFromOption(selectElement()->listToOptionIndex(listIndex)); | 607 setTextFromOption(selectElement()->listToOptionIndex(listIndex)); |
| 606 } | 608 } |
| 607 | 609 |
| 608 } // namespace blink | 610 } // namespace blink |
| OLD | NEW |