Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Side by Side Diff: Source/core/layout/LayoutMenuList.cpp

Issue 988523003: Reimplement min-width: auto (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: review comments Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/layout/LayoutGrid.cpp ('k') | Source/core/layout/LayoutReplaced.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 506 matching lines...) Expand 10 before | Expand all | Expand 10 after
623 HTMLElement* element = listItems[listIndex]; 625 HTMLElement* element = listItems[listIndex];
624 return isHTMLOptionElement(*element) && toHTMLOptionElement(*element).select ed(); 626 return isHTMLOptionElement(*element) && toHTMLOptionElement(*element).select ed();
625 } 627 }
626 628
627 void LayoutMenuList::provisionalSelectionChanged(unsigned listIndex) 629 void LayoutMenuList::provisionalSelectionChanged(unsigned listIndex)
628 { 630 {
629 setIndexToSelectOnCancel(listIndex); 631 setIndexToSelectOnCancel(listIndex);
630 } 632 }
631 633
632 } // namespace blink 634 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutGrid.cpp ('k') | Source/core/layout/LayoutReplaced.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698