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

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

Issue 1070143002: [Alignment] Single class for holding the alignment data. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased and got back previous setter names. 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
« no previous file with comments | « Source/core/layout/LayoutGrid.cpp ('k') | Source/core/style/ComputedStyle.h » ('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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
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. 107 // min-width: 0; is needed for correct shrinking.
108 innerStyle.setMinWidth(Length(0, Fixed)); 108 innerStyle.setMinWidth(Length(0, Fixed));
109 // 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.
110 // 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.
111 // 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.
112 if (style()->alignItems() == ItemPositionCenter) { 112 if (style()->alignItemsPosition() == ItemPositionCenter) {
113 innerStyle.setMarginTop(Length()); 113 innerStyle.setMarginTop(Length());
114 innerStyle.setMarginBottom(Length()); 114 innerStyle.setMarginBottom(Length());
115 innerStyle.setAlignSelf(ItemPositionFlexStart); 115 innerStyle.setAlignSelfPosition(ItemPositionFlexStart);
116 } 116 }
117 117
118 innerStyle.setPaddingLeft(Length(LayoutTheme::theme().popupInternalPaddingLe ft(styleRef()), Fixed)); 118 innerStyle.setPaddingLeft(Length(LayoutTheme::theme().popupInternalPaddingLe ft(styleRef()), Fixed));
119 innerStyle.setPaddingRight(Length(LayoutTheme::theme().popupInternalPaddingR ight(styleRef()), Fixed)); 119 innerStyle.setPaddingRight(Length(LayoutTheme::theme().popupInternalPaddingR ight(styleRef()), Fixed));
120 innerStyle.setPaddingTop(Length(LayoutTheme::theme().popupInternalPaddingTop (styleRef()), Fixed)); 120 innerStyle.setPaddingTop(Length(LayoutTheme::theme().popupInternalPaddingTop (styleRef()), Fixed));
121 innerStyle.setPaddingBottom(Length(LayoutTheme::theme().popupInternalPadding Bottom(styleRef()), Fixed)); 121 innerStyle.setPaddingBottom(Length(LayoutTheme::theme().popupInternalPadding Bottom(styleRef()), Fixed));
122 122
123 if (m_optionStyle) { 123 if (m_optionStyle) {
124 if ((m_optionStyle->direction() != innerStyle.direction() || m_optionSty le->unicodeBidi() != innerStyle.unicodeBidi())) 124 if ((m_optionStyle->direction() != innerStyle.direction() || m_optionSty le->unicodeBidi() != innerStyle.unicodeBidi()))
125 m_innerBlock->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidat ion(LayoutInvalidationReason::StyleChange); 125 m_innerBlock->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidat ion(LayoutInvalidationReason::StyleChange);
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after
623 HTMLElement* element = listItems[listIndex]; 623 HTMLElement* element = listItems[listIndex];
624 return isHTMLOptionElement(*element) && toHTMLOptionElement(*element).select ed(); 624 return isHTMLOptionElement(*element) && toHTMLOptionElement(*element).select ed();
625 } 625 }
626 626
627 void LayoutMenuList::provisionalSelectionChanged(unsigned listIndex) 627 void LayoutMenuList::provisionalSelectionChanged(unsigned listIndex)
628 { 628 {
629 setIndexToSelectOnCancel(listIndex); 629 setIndexToSelectOnCancel(listIndex);
630 } 630 }
631 631
632 } // namespace blink 632 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutGrid.cpp ('k') | Source/core/style/ComputedStyle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698