| 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 HTMLSelectElement* select = selectElement(); | 106 HTMLSelectElement* select = selectElement(); |
| 107 if (!select) | 107 if (!select) |
| 108 return 0; | 108 return 0; |
| 109 Element* baseItem = ElementTraversal::firstChild(*select); | 109 Element* baseItem = ElementTraversal::firstChild(*select); |
| 110 if (!baseItem) | 110 if (!baseItem) |
| 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->layoutObject(); |
| 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 toLayoutBox(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(); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 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 |