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. (http://www.torchmo
bile.com/) | 3 * 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 return defaultItemHeight(); | 111 return defaultItemHeight(); |
112 if (isHTMLOptGroupElement(baseItem)) | 112 if (isHTMLOptGroupElement(baseItem)) |
113 baseItem = &toHTMLOptGroupElement(baseItem)->optGroupLabelElement(); | 113 baseItem = &toHTMLOptGroupElement(baseItem)->optGroupLabelElement(); |
114 else if (!isHTMLOptionElement(baseItem)) | 114 else if (!isHTMLOptionElement(baseItem)) |
115 return defaultItemHeight(); | 115 return defaultItemHeight(); |
116 LayoutObject* baseItemRenderer = baseItem->renderer(); | 116 LayoutObject* baseItemRenderer = baseItem->renderer(); |
117 if (!baseItemRenderer) | 117 if (!baseItemRenderer) |
118 return defaultItemHeight(); | 118 return defaultItemHeight(); |
119 if (!baseItemRenderer || !baseItemRenderer->isBox()) | 119 if (!baseItemRenderer || !baseItemRenderer->isBox()) |
120 return defaultItemHeight(); | 120 return defaultItemHeight(); |
121 return toRenderBox(baseItemRenderer)->size().height(); | 121 return toLayoutBox(baseItemRenderer)->size().height(); |
122 } | 122 } |
123 | 123 |
124 void LayoutListBox::computeLogicalHeight(LayoutUnit, LayoutUnit logicalTop, Logi
calExtentComputedValues& computedValues) const | 124 void LayoutListBox::computeLogicalHeight(LayoutUnit, LayoutUnit logicalTop, Logi
calExtentComputedValues& computedValues) const |
125 { | 125 { |
126 LayoutUnit height = itemHeight() * size(); | 126 LayoutUnit height = itemHeight() * size(); |
127 // FIXME: The item height should have been added before updateLogicalHeight
was called to avoid this hack. | 127 // FIXME: The item height should have been added before updateLogicalHeight
was called to avoid this hack. |
128 setIntrinsicContentLogicalHeight(height); | 128 setIntrinsicContentLogicalHeight(height); |
129 | 129 |
130 height += borderAndPaddingHeight(); | 130 height += borderAndPaddingHeight(); |
131 | 131 |
132 RenderBox::computeLogicalHeight(height, logicalTop, computedValues); | 132 LayoutBox::computeLogicalHeight(height, logicalTop, computedValues); |
133 } | 133 } |
134 | 134 |
135 void LayoutListBox::stopAutoscroll() | 135 void LayoutListBox::stopAutoscroll() |
136 { | 136 { |
137 HTMLSelectElement* select = selectElement(); | 137 HTMLSelectElement* select = selectElement(); |
138 if (select->isDisabledFormControl()) | 138 if (select->isDisabledFormControl()) |
139 return; | 139 return; |
140 select->handleMouseRelease(); | 140 select->handleMouseRelease(); |
141 } | 141 } |
142 | 142 |
143 void LayoutListBox::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, L
ayoutUnit& maxLogicalWidth) const | 143 void LayoutListBox::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, L
ayoutUnit& maxLogicalWidth) const |
144 { | 144 { |
145 RenderBlockFlow::computeIntrinsicLogicalWidths(minLogicalWidth, maxLogicalWi
dth); | 145 RenderBlockFlow::computeIntrinsicLogicalWidths(minLogicalWidth, maxLogicalWi
dth); |
146 if (style()->width().isPercent()) | 146 if (style()->width().isPercent()) |
147 minLogicalWidth = 0; | 147 minLogicalWidth = 0; |
148 } | 148 } |
149 | 149 |
150 void LayoutListBox::scrollToRect(const LayoutRect& rect) | 150 void LayoutListBox::scrollToRect(const LayoutRect& rect) |
151 { | 151 { |
152 if (hasOverflowClip()) { | 152 if (hasOverflowClip()) { |
153 ASSERT(layer()); | 153 ASSERT(layer()); |
154 ASSERT(layer()->scrollableArea()); | 154 ASSERT(layer()->scrollableArea()); |
155 layer()->scrollableArea()->exposeRect(rect, ScrollAlignment::alignToEdge
IfNeeded, ScrollAlignment::alignToEdgeIfNeeded); | 155 layer()->scrollableArea()->exposeRect(rect, ScrollAlignment::alignToEdge
IfNeeded, ScrollAlignment::alignToEdgeIfNeeded); |
156 } | 156 } |
157 } | 157 } |
158 | 158 |
159 } // namespace blink | 159 } // namespace blink |
OLD | NEW |