OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2011 Apple Inc. All rights reserved. |
3 * 2009 Torch Mobile Inc. All rights reserved. | 3 * 2009 Torch Mobile Inc. All rights reserved. |
4 * (http://www.torchmobile.com/) | 4 * (http://www.torchmobile.com/) |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * | 9 * |
10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
(...skipping 28 matching lines...) Expand all Loading... |
39 | 39 |
40 namespace blink { | 40 namespace blink { |
41 | 41 |
42 // Default size when the multiple attribute is present but size attribute is | 42 // Default size when the multiple attribute is present but size attribute is |
43 // absent. | 43 // absent. |
44 const int defaultSize = 4; | 44 const int defaultSize = 4; |
45 | 45 |
46 const int defaultPaddingBottom = 1; | 46 const int defaultPaddingBottom = 1; |
47 | 47 |
48 LayoutListBox::LayoutListBox(Element* element) : LayoutBlockFlow(element) { | 48 LayoutListBox::LayoutListBox(Element* element) : LayoutBlockFlow(element) { |
49 ASSERT(element); | 49 DCHECK(element); |
50 ASSERT(element->isHTMLElement()); | 50 DCHECK(element->isHTMLElement()); |
51 ASSERT(isHTMLSelectElement(element)); | 51 DCHECK(isHTMLSelectElement(element)); |
52 } | 52 } |
53 | 53 |
54 LayoutListBox::~LayoutListBox() {} | 54 LayoutListBox::~LayoutListBox() {} |
55 | 55 |
56 inline HTMLSelectElement* LayoutListBox::selectElement() const { | 56 inline HTMLSelectElement* LayoutListBox::selectElement() const { |
57 return toHTMLSelectElement(node()); | 57 return toHTMLSelectElement(node()); |
58 } | 58 } |
59 | 59 |
60 unsigned LayoutListBox::size() const { | 60 unsigned LayoutListBox::size() const { |
61 unsigned specifiedSize = selectElement()->size(); | 61 unsigned specifiedSize = selectElement()->size(); |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 LayoutUnit& minLogicalWidth, | 121 LayoutUnit& minLogicalWidth, |
122 LayoutUnit& maxLogicalWidth) const { | 122 LayoutUnit& maxLogicalWidth) const { |
123 LayoutBlockFlow::computeIntrinsicLogicalWidths(minLogicalWidth, | 123 LayoutBlockFlow::computeIntrinsicLogicalWidths(minLogicalWidth, |
124 maxLogicalWidth); | 124 maxLogicalWidth); |
125 if (style()->width().isPercentOrCalc()) | 125 if (style()->width().isPercentOrCalc()) |
126 minLogicalWidth = LayoutUnit(); | 126 minLogicalWidth = LayoutUnit(); |
127 } | 127 } |
128 | 128 |
129 void LayoutListBox::scrollToRect(const LayoutRect& rect) { | 129 void LayoutListBox::scrollToRect(const LayoutRect& rect) { |
130 if (hasOverflowClip()) { | 130 if (hasOverflowClip()) { |
131 ASSERT(layer()); | 131 DCHECK(layer()); |
132 ASSERT(layer()->getScrollableArea()); | 132 DCHECK(layer()->getScrollableArea()); |
133 layer()->getScrollableArea()->scrollIntoView( | 133 layer()->getScrollableArea()->scrollIntoView( |
134 rect, ScrollAlignment::alignToEdgeIfNeeded, | 134 rect, ScrollAlignment::alignToEdgeIfNeeded, |
135 ScrollAlignment::alignToEdgeIfNeeded); | 135 ScrollAlignment::alignToEdgeIfNeeded); |
136 } | 136 } |
137 } | 137 } |
138 | 138 |
139 } // namespace blink | 139 } // namespace blink |
OLD | NEW |