Changeset 285583 in webkit
- Timestamp:
- Nov 10, 2021 9:24:42 AM (8 months 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) (2 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
r285571 r285583 1 2021-11-10 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-10 Enrique Ocaña González <eocanha@igalia.com> 2 13 -
trunk/LayoutTests/TestExpectations
r285505 r285583 4740 4740 # webkit-ruby-text 4741 4741 imported/w3c/web-platform-tests/css/css-contain/contain-layout-017.html [ ImageOnlyFailure ] 4742 imported/w3c/web-platform-tests/css/css-contain/contain-paint-005.html [ ImageOnlyFailure ] 4743 imported/w3c/web-platform-tests/css/css-contain/contain-paint-006.html [ ImageOnlyFailure ] 4744 imported/w3c/web-platform-tests/css/css-contain/contain-paint-008.html [ ImageOnlyFailure ] 4745 imported/w3c/web-platform-tests/css/css-contain/contain-paint-021.html [ ImageOnlyFailure ] 4742 4746 imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-001.html [ ImageOnlyFailure ] 4743 4747 imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-003.html [ ImageOnlyFailure ] … … 4754 4758 imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-021.html [ ImageOnlyFailure ] 4755 4759 imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-022.html [ ImageOnlyFailure ] 4756 imported/w3c/web-platform-tests/css/css-contain/contain-paint-001.html [ ImageOnlyFailure ]4757 imported/w3c/web-platform-tests/css/css-contain/contain-paint-004.html [ ImageOnlyFailure ]4758 imported/w3c/web-platform-tests/css/css-contain/contain-paint-005.html [ ImageOnlyFailure ]4759 imported/w3c/web-platform-tests/css/css-contain/contain-paint-006.html [ ImageOnlyFailure ]4760 imported/w3c/web-platform-tests/css/css-contain/contain-paint-008.html [ ImageOnlyFailure ]4761 imported/w3c/web-platform-tests/css/css-contain/contain-paint-009.html [ ImageOnlyFailure ]4762 imported/w3c/web-platform-tests/css/css-contain/contain-paint-010.html [ ImageOnlyFailure ]4763 imported/w3c/web-platform-tests/css/css-contain/contain-paint-014.html [ ImageOnlyFailure ]4764 imported/w3c/web-platform-tests/css/css-contain/contain-paint-019.html [ ImageOnlyFailure ]4765 imported/w3c/web-platform-tests/css/css-contain/contain-paint-020.html [ ImageOnlyFailure ]4766 imported/w3c/web-platform-tests/css/css-contain/contain-paint-022.html [ ImageOnlyFailure ]4767 imported/w3c/web-platform-tests/css/css-contain/contain-paint-023.html [ ImageOnlyFailure ]4768 imported/w3c/web-platform-tests/css/css-contain/contain-paint-047.html [ ImageOnlyFailure ]4769 imported/w3c/web-platform-tests/css/css-contain/contain-paint-048.html [ ImageOnlyFailure ]4770 imported/w3c/web-platform-tests/css/css-contain/contain-paint-cell-001.html [ ImageOnlyFailure ]4771 imported/w3c/web-platform-tests/css/css-contain/contain-paint-cell-002.html [ ImageOnlyFailure ]4772 imported/w3c/web-platform-tests/css/css-contain/contain-paint-clip-001.html [ ImageOnlyFailure ]4773 imported/w3c/web-platform-tests/css/css-contain/contain-paint-clip-002.html [ ImageOnlyFailure ]4774 imported/w3c/web-platform-tests/css/css-contain/contain-paint-clip-006.html [ ImageOnlyFailure ]4775 imported/w3c/web-platform-tests/css/css-contain/contain-paint-clip-011.html [ ImageOnlyFailure ]4776 imported/w3c/web-platform-tests/css/css-contain/contain-paint-clip-012.html [ ImageOnlyFailure ]4777 imported/w3c/web-platform-tests/css/css-contain/contain-paint-clip-013.html [ ImageOnlyFailure ]4778 imported/w3c/web-platform-tests/css/css-contain/contain-paint-clip-014.html [ ImageOnlyFailure ]4779 4760 imported/w3c/web-platform-tests/css/css-contain/contain-paint-clip-015.html [ ImageOnlyFailure ] 4780 4761 imported/w3c/web-platform-tests/css/css-contain/contain-paint-clip-016.html [ ImageOnlyFailure ] 4781 imported/w3c/web-platform-tests/css/css-contain/contain-paint-clip-017.html [ ImageOnlyFailure ]4782 imported/w3c/web-platform-tests/css/css-contain/contain-paint-clip-018.html [ ImageOnlyFailure ]4783 imported/w3c/web-platform-tests/css/css-contain/contain-paint-clip-019.html [ ImageOnlyFailure ]4784 imported/w3c/web-platform-tests/css/css-contain/contain-paint-containing-block-absolute-001.html [ ImageOnlyFailure ]4785 imported/w3c/web-platform-tests/css/css-contain/contain-paint-containing-block-fixed-001.html [ ImageOnlyFailure ]4786 imported/w3c/web-platform-tests/css/css-contain/contain-paint-formatting-context-float-001.html [ ImageOnlyFailure ]4787 imported/w3c/web-platform-tests/css/css-contain/contain-paint-formatting-context-margin-001.html [ ImageOnlyFailure ]4788 imported/w3c/web-platform-tests/css/css-contain/contain-paint-ifc-011.html [ ImageOnlyFailure ]4789 imported/w3c/web-platform-tests/css/css-contain/contain-paint-independent-formatting-context-001.html [ ImageOnlyFailure ]4790 imported/w3c/web-platform-tests/css/css-contain/contain-paint-size-001.html [ ImageOnlyFailure ]4791 imported/w3c/web-platform-tests/css/css-contain/contain-paint-size-002.html [ ImageOnlyFailure ]4792 imported/w3c/web-platform-tests/css/css-contain/contain-paint-size-003.html [ ImageOnlyFailure ]4793 imported/w3c/web-platform-tests/css/css-contain/contain-paint-stacking-context-001a.html [ ImageOnlyFailure ]4794 imported/w3c/web-platform-tests/css/css-contain/contain-paint-table-001.html [ ImageOnlyFailure ]4795 imported/w3c/web-platform-tests/css/css-contain/contain-paint-table-002.html [ ImageOnlyFailure ]4796 imported/w3c/web-platform-tests/css/css-contain/contain-strict-001.html [ ImageOnlyFailure ]4797 imported/w3c/web-platform-tests/css/css-contain/contain-strict-002.html [ ImageOnlyFailure ]4798 imported/w3c/web-platform-tests/css/css-contain/contain-strict-011.html [ ImageOnlyFailure ]4799 4762 imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-032.html [ ImageOnlyFailure ] 4800 4763 imported/w3c/web-platform-tests/css/css-contain/content-visibility/content-visibility-033.sub.https.html [ ImageOnlyFailure ] -
trunk/LayoutTests/imported/w3c/ChangeLog
r285577 r285583 1 2021-11-10 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-10 Youenn Fablet <youenn@apple.com> 2 13 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/flex-item-contains-strict-expected.txt
r277321 r285583 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
r285577 r285583 1 2021-11-10 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::shouldApplyPaintContainment): 59 * rendering/RenderObject.h: 60 (WebCore::RenderObject::paintContainmentApplies const): 61 * rendering/style/RenderStyle.h: 62 (WebCore::RenderStyle::overflowY const): 63 (WebCore::RenderStyle::containsPaint const): 64 (WebCore::RenderStyle::overflowInlineDirection const): Deleted. 65 (WebCore::RenderStyle::overflowBlockDirection const): Deleted. 66 * rendering/svg/RenderSVGRoot.cpp: 67 (WebCore::RenderSVGRoot::shouldApplyViewportClip const): 68 1 69 2021-11-10 Youenn Fablet <youenn@apple.com> and Victor M. Jaquez L. <vjaquez@igalia.com> 2 70 -
trunk/Source/WebCore/page/FrameView.cpp
r285528 r285583 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
r284793 r285583 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
r285495 r285583 484 484 485 485 // We also handle <body> and <html>, whose overflow applies to the viewport. 486 if (!( styleToUse.overflowX() == Overflow::Visible && styleToUse.overflowY() == Overflow::Visible) && !isDocElementRenderer && isRenderBlock()) {486 if (!(effectiveOverflowX() == Overflow::Visible && effectiveOverflowY() == Overflow::Visible) && !isDocElementRenderer && isRenderBlock()) { 487 487 bool boxHasNonVisibleOverflow = true; 488 488 if (isBody()) { … … 493 493 if (is<HTMLHtmlElement>(*document().documentElement()) 494 494 && document().body() == element() 495 && document().documentElement()->renderer()-> style().overflowX() == Overflow::Visible) {495 && document().documentElement()->renderer()->effectiveOverflowX() == Overflow::Visible) { 496 496 boxHasNonVisibleOverflow = false; 497 497 } … … 663 663 return logicalWidth; 664 664 auto minLength = styleToUse.logicalMinWidth(); 665 if (styleToUse.hasAspectRatio() && minLength.isAuto() && (styleToUse.logicalWidth().isAuto() || styleToUse.logicalWidth().isMinContent() || styleToUse.logicalWidth().isMaxContent()) && styleToUse.overflowInlineDirection() == Overflow::Visible) {665 if (styleToUse.hasAspectRatio() && minLength.isAuto() && (styleToUse.logicalWidth().isAuto() || styleToUse.logicalWidth().isMinContent() || styleToUse.logicalWidth().isMaxContent()) && effectiveOverflowInlineDirection() == Overflow::Visible) { 666 666 // Make sure we actually used the aspect ratio. 667 667 if (shouldComputeLogicalWidthFromAspectRatio()) … … 679 679 } 680 680 auto logicalMinHeight = styleToUse.logicalMinHeight(); 681 if (logicalMinHeight.isAuto() && shouldComputeLogicalHeightFromAspectRatio() && intrinsicContentHeight && styleToUse.overflowBlockDirection() == Overflow::Visible) {681 if (logicalMinHeight.isAuto() && shouldComputeLogicalHeightFromAspectRatio() && intrinsicContentHeight && effectiveOverflowBlockDirection() == Overflow::Visible) { 682 682 auto heightFromAspectRatio = blockSizeFromAspectRatio(horizontalBorderAndPaddingExtent(), verticalBorderAndPaddingExtent(), LayoutUnit(style().logicalAspectRatio()), style().boxSizingForAspectRatio(), logicalWidth()) - borderAndPaddingLogicalHeight(); 683 683 if (firstChild()) … … 4849 4849 return isInlineBlockOrInlineTable() || isFloatingOrOutOfFlowPositioned() || hasPotentiallyScrollableOverflow() || isFlexItemIncludingDeprecated() 4850 4850 || isTableCell() || isTableCaption() || isFieldset() || isWritingModeRoot() || isDocumentElementRenderer() || isRenderFragmentedFlow() 4851 || style().containsLayout() || isGridItem() || style().specifiesColumns() || style().columnSpan() == ColumnSpan::All || style().display() == DisplayType::FlowRoot;4851 || style().containsLayout() || paintContainmentApplies() || isGridItem() || style().specifiesColumns() || style().columnSpan() == ColumnSpan::All || style().display() == DisplayType::FlowRoot; 4852 4852 } 4853 4853 … … 4917 4917 void RenderBox::addOverflowFromChild(const RenderBox* child, const LayoutSize& delta) 4918 4918 { 4919 if (paintContainmentApplies()) 4920 return; 4919 4921 // Never allow flow threads to propagate overflow up to a parent. 4920 4922 if (child->isRenderFragmentedFlow()) -
trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp
r284437 r285583 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
r284857 r285583 2321 2321 // For fixed height styles, if the overflow size of the element spills out of the specified 2322 2322 // height, assume we can apply text auto-sizing. 2323 if ( style.overflowY() == Overflow::Visible2323 if (downcast<RenderBlock>(renderer).effectiveOverflowY() == Overflow::Visible 2324 2324 && style.height().value() < downcast<RenderBlock>(renderer).layoutOverflowRect().maxY()) 2325 2325 return RenderObject::OverflowHeight; … … 2411 2411 } 2412 2412 2413 } 2413 Overflow RenderElement::effectiveOverflowX() const 2414 { 2415 auto overflowX = style().overflowX(); 2416 if (paintContainmentApplies() && overflowX == Overflow::Visible) 2417 return Overflow::Clip; 2418 return overflowX; 2419 } 2420 2421 Overflow RenderElement::effectiveOverflowY() const 2422 { 2423 auto overflowY = style().overflowY(); 2424 if (paintContainmentApplies() && overflowY == Overflow::Visible) 2425 return Overflow::Clip; 2426 return overflowY; 2427 } 2428 2429 } -
trunk/Source/WebCore/rendering/RenderElement.h
r283079 r285583 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
r285045 r285583 1806 1806 { 1807 1807 if (isHorizontalFlow()) 1808 return child. style().overflowX();1809 return child. style().overflowY();1808 return child.effectiveOverflowX(); 1809 return child.effectiveOverflowY(); 1810 1810 } 1811 1811 … … 1813 1813 { 1814 1814 if (isHorizontalFlow()) 1815 return child. style().overflowY();1816 return child. style().overflowX();1815 return child.effectiveOverflowY(); 1816 return child.effectiveOverflowX(); 1817 1817 } 1818 1818 -
trunk/Source/WebCore/rendering/RenderFragmentContainer.cpp
r280017 r285583 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
r283367 r285583 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
r285570 r285583 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
r284642 r285583 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 { … … 2547 2553 return (!renderer.isInline() || renderer.isAtomicInlineLevelBox()) && !renderer.isRubyText() && (!renderer.isTablePart() || renderer.isTableCaption()) && !renderer.isTable(); 2548 2554 } 2555 2556 bool WebCore::shouldApplyPaintContainment(const WebCore::RenderObject& renderer) 2557 { 2558 return renderer.style().containsPaint() && (!renderer.isInline() || renderer.isAtomicInlineLevelBox()) && !renderer.isRubyText() && (!renderer.isTablePart() || renderer.isRenderBlockFlow()); 2559 } 2560 -
trunk/Source/WebCore/rendering/RenderObject.h
r284642 r285583 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
r285423 r285583 332 332 Overflow overflowX() const { return static_cast<Overflow>(m_nonInheritedFlags.overflowX); } 333 333 Overflow overflowY() const { return static_cast<Overflow>(m_nonInheritedFlags.overflowY); } 334 Overflow overflowInlineDirection() const { return isHorizontalWritingMode() ? overflowX() : overflowY(); }335 Overflow overflowBlockDirection() const { return isHorizontalWritingMode() ? overflowY() : overflowX(); }336 334 bool isOverflowVisible() const { return overflowX() == Overflow::Visible || overflowY() == Overflow::Visible; } 337 335 … … 533 531 bool containsSize() const { return m_rareNonInheritedData->contain.contains(Containment::Size); } 534 532 bool containsStyle() const { return m_rareNonInheritedData->contain.contains(Containment::Style); } 533 bool containsPaint() const { return m_rareNonInheritedData->contain.contains(Containment::Paint); } 535 534 BoxAlignment boxAlign() const { return static_cast<BoxAlignment>(m_rareNonInheritedData->deprecatedFlexibleBox->align); } 536 535 BoxDirection boxDirection() const { return static_cast<BoxDirection>(m_inheritedFlags.boxDirection); } -
trunk/Source/WebCore/rendering/svg/RenderSVGRoot.cpp
r283851 r285583 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.