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

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

Issue 926193003: Move rendering/RenderBox to layout/LayoutBox. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/layout/LayoutImage.cpp ('k') | Source/core/layout/LayoutListItem.cpp » ('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 * 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
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
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutImage.cpp ('k') | Source/core/layout/LayoutListItem.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698