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

Side by Side Diff: Source/core/rendering/RenderListBox.cpp

Issue 237823002: Properly shrink stretched flexbox children on relayout (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Made comments clearer Created 6 years, 8 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/rendering/RenderFlexibleBox.cpp ('k') | Source/core/rendering/RenderReplaced.h » ('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 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 return m_listItemCount; 283 return m_listItemCount;
284 } 284 }
285 285
286 LayoutUnit RenderListBox::listHeight() const 286 LayoutUnit RenderListBox::listHeight() const
287 { 287 {
288 return itemHeight() * numItems() - rowSpacing; 288 return itemHeight() * numItems() - rowSpacing;
289 } 289 }
290 290
291 void RenderListBox::computeLogicalHeight(LayoutUnit, LayoutUnit logicalTop, Logi calExtentComputedValues& computedValues) const 291 void RenderListBox::computeLogicalHeight(LayoutUnit, LayoutUnit logicalTop, Logi calExtentComputedValues& computedValues) const
292 { 292 {
293 LayoutUnit height = itemHeight() * size() - rowSpacing + borderAndPaddingHei ght(); 293 LayoutUnit height = itemHeight() * size() - rowSpacing;
294 // FIXME: The item height should have been added before updateLogicalHeight was called to avoid this hack.
295 updateIntrinsicContentLogicalHeight(height);
296
297 height += borderAndPaddingHeight();
298
294 RenderBox::computeLogicalHeight(height, logicalTop, computedValues); 299 RenderBox::computeLogicalHeight(height, logicalTop, computedValues);
295 } 300 }
296 301
297 int RenderListBox::baselinePosition(FontBaseline baselineType, bool firstLine, L ineDirectionMode lineDirection, LinePositionMode linePositionMode) const 302 int RenderListBox::baselinePosition(FontBaseline baselineType, bool firstLine, L ineDirectionMode lineDirection, LinePositionMode linePositionMode) const
298 { 303 {
299 return RenderBox::baselinePosition(baselineType, firstLine, lineDirection, l inePositionMode) - baselineAdjustment; 304 return RenderBox::baselinePosition(baselineType, firstLine, lineDirection, l inePositionMode) - baselineAdjustment;
300 } 305 }
301 306
302 LayoutRect RenderListBox::itemBoundingBoxRectInternal(const LayoutPoint& additio nalOffset, int index) const 307 LayoutRect RenderListBox::itemBoundingBoxRectInternal(const LayoutPoint& additio nalOffset, int index) const
303 { 308 {
(...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after
1016 { 1021 {
1017 return itemBoundingBoxRectInternal(point, listIndexToRenderListBoxIndex(inde x)); 1022 return itemBoundingBoxRectInternal(point, listIndexToRenderListBoxIndex(inde x));
1018 } 1023 }
1019 1024
1020 bool RenderListBox::scrollToRevealElementAtListIndex(int index) 1025 bool RenderListBox::scrollToRevealElementAtListIndex(int index)
1021 { 1026 {
1022 return scrollToRevealElementAtListIndexInternal(listIndexToRenderListBoxInde x(index)); 1027 return scrollToRevealElementAtListIndexInternal(listIndexToRenderListBoxInde x(index));
1023 } 1028 }
1024 1029
1025 } // namespace WebCore 1030 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderFlexibleBox.cpp ('k') | Source/core/rendering/RenderReplaced.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698