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

Side by Side Diff: Source/core/html/shadow/SliderThumbElement.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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
3 * Copyright (C) 2010 Google Inc. All rights reserved. 3 * Copyright (C) 2010 Google Inc. All rights reserved.
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 are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 if (offsetFromCenter < 0) 121 if (offsetFromCenter < 0)
122 trackHeight = -2 * offsetFromCenter; 122 trackHeight = -2 * offsetFromCenter;
123 else { 123 else {
124 int tickLength = RenderTheme::theme().sliderTickSize().height(); 124 int tickLength = RenderTheme::theme().sliderTickSize().height();
125 trackHeight = 2 * (offsetFromCenter + tickLength); 125 trackHeight = 2 * (offsetFromCenter + tickLength);
126 } 126 }
127 float zoomFactor = style()->effectiveZoom(); 127 float zoomFactor = style()->effectiveZoom();
128 if (zoomFactor != 1.0) 128 if (zoomFactor != 1.0)
129 trackHeight *= zoomFactor; 129 trackHeight *= zoomFactor;
130 130
131 // FIXME: The trackHeight should have been added before updateLogicalHei ght was called to avoid this hack.
132 updateIntrinsicContentLogicalHeight(trackHeight);
133
131 RenderBox::computeLogicalHeight(trackHeight, logicalTop, computedValues) ; 134 RenderBox::computeLogicalHeight(trackHeight, logicalTop, computedValues) ;
132 return; 135 return;
133 } 136 }
134 if (isVertical) 137 if (isVertical)
135 logicalHeight = RenderSlider::defaultTrackLength; 138 logicalHeight = RenderSlider::defaultTrackLength;
139
140 // FIXME: The trackHeight should have been added before updateLogicalHeight was called to avoid this hack.
141 updateIntrinsicContentLogicalHeight(logicalHeight);
142
136 RenderBox::computeLogicalHeight(logicalHeight, logicalTop, computedValues); 143 RenderBox::computeLogicalHeight(logicalHeight, logicalTop, computedValues);
137 } 144 }
138 145
139 void RenderSliderContainer::layout() 146 void RenderSliderContainer::layout()
140 { 147 {
141 HTMLInputElement* input = toHTMLInputElement(node()->shadowHost()); 148 HTMLInputElement* input = toHTMLInputElement(node()->shadowHost());
142 bool isVertical = hasVerticalAppearance(input); 149 bool isVertical = hasVerticalAppearance(input);
143 style()->setFlexDirection(isVertical ? FlowColumn : FlowRow); 150 style()->setFlexDirection(isVertical ? FlowColumn : FlowRow);
144 TextDirection oldTextDirection = style()->direction(); 151 TextDirection oldTextDirection = style()->direction();
145 if (isVertical) { 152 if (isVertical) {
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 case MediaVolumeSliderThumbPart: 470 case MediaVolumeSliderThumbPart:
464 case MediaFullScreenVolumeSliderPart: 471 case MediaFullScreenVolumeSliderPart:
465 case MediaFullScreenVolumeSliderThumbPart: 472 case MediaFullScreenVolumeSliderThumbPart:
466 return mediaSliderContainer; 473 return mediaSliderContainer;
467 default: 474 default:
468 return sliderContainer; 475 return sliderContainer;
469 } 476 }
470 } 477 }
471 478
472 } 479 }
OLDNEW
« no previous file with comments | « LayoutTests/css3/flexbox/stretched-child-shrink-on-relayout-expected.txt ('k') | Source/core/rendering/RenderBox.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698