Changeset 237783 in webkit
- Timestamp:
- Nov 4, 2018 7:46:38 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r237782 r237783 1 2018-11-04 Zalan Bujtas <zalan@apple.com> 2 3 [LFC][BFC] Add support for percentage height in quirks mode. 4 https://bugs.webkit.org/show_bug.cgi?id=191232 5 6 Reviewed by Antti Koivisto. 7 8 * fast/block/basic/quirk-mode-percent-height-expected.txt: Added. 9 * fast/block/basic/quirk-mode-percent-height.html: Added. 10 * platform/ios/TestExpectations: 11 1 12 2018-11-04 Zalan Bujtas <zalan@apple.com> 2 13 -
trunk/LayoutTests/platform/ios/TestExpectations
r237782 r237783 3118 3118 fast/block/basic/height-percentage-simple.html [ Failure ] 3119 3119 fast/block/basic/child-block-level-box-with-height-percent.html [ Failure ] 3120 fast/block/basic/quirk-mode-percent-height.html [ Failure ] 3120 3121 3121 3122 # Datalist -
trunk/Source/WebCore/ChangeLog
r237782 r237783 1 2018-11-04 Zalan Bujtas <zalan@apple.com> 2 3 [LFC][BFC] Add support for percentage height in quirks mode. 4 https://bugs.webkit.org/show_bug.cgi?id=191232 5 6 Reviewed by Antti Koivisto. 7 8 In quirks mode, we go and travers the containing block chain to find a block level 9 box with fixed height value to resolve the percentage value. 10 11 Test: fast/block/basic/quirk-mode-percent-height.html 12 13 * layout/FormattingContextGeometry.cpp: 14 (WebCore::Layout::FormattingContext::Geometry::computedHeightValue): 15 * layout/Verification.cpp: 16 (WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const): 17 1 18 2018-11-04 Zalan Bujtas <zalan@apple.com> 2 19 -
trunk/Source/WebCore/layout/FormattingContextGeometry.cpp
r237782 r237783 69 69 70 70 std::optional<LayoutUnit> containingBlockHeightValue; 71 auto containingBlockHeight = layoutBox.containingBlock()->style().logicalHeight(); 72 if (containingBlockHeight.isFixed()) 73 containingBlockHeightValue = { containingBlockHeight.value() }; 74 else if (layoutBox.isOutOfFlowPositioned()) { 75 // Containing block's height is already computed. 71 if (layoutBox.isOutOfFlowPositioned()) { 72 // Containing block's height is already computed since we layout the out-of-flow boxes as the last step. 76 73 containingBlockHeightValue = layoutState.displayBoxForLayoutBox(*layoutBox.containingBlock()).height(); 74 } else { 75 auto computedHeightValueForQuirksMode = [&]() -> LayoutUnit { 76 // In quirks mode, we go and travers the containing block chain to find a block level box with fixed height value, even if it means leaving 77 // the current formatting context. FIXME: surely we need to do some tricks here when block direction support is added. 78 auto* containingBlock = layoutBox.containingBlock(); 79 LayoutUnit bodyAndDocumentVerticalMarginsPaddingsAndBorders; 80 while (containingBlock) { 81 auto containingBlockHeight = containingBlock->style().logicalHeight(); 82 if (containingBlockHeight.isFixed()) 83 return containingBlockHeight.value() - bodyAndDocumentVerticalMarginsPaddingsAndBorders; 84 85 // If the only fixed value box we find is the ICB, then ignore the body and the document (vertical) margin, padding and border. So much quirkiness. 86 // -and it's totally insane because now we freely travel across formatting context boundaries and computed margins are nonexistent. 87 if (containingBlock->isBodyBox() || containingBlock->isDocumentBox()) { 88 auto& displayBox = layoutState.displayBoxForLayoutBox(*containingBlock); 89 90 auto verticalMargins = computedNonCollapsedVerticalMarginValue(layoutState, *containingBlock); 91 auto verticalPaddings = displayBox.paddingTop().value_or(0) + displayBox.paddingBottom().value_or(0); 92 auto verticalBorders = displayBox.borderTop() + displayBox.borderBottom(); 93 bodyAndDocumentVerticalMarginsPaddingsAndBorders += verticalMargins.top + verticalMargins.bottom + verticalPaddings + verticalBorders; 94 } 95 96 containingBlock = containingBlock->containingBlock(); 97 } 98 // Initial containing block has to have a height. 99 return layoutState.displayBoxForLayoutBox(layoutBox.initialContainingBlock()).contentBox().height() - bodyAndDocumentVerticalMarginsPaddingsAndBorders; 100 }; 101 102 if (layoutState.inQuirksMode()) 103 containingBlockHeightValue = computedHeightValueForQuirksMode(); 104 else { 105 auto containingBlockHeight = layoutBox.containingBlock()->style().logicalHeight(); 106 if (containingBlockHeight.isFixed()) 107 containingBlockHeightValue = { containingBlockHeight.value() }; 108 } 77 109 } 78 110 -
trunk/Tools/ChangeLog
r237782 r237783 1 2018-11-04 Zalan Bujtas <zalan@apple.com> 2 3 [LFC][BFC] Add support for percentage height in quirks mode. 4 https://bugs.webkit.org/show_bug.cgi?id=191232 5 6 Reviewed by Antti Koivisto. 7 8 * LayoutReloaded/misc/LFC-passing-tests.txt: 9 1 10 2018-11-04 Zalan Bujtas <zalan@apple.com> 2 11 -
trunk/Tools/LayoutReloaded/misc/LFC-passing-tests.txt
r237782 r237783 72 72 fast/block/basic/height-percentage-simple.html 73 73 fast/block/basic/child-block-level-box-with-height-percent.html 74 fast/block/basic/quirk-mode-percent-height.html
Note: See TracChangeset
for help on using the changeset viewer.