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

Side by Side Diff: Source/core/rendering/RenderMenuList.cpp

Issue 134013002: Upgrade align-self and align-items parsing to CSS 3 (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Really fix the tests Created 6 years, 11 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 * 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 { 99 {
100 RenderStyle* innerStyle = m_innerBlock->style(); 100 RenderStyle* innerStyle = m_innerBlock->style();
101 innerStyle->setFlexGrow(1); 101 innerStyle->setFlexGrow(1);
102 innerStyle->setFlexShrink(1); 102 innerStyle->setFlexShrink(1);
103 // min-width: 0; is needed for correct shrinking. 103 // min-width: 0; is needed for correct shrinking.
104 // FIXME: Remove this line when https://bugs.webkit.org/show_bug.cgi?id=1117 90 is fixed. 104 // FIXME: Remove this line when https://bugs.webkit.org/show_bug.cgi?id=1117 90 is fixed.
105 innerStyle->setMinWidth(Length(0, Fixed)); 105 innerStyle->setMinWidth(Length(0, Fixed));
106 // Use margin:auto instead of align-items:center to get safe centering, i.e. 106 // 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. 107 // 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. 108 // But we only do that for the cases where html.css would otherwise use cent er.
109 if (style()->alignItems() == AlignCenter) { 109 if (style()->alignItems() == ItemPositionCenter) {
110 innerStyle->setMarginTop(Length()); 110 innerStyle->setMarginTop(Length());
111 innerStyle->setMarginBottom(Length()); 111 innerStyle->setMarginBottom(Length());
112 innerStyle->setAlignSelf(AlignFlexStart); 112 innerStyle->setAlignSelf(ItemPositionFlexStart);
113 } 113 }
114 114
115 innerStyle->setPaddingLeft(Length(RenderTheme::theme().popupInternalPaddingL eft(style()), Fixed)); 115 innerStyle->setPaddingLeft(Length(RenderTheme::theme().popupInternalPaddingL eft(style()), Fixed));
116 innerStyle->setPaddingRight(Length(RenderTheme::theme().popupInternalPadding Right(style()), Fixed)); 116 innerStyle->setPaddingRight(Length(RenderTheme::theme().popupInternalPadding Right(style()), Fixed));
117 innerStyle->setPaddingTop(Length(RenderTheme::theme().popupInternalPaddingTo p(style()), Fixed)); 117 innerStyle->setPaddingTop(Length(RenderTheme::theme().popupInternalPaddingTo p(style()), Fixed));
118 innerStyle->setPaddingBottom(Length(RenderTheme::theme().popupInternalPaddin gBottom(style()), Fixed)); 118 innerStyle->setPaddingBottom(Length(RenderTheme::theme().popupInternalPaddin gBottom(style()), Fixed));
119 119
120 if (m_optionStyle) { 120 if (m_optionStyle) {
121 if ((m_optionStyle->direction() != innerStyle->direction() || m_optionSt yle->unicodeBidi() != innerStyle->unicodeBidi())) 121 if ((m_optionStyle->direction() != innerStyle->direction() || m_optionSt yle->unicodeBidi() != innerStyle->unicodeBidi()))
122 m_innerBlock->setNeedsLayoutAndPrefWidthsRecalc(); 122 m_innerBlock->setNeedsLayoutAndPrefWidthsRecalc();
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after
586 { 586 {
587 setTextFromOption(selectElement()->listToOptionIndex(listIndex)); 587 setTextFromOption(selectElement()->listToOptionIndex(listIndex));
588 } 588 }
589 589
590 FontSelector* RenderMenuList::fontSelector() const 590 FontSelector* RenderMenuList::fontSelector() const
591 { 591 {
592 return document().styleEngine()->fontSelector(); 592 return document().styleEngine()->fontSelector();
593 } 593 }
594 594
595 } 595 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698