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

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

Issue 2154593003: [css-grid] Fix indefinite height detection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix fast/table/003.html test 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 if (LayoutMultiColumnFlowThread* flowThread = multiColumnFlowThread()) { 227 if (LayoutMultiColumnFlowThread* flowThread = multiColumnFlowThread()) {
228 // Calculate the non-auto content box height, or set it to 0 if it's aut o. We need to know 228 // Calculate the non-auto content box height, or set it to 0 if it's aut o. We need to know
229 // this before layout, so that we can figure out where to insert column breaks. We also 229 // this before layout, so that we can figure out where to insert column breaks. We also
230 // treat LayoutView (which may be paginated, which uses the multicol imp lmentation) as 230 // treat LayoutView (which may be paginated, which uses the multicol imp lmentation) as
231 // having non-auto height, since its height is deduced from the viewport height. We use 231 // having non-auto height, since its height is deduced from the viewport height. We use
232 // computeLogicalHeight() to calculate the content box height. That meth od will clamp 232 // computeLogicalHeight() to calculate the content box height. That meth od will clamp
233 // against max-height and min-height. Since we're now at the beginning o f layout, and we 233 // against max-height and min-height. Since we're now at the beginning o f layout, and we
234 // don't know the actual height of the content yet, only call that metho d when height is 234 // don't know the actual height of the content yet, only call that metho d when height is
235 // definite, or we might fool ourselves into believing that columns have a definite height 235 // definite, or we might fool ourselves into believing that columns have a definite height
236 // when they in fact don't. 236 // when they in fact don't.
237 // To check if we've a definite height we verify that percentage height is resolvable
238 // on the first in-flow child.
239 LayoutUnit columnHeight; 237 LayoutUnit columnHeight;
240 if (!firstInFlowChildBox() || firstInFlowChildBox()->percentageLogicalHe ightIsResolvable() || isLayoutView()) { 238 if (hasDefiniteLogicalHeight() || isLayoutView()) {
241 LogicalExtentComputedValues computedValues; 239 LogicalExtentComputedValues computedValues;
242 computeLogicalHeight(LayoutUnit(), logicalTop(), computedValues); 240 computeLogicalHeight(LayoutUnit(), logicalTop(), computedValues);
243 columnHeight = computedValues.m_extent - borderAndPaddingLogicalHeig ht() - scrollbarLogicalHeight(); 241 columnHeight = computedValues.m_extent - borderAndPaddingLogicalHeig ht() - scrollbarLogicalHeight();
244 } 242 }
245 pageLogicalHeightChanged = columnHeight != flowThread->columnHeightAvail able(); 243 pageLogicalHeightChanged = columnHeight != flowThread->columnHeightAvail able();
246 flowThread->setColumnHeightAvailable(std::max(columnHeight, LayoutUnit() )); 244 flowThread->setColumnHeightAvailable(std::max(columnHeight, LayoutUnit() ));
247 } else if (isLayoutFlowThread()) { 245 } else if (isLayoutFlowThread()) {
248 LayoutFlowThread* flowThread = toLayoutFlowThread(this); 246 LayoutFlowThread* flowThread = toLayoutFlowThread(this);
249 247
250 // FIXME: This is a hack to always make sure we have a page logical heig ht, if said height 248 // FIXME: This is a hack to always make sure we have a page logical heig ht, if said height
(...skipping 3524 matching lines...) Expand 10 before | Expand all | Expand 10 after
3775 if (!rect.isEmpty()) 3773 if (!rect.isEmpty())
3776 rects.append(rect); 3774 rects.append(rect);
3777 } 3775 }
3778 } 3776 }
3779 3777
3780 if (inlineElementContinuation) 3778 if (inlineElementContinuation)
3781 inlineElementContinuation->addOutlineRects(rects, additionalOffset + (in lineElementContinuation->containingBlock()->location() - location()), includeBlo ckOverflows); 3779 inlineElementContinuation->addOutlineRects(rects, additionalOffset + (in lineElementContinuation->containingBlock()->location() - location()), includeBlo ckOverflows);
3782 } 3780 }
3783 3781
3784 } // namespace blink 3782 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698