Changeset 280509 in webkit
- Timestamp:
- Jul 30, 2021 11:07:09 PM (12 months ago)
- Location:
- trunk
- Files:
-
- 2 added
- 20 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/TestExpectations (modified) (2 diffs)
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-overflow/overflow-clip-hit-testing-expected.txt (added)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-overflow/overflow-clip-scroll-size-expected.txt (added)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-overflow/parsing/overflow-computed-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-overflow/parsing/overflow-valid-expected.txt (modified) (1 diff)
-
Source/WTF/ChangeLog (modified) (1 diff)
-
Source/WTF/Scripts/Preferences/WebPreferencesExperimental.yaml (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/css/CSSPrimitiveValueMappings.h (modified) (2 diffs)
-
Source/WebCore/css/CSSProperties.json (modified) (2 diffs)
-
Source/WebCore/css/parser/CSSParserContext.cpp (modified) (3 diffs)
-
Source/WebCore/css/parser/CSSParserContext.h (modified) (1 diff)
-
Source/WebCore/css/parser/CSSParserFastPaths.cpp (modified) (1 diff)
-
Source/WebCore/page/FrameView.cpp (modified) (2 diffs)
-
Source/WebCore/rendering/RenderBox.cpp (modified) (14 diffs)
-
Source/WebCore/rendering/RenderObject.cpp (modified) (1 diff)
-
Source/WebCore/rendering/RenderObject.h (modified) (2 diffs)
-
Source/WebCore/rendering/style/RenderStyleConstants.cpp (modified) (1 diff)
-
Source/WebCore/rendering/style/RenderStyleConstants.h (modified) (1 diff)
-
Source/WebCore/style/StyleAdjuster.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r280504 r280509 1 2021-07-30 Rob Buis <rbuis@igalia.com> 2 3 [css-overflow] Implement clip value for overflow 4 https://bugs.webkit.org/show_bug.cgi?id=198230 5 6 Reviewed by Simon Fraser. 7 8 * TestExpectations: 9 1 10 2021-07-30 Chris Dumez <cdumez@apple.com> 2 11 -
trunk/LayoutTests/TestExpectations
r280504 r280509 4631 4631 webkit.org/b/214458 imported/w3c/web-platform-tests/css/css-multicol/nested-with-too-tall-line.html [ ImageOnlyFailure ] 4632 4632 4633 webkit.org/b/214459 imported/w3c/web-platform-tests/css/css-overflow/clip-001.html [ ImageOnlyFailure ]4634 webkit.org/b/214459 imported/w3c/web-platform-tests/css/css-overflow/dynamic-visible-to-clip-001.html [ ImageOnlyFailure ]4635 4633 webkit.org/b/214459 imported/w3c/web-platform-tests/css/css-overflow/text-overflow-ellipsis-editing-input.html [ ImageOnlyFailure ] 4636 4634 webkit.org/b/214459 imported/w3c/web-platform-tests/css/css-overflow/text-overflow-ellipsis-vertical-001.html [ ImageOnlyFailure ] … … 5095 5093 webkit.org/b/227849 imported/w3c/web-platform-tests/css/css-overflow/overflow-body-propagation-010.html [ Skip ] 5096 5094 webkit.org/b/227849 imported/w3c/web-platform-tests/css/css-overflow/overflow-body-propagation-011.html [ Skip ] 5097 webkit.org/b/198230 imported/w3c/web-platform-tests/css/css-overflow/clip-002.html [ Skip ]5098 5095 webkit.org/b/198230 imported/w3c/web-platform-tests/css/css-overflow/clip-003.html [ Skip ] 5099 webkit.org/b/198230 imported/w3c/web-platform-tests/css/css-overflow/clip-004.html [ Skip ]5100 webkit.org/b/198230 imported/w3c/web-platform-tests/css/css-overflow/clip-005.html [ Skip ]5101 webkit.org/b/198230 imported/w3c/web-platform-tests/css/css-overflow/clip-006.html [ Skip ]5102 webkit.org/b/198230 imported/w3c/web-platform-tests/css/css-overflow/clip-007.html [ Skip ]5103 webkit.org/b/198230 imported/w3c/web-platform-tests/css/css-overflow/overflow-clip-cant-scroll.html [ Skip ]5104 webkit.org/b/198230 imported/w3c/web-platform-tests/css/css-overflow/overflow-clip-content-visual-overflow.html [ Skip ]5105 5096 webkit.org/b/198230 imported/w3c/web-platform-tests/css/css-overflow/overflow-clip-margin-intersection-observer.html [ Skip ] 5106 webkit.org/b/198230 imported/w3c/web-platform-tests/css/css-overflow/overflow-clip-scroll-size.html [ Skip ]5107 webkit.org/b/198230 imported/w3c/web-platform-tests/css/css-overflow/overflow-clip-hit-testing.html [ Skip ]5108 5097 webkit.org/b/198230 imported/w3c/web-platform-tests/css/css-overflow/overflow-clip-margin-invalidation.html [ Skip ] 5109 5098 webkit.org/b/198230 imported/w3c/web-platform-tests/css/css-overflow/overflow-clip-margin-001.html [ Skip ] -
trunk/LayoutTests/imported/w3c/ChangeLog
r280504 r280509 1 2021-07-30 Rob Buis <rbuis@igalia.com> 2 3 [css-overflow] Implement clip value for overflow 4 https://bugs.webkit.org/show_bug.cgi?id=198230 5 6 Reviewed by Simon Fraser. 7 8 * web-platform-tests/css/css-overflow/overflow-clip-hit-testing-expected.txt: Added. 9 * web-platform-tests/css/css-overflow/overflow-clip-scroll-size-expected.txt: Added. 10 * web-platform-tests/css/css-overflow/parsing/overflow-computed-expected.txt: 11 * web-platform-tests/css/css-overflow/parsing/overflow-valid-expected.txt: 12 1 13 2021-07-30 Chris Dumez <cdumez@apple.com> 2 14 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-overflow/parsing/overflow-computed-expected.txt
r279819 r280509 2 2 PASS Property overflow value 'visible' 3 3 PASS Property overflow value 'hidden' 4 FAIL Property overflow value 'clip' assert_true: 'clip' is a supported value for overflow. expected true got false 4 PASS Property overflow value 'clip' 5 5 PASS Property overflow value 'scroll' 6 6 PASS Property overflow value 'auto' 7 7 PASS Property overflow value 'auto auto' 8 FAIL Property overflow value 'auto clip' assert_true: 'auto clip' is a supported value for overflow. expected true got false 8 PASS Property overflow value 'auto clip' 9 9 PASS Property overflow value 'auto visible' 10 FAIL Property overflow value 'clip auto' assert_true: 'clip auto' is a supported value for overflow. expected true got false 11 FAIL Property overflow value 'clip clip' assert_true: 'clip clip' is a supported value for overflow. expected true got false 12 FAIL Property overflow value 'clip hidden' assert_true: 'clip hidden' is a supported value for overflow. expected true got false 13 FAIL Property overflow value 'clip scroll' assert_true: 'clip scroll' is a supported value for overflow. expected true got false 14 FAIL Property overflow value 'clip visible' assert_true: 'clip visible' is a supported value for overflow. expected true got false 15 FAIL Property overflow value 'hidden clip' assert_true: 'hidden clip' is a supported value for overflow. expected true got false 10 PASS Property overflow value 'clip auto' 11 PASS Property overflow value 'clip clip' 12 PASS Property overflow value 'clip hidden' 13 PASS Property overflow value 'clip scroll' 14 PASS Property overflow value 'clip visible' 15 PASS Property overflow value 'hidden clip' 16 16 PASS Property overflow value 'hidden visible' 17 17 PASS Property overflow value 'scroll auto' 18 FAIL Property overflow value 'scroll clip' assert_true: 'scroll clip' is a supported value for overflow. expected true got false 18 PASS Property overflow value 'scroll clip' 19 19 PASS Property overflow value 'scroll visible' 20 20 PASS Property overflow value 'visible auto' 21 21 PASS Property overflow value 'visible hidden' 22 22 PASS Property overflow value 'visible scroll' 23 FAIL Property overflow value 'visible clip' assert_true: 'visible clip' is a supported value for overflow. expected true got false 23 PASS Property overflow value 'visible clip' 24 24 PASS Property overflow value 'visible visible' 25 25 PASS Property overflow-x value 'scroll' 26 26 PASS Property overflow-x value 'hidden' 27 27 PASS Property overflow-x value 'visible' 28 FAIL Property overflow-y value 'clip' assert_true: 'clip' is a supported value for overflow-y. expected true got false 28 PASS Property overflow-y value 'clip' 29 29 PASS Property overflow-y value 'auto' 30 30 PASS Property overflow-y value 'visible' -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-overflow/parsing/overflow-valid-expected.txt
r267650 r280509 2 2 PASS e.style['overflow'] = "visible" should set the property value 3 3 PASS e.style['overflow'] = "hidden" should set the property value 4 FAIL e.style['overflow'] = "clip" should set the property value assert_not_equals: property should be set got disallowed value "" 4 PASS e.style['overflow'] = "clip" should set the property value 5 5 PASS e.style['overflow'] = "scroll" should set the property value 6 6 PASS e.style['overflow'] = "auto" should set the property value 7 7 PASS e.style['overflow'] = "visible visible" should set the property value 8 8 PASS e.style['overflow'] = "hidden visible" should set the property value 9 FAIL e.style['overflow'] = "clip clip" should set the property value assert_not_equals: property should be set got disallowed value "" 9 PASS e.style['overflow'] = "clip clip" should set the property value 10 10 PASS e.style['overflow'] = "scroll auto" should set the property value 11 11 PASS e.style['overflow'] = "auto auto" should set the property value 12 12 PASS e.style['overflow-x'] = "visible" should set the property value 13 13 PASS e.style['overflow-x'] = "scroll" should set the property value 14 FAIL e.style['overflow-y'] = "clip" should set the property value assert_not_equals: property should be set got disallowed value "" 14 PASS e.style['overflow-y'] = "clip" should set the property value 15 15 PASS e.style['overflow-y'] = "auto" should set the property value 16 16 FAIL e.style['overflow-block'] = "hidden" should set the property value assert_not_equals: property should be set got disallowed value "" -
trunk/Source/WTF/ChangeLog
r280504 r280509 1 2021-07-30 Rob Buis <rbuis@igalia.com> 2 3 [css-overflow] Implement clip value for overflow 4 https://bugs.webkit.org/show_bug.cgi?id=198230 5 6 Reviewed by Simon Fraser. 7 8 Add preference for overflow: clip support. 9 10 * Scripts/Preferences/WebPreferencesExperimental.yaml: 11 1 12 2021-07-30 Chris Dumez <cdumez@apple.com> 2 13 -
trunk/Source/WTF/Scripts/Preferences/WebPreferencesExperimental.yaml
r280504 r280509 745 745 default: true 746 746 747 OverflowClipEnabled: 748 type: bool 749 humanReadableName: "CSS overflow: clip support" 750 humanReadableDescription: "Enable CSS overflow: clip support" 751 defaultValue: 752 WebKitLegacy: 753 default: false 754 WebKit: 755 default: false 756 WebCore: 757 default: false 758 747 759 OverscrollBehaviorEnabled: 748 760 type: bool -
trunk/Source/WebCore/ChangeLog
r280504 r280509 1 2021-07-30 Rob Buis <rbuis@igalia.com> 2 3 [css-overflow] Implement clip value for overflow 4 https://bugs.webkit.org/show_bug.cgi?id=198230 5 6 Reviewed by Simon Fraser. 7 8 Implement overflow: clip. Parsing is like the other 9 overflow values but special logic is added to handle 10 the case where only one of overflow-x/overflow-y uses 11 'clip' [1]. Also adjusts code that computes layout and 12 visual overflow to take overflow: clip into account. 13 14 This matches Chrome and Firefox. 15 16 [1] https://drafts.csswg.org/css-overflow/#propdef-overflow-x 17 18 * css/CSSPrimitiveValueMappings.h: 19 (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): 20 (WebCore::CSSPrimitiveValue::operator Overflow const): 21 * css/CSSProperties.json: 22 * css/parser/CSSParserContext.cpp: 23 (WebCore::operator==): 24 (WebCore::add): 25 * css/parser/CSSParserContext.h: 26 * css/parser/CSSParserFastPaths.cpp: 27 (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue): 28 * page/FrameView.cpp: handle scrollbars 29 on viewport element same as overflow: hidden. 30 (WebCore::FrameView::applyOverflowToViewport): 31 * rendering/RenderBox.cpp: 32 (WebCore::RenderBox::updateFromStyle): 33 (WebCore::RenderBox::scrollWidth const): overflow clip 34 forbids all scrolling. 35 (WebCore::RenderBox::scrollHeight const): Ditto. 36 (WebCore::RenderBox::setScrollLeft): Ditto. 37 (WebCore::RenderBox::setScrollTop): Ditto. 38 (WebCore::RenderBox::setScrollPosition): Ditto. 39 (WebCore::RenderBox::requiresLayerWithScrollableArea const): do 40 not create layer with scrollable area for overflow: clip. 41 (WebCore::RenderBox::canBeProgramaticallyScrolled const): overflow clip 42 forbids all scrolling. 43 (WebCore::RenderBox::scrollPosition const): overflow clip 44 forbids all scrolling. 45 (WebCore::RenderBox::overflowClipRect const): only clip the rect horizontally 46 for overflow-x: clip and only vertically for overflow-y: clip. 47 (WebCore::RenderBox::createsNewFormattingContext const): do 48 not create formatting context for overflow: clip. 49 (WebCore::RenderBox::addOverflowFromChild): 50 (WebCore::RenderBox::addLayoutOverflow): 51 (WebCore::RenderBox::layoutOverflowRectForPropagation const): 52 * rendering/RenderObject.cpp: 53 (WebCore::RenderObject::enclosingScrollableContainerForSnapping const): 54 * rendering/RenderObject.h: Add helper method that excludes overflow-x/y: clip. 55 (WebCore::RenderObject::hasPotentiallyScrollableOverflow const): 56 * rendering/style/RenderStyleConstants.cpp: 57 (WebCore::operator<<): 58 * rendering/style/RenderStyleConstants.h: 59 * style/StyleAdjuster.cpp: Add special logic is to handle the case where only 60 one of overflow-x/overflow-y uses 'clip'. 61 (WebCore::Style::Adjuster::adjust const): 62 1 63 2021-07-30 Chris Dumez <cdumez@apple.com> 2 64 -
trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h
r279218 r280509 1953 1953 m_value.valueID = CSSValueWebkitPagedY; 1954 1954 break; 1955 case Overflow::Clip: 1956 m_value.valueID = CSSValueClip; 1957 break; 1955 1958 } 1956 1959 } … … 1974 1977 case CSSValueWebkitPagedY: 1975 1978 return Overflow::PagedY; 1979 case CSSValueClip: 1980 return Overflow::Clip; 1976 1981 default: 1977 1982 break; -
trunk/Source/WebCore/css/CSSProperties.json
r279218 r280509 3631 3631 "visible", 3632 3632 "hidden", 3633 "clip", 3633 3634 "scroll", 3634 3635 "auto" … … 3643 3644 "visible", 3644 3645 "hidden", 3646 "clip", 3645 3647 "scroll", 3646 3648 "auto", -
trunk/Source/WebCore/css/parser/CSSParserContext.cpp
r279050 r280509 98 98 , attachmentEnabled { RuntimeEnabledFeatures::sharedFeatures().attachmentElementEnabled() } 99 99 #endif 100 , overflowClipEnabled { document.settings().overflowClipEnabled() } 100 101 { 101 102 } … … 140 141 && a.attachmentEnabled == b.attachmentEnabled 141 142 #endif 143 && a.overflowClipEnabled == b.overflowClipEnabled 142 144 ; 143 145 } … … 176 178 | context.attachmentEnabled << 22 177 179 #endif 178 | context.mode << 23; // This is multiple bits, so keep it last. 180 | context.overflowClipEnabled << 23 181 | context.mode << 24; // This is multiple bits, so keep it last. 179 182 add(hasher, context.baseURL, context.charset, bits); 180 183 } -
trunk/Source/WebCore/css/parser/CSSParserContext.h
r279050 r280509 88 88 #endif 89 89 90 bool overflowClipEnabled { false }; 91 90 92 CSSParserContext(CSSParserMode, const URL& baseURL = URL()); 91 93 WEBCORE_EXPORT CSSParserContext(const Document&, const URL& baseURL = URL(), const String& charset = emptyString()); -
trunk/Source/WebCore/css/parser/CSSParserFastPaths.cpp
r280316 r280509 675 675 return valueID == CSSValueNormal || valueID == CSSValueBreakWord; 676 676 case CSSPropertyOverflowX: // visible | hidden | scroll | auto | overlay (overlay is a synonym for auto) 677 if (context.overflowClipEnabled && valueID == CSSValueClip) 678 return true; 677 679 return valueID == CSSValueVisible || valueID == CSSValueHidden || valueID == CSSValueScroll || valueID == CSSValueAuto || valueID == CSSValueOverlay; 678 680 case CSSPropertyOverflowY: // visible | hidden | scroll | auto | overlay | -webkit-paged-x | -webkit-paged-y (overlay is a synonym for auto) 681 if (context.overflowClipEnabled && valueID == CSSValueClip) 682 return true; 679 683 return valueID == CSSValueVisible || valueID == CSSValueHidden || valueID == CSSValueScroll || valueID == CSSValueAuto || valueID == CSSValueOverlay || valueID == CSSValueWebkitPagedX || valueID == CSSValueWebkitPagedY; 680 684 case CSSPropertyOverscrollBehaviorX: -
trunk/Source/WebCore/page/FrameView.cpp
r280306 r280509 650 650 switch (overflowX) { 651 651 case Overflow::Hidden: 652 case Overflow::Clip: 652 653 if (overrideHidden) 653 654 hMode = ScrollbarAuto; … … 668 669 switch (overflowY) { 669 670 case Overflow::Hidden: 671 case Overflow::Clip: 670 672 if (overrideHidden) 671 673 vMode = ScrollbarAuto; -
trunk/Source/WebCore/rendering/RenderBox.cpp
r280075 r280509 483 483 484 484 // We also handle <body> and <html>, whose overflow applies to the viewport. 485 if ( styleToUse.overflowX() != Overflow::Visible&& !isDocElementRenderer && isRenderBlock()) {485 if (!(styleToUse.overflowX() == Overflow::Visible && styleToUse.overflowY() == Overflow::Visible) && !isDocElementRenderer && isRenderBlock()) { 486 486 bool boxHasNonVisibleOverflow = true; 487 487 if (isBody()) { … … 549 549 int RenderBox::scrollWidth() const 550 550 { 551 if (has NonVisibleOverflow() && layer())551 if (hasPotentiallyScrollableOverflow() && layer()) 552 552 return layer()->scrollWidth(); 553 553 // For objects with visible overflow, this matches IE. … … 562 562 int RenderBox::scrollHeight() const 563 563 { 564 if (has NonVisibleOverflow() && layer())564 if (hasPotentiallyScrollableOverflow() && layer()) 565 565 return layer()->scrollHeight(); 566 566 // For objects with visible overflow, this matches IE. … … 598 598 void RenderBox::setScrollLeft(int newLeft, const ScrollPositionChangeOptions& options) 599 599 { 600 if (!has NonVisibleOverflow() || !layer())600 if (!hasPotentiallyScrollableOverflow() || !layer()) 601 601 return; 602 602 auto* scrollableArea = layer()->scrollableArea(); … … 608 608 void RenderBox::setScrollTop(int newTop, const ScrollPositionChangeOptions& options) 609 609 { 610 if (!has NonVisibleOverflow() || !layer())610 if (!hasPotentiallyScrollableOverflow() || !layer()) 611 611 return; 612 612 auto* scrollableArea = layer()->scrollableArea(); … … 618 618 void RenderBox::setScrollPosition(const ScrollPosition& position, const ScrollPositionChangeOptions& options) 619 619 { 620 if (!has NonVisibleOverflow() || !layer())620 if (!hasPotentiallyScrollableOverflow() || !layer()) 621 621 return; 622 622 auto* scrollableArea = layer()->scrollableArea(); … … 959 959 return true; 960 960 961 if (has NonVisibleOverflow())961 if (hasPotentiallyScrollableOverflow()) 962 962 return true; 963 963 … … 977 977 return true; 978 978 979 if (!has NonVisibleOverflow())979 if (!hasPotentiallyScrollableOverflow()) 980 980 return false; 981 981 … … 1099 1099 ScrollPosition RenderBox::scrollPosition() const 1100 1100 { 1101 if (!has NonVisibleOverflow())1101 if (!hasPotentiallyScrollableOverflow()) 1102 1102 return { 0, 0 }; 1103 1103 … … 2043 2043 LayoutRect RenderBox::overflowClipRect(const LayoutPoint& location, RenderFragmentContainer* fragment, OverlayScrollbarSizeRelevancy relevancy, PaintPhase) const 2044 2044 { 2045 // FIXME: When overflow-clip (CSS3) is implemented, we'll obtain the property2046 // here.2047 2045 LayoutRect clipRect = borderBoxRectInFragment(fragment); 2048 2046 clipRect.setLocation(location + clipRect.location() + LayoutSize(borderLeft(), borderTop())); 2049 2047 clipRect.setSize(clipRect.size() - LayoutSize(borderLeft() + borderRight(), borderTop() + borderBottom())); 2048 if (style().overflowX() == Overflow::Clip && style().overflowY() == Overflow::Visible) { 2049 LayoutRect infRect = LayoutRect::infiniteRect(); 2050 clipRect.setY(infRect.y()); 2051 clipRect.setHeight(infRect.height()); 2052 } else if (style().overflowY() == Overflow::Clip && style().overflowX() == Overflow::Visible) { 2053 LayoutRect infRect = LayoutRect::infiniteRect(); 2054 clipRect.setX(infRect.x()); 2055 clipRect.setWidth(infRect.width()); 2056 } 2050 2057 2051 2058 // Subtract out scrollbars if we have them. … … 4804 4811 bool RenderBox::createsNewFormattingContext() const 4805 4812 { 4806 return isInlineBlockOrInlineTable() || isFloatingOrOutOfFlowPositioned() || has NonVisibleOverflow() || isFlexItemIncludingDeprecated()4813 return isInlineBlockOrInlineTable() || isFloatingOrOutOfFlowPositioned() || hasPotentiallyScrollableOverflow() || isFlexItemIncludingDeprecated() 4807 4814 || isTableCell() || isTableCaption() || isFieldset() || isWritingModeRoot() || isDocumentElementRenderer() || isRenderFragmentedFlow() || isRenderFragmentContainer() 4808 4815 || style().containsLayout() || isGridItem() || style().specifiesColumns() || style().columnSpan() == ColumnSpan::All || style().display() == DisplayType::FlowRoot; … … 4892 4899 // have visual overflow of its own set from box shadows or reflections. It is unnecessary to propagate this 4893 4900 // overflow if we are clipping our own overflow. 4894 if (child->hasSelfPaintingLayer() || has NonVisibleOverflow())4901 if (child->hasSelfPaintingLayer() || hasPotentiallyScrollableOverflow()) 4895 4902 return; 4896 4903 LayoutRect childVisualOverflowRect = child->visualOverflowRectForPropagation(&style()); … … 4907 4914 // For overflow clip objects, we don't want to propagate overflow into unreachable areas. 4908 4915 LayoutRect overflowRect(rect); 4909 if (has NonVisibleOverflow() || isRenderView()) {4916 if (hasPotentiallyScrollableOverflow() || isRenderView()) { 4910 4917 // Overflow is in the block's coordinate space and thus is flipped for horizontal-bt and vertical-rl 4911 4918 // writing modes. At this stage that is actually a simplification, since we can treat horizontal-tb/bt as the same … … 5052 5059 LayoutRect RenderBox::layoutOverflowRectForPropagation(const RenderStyle* parentStyle) const 5053 5060 { 5054 // Only propagate interior layout overflow if we don't c lip it.5061 // Only propagate interior layout overflow if we don't completely clip it. 5055 5062 LayoutRect rect = borderBoxRect(); 5056 if (!shouldApplyLayoutContainment(*this) && !hasNonVisibleOverflow()) 5057 rect.unite(layoutOverflowRect()); 5063 if (!shouldApplyLayoutContainment(*this)) { 5064 if (style().overflowX() == Overflow::Clip && style().overflowY() == Overflow::Visible) { 5065 LayoutRect clippedOverflowRect = layoutOverflowRect(); 5066 clippedOverflowRect.setX(rect.x()); 5067 clippedOverflowRect.setWidth(rect.width()); 5068 rect.unite(clippedOverflowRect); 5069 } else if (style().overflowY() == Overflow::Clip && style().overflowX() == Overflow::Visible) { 5070 LayoutRect clippedOverflowRect = layoutOverflowRect(); 5071 clippedOverflowRect.setY(rect.y()); 5072 clippedOverflowRect.setHeight(rect.height()); 5073 rect.unite(clippedOverflowRect); 5074 } else if (!hasNonVisibleOverflow()) 5075 rect.unite(layoutOverflowRect()); 5076 } 5058 5077 5059 5078 bool hasTransform = this->hasTransform(); -
trunk/Source/WebCore/rendering/RenderObject.cpp
r279958 r280509 482 482 if (candidate->isRenderView()) 483 483 break; 484 if (candidate->has NonVisibleOverflow())484 if (candidate->hasPotentiallyScrollableOverflow()) 485 485 return downcast<RenderBox>(candidate); 486 486 } -
trunk/Source/WebCore/rendering/RenderObject.h
r279918 r280509 437 437 438 438 bool hasNonVisibleOverflow() const { return m_bitfields.hasNonVisibleOverflow(); } 439 440 bool hasPotentiallyScrollableOverflow() const; 439 441 440 442 bool hasTransformRelatedProperty() const { return m_bitfields.hasTransformRelatedProperty(); } // Transform, perspective or transform-style: preserve-3d. … … 1188 1190 } 1189 1191 1192 inline bool RenderObject::hasPotentiallyScrollableOverflow() const 1193 { 1194 // We only need to test one overflow dimension since 'visible' and 'clip' always get accompanied 1195 // with 'clip' or 'visible' in the other dimension (see Style::Adjuster::adjust). 1196 return hasNonVisibleOverflow() && style().overflowX() != Overflow::Clip && style().overflowX() != Overflow::Visible; 1197 } 1198 1190 1199 WTF::TextStream& operator<<(WTF::TextStream&, const RenderObject&); 1191 1200 -
trunk/Source/WebCore/rendering/style/RenderStyleConstants.cpp
r279941 r280509 803 803 case Overflow::PagedX: ts << "paged-x"; break; 804 804 case Overflow::PagedY: ts << "paged-y"; break; 805 case Overflow::Clip: ts << "clip"; break; 805 806 } 806 807 return ts; -
trunk/Source/WebCore/rendering/style/RenderStyleConstants.h
r279218 r280509 276 276 Visible, 277 277 Hidden, 278 Clip, 278 279 Scroll, 279 280 Auto, -
trunk/Source/WebCore/style/StyleAdjuster.cpp
r278698 r280509 413 413 style.setTextDecorationsInEffect(style.textDecoration()); 414 414 415 // If either overflow value is not visible, change to auto. 416 if (style.overflowX() == Overflow::Visible && style.overflowY() != Overflow::Visible) { 417 // FIXME: Once we implement pagination controls, overflow-x should default to hidden 418 // if overflow-y is set to -webkit-paged-x or -webkit-page-y. For now, we'll let it 419 // default to auto so we can at least scroll through the pages. 420 style.setOverflowX(Overflow::Auto); 421 } else if (style.overflowY() == Overflow::Visible && style.overflowX() != Overflow::Visible) 422 style.setOverflowY(Overflow::Auto); 415 auto overflowReplacement = [] (Overflow overflow, Overflow overflowInOtherDimension) -> std::optional<Overflow> { 416 if (overflow != Overflow::Visible && overflow != Overflow::Clip) { 417 if (overflowInOtherDimension == Overflow::Visible) 418 return Overflow::Auto; 419 if (overflowInOtherDimension == Overflow::Clip) 420 return Overflow::Hidden; 421 } 422 return std::nullopt; 423 }; 424 425 // If either overflow value is not visible, change to auto. Similarly if either overflow 426 // value is not clip, change to hidden. 427 // FIXME: Once we implement pagination controls, overflow-x should default to hidden 428 // if overflow-y is set to -webkit-paged-x or -webkit-page-y. For now, we'll let it 429 // default to auto so we can at least scroll through the pages. 430 if (auto replacement = overflowReplacement(style.overflowY(), style.overflowX())) 431 style.setOverflowX(*replacement); 432 else if (auto replacement = overflowReplacement(style.overflowX(), style.overflowY())) 433 style.setOverflowY(*replacement); 423 434 424 435 // Call setStylesForPaginationMode() if a pagination mode is set for any non-root elements. If these
Note: See TracChangeset
for help on using the changeset viewer.