OLD | NEW |
---|---|
1 /* | 1 /* |
Julien - ping for review
2015/04/06 17:06:47
O_o
cbiesinger
2015/04/06 21:34:16
Oops...
| |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) | 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) |
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) | 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) |
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. | 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. |
7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. | 7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. |
8 * | 8 * |
9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
11 * License as published by the Free Software Foundation; either | 11 * License as published by the Free Software Foundation; either |
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
581 const ComputedStyle& styleToUse = styleRef(); | 581 const ComputedStyle& styleToUse = styleRef(); |
582 if (!styleToUse.logicalMaxWidth().isMaxSizeNone()) | 582 if (!styleToUse.logicalMaxWidth().isMaxSizeNone()) |
583 logicalWidth = std::min(logicalWidth, computeLogicalWidthUsing(MaxSize, styleToUse.logicalMaxWidth(), availableWidth, cb)); | 583 logicalWidth = std::min(logicalWidth, computeLogicalWidthUsing(MaxSize, styleToUse.logicalMaxWidth(), availableWidth, cb)); |
584 return std::max(logicalWidth, computeLogicalWidthUsing(MinSize, styleToUse.l ogicalMinWidth(), availableWidth, cb)); | 584 return std::max(logicalWidth, computeLogicalWidthUsing(MinSize, styleToUse.l ogicalMinWidth(), availableWidth, cb)); |
585 } | 585 } |
586 | 586 |
587 LayoutUnit LayoutBox::constrainLogicalHeightByMinMax(LayoutUnit logicalHeight, L ayoutUnit intrinsicContentHeight) const | 587 LayoutUnit LayoutBox::constrainLogicalHeightByMinMax(LayoutUnit logicalHeight, L ayoutUnit intrinsicContentHeight) const |
588 { | 588 { |
589 const ComputedStyle& styleToUse = styleRef(); | 589 const ComputedStyle& styleToUse = styleRef(); |
590 if (!styleToUse.logicalMaxHeight().isMaxSizeNone()) { | 590 if (!styleToUse.logicalMaxHeight().isMaxSizeNone()) { |
591 LayoutUnit maxH = computeLogicalHeightUsing(styleToUse.logicalMaxHeight( ), intrinsicContentHeight); | 591 LayoutUnit maxH = computeLogicalHeightUsing(MaxSize, styleToUse.logicalM axHeight(), intrinsicContentHeight); |
592 if (maxH != -1) | 592 if (maxH != -1) |
593 logicalHeight = std::min(logicalHeight, maxH); | 593 logicalHeight = std::min(logicalHeight, maxH); |
594 } | 594 } |
595 return std::max(logicalHeight, computeLogicalHeightUsing(styleToUse.logicalM inHeight(), intrinsicContentHeight)); | 595 return std::max(logicalHeight, computeLogicalHeightUsing(MinSize, styleToUse .logicalMinHeight(), intrinsicContentHeight)); |
596 } | 596 } |
597 | 597 |
598 LayoutUnit LayoutBox::constrainContentBoxLogicalHeightByMinMax(LayoutUnit logica lHeight, LayoutUnit intrinsicContentHeight) const | 598 LayoutUnit LayoutBox::constrainContentBoxLogicalHeightByMinMax(LayoutUnit logica lHeight, LayoutUnit intrinsicContentHeight) const |
599 { | 599 { |
600 const ComputedStyle& styleToUse = styleRef(); | 600 const ComputedStyle& styleToUse = styleRef(); |
601 if (!styleToUse.logicalMaxHeight().isMaxSizeNone()) { | 601 if (!styleToUse.logicalMaxHeight().isMaxSizeNone()) { |
602 LayoutUnit maxH = computeContentLogicalHeight(styleToUse.logicalMaxHeigh t(), intrinsicContentHeight); | 602 LayoutUnit maxH = computeContentLogicalHeight(MaxSize, styleToUse.logica lMaxHeight(), intrinsicContentHeight); |
603 if (maxH != -1) | 603 if (maxH != -1) |
604 logicalHeight = std::min(logicalHeight, maxH); | 604 logicalHeight = std::min(logicalHeight, maxH); |
605 } | 605 } |
606 return std::max(logicalHeight, computeContentLogicalHeight(styleToUse.logica lMinHeight(), intrinsicContentHeight)); | 606 return std::max(logicalHeight, computeContentLogicalHeight(MinSize, styleToU se.logicalMinHeight(), intrinsicContentHeight)); |
607 } | 607 } |
608 | 608 |
609 void LayoutBox::setLocationAndUpdateOverflowControlsIfNeeded(const LayoutPoint& location) | 609 void LayoutBox::setLocationAndUpdateOverflowControlsIfNeeded(const LayoutPoint& location) |
610 { | 610 { |
611 if (hasOverflowClip()) { | 611 if (hasOverflowClip()) { |
612 IntSize oldPixelSnappedBorderRectSize = pixelSnappedBorderBoxRect().size (); | 612 IntSize oldPixelSnappedBorderRectSize = pixelSnappedBorderBoxRect().size (); |
613 setLocation(location); | 613 setLocation(location); |
614 if (pixelSnappedBorderBoxRect().size() != oldPixelSnappedBorderRectSize) | 614 if (pixelSnappedBorderBoxRect().size() != oldPixelSnappedBorderRectSize) |
615 scrollableArea()->updateAfterLayout(); | 615 scrollableArea()->updateAfterLayout(); |
616 return; | 616 return; |
(...skipping 1456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2073 maxLogicalWidth += borderAndPadding; | 2073 maxLogicalWidth += borderAndPadding; |
2074 return std::max(minLogicalWidth, std::min(maxLogicalWidth, fillAvailable Measure(availableLogicalWidth))); | 2074 return std::max(minLogicalWidth, std::min(maxLogicalWidth, fillAvailable Measure(availableLogicalWidth))); |
2075 } | 2075 } |
2076 | 2076 |
2077 ASSERT_NOT_REACHED(); | 2077 ASSERT_NOT_REACHED(); |
2078 return 0; | 2078 return 0; |
2079 } | 2079 } |
2080 | 2080 |
2081 LayoutUnit LayoutBox::computeLogicalWidthUsing(SizeType widthType, const Length& logicalWidth, LayoutUnit availableLogicalWidth, const LayoutBlock* cb) const | 2081 LayoutUnit LayoutBox::computeLogicalWidthUsing(SizeType widthType, const Length& logicalWidth, LayoutUnit availableLogicalWidth, const LayoutBlock* cb) const |
2082 { | 2082 { |
2083 if (widthType == MinSize && logicalWidth.isAuto()) | |
2084 return adjustBorderBoxLogicalWidthForBoxSizing(0); | |
2085 | |
2083 if (!logicalWidth.isIntrinsicOrAuto()) { | 2086 if (!logicalWidth.isIntrinsicOrAuto()) { |
2084 // FIXME: If the containing block flow is perpendicular to our direction we need to use the available logical height instead. | 2087 // FIXME: If the containing block flow is perpendicular to our direction we need to use the available logical height instead. |
2085 return adjustBorderBoxLogicalWidthForBoxSizing(valueForLength(logicalWid th, availableLogicalWidth)); | 2088 return adjustBorderBoxLogicalWidthForBoxSizing(valueForLength(logicalWid th, availableLogicalWidth)); |
2086 } | 2089 } |
2087 | 2090 |
2088 if (logicalWidth.isIntrinsic()) | 2091 if (logicalWidth.isIntrinsic()) |
2089 return computeIntrinsicLogicalWidthUsing(logicalWidth, availableLogicalW idth, borderAndPaddingLogicalWidth()); | 2092 return computeIntrinsicLogicalWidthUsing(logicalWidth, availableLogicalW idth, borderAndPaddingLogicalWidth()); |
2090 | 2093 |
2091 LayoutUnit marginStart = 0; | 2094 LayoutUnit marginStart = 0; |
2092 LayoutUnit marginEnd = 0; | 2095 LayoutUnit marginEnd = 0; |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2323 // Block children of horizontal flexible boxes fill the height of the bo x. | 2326 // Block children of horizontal flexible boxes fill the height of the bo x. |
2324 // FIXME: Account for writing-mode in flexible boxes. | 2327 // FIXME: Account for writing-mode in flexible boxes. |
2325 // https://bugs.webkit.org/show_bug.cgi?id=46418 | 2328 // https://bugs.webkit.org/show_bug.cgi?id=46418 |
2326 if (h.isAuto() && inHorizontalBox && toLayoutDeprecatedFlexibleBox(paren t())->isStretchingChildren()) { | 2329 if (h.isAuto() && inHorizontalBox && toLayoutDeprecatedFlexibleBox(paren t())->isStretchingChildren()) { |
2327 h = Length(parentBox()->contentLogicalHeight() - marginBefore() - ma rginAfter() - borderAndPaddingLogicalHeight(), Fixed); | 2330 h = Length(parentBox()->contentLogicalHeight() - marginBefore() - ma rginAfter() - borderAndPaddingLogicalHeight(), Fixed); |
2328 checkMinMaxHeight = false; | 2331 checkMinMaxHeight = false; |
2329 } | 2332 } |
2330 | 2333 |
2331 LayoutUnit heightResult; | 2334 LayoutUnit heightResult; |
2332 if (checkMinMaxHeight) { | 2335 if (checkMinMaxHeight) { |
2333 heightResult = computeLogicalHeightUsing(style()->logicalHeight(), c omputedValues.m_extent - borderAndPaddingLogicalHeight()); | 2336 heightResult = computeLogicalHeightUsing(MainOrPreferredSize, style( )->logicalHeight(), computedValues.m_extent - borderAndPaddingLogicalHeight()); |
2334 if (heightResult == -1) | 2337 if (heightResult == -1) |
2335 heightResult = computedValues.m_extent; | 2338 heightResult = computedValues.m_extent; |
2336 heightResult = constrainLogicalHeightByMinMax(heightResult, computed Values.m_extent - borderAndPaddingLogicalHeight()); | 2339 heightResult = constrainLogicalHeightByMinMax(heightResult, computed Values.m_extent - borderAndPaddingLogicalHeight()); |
2337 } else { | 2340 } else { |
2338 // The only times we don't check min/max height are when a fixed len gth has | 2341 // The only times we don't check min/max height are when a fixed len gth has |
2339 // been given as an override. Just use that. The value has already been adjusted | 2342 // been given as an override. Just use that. The value has already been adjusted |
2340 // for box-sizing. | 2343 // for box-sizing. |
2341 ASSERT(h.isFixed()); | 2344 ASSERT(h.isFixed()); |
2342 heightResult = h.value() + borderAndPaddingLogicalHeight(); | 2345 heightResult = h.value() + borderAndPaddingLogicalHeight(); |
2343 } | 2346 } |
(...skipping 15 matching lines...) Expand all Loading... | |
2359 LayoutUnit visibleHeight = view()->viewLogicalHeightForPercentages(); | 2362 LayoutUnit visibleHeight = view()->viewLogicalHeightForPercentages(); |
2360 if (isDocumentElement()) { | 2363 if (isDocumentElement()) { |
2361 computedValues.m_extent = std::max(computedValues.m_extent, visibleH eight - margins); | 2364 computedValues.m_extent = std::max(computedValues.m_extent, visibleH eight - margins); |
2362 } else { | 2365 } else { |
2363 LayoutUnit marginsBordersPadding = margins + parentBox()->marginBefo re() + parentBox()->marginAfter() + parentBox()->borderAndPaddingLogicalHeight() ; | 2366 LayoutUnit marginsBordersPadding = margins + parentBox()->marginBefo re() + parentBox()->marginAfter() + parentBox()->borderAndPaddingLogicalHeight() ; |
2364 computedValues.m_extent = std::max(computedValues.m_extent, visibleH eight - marginsBordersPadding); | 2367 computedValues.m_extent = std::max(computedValues.m_extent, visibleH eight - marginsBordersPadding); |
2365 } | 2368 } |
2366 } | 2369 } |
2367 } | 2370 } |
2368 | 2371 |
2369 LayoutUnit LayoutBox::computeLogicalHeightUsing(const Length& height, LayoutUnit intrinsicContentHeight) const | 2372 LayoutUnit LayoutBox::computeLogicalHeightUsing(SizeType heightType, const Lengt h& height, LayoutUnit intrinsicContentHeight) const |
2370 { | 2373 { |
2371 LayoutUnit logicalHeight = computeContentAndScrollbarLogicalHeightUsing(heig ht, intrinsicContentHeight); | 2374 LayoutUnit logicalHeight = computeContentAndScrollbarLogicalHeightUsing(heig htType, height, intrinsicContentHeight); |
2372 if (logicalHeight != -1) | 2375 if (logicalHeight != -1) |
2373 logicalHeight = adjustBorderBoxLogicalHeightForBoxSizing(logicalHeight); | 2376 logicalHeight = adjustBorderBoxLogicalHeightForBoxSizing(logicalHeight); |
2374 return logicalHeight; | 2377 return logicalHeight; |
2375 } | 2378 } |
2376 | 2379 |
2377 LayoutUnit LayoutBox::computeContentLogicalHeight(const Length& height, LayoutUn it intrinsicContentHeight) const | 2380 LayoutUnit LayoutBox::computeContentLogicalHeight(SizeType heightType, const Len gth& height, LayoutUnit intrinsicContentHeight) const |
2378 { | 2381 { |
2379 LayoutUnit heightIncludingScrollbar = computeContentAndScrollbarLogicalHeigh tUsing(height, intrinsicContentHeight); | 2382 LayoutUnit heightIncludingScrollbar = computeContentAndScrollbarLogicalHeigh tUsing(heightType, height, intrinsicContentHeight); |
2380 if (heightIncludingScrollbar == -1) | 2383 if (heightIncludingScrollbar == -1) |
2381 return -1; | 2384 return -1; |
2382 return std::max(LayoutUnit(), adjustContentBoxLogicalHeightForBoxSizing(heig htIncludingScrollbar) - scrollbarLogicalHeight()); | 2385 return std::max(LayoutUnit(), adjustContentBoxLogicalHeightForBoxSizing(heig htIncludingScrollbar) - scrollbarLogicalHeight()); |
2383 } | 2386 } |
2384 | 2387 |
2385 LayoutUnit LayoutBox::computeIntrinsicLogicalContentHeightUsing(const Length& lo gicalHeightLength, LayoutUnit intrinsicContentHeight, LayoutUnit borderAndPaddin g) const | 2388 LayoutUnit LayoutBox::computeIntrinsicLogicalContentHeightUsing(const Length& lo gicalHeightLength, LayoutUnit intrinsicContentHeight, LayoutUnit borderAndPaddin g) const |
2386 { | 2389 { |
2387 // FIXME(cbiesinger): The css-sizing spec is considering changing what min-c ontent/max-content should resolve to. | 2390 // FIXME(cbiesinger): The css-sizing spec is considering changing what min-c ontent/max-content should resolve to. |
2388 // If that happens, this code will have to change. | 2391 // If that happens, this code will have to change. |
2389 if (logicalHeightLength.isMinContent() || logicalHeightLength.isMaxContent() || logicalHeightLength.isFitContent()) { | 2392 if (logicalHeightLength.isMinContent() || logicalHeightLength.isMaxContent() || logicalHeightLength.isFitContent()) { |
2390 if (isReplaced()) | 2393 if (isReplaced()) |
2391 return intrinsicSize().height(); | 2394 return intrinsicSize().height(); |
2392 if (m_intrinsicContentLogicalHeight != -1) | 2395 if (m_intrinsicContentLogicalHeight != -1) |
2393 return m_intrinsicContentLogicalHeight; | 2396 return m_intrinsicContentLogicalHeight; |
2394 return intrinsicContentHeight; | 2397 return intrinsicContentHeight; |
2395 } | 2398 } |
2396 if (logicalHeightLength.isFillAvailable()) | 2399 if (logicalHeightLength.isFillAvailable()) |
2397 return containingBlock()->availableLogicalHeight(ExcludeMarginBorderPadd ing) - borderAndPadding; | 2400 return containingBlock()->availableLogicalHeight(ExcludeMarginBorderPadd ing) - borderAndPadding; |
2398 ASSERT_NOT_REACHED(); | 2401 ASSERT_NOT_REACHED(); |
2399 return 0; | 2402 return 0; |
2400 } | 2403 } |
2401 | 2404 |
2402 LayoutUnit LayoutBox::computeContentAndScrollbarLogicalHeightUsing(const Length& height, LayoutUnit intrinsicContentHeight) const | 2405 LayoutUnit LayoutBox::computeContentAndScrollbarLogicalHeightUsing(SizeType heig htType, const Length& height, LayoutUnit intrinsicContentHeight) const |
2403 { | 2406 { |
2407 if (height.isAuto()) | |
2408 return heightType == MinSize ? 0 : -1; | |
2404 // FIXME(cbiesinger): The css-sizing spec is considering changing what min-c ontent/max-content should resolve to. | 2409 // FIXME(cbiesinger): The css-sizing spec is considering changing what min-c ontent/max-content should resolve to. |
2405 // If that happens, this code will have to change. | 2410 // If that happens, this code will have to change. |
2406 if (height.isIntrinsic()) { | 2411 if (height.isIntrinsic()) { |
2407 if (intrinsicContentHeight == -1) | 2412 if (intrinsicContentHeight == -1) |
2408 return -1; // Intrinsic height isn't available. | 2413 return -1; // Intrinsic height isn't available. |
2409 return computeIntrinsicLogicalContentHeightUsing(height, intrinsicConten tHeight, borderAndPaddingLogicalHeight()); | 2414 return computeIntrinsicLogicalContentHeightUsing(height, intrinsicConten tHeight, borderAndPaddingLogicalHeight()); |
2410 } | 2415 } |
2411 if (height.isFixed()) | 2416 if (height.isFixed()) |
2412 return height.value(); | 2417 return height.value(); |
2413 if (height.isPercent()) | 2418 if (height.isPercent()) |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2525 // box model. This is essential for sizing inside | 2530 // box model. This is essential for sizing inside |
2526 // table cells using percentage heights. | 2531 // table cells using percentage heights. |
2527 result -= borderAndPaddingLogicalHeight(); | 2532 result -= borderAndPaddingLogicalHeight(); |
2528 return std::max(LayoutUnit(), result); | 2533 return std::max(LayoutUnit(), result); |
2529 } | 2534 } |
2530 return result; | 2535 return result; |
2531 } | 2536 } |
2532 | 2537 |
2533 LayoutUnit LayoutBox::computeReplacedLogicalWidth(ShouldComputePreferred shouldC omputePreferred) const | 2538 LayoutUnit LayoutBox::computeReplacedLogicalWidth(ShouldComputePreferred shouldC omputePreferred) const |
2534 { | 2539 { |
2535 return computeReplacedLogicalWidthRespectingMinMaxWidth(computeReplacedLogic alWidthUsing(style()->logicalWidth()), shouldComputePreferred); | 2540 return computeReplacedLogicalWidthRespectingMinMaxWidth(computeReplacedLogic alWidthUsing(MainOrPreferredSize, style()->logicalWidth()), shouldComputePreferr ed); |
2536 } | 2541 } |
2537 | 2542 |
2538 LayoutUnit LayoutBox::computeReplacedLogicalWidthRespectingMinMaxWidth(LayoutUni t logicalWidth, ShouldComputePreferred shouldComputePreferred) const | 2543 LayoutUnit LayoutBox::computeReplacedLogicalWidthRespectingMinMaxWidth(LayoutUni t logicalWidth, ShouldComputePreferred shouldComputePreferred) const |
2539 { | 2544 { |
2540 LayoutUnit minLogicalWidth = (shouldComputePreferred == ComputePreferred && style()->logicalMinWidth().isPercent()) || style()->logicalMinWidth().isMaxSizeN one() ? logicalWidth : computeReplacedLogicalWidthUsing(style()->logicalMinWidth ()); | 2545 LayoutUnit minLogicalWidth = (shouldComputePreferred == ComputePreferred && style()->logicalMinWidth().isPercent()) || style()->logicalMinWidth().isMaxSizeN one() ? logicalWidth : computeReplacedLogicalWidthUsing(MinSize, style()->logica lMinWidth()); |
2541 LayoutUnit maxLogicalWidth = (shouldComputePreferred == ComputePreferred && style()->logicalMaxWidth().isPercent()) || style()->logicalMaxWidth().isMaxSizeN one() ? logicalWidth : computeReplacedLogicalWidthUsing(style()->logicalMaxWidth ()); | 2546 LayoutUnit maxLogicalWidth = (shouldComputePreferred == ComputePreferred && style()->logicalMaxWidth().isPercent()) || style()->logicalMaxWidth().isMaxSizeN one() ? logicalWidth : computeReplacedLogicalWidthUsing(MaxSize, style()->logica lMaxWidth()); |
2542 return std::max(minLogicalWidth, std::min(logicalWidth, maxLogicalWidth)); | 2547 return std::max(minLogicalWidth, std::min(logicalWidth, maxLogicalWidth)); |
2543 } | 2548 } |
2544 | 2549 |
2545 LayoutUnit LayoutBox::computeReplacedLogicalWidthUsing(const Length& logicalWidt h) const | 2550 LayoutUnit LayoutBox::computeReplacedLogicalWidthUsing(SizeType sizeType, const Length& logicalWidth) const |
2546 { | 2551 { |
2552 if (sizeType == MinSize && logicalWidth.isAuto()) | |
2553 return adjustContentBoxLogicalWidthForBoxSizing(0); | |
2554 | |
2547 switch (logicalWidth.type()) { | 2555 switch (logicalWidth.type()) { |
2548 case Fixed: | 2556 case Fixed: |
2549 return adjustContentBoxLogicalWidthForBoxSizing(logicalWidth.value()); | 2557 return adjustContentBoxLogicalWidthForBoxSizing(logicalWidth.value()); |
2550 case MinContent: | 2558 case MinContent: |
2551 case MaxContent: { | 2559 case MaxContent: { |
2552 // MinContent/MaxContent don't need the availableLogicalWidth argument. | 2560 // MinContent/MaxContent don't need the availableLogicalWidth argument. |
2553 LayoutUnit availableLogicalWidth = 0; | 2561 LayoutUnit availableLogicalWidth = 0; |
2554 return computeIntrinsicLogicalWidthUsing(logicalWidth, availableLogicalW idth, borderAndPaddingLogicalWidth()) - borderAndPaddingLogicalWidth(); | 2562 return computeIntrinsicLogicalWidthUsing(logicalWidth, availableLogicalW idth, borderAndPaddingLogicalWidth()) - borderAndPaddingLogicalWidth(); |
2555 } | 2563 } |
2556 case FitContent: | 2564 case FitContent: |
(...skipping 23 matching lines...) Expand all Loading... | |
2580 case DeviceHeight: | 2588 case DeviceHeight: |
2581 break; | 2589 break; |
2582 } | 2590 } |
2583 | 2591 |
2584 ASSERT_NOT_REACHED(); | 2592 ASSERT_NOT_REACHED(); |
2585 return 0; | 2593 return 0; |
2586 } | 2594 } |
2587 | 2595 |
2588 LayoutUnit LayoutBox::computeReplacedLogicalHeight() const | 2596 LayoutUnit LayoutBox::computeReplacedLogicalHeight() const |
2589 { | 2597 { |
2590 return computeReplacedLogicalHeightRespectingMinMaxHeight(computeReplacedLog icalHeightUsing(style()->logicalHeight())); | 2598 return computeReplacedLogicalHeightRespectingMinMaxHeight(computeReplacedLog icalHeightUsing(MainOrPreferredSize, style()->logicalHeight())); |
2591 } | 2599 } |
2592 | 2600 |
2593 bool LayoutBox::logicalHeightComputesAsNone(SizeType sizeType) const | 2601 bool LayoutBox::logicalHeightComputesAsNone(SizeType sizeType) const |
2594 { | 2602 { |
2595 ASSERT(sizeType == MinSize || sizeType == MaxSize); | 2603 ASSERT(sizeType == MinSize || sizeType == MaxSize); |
2596 Length logicalHeight = sizeType == MinSize ? style()->logicalMinHeight() : s tyle()->logicalMaxHeight(); | 2604 Length logicalHeight = sizeType == MinSize ? style()->logicalMinHeight() : s tyle()->logicalMaxHeight(); |
2597 Length initialLogicalHeight = sizeType == MinSize ? ComputedStyle::initialMi nSize() : ComputedStyle::initialMaxSize(); | 2605 Length initialLogicalHeight = sizeType == MinSize ? ComputedStyle::initialMi nSize() : ComputedStyle::initialMaxSize(); |
2598 | 2606 |
2599 if (logicalHeight == initialLogicalHeight) | 2607 if (logicalHeight == initialLogicalHeight) |
2600 return true; | 2608 return true; |
2601 | 2609 |
2602 if (LayoutBlock* cb = containingBlockForAutoHeightDetection(logicalHeight)) | 2610 if (LayoutBlock* cb = containingBlockForAutoHeightDetection(logicalHeight)) |
2603 return cb->hasAutoHeightOrContainingBlockWithAutoHeight(); | 2611 return cb->hasAutoHeightOrContainingBlockWithAutoHeight(); |
2604 return false; | 2612 return false; |
2605 } | 2613 } |
2606 | 2614 |
2607 LayoutUnit LayoutBox::computeReplacedLogicalHeightRespectingMinMaxHeight(LayoutU nit logicalHeight) const | 2615 LayoutUnit LayoutBox::computeReplacedLogicalHeightRespectingMinMaxHeight(LayoutU nit logicalHeight) const |
2608 { | 2616 { |
2609 // If the height of the containing block is not specified explicitly (i.e., it depends on content height), and this element is not absolutely positioned, | 2617 // If the height of the containing block is not specified explicitly (i.e., it depends on content height), and this element is not absolutely positioned, |
2610 // the percentage value is treated as '0' (for 'min-height') or 'none' (for 'max-height'). | 2618 // the percentage value is treated as '0' (for 'min-height') or 'none' (for 'max-height'). |
2611 LayoutUnit minLogicalHeight; | 2619 LayoutUnit minLogicalHeight; |
2612 if (!logicalHeightComputesAsNone(MinSize)) | 2620 if (!logicalHeightComputesAsNone(MinSize)) |
2613 minLogicalHeight = computeReplacedLogicalHeightUsing(style()->logicalMin Height()); | 2621 minLogicalHeight = computeReplacedLogicalHeightUsing(MinSize, style()->l ogicalMinHeight()); |
2614 LayoutUnit maxLogicalHeight = logicalHeight; | 2622 LayoutUnit maxLogicalHeight = logicalHeight; |
2615 if (!logicalHeightComputesAsNone(MaxSize)) | 2623 if (!logicalHeightComputesAsNone(MaxSize)) |
2616 maxLogicalHeight = computeReplacedLogicalHeightUsing(style()->logicalMa xHeight()); | 2624 maxLogicalHeight = computeReplacedLogicalHeightUsing(MaxSize, style()-> logicalMaxHeight()); |
2617 return std::max(minLogicalHeight, std::min(logicalHeight, maxLogicalHeight)) ; | 2625 return std::max(minLogicalHeight, std::min(logicalHeight, maxLogicalHeight)) ; |
2618 } | 2626 } |
2619 | 2627 |
2620 LayoutUnit LayoutBox::computeReplacedLogicalHeightUsing(const Length& logicalHei ght) const | 2628 LayoutUnit LayoutBox::computeReplacedLogicalHeightUsing(SizeType sizeType, const Length& logicalHeight) const |
2621 { | 2629 { |
2630 if (sizeType == MinSize && logicalHeight.isAuto()) | |
2631 return adjustContentBoxLogicalHeightForBoxSizing(0); | |
2632 | |
2622 switch (logicalHeight.type()) { | 2633 switch (logicalHeight.type()) { |
2623 case Fixed: | 2634 case Fixed: |
2624 return adjustContentBoxLogicalHeightForBoxSizing(logicalHeight.value()); | 2635 return adjustContentBoxLogicalHeightForBoxSizing(logicalHeight.value()); |
2625 case Percent: | 2636 case Percent: |
2626 case Calculated: | 2637 case Calculated: |
2627 { | 2638 { |
2628 LayoutObject* cb = isOutOfFlowPositioned() ? container() : containingBlo ck(); | 2639 LayoutObject* cb = isOutOfFlowPositioned() ? container() : containingBlo ck(); |
2629 while (cb->isAnonymous()) | 2640 while (cb->isAnonymous()) |
2630 cb = cb->containingBlock(); | 2641 cb = cb->containingBlock(); |
2631 if (cb->isLayoutBlock()) | 2642 if (cb->isLayoutBlock()) |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2696 return overrideLogicalContentHeight(); | 2707 return overrideLogicalContentHeight(); |
2697 return logicalHeight() - borderAndPaddingLogicalHeight(); | 2708 return logicalHeight() - borderAndPaddingLogicalHeight(); |
2698 } | 2709 } |
2699 | 2710 |
2700 if (h.isPercent() && isOutOfFlowPositioned()) { | 2711 if (h.isPercent() && isOutOfFlowPositioned()) { |
2701 // FIXME: This is wrong if the containingBlock has a perpendicular writi ng mode. | 2712 // FIXME: This is wrong if the containingBlock has a perpendicular writi ng mode. |
2702 LayoutUnit availableHeight = containingBlockLogicalHeightForPositioned(c ontainingBlock()); | 2713 LayoutUnit availableHeight = containingBlockLogicalHeightForPositioned(c ontainingBlock()); |
2703 return adjustContentBoxLogicalHeightForBoxSizing(valueForLength(h, avail ableHeight)); | 2714 return adjustContentBoxLogicalHeightForBoxSizing(valueForLength(h, avail ableHeight)); |
2704 } | 2715 } |
2705 | 2716 |
2706 LayoutUnit heightIncludingScrollbar = computeContentAndScrollbarLogicalHeigh tUsing(h, -1); | 2717 LayoutUnit heightIncludingScrollbar = computeContentAndScrollbarLogicalHeigh tUsing(MainOrPreferredSize, h, -1); |
2707 if (heightIncludingScrollbar != -1) | 2718 if (heightIncludingScrollbar != -1) |
2708 return std::max(LayoutUnit(), adjustContentBoxLogicalHeightForBoxSizing( heightIncludingScrollbar) - scrollbarLogicalHeight()); | 2719 return std::max(LayoutUnit(), adjustContentBoxLogicalHeightForBoxSizing( heightIncludingScrollbar) - scrollbarLogicalHeight()); |
2709 | 2720 |
2710 // FIXME: Check logicalTop/logicalBottom here to correctly handle vertical w riting-mode. | 2721 // FIXME: Check logicalTop/logicalBottom here to correctly handle vertical w riting-mode. |
2711 // https://bugs.webkit.org/show_bug.cgi?id=46500 | 2722 // https://bugs.webkit.org/show_bug.cgi?id=46500 |
2712 if (isLayoutBlock() && isOutOfFlowPositioned() && style()->height().isAuto() && !(style()->top().isAuto() || style()->bottom().isAuto())) { | 2723 if (isLayoutBlock() && isOutOfFlowPositioned() && style()->height().isAuto() && !(style()->top().isAuto() || style()->bottom().isAuto())) { |
2713 LayoutBlock* block = const_cast<LayoutBlock*>(toLayoutBlock(this)); | 2724 LayoutBlock* block = const_cast<LayoutBlock*>(toLayoutBlock(this)); |
2714 LogicalExtentComputedValues computedValues; | 2725 LogicalExtentComputedValues computedValues; |
2715 block->computeLogicalHeight(block->logicalHeight(), 0, computedValues); | 2726 block->computeLogicalHeight(block->logicalHeight(), 0, computedValues); |
2716 LayoutUnit newContentHeight = computedValues.m_extent - block->borderAnd PaddingLogicalHeight() - block->scrollbarLogicalHeight(); | 2727 LayoutUnit newContentHeight = computedValues.m_extent - block->borderAnd PaddingLogicalHeight() - block->scrollbarLogicalHeight(); |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2939 * fixed positioned elements is the initial containing block instead of the | 2950 * fixed positioned elements is the initial containing block instead of the |
2940 * viewport, and all scrollable boxes should be assumed to be scrolled to th eir | 2951 * viewport, and all scrollable boxes should be assumed to be scrolled to th eir |
2941 * origin. | 2952 * origin. |
2942 \*-------------------------------------------------------------------------- -*/ | 2953 \*-------------------------------------------------------------------------- -*/ |
2943 | 2954 |
2944 // see FIXME 1 | 2955 // see FIXME 1 |
2945 // Calculate the static distance if needed. | 2956 // Calculate the static distance if needed. |
2946 computeInlineStaticDistance(logicalLeftLength, logicalRightLength, this, con tainerBlock, containerLogicalWidth); | 2957 computeInlineStaticDistance(logicalLeftLength, logicalRightLength, this, con tainerBlock, containerLogicalWidth); |
2947 | 2958 |
2948 // Calculate constraint equation values for 'width' case. | 2959 // Calculate constraint equation values for 'width' case. |
2949 computePositionedLogicalWidthUsing(style()->logicalWidth(), containerBlock, containerDirection, | 2960 computePositionedLogicalWidthUsing(MainOrPreferredSize, style()->logicalWidt h(), containerBlock, containerDirection, |
2950 containerLogicalWidth, bordersPlusPadding, | 2961 containerLogicalWidth, bordersPlusPadding, |
2951 logicalLeftLength, logicalRightLength, marginLogicalLeft, marginLogicalR ight, | 2962 logicalLeftLength, logicalRightLength, marginLogicalLeft, marginLogicalR ight, |
2952 computedValues); | 2963 computedValues); |
2953 | 2964 |
2954 // Calculate constraint equation values for 'max-width' case. | 2965 // Calculate constraint equation values for 'max-width' case. |
2955 if (!style()->logicalMaxWidth().isMaxSizeNone()) { | 2966 if (!style()->logicalMaxWidth().isMaxSizeNone()) { |
2956 LogicalExtentComputedValues maxValues; | 2967 LogicalExtentComputedValues maxValues; |
2957 | 2968 |
2958 computePositionedLogicalWidthUsing(style()->logicalMaxWidth(), container Block, containerDirection, | 2969 computePositionedLogicalWidthUsing(MaxSize, style()->logicalMaxWidth(), containerBlock, containerDirection, |
2959 containerLogicalWidth, bordersPlusPadding, | 2970 containerLogicalWidth, bordersPlusPadding, |
2960 logicalLeftLength, logicalRightLength, marginLogicalLeft, marginLogi calRight, | 2971 logicalLeftLength, logicalRightLength, marginLogicalLeft, marginLogi calRight, |
2961 maxValues); | 2972 maxValues); |
2962 | 2973 |
2963 if (computedValues.m_extent > maxValues.m_extent) { | 2974 if (computedValues.m_extent > maxValues.m_extent) { |
2964 computedValues.m_extent = maxValues.m_extent; | 2975 computedValues.m_extent = maxValues.m_extent; |
2965 computedValues.m_position = maxValues.m_position; | 2976 computedValues.m_position = maxValues.m_position; |
2966 computedValues.m_margins.m_start = maxValues.m_margins.m_start; | 2977 computedValues.m_margins.m_start = maxValues.m_margins.m_start; |
2967 computedValues.m_margins.m_end = maxValues.m_margins.m_end; | 2978 computedValues.m_margins.m_end = maxValues.m_margins.m_end; |
2968 } | 2979 } |
2969 } | 2980 } |
2970 | 2981 |
2971 // Calculate constraint equation values for 'min-width' case. | 2982 // Calculate constraint equation values for 'min-width' case. |
2972 if (!style()->logicalMinWidth().isZero() || style()->logicalMinWidth().isInt rinsic()) { | 2983 if (!style()->logicalMinWidth().isZero() || style()->logicalMinWidth().isInt rinsic()) { |
2973 LogicalExtentComputedValues minValues; | 2984 LogicalExtentComputedValues minValues; |
2974 | 2985 |
2975 computePositionedLogicalWidthUsing(style()->logicalMinWidth(), container Block, containerDirection, | 2986 computePositionedLogicalWidthUsing(MinSize, style()->logicalMinWidth(), containerBlock, containerDirection, |
2976 containerLogicalWidth, bordersPlusPadding, | 2987 containerLogicalWidth, bordersPlusPadding, |
2977 logicalLeftLength, logicalRightLength, marginLogicalLeft, marginLogi calRight, | 2988 logicalLeftLength, logicalRightLength, marginLogicalLeft, marginLogi calRight, |
2978 minValues); | 2989 minValues); |
2979 | 2990 |
2980 if (computedValues.m_extent < minValues.m_extent) { | 2991 if (computedValues.m_extent < minValues.m_extent) { |
2981 computedValues.m_extent = minValues.m_extent; | 2992 computedValues.m_extent = minValues.m_extent; |
2982 computedValues.m_position = minValues.m_position; | 2993 computedValues.m_position = minValues.m_position; |
2983 computedValues.m_margins.m_start = minValues.m_margins.m_start; | 2994 computedValues.m_margins.m_start = minValues.m_margins.m_start; |
2984 computedValues.m_margins.m_end = minValues.m_margins.m_end; | 2995 computedValues.m_margins.m_end = minValues.m_margins.m_end; |
2985 } | 2996 } |
(...skipping 17 matching lines...) Expand all Loading... | |
3003 } | 3014 } |
3004 } | 3015 } |
3005 | 3016 |
3006 LayoutUnit LayoutBox::shrinkToFitLogicalWidth(LayoutUnit availableLogicalWidth, LayoutUnit bordersPlusPadding) const | 3017 LayoutUnit LayoutBox::shrinkToFitLogicalWidth(LayoutUnit availableLogicalWidth, LayoutUnit bordersPlusPadding) const |
3007 { | 3018 { |
3008 LayoutUnit preferredLogicalWidth = maxPreferredLogicalWidth() - bordersPlusP adding; | 3019 LayoutUnit preferredLogicalWidth = maxPreferredLogicalWidth() - bordersPlusP adding; |
3009 LayoutUnit preferredMinLogicalWidth = minPreferredLogicalWidth() - bordersPl usPadding; | 3020 LayoutUnit preferredMinLogicalWidth = minPreferredLogicalWidth() - bordersPl usPadding; |
3010 return std::min(std::max(preferredMinLogicalWidth, availableLogicalWidth), p referredLogicalWidth); | 3021 return std::min(std::max(preferredMinLogicalWidth, availableLogicalWidth), p referredLogicalWidth); |
3011 } | 3022 } |
3012 | 3023 |
3013 void LayoutBox::computePositionedLogicalWidthUsing(Length logicalWidth, const La youtBoxModelObject* containerBlock, TextDirection containerDirection, | 3024 void LayoutBox::computePositionedLogicalWidthUsing(SizeType widthSizeType, Lengt h logicalWidth, const LayoutBoxModelObject* containerBlock, TextDirection contai nerDirection, |
3014 LayoutUnit containerLogicalWidth, LayoutUnit bordersPlusPadding, | 3025 LayoutUnit containerLogicalWidth, LayoutUnit bordersPlusPadding, |
3015 const Length& logicalLeft, const Length& logicalRight, const Length& marginL ogicalLeft, | 3026 const Length& logicalLeft, const Length& logicalRight, const Length& marginL ogicalLeft, |
3016 const Length& marginLogicalRight, LogicalExtentComputedValues& computedValue s) const | 3027 const Length& marginLogicalRight, LogicalExtentComputedValues& computedValue s) const |
3017 { | 3028 { |
3018 if (logicalWidth.isIntrinsic()) | 3029 if (widthSizeType == MinSize && logicalWidth.isAuto()) |
3030 logicalWidth = Length(0, Fixed); | |
3031 else if (logicalWidth.isIntrinsic()) | |
3019 logicalWidth = Length(computeIntrinsicLogicalWidthUsing(logicalWidth, co ntainerLogicalWidth, bordersPlusPadding) - bordersPlusPadding, Fixed); | 3032 logicalWidth = Length(computeIntrinsicLogicalWidthUsing(logicalWidth, co ntainerLogicalWidth, bordersPlusPadding) - bordersPlusPadding, Fixed); |
3020 | 3033 |
3021 // 'left' and 'right' cannot both be 'auto' because one would of been | 3034 // 'left' and 'right' cannot both be 'auto' because one would of been |
3022 // converted to the static position already | 3035 // converted to the static position already |
3023 ASSERT(!(logicalLeft.isAuto() && logicalRight.isAuto())); | 3036 ASSERT(!(logicalLeft.isAuto() && logicalRight.isAuto())); |
3024 | 3037 |
3025 // minimumValueForLength will convert 'auto' to 0 so that it doesn't impact the available space computation below. | 3038 // minimumValueForLength will convert 'auto' to 0 so that it doesn't impact the available space computation below. |
3026 LayoutUnit logicalLeftValue = minimumValueForLength(logicalLeft, containerLo gicalWidth); | 3039 LayoutUnit logicalLeftValue = minimumValueForLength(logicalLeft, containerLo gicalWidth); |
3027 LayoutUnit logicalRightValue = minimumValueForLength(logicalRight, container LogicalWidth); | 3040 LayoutUnit logicalRightValue = minimumValueForLength(logicalRight, container LogicalWidth); |
3028 | 3041 |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3241 * of fixed positioned elements is the initial containing block instead of | 3254 * of fixed positioned elements is the initial containing block instead of |
3242 * the viewport. | 3255 * the viewport. |
3243 \*-------------------------------------------------------------------------- -*/ | 3256 \*-------------------------------------------------------------------------- -*/ |
3244 | 3257 |
3245 // see FIXME 1 | 3258 // see FIXME 1 |
3246 // Calculate the static distance if needed. | 3259 // Calculate the static distance if needed. |
3247 computeBlockStaticDistance(logicalTopLength, logicalBottomLength, this, cont ainerBlock); | 3260 computeBlockStaticDistance(logicalTopLength, logicalBottomLength, this, cont ainerBlock); |
3248 | 3261 |
3249 // Calculate constraint equation values for 'height' case. | 3262 // Calculate constraint equation values for 'height' case. |
3250 LayoutUnit logicalHeight = computedValues.m_extent; | 3263 LayoutUnit logicalHeight = computedValues.m_extent; |
3251 computePositionedLogicalHeightUsing(styleToUse.logicalHeight(), containerBlo ck, containerLogicalHeight, bordersPlusPadding, logicalHeight, | 3264 computePositionedLogicalHeightUsing(MainOrPreferredSize, styleToUse.logicalH eight(), containerBlock, containerLogicalHeight, bordersPlusPadding, logicalHeig ht, |
3252 logicalTopLength, logicalBottomLength, marginBefore, marginAfter, | 3265 logicalTopLength, logicalBottomLength, marginBefore, marginAfter, |
3253 computedValues); | 3266 computedValues); |
3254 | 3267 |
3255 // Avoid doing any work in the common case (where the values of min-height a nd max-height are their defaults). | 3268 // Avoid doing any work in the common case (where the values of min-height a nd max-height are their defaults). |
3256 // see FIXME 2 | 3269 // see FIXME 2 |
3257 | 3270 |
3258 // Calculate constraint equation values for 'max-height' case. | 3271 // Calculate constraint equation values for 'max-height' case. |
3259 if (!styleToUse.logicalMaxHeight().isMaxSizeNone()) { | 3272 if (!styleToUse.logicalMaxHeight().isMaxSizeNone()) { |
3260 LogicalExtentComputedValues maxValues; | 3273 LogicalExtentComputedValues maxValues; |
3261 | 3274 |
3262 computePositionedLogicalHeightUsing(styleToUse.logicalMaxHeight(), conta inerBlock, containerLogicalHeight, bordersPlusPadding, logicalHeight, | 3275 computePositionedLogicalHeightUsing(MaxSize, styleToUse.logicalMaxHeight (), containerBlock, containerLogicalHeight, bordersPlusPadding, logicalHeight, |
3263 logicalTopLength, logicalBottomLength, marginBefore, marginAfter, | 3276 logicalTopLength, logicalBottomLength, marginBefore, marginAfter, |
3264 maxValues); | 3277 maxValues); |
3265 | 3278 |
3266 if (computedValues.m_extent > maxValues.m_extent) { | 3279 if (computedValues.m_extent > maxValues.m_extent) { |
3267 computedValues.m_extent = maxValues.m_extent; | 3280 computedValues.m_extent = maxValues.m_extent; |
3268 computedValues.m_position = maxValues.m_position; | 3281 computedValues.m_position = maxValues.m_position; |
3269 computedValues.m_margins.m_before = maxValues.m_margins.m_before; | 3282 computedValues.m_margins.m_before = maxValues.m_margins.m_before; |
3270 computedValues.m_margins.m_after = maxValues.m_margins.m_after; | 3283 computedValues.m_margins.m_after = maxValues.m_margins.m_after; |
3271 } | 3284 } |
3272 } | 3285 } |
3273 | 3286 |
3274 // Calculate constraint equation values for 'min-height' case. | 3287 // Calculate constraint equation values for 'min-height' case. |
3275 if (!styleToUse.logicalMinHeight().isZero() || styleToUse.logicalMinHeight() .isIntrinsic()) { | 3288 if (!styleToUse.logicalMinHeight().isZero() || styleToUse.logicalMinHeight() .isIntrinsic()) { |
3276 LogicalExtentComputedValues minValues; | 3289 LogicalExtentComputedValues minValues; |
3277 | 3290 |
3278 computePositionedLogicalHeightUsing(styleToUse.logicalMinHeight(), conta inerBlock, containerLogicalHeight, bordersPlusPadding, logicalHeight, | 3291 computePositionedLogicalHeightUsing(MinSize, styleToUse.logicalMinHeight (), containerBlock, containerLogicalHeight, bordersPlusPadding, logicalHeight, |
3279 logicalTopLength, logicalBottomLength, marginBefore, marginAfter, | 3292 logicalTopLength, logicalBottomLength, marginBefore, marginAfter, |
3280 minValues); | 3293 minValues); |
3281 | 3294 |
3282 if (computedValues.m_extent < minValues.m_extent) { | 3295 if (computedValues.m_extent < minValues.m_extent) { |
3283 computedValues.m_extent = minValues.m_extent; | 3296 computedValues.m_extent = minValues.m_extent; |
3284 computedValues.m_position = minValues.m_position; | 3297 computedValues.m_position = minValues.m_position; |
3285 computedValues.m_margins.m_before = minValues.m_margins.m_before; | 3298 computedValues.m_margins.m_before = minValues.m_margins.m_before; |
3286 computedValues.m_margins.m_after = minValues.m_margins.m_after; | 3299 computedValues.m_margins.m_after = minValues.m_margins.m_after; |
3287 } | 3300 } |
3288 } | 3301 } |
(...skipping 20 matching lines...) Expand all Loading... | |
3309 else | 3322 else |
3310 logicalTopPos += containerBlock->borderRight(); | 3323 logicalTopPos += containerBlock->borderRight(); |
3311 } else { | 3324 } else { |
3312 if (child->isHorizontalWritingMode()) | 3325 if (child->isHorizontalWritingMode()) |
3313 logicalTopPos += containerBlock->borderTop(); | 3326 logicalTopPos += containerBlock->borderTop(); |
3314 else | 3327 else |
3315 logicalTopPos += containerBlock->borderLeft(); | 3328 logicalTopPos += containerBlock->borderLeft(); |
3316 } | 3329 } |
3317 } | 3330 } |
3318 | 3331 |
3319 void LayoutBox::computePositionedLogicalHeightUsing(Length logicalHeightLength, const LayoutBoxModelObject* containerBlock, | 3332 void LayoutBox::computePositionedLogicalHeightUsing(SizeType heightSizeType, Len gth logicalHeightLength, const LayoutBoxModelObject* containerBlock, |
3320 LayoutUnit containerLogicalHeight, LayoutUnit bordersPlusPadding, LayoutUnit logicalHeight, | 3333 LayoutUnit containerLogicalHeight, LayoutUnit bordersPlusPadding, LayoutUnit logicalHeight, |
3321 const Length& logicalTop, const Length& logicalBottom, const Length& marginB efore, | 3334 const Length& logicalTop, const Length& logicalBottom, const Length& marginB efore, |
3322 const Length& marginAfter, LogicalExtentComputedValues& computedValues) cons t | 3335 const Length& marginAfter, LogicalExtentComputedValues& computedValues) cons t |
3323 { | 3336 { |
3337 if (heightSizeType == MinSize && logicalHeightLength.isAuto()) | |
3338 logicalHeightLength = Length(0, Fixed); | |
3339 | |
3324 // 'top' and 'bottom' cannot both be 'auto' because 'top would of been | 3340 // 'top' and 'bottom' cannot both be 'auto' because 'top would of been |
3325 // converted to the static position in computePositionedLogicalHeight() | 3341 // converted to the static position in computePositionedLogicalHeight() |
3326 ASSERT(!(logicalTop.isAuto() && logicalBottom.isAuto())); | 3342 ASSERT(!(logicalTop.isAuto() && logicalBottom.isAuto())); |
3327 | 3343 |
3328 LayoutUnit logicalHeightValue; | 3344 LayoutUnit logicalHeightValue; |
3329 LayoutUnit contentLogicalHeight = logicalHeight - bordersPlusPadding; | 3345 LayoutUnit contentLogicalHeight = logicalHeight - bordersPlusPadding; |
3330 | 3346 |
3331 const LayoutUnit containerRelativeLogicalWidth = containingBlockLogicalWidth ForPositioned(containerBlock, false); | 3347 const LayoutUnit containerRelativeLogicalWidth = containingBlockLogicalWidth ForPositioned(containerBlock, false); |
3332 | 3348 |
3333 LayoutUnit logicalTopValue = 0; | 3349 LayoutUnit logicalTopValue = 0; |
(...skipping 1310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4644 computedValues.m_margins.m_end = marginEnd(); | 4660 computedValues.m_margins.m_end = marginEnd(); |
4645 | 4661 |
4646 setLogicalTop(oldLogicalTop); | 4662 setLogicalTop(oldLogicalTop); |
4647 setLogicalWidth(oldLogicalWidth); | 4663 setLogicalWidth(oldLogicalWidth); |
4648 setLogicalLeft(oldLogicalLeft); | 4664 setLogicalLeft(oldLogicalLeft); |
4649 setMarginLeft(oldMarginLeft); | 4665 setMarginLeft(oldMarginLeft); |
4650 setMarginRight(oldMarginRight); | 4666 setMarginRight(oldMarginRight); |
4651 } | 4667 } |
4652 | 4668 |
4653 } // namespace blink | 4669 } // namespace blink |
OLD | NEW |