Changeset 285885 in webkit
- Timestamp:
- Nov 16, 2021, 2:32:39 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 19 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-flexbox/flex-item-contains-strict-expected.txt (modified) (2 diffs)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/page/FrameView.cpp (modified) (3 diffs)
-
Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp (modified) (1 diff)
-
Source/WebCore/rendering/RenderBox.cpp (modified) (6 diffs)
-
Source/WebCore/rendering/RenderBoxModelObject.cpp (modified) (1 diff)
-
Source/WebCore/rendering/RenderElement.cpp (modified) (2 diffs)
-
Source/WebCore/rendering/RenderElement.h (modified) (3 diffs)
-
Source/WebCore/rendering/RenderFlexibleBox.cpp (modified) (2 diffs)
-
Source/WebCore/rendering/RenderFragmentContainer.cpp (modified) (2 diffs)
-
Source/WebCore/rendering/RenderInline.h (modified) (1 diff)
-
Source/WebCore/rendering/RenderLayer.cpp (modified) (5 diffs)
-
Source/WebCore/rendering/RenderObject.cpp (modified) (3 diffs)
-
Source/WebCore/rendering/RenderObject.h (modified) (4 diffs)
-
Source/WebCore/rendering/style/RenderStyle.h (modified) (2 diffs)
-
Source/WebCore/rendering/svg/RenderSVGRoot.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r285874 r285885 1 2021-11-16 Rob Buis <rbuis@igalia.com> 2 3 [css-contain] Support contain:paint 4 https://bugs.webkit.org/show_bug.cgi?id=224742 5 6 Reviewed by Alan Bujtas. 7 8 Unskip tests that pass now. 9 10 * TestExpectations: 11 1 12 2021-11-16 Tyler Wilcock <tyler_w@apple.com> 2 13 -
trunk/LayoutTests/TestExpectations
r285857 r285885 4734 4734 # webkit-ruby-text 4735 4735 imported/w3c/web-platform-tests/css/css-contain/contain-layout-017.html [ ImageOnlyFailure ] 4736 imported/w3c/web-platform-tests/css/css-contain/contain-paint-005.html [ ImageOnlyFailure ] 4737 imported/w3c/web-platform-tests/css/css-contain/contain-paint-006.html [ ImageOnlyFailure ] 4738 imported/w3c/web-platform-tests/css/css-contain/contain-paint-008.html [ ImageOnlyFailure ] 4739 imported/w3c/web-platform-tests/css/css-contain/contain-paint-021.html [ ImageOnlyFailure ] 4736 4740 imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-001.html [ ImageOnlyFailure ] 4737 4741 imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-003.html [ ImageOnlyFailure ] … … 4748 4752 imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-021.html [ ImageOnlyFailure ] 4749 4753 imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-022.html [ ImageOnlyFailure ] 4750 imported/w3c/web-platform-tests/css/css-contain/contain-paint-001.html [ ImageOnlyFailure ]4751 imported/w3c/web-platform-tests/css/css-contain/contain-paint-004.html [ ImageOnlyFailure ]4752 imported/w3c/web-platform-tests/css/css-contain/contain-paint-005.html [ ImageOnlyFailure ]4753 imported/w3c/web-platform-tests/css/css-contain/contain-paint-006.html [ ImageOnlyFailure ]4754 imported/w3c/web-platform-tests/css/css-contain/contain-paint-008.html [ ImageOnlyFailure ]4755 imported/w3c/web-platform-tests/css/css-contain/contain-paint-009.html [ ImageOnlyFailure ]4756 imported/w3c/web-platform-tests/css/css-contain/contain-paint-010.html [ ImageOnlyFailure ]4757 imported/w3c/web-platform-tests/css/css-contain/contain-paint-014.html [ ImageOnlyFailure ]4758 imported/w3c/web-platform-tests/css/css-contain/contain-paint-019.html [ ImageOnlyFailure ]4759 imported/w3c/web-platform-tests/css/css-contain/contain-paint-020.html [ ImageOnlyFailure ]4760 imported/w3c/web-platform-tests/css/css-contain/contain-paint-022.html [ ImageOnlyFailure ]4761 imported/w3c/web-platform-tests/css/css-contain/contain-paint-023.html [ ImageOnlyFailure ]4762 imported/w3c/web-platform-tests/css/css-contain/contain-paint-047.html [ ImageOnlyFailure ]4763 imported/w3c/web-platform-tests/css/css-contain/contain-paint-048.html [ ImageOnlyFailure ]4764 imported/w3c/web-platform-tests/css/css-contain/contain-paint-cell-001.html [ ImageOnlyFailure ]4765 imported/w3c/web-platform-tests/css/css-contain/contain-paint-cell-002.html [ ImageOnlyFailure ]4766 imported/w3c/web-platform-tests/css/css-contain/contain-paint-clip-001.html [ ImageOnlyFailure ]4767 imported/w3c/web-platform-tests/css/css-contain/contain-paint-clip-002.html [ ImageOnlyFailure ]4768 imported/w3c/web-platform-tests/css/css-contain/contain-paint-clip-006.html [ ImageOnlyFailure ]4769 imported/w3c/web-platform-tests/css/css-contain/contain-paint-clip-011.html [ ImageOnlyFailure ]4770 imported/w3c/web-platform-tests/css/css-contain/contain-paint-clip-012.html [ ImageOnlyFailure ]4771 imported/w3c/web-platform-tests/css/css-contain/contain-paint-clip-013.html [ ImageOnlyFailure ]4772 imported/w3c/web-platform-tests/css/css-contain/contain-paint-clip-014.html [ ImageOnlyFailure ]4773 4754 imported/w3c/web-platform-tests/css/css-contain/contain-paint-clip-015.html [ ImageOnlyFailure ] 4774 4755 imported/w3c/web-platform-tests/css/css-contain/contain-paint-clip-016.html [ ImageOnlyFailure ] 4775 imported/w3c/web-platform-tests/css/css-contain/contain-paint-clip-017.html [ ImageOnlyFailure ] 4776 imported/w3c/web-platform-tests/css/css-contain/contain-paint-clip-018.html [ ImageOnlyFailure ] 4777 imported/w3c/web-platform-tests/css/css-contain/contain-paint-clip-019.html [ ImageOnlyFailure ] 4778 imported/w3c/web-platform-tests/css/css-contain/contain-paint-containing-block-absolute-001.html [ ImageOnlyFailure ] 4779 imported/w3c/web-platform-tests/css/css-contain/contain-paint-containing-block-fixed-001.html [ ImageOnlyFailure ] 4780 imported/w3c/web-platform-tests/css/css-contain/contain-paint-formatting-context-float-001.html [ ImageOnlyFailure ] 4781 imported/w3c/web-platform-tests/css/css-contain/contain-paint-formatting-context-margin-001.html [ ImageOnlyFailure ] 4782 imported/w3c/web-platform-tests/css/css-contain/contain-paint-ifc-011.html [ ImageOnlyFailure ] 4783 imported/w3c/web-platform-tests/css/css-contain/contain-paint-independent-formatting-context-001.html [ ImageOnlyFailure ] 4784 imported/w3c/web-platform-tests/css/css-contain/contain-paint-size-001.html [ ImageOnlyFailure ] 4785 imported/w3c/web-platform-tests/css/css-contain/contain-paint-size-002.html [ ImageOnlyFailure ] 4786 imported/w3c/web-platform-tests/css/css-contain/contain-paint-size-003.html [ ImageOnlyFailure ] 4787 imported/w3c/web-platform-tests/css/css-contain/contain-paint-stacking-context-001a.html [ ImageOnlyFailure ] 4788 imported/w3c/web-platform-tests/css/css-contain/contain-paint-table-001.html [ ImageOnlyFailure ] 4789 imported/w3c/web-platform-tests/css/css-contain/contain-paint-table-002.html [ ImageOnlyFailure ] 4790 imported/w3c/web-platform-tests/css/css-contain/contain-strict-001.html [ ImageOnlyFailure ] 4791 imported/w3c/web-platform-tests/css/css-contain/contain-strict-002.html [ ImageOnlyFailure ] 4792 imported/w3c/web-platform-tests/css/css-contain/contain-strict-011.html [ ImageOnlyFailure ] 4756 webkit.org/b/233193 imported/w3c/web-platform-tests/css/css-contain/contain-strict-011.html [ ImageOnlyFailure ] 4793 4757 imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-032.html [ ImageOnlyFailure ] 4794 4758 imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-033.sub.https.html [ ImageOnlyFailure ] -
trunk/LayoutTests/imported/w3c/ChangeLog
r285861 r285885 1 2021-11-16 Rob Buis <rbuis@igalia.com> 2 3 [css-contain] Support contain:paint 4 https://bugs.webkit.org/show_bug.cgi?id=224742 5 6 Reviewed by Alan Bujtas. 7 8 Adjust test expectation now that contain: strict is supported. 9 10 * web-platform-tests/css/css-flexbox/flex-item-contains-strict-expected.txt: 11 1 12 2021-11-16 Andreu Botella <andreu@andreubotella.com> 2 13 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/flex-item-contains-strict-expected.txt
r285745 r285885 1 1 Stretched: 2 2 3 Column4 3 5 Row6 4 7 5 Column … … 10 8 Flex-start: 11 9 12 Column13 10 14 Row15 11 16 12 Column -
trunk/Source/WebCore/ChangeLog
r285883 r285885 1 2021-11-16 Rob Buis <rbuis@igalia.com> 2 3 [css-contain] Support contain:paint 4 https://bugs.webkit.org/show_bug.cgi?id=224742 5 6 Reviewed by Alan Bujtas. 7 8 This patch implements paint containment as specified[1]. 9 10 It adds shouldApplyPaintContainment to check whether the element applies for paint containment. Is so, then: 11 - an independent formatting context is established. 12 - an absolute positioning and fixed positioning containing block is established. 13 - a stacking context is created. 14 - implements clipping on the overflow clip edge. 15 16 This patch also adds effectiveOverflowX/effectiveOverflowY on RenderElement to take 17 the effect of paint containment on overflow-x/y into account. 18 19 [1] https://drafts.csswg.org/css-contain-2/#paint-containment 20 21 * page/FrameView.cpp: 22 (WebCore::FrameView::applyOverflowToViewport): 23 (WebCore::FrameView::applyPaginationToViewport): 24 (WebCore::FrameView::calculateScrollbarModesForLayout): 25 * rendering/GridTrackSizingAlgorithm.cpp: 26 (WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild const): 27 * rendering/RenderBox.cpp: 28 (WebCore::RenderBox::updateFromStyle): 29 (WebCore::RenderBox::constrainLogicalWidthInFragmentByMinMax const): 30 (WebCore::RenderBox::constrainLogicalHeightByMinMax const): 31 (WebCore::RenderBox::createsNewFormattingContext const): 32 (WebCore::RenderBox::addOverflowFromChild): 33 * rendering/RenderBoxModelObject.cpp: 34 (WebCore::RenderBoxModelObject::updateFromStyle): 35 * rendering/RenderElement.cpp: 36 (WebCore::includeNonFixedHeight): 37 (WebCore::RenderElement::effectiveOverflowX const): 38 (WebCore::RenderElement::effectiveOverflowY const): 39 * rendering/RenderElement.h: 40 (WebCore::RenderElement::effectiveOverflowInlineDirection const): 41 (WebCore::RenderElement::effectiveOverflowBlockDirection const): 42 (WebCore::RenderElement::canContainFixedPositionObjects const): 43 (WebCore::RenderElement::canContainAbsolutelyPositionedObjects const): 44 * rendering/RenderFlexibleBox.cpp: 45 (WebCore::RenderFlexibleBox::mainAxisOverflowForChild const): 46 (WebCore::RenderFlexibleBox::crossAxisOverflowForChild const): 47 * rendering/RenderFragmentContainer.cpp: 48 (WebCore::RenderFragmentContainer::overflowRectForFragmentedFlowPortion): 49 * rendering/RenderInline.h: 50 * rendering/RenderLayer.cpp: 51 (WebCore::canCreateStackingContext): 52 (WebCore::RenderLayer::shouldBeCSSStackingContext const): 53 (WebCore::RenderLayer::setAncestorChainHasSelfPaintingLayerDescendant): 54 (WebCore::RenderLayer::setAncestorChainHasVisibleDescendant): 55 (WebCore::RenderLayer::calculateClipRects const): 56 * rendering/RenderObject.cpp: 57 (WebCore::RenderObject::setPaintContainmentApplies): 58 (WebCore::RenderObject::RenderObjectRareData::RenderObjectRareData): 59 (WebCore::shouldApplyPaintContainment): 60 * rendering/RenderObject.h: 61 (WebCore::RenderObject::paintContainmentApplies const): 62 * rendering/style/RenderStyle.h: 63 (WebCore::RenderStyle::overflowY const): 64 (WebCore::RenderStyle::containsPaint const): 65 (WebCore::RenderStyle::overflowInlineDirection const): Deleted. 66 (WebCore::RenderStyle::overflowBlockDirection const): Deleted. 67 * rendering/svg/RenderSVGRoot.cpp: 68 (WebCore::RenderSVGRoot::shouldApplyViewportClip const): 69 1 70 2021-11-16 Simon Fraser <simon.fraser@apple.com> 2 71 -
trunk/Source/WebCore/page/FrameView.cpp
r285745 r285885 645 645 bool overrideHidden = frame().isMainFrame() && ((frame().frameScaleFactor() > 1) || headerHeight() || footerHeight()); 646 646 647 Overflow overflowX = renderer. style().overflowX();648 Overflow overflowY = renderer. style().overflowY();647 Overflow overflowX = renderer.effectiveOverflowX(); 648 Overflow overflowY = renderer.effectiveOverflowY(); 649 649 650 650 if (is<RenderSVGRoot>(renderer)) { … … 710 710 auto* body = document->body(); 711 711 if (body && body->renderer()) { 712 documentOrBodyRenderer = documentRenderer. style().overflowX() == Overflow::Visible && is<HTMLHtmlElement>(*documentElement) ?712 documentOrBodyRenderer = documentRenderer.effectiveOverflowX() == Overflow::Visible && is<HTMLHtmlElement>(*documentElement) ? 713 713 body->renderer() : &documentRenderer; 714 714 } 715 715 716 716 Pagination pagination; 717 Overflow overflowY = documentOrBodyRenderer-> style().overflowY();717 Overflow overflowY = documentOrBodyRenderer->effectiveOverflowY(); 718 718 if (overflowY == Overflow::PagedX || overflowY == Overflow::PagedY) { 719 719 pagination.mode = WebCore::paginationModeForRenderStyle(documentOrBodyRenderer->style()); … … 777 777 // It's sufficient to just check the X overflow, 778 778 // since it's illegal to have visible in only one direction. 779 if (rootRenderer-> style().overflowX() == Overflow::Visible && is<HTMLHtmlElement>(documentElement)) {779 if (rootRenderer->effectiveOverflowX() == Overflow::Visible && is<HTMLHtmlElement>(documentElement)) { 780 780 auto* bodyRenderer = bodyOrFrameset->renderer(); 781 781 if (bodyRenderer) { -
trunk/Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp
r285745 r285885 847 847 848 848 const Length& childMinSize = isRowAxis ? child.style().logicalMinWidth() : child.style().logicalMinHeight(); 849 bool overflowIsVisible = isRowAxis ? child. style().overflowInlineDirection() == Overflow::Visible : child.style().overflowBlockDirection() == Overflow::Visible;849 bool overflowIsVisible = isRowAxis ? child.effectiveOverflowInlineDirection() == Overflow::Visible : child.effectiveOverflowBlockDirection() == Overflow::Visible; 850 850 LayoutUnit baselineShim = m_algorithm.baselineOffsetForChild(child, gridAxisForDirection(direction())); 851 851 -
trunk/Source/WebCore/rendering/RenderBox.cpp
r285745 r285885 488 488 489 489 // We also handle <body> and <html>, whose overflow applies to the viewport. 490 if (!( styleToUse.overflowX() == Overflow::Visible && styleToUse.overflowY() == Overflow::Visible) && !isDocElementRenderer && isRenderBlock()) {490 if (!(effectiveOverflowX() == Overflow::Visible && effectiveOverflowY() == Overflow::Visible) && !isDocElementRenderer && isRenderBlock()) { 491 491 bool boxHasNonVisibleOverflow = true; 492 492 if (isBody()) { … … 497 497 if (is<HTMLHtmlElement>(*document().documentElement()) 498 498 && document().body() == element() 499 && document().documentElement()->renderer()-> style().overflowX() == Overflow::Visible) {499 && document().documentElement()->renderer()->effectiveOverflowX() == Overflow::Visible) { 500 500 boxHasNonVisibleOverflow = false; 501 501 } … … 667 667 return logicalWidth; 668 668 auto minLength = styleToUse.logicalMinWidth(); 669 if (styleToUse.hasAspectRatio() && minLength.isAuto() && (styleToUse.logicalWidth().isAuto() || styleToUse.logicalWidth().isMinContent() || styleToUse.logicalWidth().isMaxContent()) && styleToUse.overflowInlineDirection() == Overflow::Visible) {669 if (styleToUse.hasAspectRatio() && minLength.isAuto() && (styleToUse.logicalWidth().isAuto() || styleToUse.logicalWidth().isMinContent() || styleToUse.logicalWidth().isMaxContent()) && effectiveOverflowInlineDirection() == Overflow::Visible) { 670 670 // Make sure we actually used the aspect ratio. 671 671 if (shouldComputeLogicalWidthFromAspectRatio()) … … 683 683 } 684 684 auto logicalMinHeight = styleToUse.logicalMinHeight(); 685 if (logicalMinHeight.isAuto() && shouldComputeLogicalHeightFromAspectRatio() && intrinsicContentHeight && styleToUse.overflowBlockDirection() == Overflow::Visible) {685 if (logicalMinHeight.isAuto() && shouldComputeLogicalHeightFromAspectRatio() && intrinsicContentHeight && effectiveOverflowBlockDirection() == Overflow::Visible) { 686 686 auto heightFromAspectRatio = blockSizeFromAspectRatio(horizontalBorderAndPaddingExtent(), verticalBorderAndPaddingExtent(), LayoutUnit(style().logicalAspectRatio()), style().boxSizingForAspectRatio(), logicalWidth()) - borderAndPaddingLogicalHeight(); 687 687 if (firstChild()) … … 4907 4907 return isInlineBlockOrInlineTable() || isFloatingOrOutOfFlowPositioned() || hasPotentiallyScrollableOverflow() || isFlexItemIncludingDeprecated() 4908 4908 || isTableCell() || isTableCaption() || isFieldset() || isWritingModeRoot() || isDocumentElementRenderer() || isRenderFragmentedFlow() 4909 || style().containsLayout() || isGridItem() || style().specifiesColumns() || style().columnSpan() == ColumnSpan::All || style().display() == DisplayType::FlowRoot;4909 || style().containsLayout() || paintContainmentApplies() || isGridItem() || style().specifiesColumns() || style().columnSpan() == ColumnSpan::All || style().display() == DisplayType::FlowRoot; 4910 4910 } 4911 4911 … … 4975 4975 void RenderBox::addOverflowFromChild(const RenderBox* child, const LayoutSize& delta) 4976 4976 { 4977 if (paintContainmentApplies()) 4978 return; 4977 4979 // Never allow flow threads to propagate overflow up to a parent. 4978 4980 if (child->isRenderFragmentedFlow()) -
trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp
r285745 r285885 212 212 if (styleToUse.isFlippedBlocksWritingMode()) 213 213 view().frameView().setHasFlippedBlockRenderers(true); 214 setPaintContainmentApplies(shouldApplyPaintContainment(*this)); 214 215 } 215 216 -
trunk/Source/WebCore/rendering/RenderElement.cpp
r285745 r285885 2318 2318 // For fixed height styles, if the overflow size of the element spills out of the specified 2319 2319 // height, assume we can apply text auto-sizing. 2320 if ( style.overflowY() == Overflow::Visible2320 if (downcast<RenderBlock>(renderer).effectiveOverflowY() == Overflow::Visible 2321 2321 && style.height().value() < downcast<RenderBlock>(renderer).layoutOverflowRect().maxY()) 2322 2322 return RenderObject::OverflowHeight; … … 2408 2408 } 2409 2409 2410 } 2410 Overflow RenderElement::effectiveOverflowX() const 2411 { 2412 auto overflowX = style().overflowX(); 2413 if (paintContainmentApplies() && overflowX == Overflow::Visible) 2414 return Overflow::Clip; 2415 return overflowX; 2416 } 2417 2418 Overflow RenderElement::effectiveOverflowY() const 2419 { 2420 auto overflowY = style().overflowY(); 2421 if (paintContainmentApplies() && overflowY == Overflow::Visible) 2422 return Overflow::Clip; 2423 return overflowY; 2424 } 2425 2426 } -
trunk/Source/WebCore/rendering/RenderElement.h
r285745 r285885 269 269 ReferencedSVGResources& ensureReferencedSVGResources(); 270 270 271 Overflow effectiveOverflowX() const; 272 Overflow effectiveOverflowY() const; 273 Overflow effectiveOverflowInlineDirection() const { return style().isHorizontalWritingMode() ? effectiveOverflowX() : effectiveOverflowY(); } 274 Overflow effectiveOverflowBlockDirection() const { return style().isHorizontalWritingMode() ? effectiveOverflowY() : effectiveOverflowX(); } 275 271 276 protected: 272 277 enum BaseTypeFlag { … … 457 462 || (isRenderBlock() && style().willChange() && style().willChange()->createsContainingBlockForOutOfFlowPositioned()) 458 463 || isSVGForeignObject() 459 || shouldApplyLayoutContainment(*this); 464 || shouldApplyLayoutContainment(*this) 465 || shouldApplyPaintContainment(*this); 460 466 } 461 467 … … 468 474 || isSVGForeignObject() 469 475 || shouldApplyLayoutContainment(*this) 476 || shouldApplyPaintContainment(*this) 470 477 || isRenderView(); 471 478 } -
trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp
r285745 r285885 1845 1845 { 1846 1846 if (isHorizontalFlow()) 1847 return child. style().overflowX();1848 return child. style().overflowY();1847 return child.effectiveOverflowX(); 1848 return child.effectiveOverflowY(); 1849 1849 } 1850 1850 … … 1852 1852 { 1853 1853 if (isHorizontalFlow()) 1854 return child. style().overflowY();1855 return child. style().overflowX();1854 return child.effectiveOverflowY(); 1855 return child.effectiveOverflowX(); 1856 1856 } 1857 1857 -
trunk/Source/WebCore/rendering/RenderFragmentContainer.cpp
r285745 r285885 158 158 LayoutUnit minY = isFirstPortion ? fragmentedFlowOverflow.y() : fragmentedFlowPortionRect.y(); 159 159 LayoutUnit maxY = isLastPortion ? std::max(fragmentedFlowPortionRect.maxY(), fragmentedFlowOverflow.maxY()) : fragmentedFlowPortionRect.maxY(); 160 bool clipX = style().overflowX() != Overflow::Visible;160 bool clipX = effectiveOverflowX() != Overflow::Visible; 161 161 LayoutUnit minX = clipX ? fragmentedFlowPortionRect.x() : std::min(fragmentedFlowPortionRect.x(), fragmentedFlowOverflow.x()); 162 162 LayoutUnit maxX = clipX ? fragmentedFlowPortionRect.maxX() : std::max(fragmentedFlowPortionRect.maxX(), fragmentedFlowOverflow.maxX()); … … 165 165 LayoutUnit minX = isFirstPortion ? fragmentedFlowOverflow.x() : fragmentedFlowPortionRect.x(); 166 166 LayoutUnit maxX = isLastPortion ? std::max(fragmentedFlowPortionRect.maxX(), fragmentedFlowOverflow.maxX()) : fragmentedFlowPortionRect.maxX(); 167 bool clipY = style().overflowY() != Overflow::Visible;167 bool clipY = effectiveOverflowY() != Overflow::Visible; 168 168 LayoutUnit minY = clipY ? fragmentedFlowPortionRect.y() : std::min(fragmentedFlowPortionRect.y(), fragmentedFlowOverflow.y()); 169 169 LayoutUnit maxY = clipY ? fragmentedFlowPortionRect.maxY() : std::max(fragmentedFlowPortionRect.y(), fragmentedFlowOverflow.maxY()); -
trunk/Source/WebCore/rendering/RenderInline.h
r285745 r285885 83 83 bool mayAffectLayout() const; 84 84 85 bool requiresLayer() const override { return isInFlowPositioned() || createsGroup() || hasClipPath() || willChangeCreatesStackingContext() || hasRunningAcceleratedAnimations(); }85 bool requiresLayer() const override { return isInFlowPositioned() || createsGroup() || hasClipPath() || shouldApplyPaintContainment(*this) || willChangeCreatesStackingContext() || hasRunningAcceleratedAnimations(); } 86 86 87 87 protected: -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r285745 r285885 557 557 || renderer.hasReflection() 558 558 || renderer.style().hasIsolation() 559 || shouldApplyPaintContainment(renderer) 559 560 || !renderer.style().hasAutoUsedZIndex() 560 561 || (renderer.style().willChange() && renderer.style().willChange()->canCreateStackingContext()) … … 588 589 bool RenderLayer::shouldBeCSSStackingContext() const 589 590 { 590 return !renderer().style().hasAutoUsedZIndex() || isRenderViewLayer();591 return !renderer().style().hasAutoUsedZIndex() || shouldApplyPaintContainment(renderer()) || isRenderViewLayer(); 591 592 } 592 593 … … 1090 1091 { 1091 1092 for (RenderLayer* layer = this; layer; layer = layer->parent()) { 1093 if (shouldApplyPaintContainment(renderer())) { 1094 m_hasSelfPaintingLayerDescendant = true; 1095 m_hasSelfPaintingLayerDescendantDirty = false; 1096 break; 1097 } 1092 1098 if (!layer->m_hasSelfPaintingLayerDescendantDirty && layer->hasSelfPaintingLayerDescendant()) 1093 1099 break; … … 1490 1496 { 1491 1497 for (RenderLayer* layer = this; layer; layer = layer->parent()) { 1498 if (shouldApplyPaintContainment(renderer())) { 1499 m_hasVisibleDescendant = true; 1500 m_visibleDescendantStatusDirty = false; 1501 break; 1502 } 1492 1503 if (!layer->m_visibleDescendantStatusDirty && layer->hasVisibleDescendant()) 1493 1504 break; … … 4530 4541 if (renderer().isPositioned()) 4531 4542 clipRects.setPosClipRect(intersection(newOverflowClip, clipRects.posClipRect())); 4543 if (shouldApplyPaintContainment(renderer())) { 4544 clipRects.setPosClipRect(intersection(newOverflowClip, clipRects.posClipRect())); 4545 clipRects.setFixedClipRect(intersection(newOverflowClip, clipRects.fixedClipRect())); 4546 } 4532 4547 } 4533 4548 if (renderer().hasClip()) { -
trunk/Source/WebCore/rendering/RenderObject.cpp
r285854 r285885 1920 1920 } 1921 1921 1922 void RenderObject::setPaintContainmentApplies(bool paintContainmentApplies) 1923 { 1924 if (paintContainmentApplies || hasRareData()) 1925 ensureRareData().setPaintContainmentApplies(paintContainmentApplies); 1926 } 1927 1922 1928 RenderObject::RareDataMap& RenderObject::rareDataMap() 1923 1929 { … … 1948 1954 , m_isRenderFragmentedFlow(false) 1949 1955 , m_hasOutlineAutoAncestor(false) 1956 , m_paintContainmentApplies(false) 1950 1957 { 1951 1958 } … … 2547 2554 return (!renderer.isInline() || renderer.isAtomicInlineLevelBox()) && !renderer.isRubyText() && (!renderer.isTablePart() || renderer.isTableCaption()) && !renderer.isTable(); 2548 2555 } 2556 2557 bool WebCore::shouldApplyPaintContainment(const WebCore::RenderObject& renderer) 2558 { 2559 return renderer.style().containsPaint() && (!renderer.isInline() || renderer.isAtomicInlineLevelBox()) && !renderer.isRubyText() && (!renderer.isTablePart() || renderer.isRenderBlockFlow()); 2560 } 2561 -
trunk/Source/WebCore/rendering/RenderObject.h
r285745 r285885 409 409 bool isRenderFragmentedFlow() const { return m_bitfields.hasRareData() && rareData().isRenderFragmentedFlow(); } 410 410 bool hasOutlineAutoAncestor() const { return m_bitfields.hasRareData() && rareData().hasOutlineAutoAncestor(); } 411 bool paintContainmentApplies() const { return m_bitfields.hasRareData() && rareData().paintContainmentApplies(); } 411 412 412 413 bool isExcludedFromNormalLayout() const { return m_bitfields.isExcludedFromNormalLayout(); } … … 506 507 void setIsRenderFragmentedFlow(bool = true); 507 508 void setHasOutlineAutoAncestor(bool = true); 509 void setPaintContainmentApplies(bool = true); 508 510 509 511 // Hook so that RenderTextControl can return the line height of its inner renderer. … … 936 938 ADD_BOOLEAN_BITFIELD(isRenderFragmentedFlow, IsRenderFragmentedFlow); 937 939 ADD_BOOLEAN_BITFIELD(hasOutlineAutoAncestor, HasOutlineAutoAncestor); 940 ADD_BOOLEAN_BITFIELD(paintContainmentApplies, PaintContainmentApplies); 938 941 939 942 // From RenderElement … … 1210 1213 bool shouldApplySizeContainment(const RenderObject&); 1211 1214 bool shouldApplyStyleContainment(const RenderObject&); 1215 bool shouldApplyPaintContainment(const RenderObject&); 1212 1216 1213 1217 } // namespace WebCore -
trunk/Source/WebCore/rendering/style/RenderStyle.h
r285822 r285885 333 333 Overflow overflowX() const { return static_cast<Overflow>(m_nonInheritedFlags.overflowX); } 334 334 Overflow overflowY() const { return static_cast<Overflow>(m_nonInheritedFlags.overflowY); } 335 Overflow overflowInlineDirection() const { return isHorizontalWritingMode() ? overflowX() : overflowY(); }336 Overflow overflowBlockDirection() const { return isHorizontalWritingMode() ? overflowY() : overflowX(); }337 335 bool isOverflowVisible() const { return overflowX() == Overflow::Visible || overflowY() == Overflow::Visible; } 338 336 … … 534 532 bool containsSize() const { return m_rareNonInheritedData->contain.contains(Containment::Size); } 535 533 bool containsStyle() const { return m_rareNonInheritedData->contain.contains(Containment::Style); } 534 bool containsPaint() const { return m_rareNonInheritedData->contain.contains(Containment::Paint); } 536 535 BoxAlignment boxAlign() const { return static_cast<BoxAlignment>(m_rareNonInheritedData->deprecatedFlexibleBox->align); } 537 536 BoxDirection boxDirection() const { return static_cast<BoxDirection>(m_inheritedFlags.boxDirection); } -
trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp
r285745 r285885 216 216 // When the svg is stand-alone (isDocumentElement() == true) the viewport clipping should always 217 217 // be applied, noting that the window scrollbars should be hidden if overflow=hidden. 218 return style().overflowX() == Overflow::Hidden218 return effectiveOverflowX() == Overflow::Hidden 219 219 || style().overflowX() == Overflow::Auto 220 220 || style().overflowX() == Overflow::Scroll
Note:
See TracChangeset
for help on using the changeset viewer.