Changeset 295094 in webkit
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/rendering/RenderBox.cpp
r294744 r295094 3260 3260 } 3261 3261 3262 static inline bool isOrthogonal(const RenderBox& renderer, const RenderElement& ancestor) 3263 { 3264 return renderer.isHorizontalWritingMode() != ancestor.isHorizontalWritingMode(); 3265 } 3266 3262 3267 std::optional<LayoutUnit> RenderBox::computeIntrinsicLogicalContentHeightUsing(Length logicalHeightLength, std::optional<LayoutUnit> intrinsicContentHeight, LayoutUnit borderAndPadding) const 3263 3268 { … … 3267 3272 if (intrinsicContentHeight) 3268 3273 return adjustIntrinsicLogicalHeightForBoxSizing(intrinsicContentHeight.value()); 3269 return std::nullopt; 3270 } 3271 if (logicalHeightLength.isFillAvailable()) 3272 return containingBlock()->availableLogicalHeight(ExcludeMarginBorderPadding) - borderAndPadding; 3274 return { }; 3275 } 3276 if (logicalHeightLength.isFillAvailable()) { 3277 auto* containingBlock = this->containingBlock(); 3278 3279 auto canResolveAvailableSpace = [&] { 3280 // FIXME: We need to find a way to say: yes, the constraint value is set and we can resolve height against it. 3281 // Until then, this is mostly just guesswork. 3282 if (!containingBlock) 3283 return false; 3284 auto containingBlockHasSpecifiedSpace = [&] { 3285 auto isOrthogonal = WebCore::isOrthogonal(*this, *containingBlock); 3286 auto& style = containingBlock->style(); 3287 if ((!isOrthogonal && style.height().isSpecified()) || (isOrthogonal && style.width().isSpecified())) 3288 return true; 3289 if (containingBlock->isOutOfFlowPositioned()) { 3290 if ((!isOrthogonal && !style.top().isAuto() && !style.bottom().isAuto()) || (isOrthogonal && !style.left().isAuto() && !style.right().isAuto())) 3291 return true; 3292 } 3293 return false; 3294 }; 3295 return containingBlockHasSpecifiedSpace() || containingBlock->hasOverridingLogicalHeight(); 3296 }; 3297 if (canResolveAvailableSpace()) 3298 return containingBlock->availableLogicalHeight(ExcludeMarginBorderPadding) - borderAndPadding; 3299 return { }; 3300 } 3273 3301 ASSERT_NOT_REACHED(); 3274 3302 return 0_lu; … … 3631 3659 } 3632 3660 3633 // FIXME: evaluate whether this should be a method of RenderObject instead.3634 static inline bool isOrthogonal(const RenderObject& renderer, const RenderObject& ancestor)3635 {3636 return renderer.isHorizontalWritingMode() != ancestor.isHorizontalWritingMode();3637 }3638 3639 3661 LayoutUnit RenderBox::availableLogicalHeightUsing(const Length& h, AvailableLogicalHeightType heightType) const 3640 3662 { … … 3820 3842 return; 3821 3843 3822 RenderObject* parent = child->parent();3844 auto* parent = child->parent(); 3823 3845 TextDirection parentDirection = parent->style().direction(); 3824 3846 … … 4257 4279 return; 4258 4280 4259 RenderObject* parent = child->parent();4281 auto* parent = child->parent(); 4260 4282 4261 4283 // The static positions from the child's layer are relative to the container block's coordinate space (which is determined
Note: See TracChangeset
for help on using the changeset viewer.