| OLD | NEW |
| 1 /* | 1 /* |
| 2 * This file is part of the select element layoutObject in WebCore. | 2 * This file is part of the select element layoutObject 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. | 5 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. |
| 6 * All rights reserved. | 6 * All rights reserved. |
| 7 * (C) 2009 Torch Mobile Inc. All rights reserved. | 7 * (C) 2009 Torch Mobile Inc. All rights reserved. |
| 8 * (http://www.torchmobile.com/) | 8 * (http://www.torchmobile.com/) |
| 9 * | 9 * |
| 10 * This library is free software; you can redistribute it and/or | 10 * This library is free software; you can redistribute it and/or |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 * along with this library; see the file COPYING.LIB. If not, write to | 21 * along with this library; see the file COPYING.LIB. If not, write to |
| 22 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 22 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 23 * Boston, MA 02110-1301, USA. | 23 * Boston, MA 02110-1301, USA. |
| 24 * | 24 * |
| 25 */ | 25 */ |
| 26 | 26 |
| 27 #include "core/layout/LayoutMenuList.h" | 27 #include "core/layout/LayoutMenuList.h" |
| 28 | 28 |
| 29 #include "core/dom/AXObjectCache.h" | 29 #include "core/dom/AXObjectCache.h" |
| 30 #include "core/dom/NodeComputedStyle.h" | 30 #include "core/dom/NodeComputedStyle.h" |
| 31 #include "core/frame/FrameView.h" |
| 31 #include "core/html/HTMLOptionElement.h" | 32 #include "core/html/HTMLOptionElement.h" |
| 32 #include "core/html/HTMLSelectElement.h" | 33 #include "core/html/HTMLSelectElement.h" |
| 33 #include "core/layout/LayoutText.h" | 34 #include "core/layout/LayoutText.h" |
| 34 #include "core/layout/LayoutTheme.h" | 35 #include "core/layout/LayoutTheme.h" |
| 35 #include "platform/text/PlatformLocale.h" | 36 #include "platform/text/PlatformLocale.h" |
| 36 #include <math.h> | 37 #include <math.h> |
| 37 | 38 |
| 38 namespace blink { | 39 namespace blink { |
| 39 | 40 |
| 40 LayoutMenuList::LayoutMenuList(Element* element) | 41 LayoutMenuList::LayoutMenuList(Element* element) |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 // But we only do that for the cases where html.css would otherwise use | 92 // But we only do that for the cases where html.css would otherwise use |
| 92 // center. | 93 // center. |
| 93 if (style()->alignItemsPosition() == ItemPositionCenter) { | 94 if (style()->alignItemsPosition() == ItemPositionCenter) { |
| 94 innerStyle.setMarginTop(Length()); | 95 innerStyle.setMarginTop(Length()); |
| 95 innerStyle.setMarginBottom(Length()); | 96 innerStyle.setMarginBottom(Length()); |
| 96 innerStyle.setAlignSelfPosition(ItemPositionFlexStart); | 97 innerStyle.setAlignSelfPosition(ItemPositionFlexStart); |
| 97 } | 98 } |
| 98 | 99 |
| 99 Length paddingStart = | 100 Length paddingStart = |
| 100 Length(LayoutTheme::theme().popupInternalPaddingStart(styleRef()), Fixed); | 101 Length(LayoutTheme::theme().popupInternalPaddingStart(styleRef()), Fixed); |
| 101 Length paddingEnd = | 102 Length paddingEnd = Length(LayoutTheme::theme().popupInternalPaddingEnd( |
| 102 Length(LayoutTheme::theme().popupInternalPaddingEnd(styleRef()), Fixed); | 103 frameView()->getHostWindow(), styleRef()), |
| 104 Fixed); |
| 103 innerStyle.setPaddingLeft(styleRef().direction() == LTR ? paddingStart | 105 innerStyle.setPaddingLeft(styleRef().direction() == LTR ? paddingStart |
| 104 : paddingEnd); | 106 : paddingEnd); |
| 105 innerStyle.setPaddingRight(styleRef().direction() == LTR ? paddingEnd | 107 innerStyle.setPaddingRight(styleRef().direction() == LTR ? paddingEnd |
| 106 : paddingStart); | 108 : paddingStart); |
| 107 innerStyle.setPaddingTop( | 109 innerStyle.setPaddingTop( |
| 108 Length(LayoutTheme::theme().popupInternalPaddingTop(styleRef()), Fixed)); | 110 Length(LayoutTheme::theme().popupInternalPaddingTop(styleRef()), Fixed)); |
| 109 innerStyle.setPaddingBottom(Length( | 111 innerStyle.setPaddingBottom(Length( |
| 110 LayoutTheme::theme().popupInternalPaddingBottom(styleRef()), Fixed)); | 112 LayoutTheme::theme().popupInternalPaddingBottom(styleRef()), Fixed)); |
| 111 | 113 |
| 112 if (m_optionStyle) { | 114 if (m_optionStyle) { |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 | 312 |
| 311 LayoutUnit LayoutMenuList::clientPaddingLeft() const { | 313 LayoutUnit LayoutMenuList::clientPaddingLeft() const { |
| 312 return paddingLeft() + m_innerBlock->paddingLeft(); | 314 return paddingLeft() + m_innerBlock->paddingLeft(); |
| 313 } | 315 } |
| 314 | 316 |
| 315 LayoutUnit LayoutMenuList::clientPaddingRight() const { | 317 LayoutUnit LayoutMenuList::clientPaddingRight() const { |
| 316 return paddingRight() + m_innerBlock->paddingRight(); | 318 return paddingRight() + m_innerBlock->paddingRight(); |
| 317 } | 319 } |
| 318 | 320 |
| 319 } // namespace blink | 321 } // namespace blink |
| OLD | NEW |