Changeset 277321 in webkit
- Timestamp:
- May 11, 2021, 5:49:46 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 37 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/TestExpectations (modified) (4 diffs)
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-contain/contain-size-grid-003-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-contain/contain-size-grid-004-expected.txt (modified) (2 diffs)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-contain/contain-size-multicol-as-flex-item-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/flex-item-contains-strict-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/canvas-aspect-ratio-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/video-aspect-ratio-expected.txt (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp (modified) (9 diffs)
-
Source/WebCore/rendering/GridTrackSizingAlgorithm.h (modified) (2 diffs)
-
Source/WebCore/rendering/RenderBlock.cpp (modified) (2 diffs)
-
Source/WebCore/rendering/RenderBlockFlow.cpp (modified) (3 diffs)
-
Source/WebCore/rendering/RenderBlockFlow.h (modified) (1 diff)
-
Source/WebCore/rendering/RenderBox.cpp (modified) (2 diffs)
-
Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp (modified) (2 diffs)
-
Source/WebCore/rendering/RenderFileUploadControl.cpp (modified) (1 diff)
-
Source/WebCore/rendering/RenderFlexibleBox.cpp (modified) (3 diffs)
-
Source/WebCore/rendering/RenderFragmentedFlow.h (modified) (1 diff)
-
Source/WebCore/rendering/RenderGrid.cpp (modified) (2 diffs)
-
Source/WebCore/rendering/RenderImage.cpp (modified) (1 diff)
-
Source/WebCore/rendering/RenderListBox.cpp (modified) (1 diff)
-
Source/WebCore/rendering/RenderMenuList.cpp (modified) (1 diff)
-
Source/WebCore/rendering/RenderMultiColumnFlow.cpp (modified) (1 diff)
-
Source/WebCore/rendering/RenderMultiColumnFlow.h (modified) (1 diff)
-
Source/WebCore/rendering/RenderMultiColumnSet.cpp (modified) (5 diffs)
-
Source/WebCore/rendering/RenderMultiColumnSet.h (modified) (2 diffs)
-
Source/WebCore/rendering/RenderObject.cpp (modified) (1 diff)
-
Source/WebCore/rendering/RenderObject.h (modified) (3 diffs)
-
Source/WebCore/rendering/RenderReplaced.cpp (modified) (2 diffs)
-
Source/WebCore/rendering/RenderReplaced.h (modified) (1 diff)
-
Source/WebCore/rendering/RenderSlider.cpp (modified) (1 diff)
-
Source/WebCore/rendering/RenderTextControl.cpp (modified) (1 diff)
-
Source/WebCore/rendering/RenderVideo.cpp (modified) (1 diff)
-
Source/WebCore/rendering/style/RenderStyle.h (modified) (1 diff)
-
Source/WebCore/rendering/svg/RenderSVGRoot.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r277320 r277321 1 2021-05-11 Cathie Chen <cathiechen@igalia.com> 2 3 [CSS contain] Support contain:size 4 https://bugs.webkit.org/show_bug.cgi?id=223570 5 6 Reviewed by Alan Bujtas. 7 8 Update the test result for size containment. Added explanations for size containment tests 9 that depended on other features. 10 11 * TestExpectations: 12 1 13 2021-05-11 Antti Koivisto <antti@apple.com> 2 14 -
trunk/LayoutTests/TestExpectations
r277091 r277321 4647 4647 4648 4648 # CSS containment tests that fail 4649 imported/w3c/web-platform-tests/css/css-contain/contain-animation-001.html [ ImageOnlyFailure ]4650 4649 # webkit-ruby-text 4651 4650 imported/w3c/web-platform-tests/css/css-contain/contain-layout-017.html [ ImageOnlyFailure ] … … 4664 4663 imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-021.html [ ImageOnlyFailure ] 4665 4664 imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-022.html [ ImageOnlyFailure ] 4666 imported/w3c/web-platform-tests/css/css-contain/contain-layout-size-003.html [ ImageOnlyFailure ]4667 4665 imported/w3c/web-platform-tests/css/css-contain/contain-paint-001.html [ ImageOnlyFailure ] 4668 4666 imported/w3c/web-platform-tests/css/css-contain/contain-paint-004.html [ ImageOnlyFailure ] … … 4706 4704 imported/w3c/web-platform-tests/css/css-contain/contain-paint-table-001.html [ ImageOnlyFailure ] 4707 4705 imported/w3c/web-platform-tests/css/css-contain/contain-paint-table-002.html [ ImageOnlyFailure ] 4708 imported/w3c/web-platform-tests/css/css-contain/contain-size-011.html [ ImageOnlyFailure ]4709 imported/w3c/web-platform-tests/css/css-contain/contain-size-013.html [ ImageOnlyFailure ]4710 imported/w3c/web-platform-tests/css/css-contain/contain-size-021.html [ ImageOnlyFailure ]4711 imported/w3c/web-platform-tests/css/css-contain/contain-size-023.html [ ImageOnlyFailure ]4712 imported/w3c/web-platform-tests/css/css-contain/contain-size-025.html [ ImageOnlyFailure ]4713 imported/w3c/web-platform-tests/css/css-contain/contain-size-027.html [ ImageOnlyFailure ]4714 imported/w3c/web-platform-tests/css/css-contain/contain-size-041.html [ ImageOnlyFailure ]4715 imported/w3c/web-platform-tests/css/css-contain/contain-size-042.html [ ImageOnlyFailure ]4716 imported/w3c/web-platform-tests/css/css-contain/contain-size-056.html [ ImageOnlyFailure ]4717 imported/w3c/web-platform-tests/css/css-contain/contain-size-061.html [ ImageOnlyFailure ]4718 imported/w3c/web-platform-tests/css/css-contain/contain-size-062.html [ ImageOnlyFailure ]4719 imported/w3c/web-platform-tests/css/css-contain/contain-size-063.html [ ImageOnlyFailure ]4720 imported/w3c/web-platform-tests/css/css-contain/contain-size-064.html [ ImageOnlyFailure ]4721 imported/w3c/web-platform-tests/css/css-contain/contain-size-block-001.html [ ImageOnlyFailure ]4722 imported/w3c/web-platform-tests/css/css-contain/contain-size-block-002.html [ ImageOnlyFailure ]4723 imported/w3c/web-platform-tests/css/css-contain/contain-size-block-003.html [ ImageOnlyFailure ]4724 imported/w3c/web-platform-tests/css/css-contain/contain-size-block-004.html [ ImageOnlyFailure ]4725 imported/w3c/web-platform-tests/css/css-contain/contain-size-borders.html [ ImageOnlyFailure ]4726 imported/w3c/web-platform-tests/css/css-contain/contain-size-breaks-001.html [ ImageOnlyFailure ]4727 imported/w3c/web-platform-tests/css/css-contain/contain-size-button-001.html [ ImageOnlyFailure ]4728 imported/w3c/web-platform-tests/css/css-contain/contain-size-button-002.html [ ImageOnlyFailure ]4729 imported/w3c/web-platform-tests/css/css-contain/contain-size-fieldset-001.html [ ImageOnlyFailure ]4730 imported/w3c/web-platform-tests/css/css-contain/contain-size-fieldset-002.html [ ImageOnlyFailure ]4731 imported/w3c/web-platform-tests/css/css-contain/contain-size-fieldset-003.html [ ImageOnlyFailure ]4732 imported/w3c/web-platform-tests/css/css-contain/contain-size-fieldset-004.html [ ImageOnlyFailure ]4733 imported/w3c/web-platform-tests/css/css-contain/contain-size-flex-001.html [ ImageOnlyFailure ]4734 imported/w3c/web-platform-tests/css/css-contain/contain-size-flexbox-001.html [ ImageOnlyFailure ]4735 imported/w3c/web-platform-tests/css/css-contain/contain-size-grid-001.html [ ImageOnlyFailure ]4736 imported/w3c/web-platform-tests/css/css-contain/contain-size-grid-002.html [ ImageOnlyFailure ]4737 imported/w3c/web-platform-tests/css/css-contain/contain-size-grid-005.html [ ImageOnlyFailure ]4738 imported/w3c/web-platform-tests/css/css-contain/contain-size-inline-block-001.html [ ImageOnlyFailure ]4739 imported/w3c/web-platform-tests/css/css-contain/contain-size-inline-block-002.html [ ImageOnlyFailure ]4740 imported/w3c/web-platform-tests/css/css-contain/contain-size-inline-block-003.html [ ImageOnlyFailure ]4741 imported/w3c/web-platform-tests/css/css-contain/contain-size-inline-block-004.html [ ImageOnlyFailure ]4742 imported/w3c/web-platform-tests/css/css-contain/contain-size-inline-flex-001.html [ ImageOnlyFailure ]4743 imported/w3c/web-platform-tests/css/css-contain/contain-size-monolithic-001.html [ ImageOnlyFailure ]4744 imported/w3c/web-platform-tests/css/css-contain/contain-size-monolithic-002.html [ ImageOnlyFailure ]4745 imported/w3c/web-platform-tests/css/css-contain/contain-size-multicol-001.html [ ImageOnlyFailure ]4746 imported/w3c/web-platform-tests/css/css-contain/contain-size-multicol-002.html [ ImageOnlyFailure ]4747 imported/w3c/web-platform-tests/css/css-contain/contain-size-multicol-003.html [ ImageOnlyFailure ]4748 imported/w3c/web-platform-tests/css/css-contain/contain-size-replaced-001.html [ ImageOnlyFailure ]4749 imported/w3c/web-platform-tests/css/css-contain/contain-size-replaced-002.html [ ImageOnlyFailure ]4750 imported/w3c/web-platform-tests/css/css-contain/contain-size-replaced-003a.html [ ImageOnlyFailure ]4751 imported/w3c/web-platform-tests/css/css-contain/contain-size-replaced-003b.html [ ImageOnlyFailure ]4752 imported/w3c/web-platform-tests/css/css-contain/contain-size-replaced-003c.html [ ImageOnlyFailure ]4753 imported/w3c/web-platform-tests/css/css-contain/contain-size-replaced-004.html [ ImageOnlyFailure ]4754 imported/w3c/web-platform-tests/css/css-contain/contain-size-replaced-005.html [ ImageOnlyFailure ]4755 imported/w3c/web-platform-tests/css/css-contain/contain-size-replaced-006.html [ ImageOnlyFailure ]4756 imported/w3c/web-platform-tests/css/css-contain/contain-size-scrollbars-001.html [ ImageOnlyFailure ]4757 imported/w3c/web-platform-tests/css/css-contain/contain-size-scrollbars-002.html [ ImageOnlyFailure ]4758 imported/w3c/web-platform-tests/css/css-contain/contain-size-scrollbars-003.html [ ImageOnlyFailure ]4759 imported/w3c/web-platform-tests/css/css-contain/contain-size-select-001.html [ ImageOnlyFailure ]4760 imported/w3c/web-platform-tests/css/css-contain/contain-size-select-002.html [ ImageOnlyFailure ]4761 imported/w3c/web-platform-tests/css/css-contain/contain-size-select-elem-001.html [ ImageOnlyFailure ]4762 imported/w3c/web-platform-tests/css/css-contain/contain-size-select-elem-002.html [ ImageOnlyFailure ]4763 imported/w3c/web-platform-tests/css/css-contain/contain-size-select-elem-003.html [ ImageOnlyFailure ]4764 imported/w3c/web-platform-tests/css/css-contain/contain-size-select-elem-004.html [ ImageOnlyFailure ]4765 imported/w3c/web-platform-tests/css/css-contain/contain-size-select-elem-005.html [ ImageOnlyFailure ]4766 imported/w3c/web-platform-tests/css/css-contain/contain-size-table-caption-001.html [ ImageOnlyFailure ]4767 4706 imported/w3c/web-platform-tests/css/css-contain/contain-strict-001.html [ ImageOnlyFailure ] 4768 4707 imported/w3c/web-platform-tests/css/css-contain/contain-strict-002.html [ ImageOnlyFailure ] 4769 imported/w3c/web-platform-tests/css/css-contain/contain-strict-003.html [ ImageOnlyFailure ]4770 4708 imported/w3c/web-platform-tests/css/css-contain/contain-strict-011.html [ ImageOnlyFailure ] 4771 4709 imported/w3c/web-platform-tests/css/css-contain/contain-style-counters-001.html [ ImageOnlyFailure ] … … 4802 4740 # Flaky css-contain test 4803 4741 imported/w3c/web-platform-tests/css/css-contain/content-visibility/animation-display-lock.html [ Failure Pass ] 4742 4743 # Canvas doesn't get default aspect-ratio for width and height attributes. 4744 webkit.org/b/217529 imported/w3c/web-platform-tests/css/css-flexbox/canvas-contain-size.html [ ImageOnlyFailure ] 4745 4746 # Content is painted on svg's padding area. 4747 webkit.org/b/425868 imported/w3c/web-platform-tests/css/css-contain/contain-size-replaced-002.html [ ImageOnlyFailure ] 4748 4749 # Multicolumn does not paint the horizontal overflow area of a relative child. 4750 webkit.org/b/41796 imported/w3c/web-platform-tests/css/css-contain/contain-size-monolithic-002.html [ ImageOnlyFailure ] 4751 4752 # Buttons with auto width and height has extra margins. 4753 imported/w3c/web-platform-tests/css/css-contain/contain-size-button-001.html [ ImageOnlyFailure ] 4754 imported/w3c/web-platform-tests/css/css-contain/contain-size-button-002.html [ ImageOnlyFailure ] 4755 4756 # Scrollbar displays are different. 4757 imported/w3c/web-platform-tests/css/css-contain/contain-size-block-003.html [ ImageOnlyFailure ] 4758 imported/w3c/web-platform-tests/css/css-contain/contain-size-inline-block-003.html [ ImageOnlyFailure ] 4759 4760 # Select with empty content always has root linebox, so the heights are different. 4761 imported/w3c/web-platform-tests/css/css-contain/contain-size-select-001.html [ ImageOnlyFailure ] 4762 imported/w3c/web-platform-tests/css/css-contain/contain-size-select-002.html [ ImageOnlyFailure ] 4763 4764 # CSS property color is not working in select elements. 4765 imported/w3c/web-platform-tests/css/css-contain/contain-size-select-elem-001.html [ ImageOnlyFailure ] 4766 imported/w3c/web-platform-tests/css/css-contain/contain-size-select-elem-002.html [ ImageOnlyFailure ] 4804 4767 4805 4768 # Tests that fail because they assume a vertical scrollbar in `writing-mode: vertical-rl` elements will be on the right-hand side -
trunk/LayoutTests/imported/w3c/ChangeLog
r277257 r277321 1 2021-05-11 Cathie Chen <cathiechen@igalia.com> 2 3 [CSS contain] Support contain:size 4 https://bugs.webkit.org/show_bug.cgi?id=223570 5 6 Reviewed by Alan Bujtas. 7 8 <canvas> and <video> don't support computing aspect ratio from width and height attributes yet, 9 so the heights are zero when they are with "contain: size". 10 11 * web-platform-tests/css/css-contain/contain-size-grid-003-expected.txt: 12 * web-platform-tests/css/css-contain/contain-size-grid-004-expected.txt: 13 * web-platform-tests/css/css-contain/contain-size-multicol-as-flex-item-expected.txt: 14 * web-platform-tests/css/css-flexbox/flex-item-contains-strict-expected.txt: 15 * web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/canvas-aspect-ratio-expected.txt: 16 * web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/video-aspect-ratio-expected.txt: 17 1 18 2021-05-10 Rob Buis <rbuis@igalia.com> 2 19 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/contain-size-grid-003-expected.txt
r274620 r277321 37 37 PASS .grid 36 38 38 PASS .grid 37 39 FAIL .grid 38 assert_equals: 40 <div class="grid" style="grid: repeat(auto-fit, 75px) / repeat(auto-fit, 100px);" data-expected-width="0" data-expected-height="0"> 41 <div></div> 42 </div> 43 width expected 0 but got 100 44 FAIL .grid 39 assert_equals: 45 <div class="grid" style="grid: auto 50px / 100px auto;" data-expected-width="100" data-expected-height="50"> 46 <div data-expected-width="100" data-expected-height="10" data-offset-x="0" data-offset-y="0">X</div> 47 <div data-expected-width="40" data-expected-height="10" data-offset-x="100" data-offset-y="0">XX</div> 48 <div data-expected-width="100" data-expected-height="50" data-offset-x="0" data-offset-y="10">XXX</div> 49 <div data-expected-width="40" data-expected-height="50" data-offset-x="100" data-offset-y="10">XXXX</div> 50 </div> 51 width expected 100 but got 140 39 PASS .grid 38 40 PASS .grid 39 52 41 53 42 X -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/contain-size-grid-004-expected.txt
r274620 r277321 1 1 2 2 PASS .grid 1 3 FAIL .grid 2 assert_equals: 4 <div class="grid percent min-content" data-expected-height="0" data-expected-width="0"> 5 <div data-expected-height="0" data-expected-width="0">XXXX</div> 6 </div> 7 width expected 0 but got 300 3 PASS .grid 2 8 4 PASS .grid 3 9 FAIL .grid 4 assert_equals: 10 <div class="grid percent max-content" data-expected-height="0" data-expected-width="0"> 11 <div data-expected-height="0" data-expected-width="0">XXXX</div> 12 </div> 13 width expected 0 but got 300 5 PASS .grid 4 14 6 PASS .grid 5 15 7 PASS .grid 6 16 8 PASS .grid 7 17 FAIL .grid 8 assert_equals: 18 <div class="grid calc min-content" data-expected-height="0" data-expected-width="0"> 19 <div data-expected-height="100" data-expected-width="100">XXXX</div> 20 </div> 21 width expected 0 but got 300 9 PASS .grid 8 22 10 PASS .grid 9 23 FAIL .grid 10 assert_equals: 24 <div class="grid calc max-content" data-expected-height="0" data-expected-width="0"> 25 <div data-expected-height="100" data-expected-width="100">XXXX</div> 26 </div> 27 width expected 0 but got 300 11 PASS .grid 10 28 12 PASS .grid 11 29 13 PASS .grid 12 30 14 PASS .grid 13 31 FAIL .grid 14 assert_equals: 32 <div class="grid minmax-percent-fixed min-content" data-expected-height="100" data-expected-width="0"> 33 <div data-expected-height="100" data-expected-width="0">XXXX</div> 34 </div> 35 width expected 0 but got 100 15 PASS .grid 14 36 16 PASS .grid 15 37 17 PASS .grid 16 … … 41 21 PASS .grid 20 42 22 PASS .grid 21 43 FAIL .grid 22 assert_equals: 44 <div class="grid minmax-fixed-percent max-content" data-expected-height="100" data-expected-width="100"> 45 <div data-expected-height="100" data-expected-width="100">XXXX</div> 46 </div> 47 width expected 100 but got 300 23 PASS .grid 22 48 24 PASS .grid 23 49 25 PASS .grid 24 50 26 PASS .grid 25 51 FAIL .grid 26 assert_equals: 52 <div class="grid minmax-percent-flex min-content" data-expected-height="0" data-expected-width="0"> 53 <div data-expected-height="0" data-expected-width="0">XXXX</div> 54 </div> 55 width expected 0 but got 300 27 PASS .grid 26 56 28 PASS .grid 27 57 FAIL .grid 28 assert_equals: 58 <div class="grid minmax-percent-flex max-content" data-expected-height="0" data-expected-width="0"> 59 <div data-expected-height="0" data-expected-width="0">XXXX</div> 60 </div> 61 width expected 0 but got 300 29 PASS .grid 28 62 30 PASS .grid 29 63 31 PASS .grid 30 64 32 PASS .grid 31 65 FAIL .grid 32 assert_equals: 66 <div class="grid minmax-intrinsic-percent min-content" data-expected-height="0" data-expected-width="0"> 67 <div data-expected-height="75" data-expected-width="300">XXXX</div> 68 </div> 69 width expected 0 but got 300 33 PASS .grid 32 70 34 PASS .grid 33 71 FAIL .grid 34 assert_equals: 72 <div class="grid minmax-intrinsic-percent max-content" data-expected-height="0" data-expected-width="0"> 73 <div data-expected-height="75" data-expected-width="300">XXXX</div> 74 </div> 75 width expected 0 but got 300 35 PASS .grid 34 76 36 PASS .grid 35 77 37 PASS .grid 36 78 38 PASS .grid 37 79 FAIL .grid 38 assert_equals: 80 <div class="grid minmax-percent-intrinsic min-content" data-expected-height="0" data-expected-width="0"> 81 <div data-expected-height="0" data-expected-width="0">XXXX</div> 82 </div> 83 width expected 0 but got 300 39 PASS .grid 38 84 40 PASS .grid 39 85 FAIL .grid 40 assert_equals: 86 <div class="grid minmax-percent-intrinsic max-content" data-expected-height="0" data-expected-width="0"> 87 <div data-expected-height="0" data-expected-width="0">XXXX</div> 88 </div> 89 width expected 0 but got 300 41 PASS .grid 40 90 42 PASS .grid 41 91 43 PASS .grid 42 92 44 PASS .grid 43 93 FAIL .grid 44 assert_equals: 94 <div class="grid fit-content min-content" data-expected-height="0" data-expected-width="0"> 95 <div data-expected-height="75" data-expected-width="300">XXXX</div> 96 </div> 97 width expected 0 but got 300 45 PASS .grid 44 98 46 PASS .grid 45 99 FAIL .grid 46 assert_equals: 100 <div class="grid fit-content max-content" data-expected-height="0" data-expected-width="0"> 101 <div data-expected-height="75" data-expected-width="300">XXXX</div> 102 </div> 103 width expected 0 but got 300 47 PASS .grid 46 104 48 PASS .grid 47 105 49 PASS .grid 48 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/contain-size-multicol-as-flex-item-expected.txt
r274620 r277321 2 2 3 3 4 FAIL #flex 1 assert_equals: 5 <div id="flex"> 6 <div id="multicol" data-expected-width="100" data-expected-height="100"> 7 <div style="width:1000px; height:1px;"></div> 8 </div> 9 </div> 10 width expected 100 but got 784 4 PASS #flex 1 11 5 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/flex-item-contains-strict-expected.txt
r267650 r277321 18 18 Row 19 19 20 FAIL .inline-flex 1 assert_equals: 21 <div class="inline-flex" style="display: inline-flex; flex-direction: column;" data-expected-width="0" data-expected-height="0"> 22 <div style="contain: strict;" data-expected-width="0" data-expected-height="0">Column</div> 23 </div> 24 width expected 0 but got 52 25 FAIL .inline-flex 2 assert_equals: 26 <div class="inline-flex" data-expected-width="0" data-expected-height="0"> 27 <div style="contain: strict;" data-expected-width="0" data-expected-height="0">Row</div> 28 </div> 29 width expected 0 but got 30 20 PASS .inline-flex 1 21 PASS .inline-flex 2 30 22 PASS .inline-flex 3 31 23 PASS .inline-flex 4 32 FAIL .inline-flex 5 assert_equals: 33 <div class="inline-flex" style="flex-direction: column; align-items: flex-start;" data-expected-width="0" data-expected-height="0"> 34 <div style="contain: strict;" data-expected-width="0" data-expected-height="0">Column</div> 35 </div> 36 width expected 0 but got 52 37 FAIL .inline-flex 6 assert_equals: 38 <div class="inline-flex" style="align-items: flex-start;" data-expected-width="0" data-expected-height="0"> 39 <div style="contain: strict;" data-expected-width="0" data-expected-height="0">Row</div> 40 </div> 41 width expected 0 but got 30 24 PASS .inline-flex 5 25 PASS .inline-flex 6 42 26 PASS .inline-flex 7 43 27 PASS .inline-flex 8 -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/canvas-aspect-ratio-expected.txt
r276498 r277321 1 1 2 2 3 PASS Canvas width and height attributes are used as the surface size with contain:size 3 FAIL Canvas width and height attributes are used as the surface size with contain:size assert_approx_equals: expected 2.5 +/- 0.001 but got Infinity 4 4 PASS Canvas width and height attributes are used as the surface size 5 5 FAIL Computed style test: canvas with {"width":"10","height":"20"} assert_equals: expected "auto 10 / 20" but got "auto" -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/rendering/replaced-elements/attributes-for-embedded-content-and-images/video-aspect-ratio-expected.txt
r276498 r277321 1 1 2 2 3 FAIL Video width and height attributes are not used to infer aspect-ratio assert_approx_equals: expected 2.5 +/- 0.001 but got 23 FAIL Video width and height attributes are not used to infer aspect-ratio assert_approx_equals: expected 2.5 +/- 0.001 but got Infinity 4 4 FAIL Computed style test: video with {"width":"10","height":"20"} assert_equals: expected "auto 10 / 20" but got "auto" 5 5 FAIL Computed style test: video with {"width":"0.5","height":"1.5"} assert_equals: expected "auto 0.5 / 1.5" but got "auto" -
trunk/Source/WebCore/ChangeLog
r277320 r277321 1 2021-05-11 Cathie Chen <cathiechen@igalia.com> 2 3 [CSS contain] Support contain:size 4 https://bugs.webkit.org/show_bug.cgi?id=223570 5 6 Reviewed by Alan Bujtas. 7 8 This patch brings initial support of CSS contain:size according to [1]. 9 It adds shouldApplySizeContainment() to indicate whether the object is a size containment box. 10 The intrinsic sizes of size containment box are determined as if it had no content. 11 So the implementation need to cooperate with the layout steps: 12 - Computing logical width: Size containment boxes skip handling children while computing minLogicalWidth 13 and maxLogicalWidth in computeIntrinsicLogicalWidths. So the logical width is not affected by children. 14 - Layout children: The logical height is changed after layout all children. 15 - Computing logical height: At the beginning, size containment boxes need to reset logical height to the empty content height 16 if it is not renderGrid. So the logical height is not affected by children. 17 We also need to calculate the sizes according to the layout algorithms. 18 - Grid layout: 19 To calculate the minLogicalWidth and maxLogicalWidth for indefinite size RenderGrid. 20 The widths are calculated by GridTrackSizingAlgorithm: m_minContentSize and m_maxContentSize which are the sum of 21 m_baseSize/m_growthLimit of all GridTracks. The size containment RenderGrid skips handling content in resolveIntrinsicTrackSizes 22 and the m_maxContentSize will be the sum of m_baseSize. The logical height is same to width, but after calculating 23 RenderGrid's logical height, it needs to calculate the track sizes again, to make sure that they are distributed properly. 24 We use computeTrackSizesForDefiniteSize(ForRows, trackBasedLogicalHeight) to recalculate it. 25 - MultiColumn layout: 26 According to the specification, size containment boxes should be monolithic, so we need to extend column height 27 for overflow and positioned size containment boxes. m_spaceShortageForSizeContainment is added to indicate the shortage space 28 that need to balance the column heights. adjustSizeContainmentChildForPagination() will calculate the shortage. 29 30 [1] https://www.w3.org/TR/css-contain-1/#containment-size 31 32 * rendering/GridTrackSizingAlgorithm.cpp: Add isComputingSizeContainment to indicate if it is calculating sizes 33 for indefinite size RenderGrid which is size containment. 34 (WebCore::GridTrackSizingAlgorithm::gridAreaBreadthForChild const): 35 (WebCore::GridTrackSizingAlgorithm::computeGridContainerIntrinsicSizes): 36 It skips resolveIntrinsicTrackSizes if isComputingSizeContainment, so growthLimit might be undefined, 37 if so, use track.baseSize() instead. 38 (WebCore::GridTrackSizingAlgorithm::resolveIntrinsicTrackSizes): Skip resolve the content if isComputingSizeContainment(). 39 (WebCore::GridTrackSizingAlgorithm::advanceNextState): Added RowSizingExtraIterationForSizeContainment. 40 (WebCore::GridTrackSizingAlgorithm::isValidTransition const): 41 (WebCore::GridTrackSizingAlgorithm::run): Do not stretch the track sizes if isComputingSizeContainment(). 42 * rendering/GridTrackSizingAlgorithm.h: 43 * rendering/RenderBlock.cpp: 44 (WebCore::RenderBlock::layoutPositionedObject): Calculate m_spaceShortageForSizeContainment for positioned size containment. 45 (WebCore::RenderBlock::computeIntrinsicLogicalWidths const): Skip computeBlockPreferredLogicalWidths if shouldApplySizeContainment. 46 * rendering/RenderBlockFlow.cpp: 47 (WebCore::RenderBlockFlow::computeIntrinsicLogicalWidths const): Skip handling the children for size containment box. 48 (WebCore::RenderBlockFlow::adjustBlockChildForPagination): Calculate m_spaceShortageForSizeContainment for child. 49 (WebCore::RenderBlockFlow::adjustSizeContainmentChildForPagination): m_spaceShortageForSizeContainment = childOverflowHeight - remainingLogicalHeight. 50 * rendering/RenderBlockFlow.h: 51 * rendering/RenderBox.cpp: 52 (WebCore::RenderBox::updateLogicalHeight): Reset the logical height to empty content height for size containment box. 53 (WebCore::RenderBox::isUnsplittableForPagination const): Size containment box is unsplittable. 54 * rendering/RenderDeprecatedFlexibleBox.cpp: 55 (WebCore::RenderDeprecatedFlexibleBox::computeIntrinsicLogicalWidths const): Ditto. 56 * rendering/RenderFileUploadControl.cpp: 57 (WebCore::RenderFileUploadControl::computeIntrinsicLogicalWidths const): Ditto. 58 * rendering/RenderFlexibleBox.cpp: 59 (WebCore::RenderFlexibleBox::computeIntrinsicLogicalWidths const): Ditto. 60 * rendering/RenderFragmentedFlow.h: 61 * rendering/RenderGrid.cpp: 62 (WebCore::RenderGrid::layoutBlock): If it is size containment with infiniteSize, using trackBasedLogicalHeight 63 to compute track sizes again to make sure the height is distributed properly. 64 (WebCore::RenderGrid::computeEmptyTracksForAutoRepeat const): Collapse if shouldApplySizeContainment. 65 * rendering/RenderImage.cpp: 66 (WebCore::RenderImage::computeIntrinsicRatioInformation const): This is handled in RenderReplaced::computeIntrinsicRatioInformation instead. 67 * rendering/RenderListBox.cpp: 68 (WebCore::RenderListBox::computeIntrinsicLogicalWidths const): The widths of size containment boxes are optionsSpacingHorizontal. 69 * rendering/RenderMenuList.cpp: 70 (RenderMenuList::computeIntrinsicLogicalWidths const): The widths of size containment box are theme.minimumMenuListSize. 71 * rendering/RenderMultiColumnFlow.cpp: 72 (WebCore::RenderMultiColumnFlow::updateSpaceShortageForSizeContainment): Set m_spaceShortageForSizeContainment. 73 * rendering/RenderMultiColumnFlow.h: 74 * rendering/RenderMultiColumnSet.cpp: 75 (WebCore::RenderMultiColumnSet::RenderMultiColumnSet): 76 (WebCore::RenderMultiColumnSet::calculateBalancedHeight const): Add m_spaceShortageForSizeContainment to the column height. 77 (WebCore::RenderMultiColumnSet::prepareForLayout): Reset m_spaceShortageForSizeContainment. 78 * rendering/RenderMultiColumnSet.h: 79 * rendering/RenderObject.cpp: 80 (WebCore::shouldApplySizeContainment): Check if the object is a size containment box. 81 * rendering/RenderObject.h: 82 (WebCore::RenderObject::isAtomicInlineLevelBox const): 83 * rendering/RenderReplaced.cpp: 84 (WebCore::RenderReplaced::computeAspectRatioInformationForRenderBox const): 85 (WebCore::RenderReplaced::computeIntrinsicRatioInformation const): Use the empty intrinsicSize. 86 * rendering/RenderReplaced.h: The intrinsicSize of size containment is (0, 0). 87 * rendering/RenderSlider.cpp: 88 (WebCore::RenderSlider::computeIntrinsicLogicalWidths const): Ditto. 89 * rendering/RenderTextControl.cpp: 90 (WebCore::RenderTextControl::computeIntrinsicLogicalWidths const): Ditto. 91 * rendering/RenderVideo.cpp: 92 (WebCore::RenderVideo::calculateIntrinsicSize): Ditto. 93 * rendering/style/RenderStyle.h: 94 (WebCore::RenderStyle::containsSize const): 95 * rendering/svg/RenderSVGRoot.cpp: 96 (WebCore::RenderSVGRoot::computeIntrinsicRatioInformation const): Handled in RenderReplaced::computeIntrinsicRatioInformation instead. 97 1 98 2021-05-11 Antti Koivisto <antti@apple.com> 2 99 -
trunk/Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp
r274933 r277321 581 581 { 582 582 bool addContentAlignmentOffset = 583 direction == ForColumns && m_sizingState == RowSizingFirstIteration;583 direction == ForColumns && (m_sizingState == RowSizingFirstIteration || m_sizingState == RowSizingExtraIterationForSizeContainment); 584 584 // To determine the column track's size based on an orthogonal grid item we need it's logical 585 585 // height, which may depend on the row track's size. It's possible that the row tracks sizing … … 737 737 Vector<GridTrack>& allTracks = tracks(m_direction); 738 738 for (auto& track : allTracks) { 739 ASSERT( !track.infiniteGrowthPotential());739 ASSERT(m_strategy->isComputingSizeContainment() || !track.infiniteGrowthPotential()); 740 740 m_minContentSize += track.baseSize(); 741 m_maxContentSize += track.growthLimit ();741 m_maxContentSize += track.growthLimitIsInfinite() ? track.baseSize() : track.growthLimit(); 742 742 // The growth limit caps must be cleared now in order to properly sort 743 743 // tracks by growth potential on an eventual "Maximize Tracks". … … 933 933 bool recomputeUsedFlexFractionIfNeeded(double& flexFraction, LayoutUnit& totalGrowth) const override; 934 934 LayoutUnit freeSpaceForStretchAutoTracksStep() const override; 935 bool isComputingSizeContainment() const override { return shouldApplySizeContainment(*renderGrid()); } 935 936 }; 936 937 … … 1031 1032 LayoutUnit minContentForChild(RenderBox&) const override; 1032 1033 LayoutUnit minLogicalSizeForChild(RenderBox&, const Length& childMinSize, Optional<LayoutUnit> availableSize) const override; 1034 bool isComputingSizeContainment() const override { return false; } 1033 1035 }; 1034 1036 … … 1147 1149 void GridTrackSizingAlgorithm::resolveIntrinsicTrackSizes() 1148 1150 { 1151 Vector<GridTrack>& allTracks = tracks(m_direction); 1152 auto handleInfinityGrowthLimit = [&]() { 1153 for (auto trackIndex : m_contentSizedTracksIndex) { 1154 GridTrack& track = allTracks[trackIndex]; 1155 if (track.growthLimit() == infinity) 1156 track.setGrowthLimit(track.baseSize()); 1157 } 1158 }; 1159 1160 if (m_strategy->isComputingSizeContainment()) { 1161 handleInfinityGrowthLimit(); 1162 return; 1163 } 1164 1149 1165 Vector<GridItemWithSpan> itemsSortedByIncreasingSpan; 1150 1166 HashSet<RenderBox*> itemsSet; 1151 Vector<GridTrack>& allTracks = tracks(m_direction);1152 1167 if (m_grid.hasGridItems()) { 1153 1168 for (auto trackIndex : m_contentSizedTracksIndex) { … … 1179 1194 it = spanGroupRange.rangeEnd; 1180 1195 } 1181 1182 for (auto trackIndex : m_contentSizedTracksIndex) { 1183 GridTrack& track = allTracks[trackIndex]; 1184 if (track.growthLimit() == infinity) 1185 track.setGrowthLimit(track.baseSize()); 1186 } 1196 handleInfinityGrowthLimit(); 1187 1197 } 1188 1198 … … 1240 1250 return; 1241 1251 case RowSizingFirstIteration: 1252 m_sizingState = m_strategy->isComputingSizeContainment() ? RowSizingExtraIterationForSizeContainment : ColumnSizingSecondIteration; 1253 return; 1254 case RowSizingExtraIterationForSizeContainment: 1242 1255 m_sizingState = ColumnSizingSecondIteration; 1243 1256 return; … … 1260 1273 return m_direction == ForColumns; 1261 1274 case RowSizingFirstIteration: 1275 case RowSizingExtraIterationForSizeContainment: 1262 1276 case RowSizingSecondIteration: 1263 1277 return m_direction == ForRows; … … 1347 1361 // Step 3. 1348 1362 m_strategy->maximizeTracks(tracks(m_direction), m_direction == ForColumns ? m_freeSpaceColumns : m_freeSpaceRows); 1363 if (m_strategy->isComputingSizeContainment()) 1364 return; 1349 1365 1350 1366 // Step 4. -
trunk/Source/WebCore/rendering/GridTrackSizingAlgorithm.h
r274933 r277321 225 225 ColumnSizingFirstIteration, 226 226 RowSizingFirstIteration, 227 RowSizingExtraIterationForSizeContainment, 227 228 ColumnSizingSecondIteration, 228 229 RowSizingSecondIteration … … 262 263 virtual bool recomputeUsedFlexFractionIfNeeded(double& flexFraction, LayoutUnit& totalGrowth) const = 0; 263 264 virtual LayoutUnit freeSpaceForStretchAutoTracksStep() const = 0; 265 virtual bool isComputingSizeContainment() const = 0; 264 266 265 267 protected: -
trunk/Source/WebCore/rendering/RenderBlock.cpp
r277124 r277321 1074 1074 r.layoutIfNeeded(); 1075 1075 } 1076 1077 if (view().frameView().layoutContext().layoutState()->isPaginated() && is<RenderBlockFlow>(*this)) 1078 downcast<RenderBlockFlow>(*this).adjustSizeContainmentChildForPagination(r, r.logicalTop()); 1076 1079 } 1077 1080 … … 2283 2286 { 2284 2287 ASSERT(!childrenInline()); 2285 2286 computeBlockPreferredLogicalWidths(minLogicalWidth, maxLogicalWidth);2288 if (!shouldApplySizeContainment(*this)) 2289 computeBlockPreferredLogicalWidths(minLogicalWidth, maxLogicalWidth); 2287 2290 2288 2291 maxLogicalWidth = std::max(minLogicalWidth, maxLogicalWidth); -
trunk/Source/WebCore/rendering/RenderBlockFlow.cpp
r276718 r277321 340 340 void RenderBlockFlow::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const 341 341 { 342 if (childrenInline()) 343 computeInlinePreferredLogicalWidths(minLogicalWidth, maxLogicalWidth); 344 else 345 computeBlockPreferredLogicalWidths(minLogicalWidth, maxLogicalWidth); 342 if (!shouldApplySizeContainment(*this)) { 343 if (childrenInline()) 344 computeInlinePreferredLogicalWidths(minLogicalWidth, maxLogicalWidth); 345 else 346 computeBlockPreferredLogicalWidths(minLogicalWidth, maxLogicalWidth); 347 } 346 348 347 349 maxLogicalWidth = std::max(minLogicalWidth, maxLogicalWidth); … … 1662 1664 } 1663 1665 } 1666 1667 if (shouldApplySizeContainment(child)) 1668 adjustSizeContainmentChildForPagination(child, result); 1664 1669 1665 1670 // For replaced elements and scrolled elements, we want to shift them to the next page if they don't fit on the current one. … … 2048 2053 } 2049 2054 2055 void RenderBlockFlow::adjustSizeContainmentChildForPagination(RenderBox& child, LayoutUnit offset) 2056 { 2057 if (!shouldApplySizeContainment(child)) 2058 return; 2059 2060 LayoutUnit childOverflowHeight = child.isHorizontalWritingMode() ? child.layoutOverflowRect().maxY() : child.layoutOverflowRect().maxX(); 2061 LayoutUnit childLogicalHeight = std::max(child.logicalHeight(), childOverflowHeight); 2062 2063 LayoutUnit remainingLogicalHeight = pageRemainingLogicalHeightForOffset(offset, ExcludePageBoundary); 2064 2065 LayoutUnit spaceShortage = childLogicalHeight - remainingLogicalHeight; 2066 if (spaceShortage <= 0) 2067 return; 2068 2069 if (RenderFragmentedFlow* fragmentedFlow = enclosingFragmentedFlow()) 2070 fragmentedFlow->updateSpaceShortageForSizeContainment(this, offsetFromLogicalTopOfFirstPage() + offset, spaceShortage); 2071 } 2072 2050 2073 void RenderBlockFlow::layoutLineGridBox() 2051 2074 { -
trunk/Source/WebCore/rendering/RenderBlockFlow.h
r276216 r277321 399 399 void updateMinimumPageHeight(LayoutUnit offset, LayoutUnit minHeight); 400 400 401 void adjustSizeContainmentChildForPagination(RenderBox& child, LayoutUnit offset); 402 401 403 void addFloatsToNewParent(RenderBlockFlow& toBlockFlow) const; 402 404 -
trunk/Source/WebCore/rendering/RenderBox.cpp
r277124 r277321 2861 2861 void RenderBox::updateLogicalHeight() 2862 2862 { 2863 if (shouldApplySizeContainment(*this) && !isRenderGrid()) { 2864 // We need the exact width of border and padding here, yet we can't use borderAndPadding* interfaces. 2865 // Because these interfaces evetually call borderAfter/Before, and RenderBlock::borderBefore 2866 // adds extra border to fieldset by adding intrinsicBorderForFieldset which is not needed here. 2867 auto borderAndPadding = RenderBox::borderBefore() + RenderBox::paddingBefore() + RenderBox::borderAfter() + RenderBox::paddingAfter(); 2868 setLogicalHeight(borderAndPadding + scrollbarLogicalHeight()); 2869 } 2870 2863 2871 cacheIntrinsicContentLogicalHeightForFlexItem(contentLogicalHeight()); 2864 2872 auto computedValues = computeLogicalHeight(logicalHeight(), logicalTop()); … … 4858 4866 || hasUnsplittableScrollingOverflow() 4859 4867 || (parent() && isWritingModeRoot()) 4860 || (isFloating() && style().styleType() == PseudoId::FirstLetter && style().initialLetterDrop() > 0); 4868 || (isFloating() && style().styleType() == PseudoId::FirstLetter && style().initialLetterDrop() > 0) 4869 || shouldApplySizeContainment(*this); 4861 4870 } 4862 4871 -
trunk/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp
r272805 r277321 188 188 void RenderDeprecatedFlexibleBox::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const 189 189 { 190 auto addScrollbarWidth = [&]() { 191 LayoutUnit scrollbarWidth = intrinsicScrollbarLogicalWidth(); 192 maxLogicalWidth += scrollbarWidth; 193 minLogicalWidth += scrollbarWidth; 194 }; 195 196 if (shouldApplySizeContainment(*this)) { 197 addScrollbarWidth(); 198 return; 199 } 200 190 201 if (hasMultipleLines() || isVertical()) { 191 202 for (RenderBox* child = firstChildBox(); child; child = child->nextSiblingBox()) { … … 212 223 213 224 maxLogicalWidth = std::max(minLogicalWidth, maxLogicalWidth); 214 215 LayoutUnit scrollbarWidth = intrinsicScrollbarLogicalWidth(); 216 maxLogicalWidth += scrollbarWidth; 217 minLogicalWidth += scrollbarWidth; 225 addScrollbarWidth(); 218 226 } 219 227 -
trunk/Source/WebCore/rendering/RenderFileUploadControl.cpp
r271934 r277321 198 198 void RenderFileUploadControl::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const 199 199 { 200 if (shouldApplySizeContainment(*this)) 201 return; 200 202 // Figure out how big the filename space needs to be for a given number of characters 201 203 // (using "0" as the nominal character). -
trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp
r277297 r277321 84 84 void RenderFlexibleBox::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const 85 85 { 86 auto addScrollbarWidth = [&]() { 87 LayoutUnit scrollbarWidth(scrollbarLogicalWidth()); 88 maxLogicalWidth += scrollbarWidth; 89 minLogicalWidth += scrollbarWidth; 90 }; 91 92 if (shouldApplySizeContainment(*this)) { 93 addScrollbarWidth(); 94 return; 95 } 96 86 97 LayoutUnit childMinWidth; 87 98 LayoutUnit childMaxWidth; … … 99 110 100 111 LayoutUnit margin = marginIntrinsicLogicalWidthForChild(*child); 101 112 102 113 LayoutUnit minPreferredLogicalWidth; 103 114 LayoutUnit maxPreferredLogicalWidth; 104 115 computeChildPreferredLogicalWidths(*child, minPreferredLogicalWidth, maxPreferredLogicalWidth); 105 116 106 117 minPreferredLogicalWidth += margin; 107 118 maxPreferredLogicalWidth += margin; … … 140 151 } 141 152 142 LayoutUnit scrollbarWidth(scrollbarLogicalWidth()); 143 maxLogicalWidth += scrollbarWidth; 144 minLogicalWidth += scrollbarWidth; 153 addScrollbarWidth(); 145 154 } 146 155 -
trunk/Source/WebCore/rendering/RenderFragmentedFlow.h
r261775 r277321 103 103 virtual void updateMinimumPageHeight(const RenderBlock*, LayoutUnit /*offset*/, LayoutUnit /*minHeight*/) { } 104 104 105 virtual void updateSpaceShortageForSizeContainment(const RenderBlock*, LayoutUnit /*offset*/, LayoutUnit /*shortage*/) { } 106 105 107 virtual RenderFragmentContainer* fragmentAtBlockOffset(const RenderBox*, LayoutUnit, bool extendLastFragment = false) const; 106 108 -
trunk/Source/WebCore/rendering/RenderGrid.cpp
r276356 r277321 251 251 // 2- Next, the track sizing algorithm resolves the sizes of the grid rows, 252 252 // using the grid column sizes calculated in the previous step. 253 if (!hasDefiniteLogicalHeight) 253 bool shouldRecomputeHeight = false; 254 if (!hasDefiniteLogicalHeight) { 254 255 computeTrackSizesForIndefiniteSize(m_trackSizingAlgorithm, ForRows); 255 else 256 if (shouldApplySizeContainment(*this)) 257 shouldRecomputeHeight = true; 258 } else 256 259 computeTrackSizesForDefiniteSize(ForRows, availableLogicalHeight(ExcludeMarginBorderPadding)); 257 260 LayoutUnit trackBasedLogicalHeight = m_trackSizingAlgorithm.computeTrackBasedSize() + borderAndPaddingLogicalHeight() + scrollbarLogicalHeight(); 261 if (shouldRecomputeHeight) 262 computeTrackSizesForDefiniteSize(ForRows, trackBasedLogicalHeight); 263 258 264 setLogicalHeight(trackBasedLogicalHeight); 259 265 … … 549 555 unsigned lastAutoRepeatTrack = firstAutoRepeatTrack + grid.autoRepeatTracks(direction); 550 556 551 if (!grid.hasGridItems() ) {557 if (!grid.hasGridItems() || shouldApplySizeContainment(*this)) { 552 558 emptyTrackIndexes = makeUnique<OrderedTrackIndexSet>(); 553 559 for (unsigned trackIndex = firstAutoRepeatTrack; trackIndex < lastAutoRepeatTrack; ++trackIndex) -
trunk/Source/WebCore/rendering/RenderImage.cpp
r276521 r277321 851 851 void RenderImage::computeIntrinsicRatioInformation(FloatSize& intrinsicSize, double& intrinsicRatio) const 852 852 { 853 ASSERT(!shouldApplySizeContainment(*this)); 853 854 RenderReplaced::computeIntrinsicRatioInformation(intrinsicSize, intrinsicRatio); 854 855 -
trunk/Source/WebCore/rendering/RenderListBox.cpp
r276235 r277321 212 212 void RenderListBox::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const 213 213 { 214 maxLogicalWidth = m_optionsWidth + 2 * optionsSpacingHorizontal;214 maxLogicalWidth = shouldApplySizeContainment(*this) ? 2 * optionsSpacingHorizontal : m_optionsWidth + 2 * optionsSpacingHorizontal; 215 215 if (m_vBar) 216 216 maxLogicalWidth += m_vBar->width(); -
trunk/Source/WebCore/rendering/RenderMenuList.cpp
r272805 r277321 316 316 void RenderMenuList::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const 317 317 { 318 maxLogicalWidth = std::max(m_optionsWidth, theme().minimumMenuListSize(style())) + m_innerBlock->paddingLeft() + m_innerBlock->paddingRight(); 318 maxLogicalWidth = shouldApplySizeContainment(*this) ? theme().minimumMenuListSize(style()) : std::max(m_optionsWidth, theme().minimumMenuListSize(style())); 319 maxLogicalWidth += m_innerBlock->paddingLeft() + m_innerBlock->paddingRight(); 319 320 if (!style().width().isPercentOrCalculated()) 320 321 minLogicalWidth = maxLogicalWidth; -
trunk/Source/WebCore/rendering/RenderMultiColumnFlow.cpp
r275478 r277321 204 204 } 205 205 206 void RenderMultiColumnFlow::updateSpaceShortageForSizeContainment(const RenderBlock* block, LayoutUnit offset, LayoutUnit shortage) 207 { 208 if (auto* multicolSet = downcast<RenderMultiColumnSet>(fragmentAtBlockOffset(block, offset))) 209 multicolSet->updateSpaceShortageForSizeContainment(shortage); 210 } 211 206 212 RenderFragmentContainer* RenderMultiColumnFlow::fragmentAtBlockOffset(const RenderBox* box, LayoutUnit offset, bool extendLastFragment) const 207 213 { -
trunk/Source/WebCore/rendering/RenderMultiColumnFlow.h
r275478 r277321 109 109 void setPageBreak(const RenderBlock*, LayoutUnit offset, LayoutUnit spaceShortage) override; 110 110 void updateMinimumPageHeight(const RenderBlock*, LayoutUnit offset, LayoutUnit minHeight) override; 111 void updateSpaceShortageForSizeContainment(const RenderBlock*, LayoutUnit offset, LayoutUnit shortage) override; 111 112 RenderFragmentContainer* fragmentAtBlockOffset(const RenderBox*, LayoutUnit, bool extendLastFragment = false) const override; 112 113 void setFragmentRangeForBox(const RenderBox&, RenderFragmentContainer*, RenderFragmentContainer*) override; -
trunk/Source/WebCore/rendering/RenderMultiColumnSet.cpp
r276458 r277321 51 51 , m_minSpaceShortage(RenderFragmentedFlow::maxLogicalHeight()) 52 52 , m_minimumColumnHeight(0) 53 , m_spaceShortageForSizeContainment(0) 53 54 { 54 55 } … … 236 237 } 237 238 239 LayoutUnit sizeContainmentShortage = std::max<LayoutUnit>(LayoutUnit(), m_spaceShortageForSizeContainment); 238 240 if (columnCount() <= computedColumnCount()) { 239 241 // With the current column height, the content fits without creating overflowing columns. We're done. 240 return m_computedColumnHeight ;242 return m_computedColumnHeight + sizeContainmentShortage; 241 243 } 242 244 … … 244 246 // Too many forced breaks to allow any implicit breaks. Initial balancing should already 245 247 // have set a good height. There's nothing more we should do. 246 return m_computedColumnHeight ;248 return m_computedColumnHeight + sizeContainmentShortage; 247 249 } 248 250 … … 253 255 // ASSERT(m_minSpaceShortage != RenderFragmentedFlow::maxLogicalHeight()); // If this happens, we probably have a bug. 254 256 if (m_minSpaceShortage == RenderFragmentedFlow::maxLogicalHeight()) 255 return m_computedColumnHeight; // So bail out rather than looping infinitely. 256 257 return m_computedColumnHeight + m_minSpaceShortage; 257 return m_computedColumnHeight + sizeContainmentShortage; // So bail out rather than looping infinitely. 258 259 auto toAdd = std::max<LayoutUnit>(sizeContainmentShortage, m_minSpaceShortage); 260 return m_computedColumnHeight + toAdd; 258 261 } 259 262 … … 365 368 // Nuke previously stored minimum column height. Contents may have changed for all we know. 366 369 m_minimumColumnHeight = 0; 370 371 m_spaceShortageForSizeContainment = 0; 367 372 368 373 // Start with "infinite" flow thread portion height until height is known. -
trunk/Source/WebCore/rendering/RenderMultiColumnSet.h
r260415 r277321 84 84 LayoutUnit minimumColumnHeight() const { return m_minimumColumnHeight; } 85 85 86 void updateSpaceShortageForSizeContainment(LayoutUnit shortage) 87 { 88 if (m_spaceShortageForSizeContainment <= 0) { 89 m_spaceShortageForSizeContainment = shortage; 90 return; 91 } 92 m_spaceShortageForSizeContainment = std::min(shortage, m_spaceShortageForSizeContainment); 93 } 94 86 95 unsigned forcedBreaksCount() const { return m_contentRuns.size(); } 87 96 void clearForcedBreaks(); … … 199 208 LayoutUnit m_minSpaceShortage; // The smallest amout of space shortage that caused a column break. 200 209 LayoutUnit m_minimumColumnHeight; 210 LayoutUnit m_spaceShortageForSizeContainment; // The shortage space that keeps size containment monolithic. 201 211 202 212 // A run of content without explicit (forced) breaks; i.e. a flow thread portion between two -
trunk/Source/WebCore/rendering/RenderObject.cpp
r276746 r277321 2499 2499 return renderer.style().containsLayout() && (!renderer.isInline() || renderer.isAtomicInlineLevelBox()) && !renderer.isRubyText() && (!renderer.isTablePart() || renderer.isRenderBlockFlow()); 2500 2500 } 2501 2502 bool WebCore::shouldApplySizeContainment(const WebCore::RenderObject& renderer) 2503 { 2504 return renderer.style().containsSize() && (!renderer.isInline() || renderer.isAtomicInlineLevelBox()) && !renderer.isRubyText() && (!renderer.isTablePart() || renderer.isTableCaption()) && !renderer.isTable(); 2505 } -
trunk/Source/WebCore/rendering/RenderObject.h
r276842 r277321 202 202 bool isRenderLayerModelObject() const; 203 203 204 inlinebool isAtomicInlineLevelBox() const;204 bool isAtomicInlineLevelBox() const; 205 205 206 206 virtual bool isCounter() const { return false; } … … 1174 1174 } 1175 1175 1176 bool RenderObject::isAtomicInlineLevelBox() const1176 inline bool RenderObject::isAtomicInlineLevelBox() const 1177 1177 { 1178 1178 return style().isDisplayInlineType() && !(style().display() == DisplayType::Inline && !isReplaced()); … … 1188 1188 1189 1189 bool shouldApplyLayoutContainment(const RenderObject&); 1190 bool shouldApplySizeContainment(const RenderObject&); 1190 1191 1191 1192 } // namespace WebCore -
trunk/Source/WebCore/rendering/RenderReplaced.cpp
r276947 r277321 392 392 { 393 393 FloatSize intrinsicSize; 394 if (contentRenderer) { 394 if (shouldApplySizeContainment(*this)) 395 RenderReplaced::computeIntrinsicRatioInformation(intrinsicSize, intrinsicRatio); 396 else if (contentRenderer) { 395 397 contentRenderer->computeIntrinsicRatioInformation(intrinsicSize, intrinsicRatio); 396 398 … … 497 499 { 498 500 // If there's an embeddedContentBox() of a remote, referenced document available, this code-path should never be used. 499 ASSERT(!embeddedContentBox() );501 ASSERT(!embeddedContentBox() || shouldApplySizeContainment(*this)); 500 502 intrinsicSize = FloatSize(intrinsicLogicalWidth(), intrinsicLogicalHeight()); 501 503 -
trunk/Source/WebCore/rendering/RenderReplaced.h
r276521 r277321 41 41 bool setNeedsLayoutIfNeededAfterIntrinsicSizeChange(); 42 42 43 LayoutSize intrinsicSize() const final { return m_intrinsicSize; } 43 LayoutSize intrinsicSize() const final 44 { 45 if (shouldApplySizeContainment(*this)) 46 return LayoutSize(); 47 return m_intrinsicSize; 48 } 44 49 45 50 RoundedRect roundedContentBoxRect() const; -
trunk/Source/WebCore/rendering/RenderSlider.cpp
r275413 r277321 70 70 void RenderSlider::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const 71 71 { 72 if (shouldApplySizeContainment(*this)) 73 return; 72 74 maxLogicalWidth = defaultTrackLength * style().effectiveZoom(); 73 75 if (!style().width().isPercentOrCalculated()) -
trunk/Source/WebCore/rendering/RenderTextControl.cpp
r271934 r277321 157 157 void RenderTextControl::computeIntrinsicLogicalWidths(LayoutUnit& minLogicalWidth, LayoutUnit& maxLogicalWidth) const 158 158 { 159 if (shouldApplySizeContainment(*this)) 160 return; 159 161 // Use average character width. Matches IE. 160 162 maxLogicalWidth = preferredContentLogicalWidth(const_cast<RenderTextControl*>(this)->getAverageCharWidth()); -
trunk/Source/WebCore/rendering/RenderVideo.cpp
r274264 r277321 124 124 LayoutSize RenderVideo::calculateIntrinsicSize() 125 125 { 126 if (shouldApplySizeContainment(*this)) 127 return LayoutSize(); 128 126 129 // Spec text from 4.8.6 127 130 // -
trunk/Source/WebCore/rendering/style/RenderStyle.h
r277320 r277321 528 528 OptionSet<Containment> contain() const { return m_rareNonInheritedData->contain; } 529 529 bool containsLayout() const { return m_rareNonInheritedData->contain.contains(Containment::Layout); } 530 bool containsSize() const { return m_rareNonInheritedData->contain.contains(Containment::Size); } 530 531 BoxAlignment boxAlign() const { return static_cast<BoxAlignment>(m_rareNonInheritedData->deprecatedFlexibleBox->align); } 531 532 BoxDirection boxDirection() const { return static_cast<BoxDirection>(m_inheritedFlags.boxDirection); } -
trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp
r277124 r277321 71 71 void RenderSVGRoot::computeIntrinsicRatioInformation(FloatSize& intrinsicSize, double& intrinsicRatio) const 72 72 { 73 ASSERT(!shouldApplySizeContainment(*this)); 74 73 75 // Spec: http://www.w3.org/TR/SVG/coords.html#IntrinsicSizing 74 76 // SVG needs to specify how to calculate some intrinsic sizing properties to enable inclusion within other languages.
Note:
See TracChangeset
for help on using the changeset viewer.