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

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

Issue 988523003: Reimplement min-width: auto (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebaselined 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
OLDNEW
1 /** 1 /**
2 * Copyright (C) 2005 Apple Computer, Inc. 2 * Copyright (C) 2005 Apple Computer, Inc.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 } else { 59 } else {
60 m_inner->removeChild(oldChild); 60 m_inner->removeChild(oldChild);
61 } 61 }
62 } 62 }
63 63
64 void LayoutButton::updateAnonymousChildStyle(const LayoutObject& child, Computed Style& childStyle) const 64 void LayoutButton::updateAnonymousChildStyle(const LayoutObject& child, Computed Style& childStyle) const
65 { 65 {
66 ASSERT(!m_inner || &child == m_inner); 66 ASSERT(!m_inner || &child == m_inner);
67 67
68 childStyle.setFlexGrow(1.0f); 68 childStyle.setFlexGrow(1.0f);
69 // min-width: 0; is needed for correct shrinking.
70 childStyle.setMinWidth(Length(0, Fixed));
69 // Use margin:auto instead of align-items:center to get safe centering, i.e. 71 // Use margin:auto instead of align-items:center to get safe centering, i.e.
70 // when the content overflows, treat it the same as align-items: flex-start. 72 // when the content overflows, treat it the same as align-items: flex-start.
71 childStyle.setMarginTop(Length()); 73 childStyle.setMarginTop(Length());
72 childStyle.setMarginBottom(Length()); 74 childStyle.setMarginBottom(Length());
73 childStyle.setFlexDirection(style()->flexDirection()); 75 childStyle.setFlexDirection(style()->flexDirection());
74 childStyle.setJustifyContent(style()->justifyContent()); 76 childStyle.setJustifyContent(style()->justifyContent());
75 childStyle.setFlexWrap(style()->flexWrap()); 77 childStyle.setFlexWrap(style()->flexWrap());
76 childStyle.setAlignItems(style()->alignItems()); 78 childStyle.setAlignItems(style()->alignItems());
77 childStyle.setAlignContent(style()->alignContent()); 79 childStyle.setAlignContent(style()->alignContent());
78 } 80 }
(...skipping 26 matching lines...) Expand all
105 // baseline for the empty case manually here. 107 // baseline for the empty case manually here.
106 if (direction == HorizontalLine) { 108 if (direction == HorizontalLine) {
107 return marginTop() + size().height() - borderBottom() - paddingBotto m() - horizontalScrollbarHeight(); 109 return marginTop() + size().height() - borderBottom() - paddingBotto m() - horizontalScrollbarHeight();
108 } 110 }
109 return marginRight() + size().width() - borderLeft() - paddingLeft() - v erticalScrollbarWidth(); 111 return marginRight() + size().width() - borderLeft() - paddingLeft() - v erticalScrollbarWidth();
110 } 112 }
111 return LayoutFlexibleBox::baselinePosition(baseline, firstLine, direction, l inePositionMode); 113 return LayoutFlexibleBox::baselinePosition(baseline, firstLine, direction, l inePositionMode);
112 } 114 }
113 115
114 } // namespace blink 116 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698