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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp

Issue 2104123002: [css-flexbox] childIntrinsicWidth needs to actually return the intrinsic width (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: had to make this more similar to childIntrinsicHeight to fix tests Created 4 years, 5 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
« no previous file with comments | « third_party/WebKit/LayoutTests/css3/flexbox/wrapping-column-dynamic-changes.html ('k') | no next file » | 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) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 // returning the max preferred height (=logical width) 469 // returning the max preferred height (=logical width)
470 if (!child.isHorizontalWritingMode() && child.styleRef().height().isAuto()) 470 if (!child.isHorizontalWritingMode() && child.styleRef().height().isAuto())
471 return child.maxPreferredLogicalWidth(); 471 return child.maxPreferredLogicalWidth();
472 return child.size().height(); 472 return child.size().height();
473 } 473 }
474 474
475 LayoutUnit LayoutFlexibleBox::childIntrinsicWidth(const LayoutBox& child) const 475 LayoutUnit LayoutFlexibleBox::childIntrinsicWidth(const LayoutBox& child) const
476 { 476 {
477 if (!child.isHorizontalWritingMode() && needToStretchChildLogicalHeight(chil d)) 477 if (!child.isHorizontalWritingMode() && needToStretchChildLogicalHeight(chil d))
478 return constrainedChildIntrinsicContentLogicalHeight(child); 478 return constrainedChildIntrinsicContentLogicalHeight(child);
479 // TOOO(cbiesinger): should this return the maxPreferredLogicalWidth? 479 if (child.isHorizontalWritingMode() && child.styleRef().width().isAuto()) {
480 // This value is already clamped by min/max-width
481 return child.maxPreferredLogicalWidth();
482 }
480 return child.size().width(); 483 return child.size().width();
481 } 484 }
482 485
483 LayoutUnit LayoutFlexibleBox::crossAxisIntrinsicExtentForChild(const LayoutBox& child) const 486 LayoutUnit LayoutFlexibleBox::crossAxisIntrinsicExtentForChild(const LayoutBox& child) const
484 { 487 {
485 return isHorizontalFlow() ? childIntrinsicHeight(child) : childIntrinsicWidt h(child); 488 return isHorizontalFlow() ? childIntrinsicHeight(child) : childIntrinsicWidt h(child);
486 } 489 }
487 490
488 LayoutUnit LayoutFlexibleBox::mainAxisExtentForChild(const LayoutBox& child) con st 491 LayoutUnit LayoutFlexibleBox::mainAxisExtentForChild(const LayoutBox& child) con st
489 { 492 {
(...skipping 1392 matching lines...) Expand 10 before | Expand all | Expand 10 after
1882 ASSERT(child); 1885 ASSERT(child);
1883 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE xtent; 1886 LayoutUnit lineCrossAxisExtent = lineContexts[lineNumber].crossAxisE xtent;
1884 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset - crossAxisStartEdge; 1887 LayoutUnit originalOffset = lineContexts[lineNumber].crossAxisOffset - crossAxisStartEdge;
1885 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi sExtent; 1888 LayoutUnit newOffset = contentExtent - originalOffset - lineCrossAxi sExtent;
1886 adjustAlignmentForChild(*child, newOffset - originalOffset); 1889 adjustAlignmentForChild(*child, newOffset - originalOffset);
1887 } 1890 }
1888 } 1891 }
1889 } 1892 }
1890 1893
1891 } // namespace blink 1894 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/css3/flexbox/wrapping-column-dynamic-changes.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698