|
Lines 3345-3363
static bool NODELETE shouldFlipBeforeAfterMargins(WritingMode containingBlockWri
a/Source/WebCore/rendering/RenderBox.cpp_sec1
|
| 3345 |
return shouldFlip; |
3345 |
return shouldFlip; |
| 3346 |
} |
3346 |
} |
| 3347 |
|
3347 |
|
|
|
3348 |
bool RenderBox::shouldCacheIntrinsicContentLogicalHeightForFlexItem() const |
| 3349 |
{ |
| 3350 |
// The flex stretch algorithm needs to know the item's intrinsic content height |
| 3351 |
// before stretch was applied. We cache it so the stretch phase can read back |
| 3352 |
// the pre-stretch value after relayout. Items with aspect-ratio don't need |
| 3353 |
// caching because their content height is always derivable from the current width. |
| 3354 |
return isFlexItem() && !isFloatingOrOutOfFlowPositioned() && !shouldComputeLogicalHeightFromAspectRatio(); |
| 3355 |
} |
| 3356 |
|
| 3348 |
void RenderBox::cacheIntrinsicContentLogicalHeightForFlexItem(LayoutUnit height) const |
3357 |
void RenderBox::cacheIntrinsicContentLogicalHeightForFlexItem(LayoutUnit height) const |
| 3349 |
{ |
3358 |
{ |
| 3350 |
// FIXME: it should be enough with checking hasOverridingLogicalHeight() as this logic could be shared |
3359 |
// FIXME: it should be enough with checking hasOverridingLogicalHeight() as this logic could be shared |
| 3351 |
// by any layout system using overrides like grid or flex. However this causes a never ending sequence of calls |
3360 |
// by any layout system using overrides like grid or flex. However this causes a never ending sequence of calls |
| 3352 |
// between layoutBlock() <-> relayoutToAvoidWidows(). |
3361 |
// between layoutBlock() <-> relayoutToAvoidWidows(). |
| 3353 |
if (isFloatingOrOutOfFlowPositioned()) |
3362 |
if (!shouldCacheIntrinsicContentLogicalHeightForFlexItem()) |
| 3354 |
return; |
|
|
| 3355 |
CheckedPtr flexibleBox = dynamicDowncast<RenderFlexibleBox>(parent()); |
| 3356 |
if (!flexibleBox) |
| 3357 |
return; |
3363 |
return; |
| 3358 |
if (overridingBorderBoxLogicalHeight() || shouldComputeLogicalHeightFromAspectRatio()) |
3364 |
ASSERT(is<RenderFlexibleBox>(parent()); |
|
|
3365 |
if (overridingBorderBoxLogicalHeight()) |
| 3359 |
return; |
3366 |
return; |
| 3360 |
flexibleBox->setCachedFlexItemIntrinsicContentLogicalHeight(*this, height); |
3367 |
if (CheckedPtr flexibleBox = dynamicDowncast<RenderFlexibleBox>(parent()); |
|
|
3368 |
flexibleBox->setCachedFlexItemIntrinsicContentLogicalHeight(*this, height); |
| 3361 |
} |
3369 |
} |
| 3362 |
|
3370 |
|
| 3363 |
void RenderBox::overrideLogicalHeightForSizeContainment() |
3371 |
void RenderBox::overrideLogicalHeightForSizeContainment() |