WebKit Bugzilla
Attachment 373299 Details for
Bug 199344
: RenderObject::absoluteClippedOverflowRect() should not be affected by whether composited scrolling is enabled
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch
bug-199344-20190701171108.patch.txt (text/plain), 74.79 KB, created by
Tim Horton
on 2019-07-01 18:58:52 PDT
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Tim Horton
Created:
2019-07-01 18:58:52 PDT
Size:
74.79 KB
patch
obsolete
>Subversion Revision: 247025 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index bd449d0600998620c1ea9cf8be30083af77dddc8..832f65793dd5e61f16312a79c89a9dc9511295db 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,108 @@ >+2019-07-01 Simon Fraser <simon.fraser@apple.com> >+ >+ RenderObject::absoluteClippedOverflowRect() should not be affected by whether composited scrolling is enabled >+ https://bugs.webkit.org/show_bug.cgi?id=199344 >+ >+ Reviewed by Tim Horton. >+ >+ Test: fast/text/mark-matches-overflow-clip-async-scrolling.html >+ >+ absoluteClippedOverflowRect() uses the repaint code path, and repainting behavior is affected >+ by whether overflow:scroll is composited (because you don't want to clip repaints in the scrolled >+ content to the bounds of the overflow:scroll element). >+ >+ So plumb some VisibleRectOptions bits through the repaint functions, which end up feeding >+ into VisibleRectContext which solved part of this problem for Intersection Observer. >+ absoluteClippedOverflowRect() then sets the VisibleRectOption::ApplyCompositedClips bit. >+ >+ To be less verbose, move VisibleRectOptions and VisibleRectContext out of RenderObject (SVG code uses >+ it too). >+ >+ * dom/Document.cpp: >+ (WebCore::computeClippedRectInRootContentsSpace): >+ (WebCore::computeIntersectionState): >+ * dom/Range.cpp: >+ (WebCore::Range::borderAndTextRects const): >+ * rendering/LayoutRepainter.cpp: >+ (WebCore::LayoutRepainter::LayoutRepainter): >+ * rendering/RenderBox.cpp: >+ (WebCore::RenderBox::applyCachedClipAndScrollPosition const): >+ (WebCore::RenderBox::clippedOverflowRectForRepaint const): >+ (WebCore::RenderBox::computeVisibleRectInContainer const): >+ * rendering/RenderBox.h: >+ * rendering/RenderElement.cpp: >+ (WebCore::RenderElement::repaintAfterLayoutIfNeeded): >+ * rendering/RenderFrameSet.cpp: >+ (WebCore::RenderFrameSet::layout): >+ * rendering/RenderInline.cpp: >+ (WebCore::RenderInline::clippedOverflowRectForRepaint const): >+ (WebCore::RenderInline::computeVisibleRectInContainer const): >+ * rendering/RenderInline.h: >+ * rendering/RenderLayer.cpp: >+ (WebCore::RenderLayer::updateLayerPositionsAfterScroll): >+ (WebCore::RenderLayer::scrollTo): >+ (WebCore::RenderLayer::calculateClipRects const): >+ * rendering/RenderLayerModelObject.cpp: >+ (WebCore::RepaintLayoutRects::RepaintLayoutRects): >+ * rendering/RenderLineBreak.h: >+ * rendering/RenderObject.cpp: >+ (WebCore::RenderObject::repaintSlowRepaintObject const): >+ (WebCore::RenderObject::rectWithOutlineForRepaint const): >+ (WebCore::RenderObject::clippedOverflowRectForRepaint const): >+ (WebCore::RenderObject::absoluteClippedOverflowRect const): >+ (WebCore::RenderObject::pixelSnappedAbsoluteClippedOverflowRect const): >+ (WebCore::RenderObject::computeRectForRepaint const): >+ (WebCore::RenderObject::computeFloatRectForRepaint const): >+ (WebCore::RenderObject::computeVisibleRectInContainer const): >+ (WebCore::RenderObject::computeFloatVisibleRectInContainer const): >+ * rendering/RenderObject.h: >+ (WebCore::visibleRectOptionsForRepaint): >+ (WebCore::visibleRectOptionsForClipGeometry): >+ (WebCore::RenderObject::absoluteClippedOverflowRect const): Deleted. >+ (WebCore::RenderObject::computeAbsoluteRepaintRect const): Deleted. >+ (WebCore::RenderObject::VisibleRectContext::VisibleRectContext): Deleted. >+ (WebCore::RenderObject::visibleRectContextForRepaint): Deleted. >+ * rendering/RenderReplaced.cpp: >+ (WebCore::RenderReplaced::clippedOverflowRectForRepaint const): >+ * rendering/RenderReplaced.h: >+ * rendering/RenderTableCell.cpp: >+ (WebCore::RenderTableCell::clippedOverflowRectForRepaint const): >+ (WebCore::RenderTableCell::computeVisibleRectInContainer const): >+ * rendering/RenderTableCell.h: >+ * rendering/RenderTableCol.cpp: >+ (WebCore::RenderTableCol::clippedOverflowRectForRepaint const): >+ * rendering/RenderTableCol.h: >+ * rendering/RenderTableRow.cpp: >+ (WebCore::RenderTableRow::clippedOverflowRectForRepaint const): >+ * rendering/RenderTableRow.h: >+ * rendering/RenderText.cpp: >+ (WebCore::RenderText::clippedOverflowRectForRepaint const): >+ * rendering/RenderText.h: >+ * rendering/RenderView.cpp: >+ (WebCore::RenderView::computeVisibleRectInContainer const): >+ * rendering/svg/RenderSVGForeignObject.cpp: >+ (WebCore::RenderSVGForeignObject::clippedOverflowRectForRepaint const): >+ * rendering/svg/RenderSVGForeignObject.h: >+ * rendering/svg/RenderSVGGradientStop.h: >+ * rendering/svg/RenderSVGHiddenContainer.h: >+ * rendering/svg/RenderSVGInline.cpp: >+ (WebCore::RenderSVGInline::clippedOverflowRectForRepaint const): >+ * rendering/svg/RenderSVGInline.h: >+ * rendering/svg/RenderSVGModelObject.cpp: >+ (WebCore::RenderSVGModelObject::clippedOverflowRectForRepaint const): >+ * rendering/svg/RenderSVGModelObject.h: >+ * rendering/svg/RenderSVGRoot.cpp: >+ (WebCore::RenderSVGRoot::clippedOverflowRectForRepaint const): >+ (WebCore::RenderSVGRoot::computeFloatVisibleRectInContainer const): >+ * rendering/svg/RenderSVGRoot.h: >+ * rendering/svg/RenderSVGText.cpp: >+ (WebCore::RenderSVGText::clippedOverflowRectForRepaint const): >+ * rendering/svg/RenderSVGText.h: >+ * rendering/svg/SVGRenderSupport.cpp: >+ (WebCore::SVGRenderSupport::clippedOverflowRectForRepaint): >+ (WebCore::SVGRenderSupport::computeFloatVisibleRectInContainer): >+ * rendering/svg/SVGRenderSupport.h: >+ > 2019-07-01 Chris Dumez <cdumez@apple.com> > > It should not be possible to trigger a load while in the middle of restoring a page in PageCache >diff --git a/Source/WebCore/dom/Document.cpp b/Source/WebCore/dom/Document.cpp >index ef33e2f82a4096ade8ac649f492417dc87425ec5..2f2e1cc6ac74fee890c8d9603a621d6268a051e2 100644 >--- a/Source/WebCore/dom/Document.cpp >+++ b/Source/WebCore/dom/Document.cpp >@@ -7283,8 +7283,8 @@ static void expandRootBoundsWithRootMargin(FloatRect& localRootBounds, const Len > > static Optional<LayoutRect> computeClippedRectInRootContentsSpace(const LayoutRect& rect, const RenderElement* renderer) > { >- OptionSet<RenderObject::VisibleRectContextOption> visibleRectOptions = { RenderObject::VisibleRectContextOption::UseEdgeInclusiveIntersection, RenderObject::VisibleRectContextOption::ApplyCompositedClips, RenderObject::VisibleRectContextOption::ApplyCompositedContainerScrolls }; >- Optional<LayoutRect> rectInFrameAbsoluteSpace = renderer->computeVisibleRectInContainer(rect, &renderer->view(), {false /* hasPositionFixedDescendant */, false /* dirtyRectIsFlipped */, visibleRectOptions }); >+ VisibleRectOptions visibleRectOptions = { VisibleRectOption::UseEdgeInclusiveIntersection, VisibleRectOption::ApplyCompositedClips, VisibleRectOption::ApplyCompositedContainerScrolls }; >+ Optional<LayoutRect> rectInFrameAbsoluteSpace = renderer->computeVisibleRectInContainer(rect, &renderer->view(), { visibleRectOptions }); > if (!rectInFrameAbsoluteSpace || renderer->frame().isMainFrame()) > return rectInFrameAbsoluteSpace; > >@@ -7357,8 +7357,8 @@ static Optional<IntersectionObservationState> computeIntersectionState(FrameView > > Optional<LayoutRect> rootLocalTargetRect; > if (observer.root()) { >- OptionSet<RenderObject::VisibleRectContextOption> visibleRectOptions = { RenderObject::VisibleRectContextOption::UseEdgeInclusiveIntersection, RenderObject::VisibleRectContextOption::ApplyCompositedClips, RenderObject::VisibleRectContextOption::ApplyCompositedContainerScrolls }; >- rootLocalTargetRect = targetRenderer->computeVisibleRectInContainer(localTargetBounds, rootRenderer, { false /* hasPositionFixedDescendant */, false /* dirtyRectIsFlipped */, visibleRectOptions }); >+ VisibleRectOptions visibleRectOptions = { VisibleRectOption::UseEdgeInclusiveIntersection, VisibleRectOption::ApplyCompositedClips, VisibleRectOption::ApplyCompositedContainerScrolls }; >+ rootLocalTargetRect = targetRenderer->computeVisibleRectInContainer(localTargetBounds, rootRenderer, { visibleRectOptions }); > } else > rootLocalTargetRect = computeClippedRectInRootContentsSpace(localTargetBounds, targetRenderer); > >diff --git a/Source/WebCore/dom/Range.cpp b/Source/WebCore/dom/Range.cpp >index bf8fdbdff96029af2d1a7a8102b4a37814c04c3d..b99986492e33f54ad8c4d2cdfdca9c0fd2fbf331 100644 >--- a/Source/WebCore/dom/Range.cpp >+++ b/Source/WebCore/dom/Range.cpp >@@ -1815,14 +1815,14 @@ Vector<FloatRect> Range::borderAndTextRects(CoordinateSpace space, OptionSet<Bou > for (Node* parent = lastNode->parentNode(); parent; parent = parent->parentNode()) > selectedElementsSet.remove(parent); > >- OptionSet<RenderObject::VisibleRectContextOption> visibleRectOptions = { RenderObject::VisibleRectContextOption::UseEdgeInclusiveIntersection, RenderObject::VisibleRectContextOption::ApplyCompositedClips, RenderObject::VisibleRectContextOption::ApplyCompositedContainerScrolls }; >+ VisibleRectOptions visibleRectOptions = { VisibleRectOption::UseEdgeInclusiveIntersection, VisibleRectOption::ApplyCompositedClips, VisibleRectOption::ApplyCompositedContainerScrolls }; > > for (Node* node = firstNode(); node != stopNode; node = NodeTraversal::next(*node)) { > if (is<Element>(*node) && selectedElementsSet.contains(node) && (useVisibleBounds || !node->parentNode() || !selectedElementsSet.contains(node->parentNode()))) { > if (auto* renderer = downcast<Element>(*node).renderBoxModelObject()) { > if (useVisibleBounds) { > auto localBounds = renderer->borderBoundingBox(); >- auto rootClippedBounds = renderer->computeVisibleRectInContainer(localBounds, &renderer->view(), { false, false, visibleRectOptions }); >+ auto rootClippedBounds = renderer->computeVisibleRectInContainer(localBounds, &renderer->view(), { visibleRectOptions }); > if (!rootClippedBounds) > continue; > auto snappedBounds = snapRectToDevicePixels(*rootClippedBounds, node->document().deviceScaleFactor()); >diff --git a/Source/WebCore/rendering/LayoutRepainter.cpp b/Source/WebCore/rendering/LayoutRepainter.cpp >index 8d5ebdb11dce0b395941d0854676ff1d6bcc15ec..bfc8f2d6f3145cd4e8297248ce292244614112e2 100644 >--- a/Source/WebCore/rendering/LayoutRepainter.cpp >+++ b/Source/WebCore/rendering/LayoutRepainter.cpp >@@ -37,7 +37,7 @@ LayoutRepainter::LayoutRepainter(RenderElement& object, bool checkForRepaint) > { > if (m_checkForRepaint) { > m_repaintContainer = m_object.containerForRepaint(); >- m_oldBounds = m_object.clippedOverflowRectForRepaint(m_repaintContainer); >+ m_oldBounds = m_object.clippedOverflowRectForRepaint(m_repaintContainer, visibleRectOptionsForRepaint()); > m_oldOutlineBox = m_object.outlineBoundsForRepaint(m_repaintContainer); > } > } >diff --git a/Source/WebCore/rendering/RenderBox.cpp b/Source/WebCore/rendering/RenderBox.cpp >index c7ed22358b01d2b94f526a95090a857ae26f8fb7..0a9c4973c260b114bf2e9377fbdc07b5d9860d60 100644 >--- a/Source/WebCore/rendering/RenderBox.cpp >+++ b/Source/WebCore/rendering/RenderBox.cpp >@@ -985,16 +985,16 @@ LayoutSize RenderBox::cachedSizeForOverflowClip() const > return layer()->size(); > } > >-bool RenderBox::applyCachedClipAndScrollPosition(LayoutRect& rect, const RenderLayerModelObject* container, VisibleRectContext context) const >+bool RenderBox::applyCachedClipAndScrollPosition(LayoutRect& rect, const RenderLayerModelObject* container, VisibleRectOptions options) const > { > flipForWritingMode(rect); > >- if (context.m_options.contains(VisibleRectContextOption::ApplyCompositedContainerScrolls) || this != container || !usesCompositedScrolling()) >+ if (options.contains(VisibleRectOption::ApplyCompositedContainerScrolls) || this != container || !usesCompositedScrolling()) > rect.moveBy(-scrollPosition()); // For overflow:auto/scroll/hidden. > > // Do not clip scroll layer contents to reduce the number of repaints while scrolling. >- if ((!context.m_options.contains(VisibleRectContextOption::ApplyCompositedClips) && usesCompositedScrolling()) >- || (!context.m_options.contains(VisibleRectContextOption::ApplyContainerClip) && this == container)) { >+ if ((!options.contains(VisibleRectOption::ApplyCompositedClips) && usesCompositedScrolling()) >+ || (!options.contains(VisibleRectOption::ApplyContainerClip) && this == container)) { > flipForWritingMode(rect); > return true; > } >@@ -1004,7 +1004,7 @@ bool RenderBox::applyCachedClipAndScrollPosition(LayoutRect& rect, const RenderL > // anyway if its size does change. > LayoutRect clipRect(LayoutPoint(), cachedSizeForOverflowClip()); > bool intersects; >- if (context.m_options.contains(VisibleRectContextOption::UseEdgeInclusiveIntersection)) >+ if (options.contains(VisibleRectOption::UseEdgeInclusiveIntersection)) > intersects = rect.edgeInclusiveIntersect(clipRect); > else { > rect.intersect(clipRect); >@@ -2179,7 +2179,7 @@ void RenderBox::deleteLineBoxWrapper() > m_inlineBoxWrapper = nullptr; > } > >-LayoutRect RenderBox::clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const >+LayoutRect RenderBox::clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer, VisibleRectOptions options) const > { > if (style().visibility() != Visibility::Visible && !enclosingLayer()->hasVisibleContent()) > return LayoutRect(); >@@ -2187,7 +2187,7 @@ LayoutRect RenderBox::clippedOverflowRectForRepaint(const RenderLayerModelObject > // FIXME: layoutDelta needs to be applied in parts before/after transforms and > // repaint containers. https://bugs.webkit.org/show_bug.cgi?id=23308 > r.move(view().frameView().layoutContext().layoutDelta()); >- return computeRectForRepaint(r, repaintContainer); >+ return computeRectForRepaint(r, repaintContainer, options); > } > > LayoutRect RenderBox::computeVisibleRectUsingPaintOffset(const LayoutRect& rect) const >@@ -2221,7 +2221,7 @@ Optional<LayoutRect> RenderBox::computeVisibleRectInContainer(const LayoutRect& > // physical coordinate space of the container. > const RenderStyle& styleToUse = style(); > // Paint offset cache is only valid for root-relative, non-fixed position repainting >- if (view().frameView().layoutContext().isPaintOffsetCacheEnabled() && !container && styleToUse.position() != PositionType::Fixed && !context.m_options.contains(VisibleRectContextOption::UseEdgeInclusiveIntersection)) >+ if (view().frameView().layoutContext().isPaintOffsetCacheEnabled() && !container && styleToUse.position() != PositionType::Fixed && !context.options.contains(VisibleRectOption::UseEdgeInclusiveIntersection)) > return computeVisibleRectUsingPaintOffset(rect); > > LayoutRect adjustedRect = rect; >@@ -2255,9 +2255,9 @@ Optional<LayoutRect> RenderBox::computeVisibleRectInContainer(const LayoutRect& > } > > if (isWritingModeRoot()) { >- if (!isOutOfFlowPositioned() || !context.m_dirtyRectIsFlipped) { >+ if (!isOutOfFlowPositioned() || !context.dirtyRectIsFlipped) { > flipForWritingMode(adjustedRect); >- context.m_dirtyRectIsFlipped = true; >+ context.dirtyRectIsFlipped = true; > } > } > >@@ -2289,12 +2289,12 @@ Optional<LayoutRect> RenderBox::computeVisibleRectInContainer(const LayoutRect& > // We are now in our parent container's coordinate space. Apply our transform to obtain a bounding box > // in the parent's coordinate space that encloses us. > if (hasLayer() && layer()->transform()) { >- context.m_hasPositionFixedDescendant = position == PositionType::Fixed; >+ context.hasPositionFixedDescendant = position == PositionType::Fixed; > adjustedRect = LayoutRect(encloseRectToDevicePixels(layer()->transform()->mapRect(adjustedRect), document().deviceScaleFactor())); > topLeft = adjustedRect.location(); > topLeft.move(locationOffset); > } else if (position == PositionType::Fixed) >- context.m_hasPositionFixedDescendant = true; >+ context.hasPositionFixedDescendant = true; > > if (position == PositionType::Absolute && localContainer->isInFlowPositioned() && is<RenderInline>(*localContainer)) > topLeft += downcast<RenderInline>(*localContainer).offsetForInFlowPositionedInline(this); >@@ -2311,9 +2311,9 @@ Optional<LayoutRect> RenderBox::computeVisibleRectInContainer(const LayoutRect& > adjustedRect.setLocation(topLeft); > if (localContainer->hasOverflowClip()) { > RenderBox& containerBox = downcast<RenderBox>(*localContainer); >- bool isEmpty = !containerBox.applyCachedClipAndScrollPosition(adjustedRect, container, context); >+ bool isEmpty = !containerBox.applyCachedClipAndScrollPosition(adjustedRect, container, context.options); > if (isEmpty) { >- if (context.m_options.contains(VisibleRectContextOption::UseEdgeInclusiveIntersection)) >+ if (context.options.contains(VisibleRectOption::UseEdgeInclusiveIntersection)) > return WTF::nullopt; > return adjustedRect; > } >diff --git a/Source/WebCore/rendering/RenderBox.h b/Source/WebCore/rendering/RenderBox.h >index b2afd00acf5baa60f3ca8466a7bcc6dc3cb549d9..cd0357d968b9821aa971ffc193640f2ed3237363 100644 >--- a/Source/WebCore/rendering/RenderBox.h >+++ b/Source/WebCore/rendering/RenderBox.h >@@ -381,7 +381,7 @@ public: > void setInlineBoxWrapper(InlineElementBox*); > void deleteLineBoxWrapper(); > >- LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const override; >+ LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer, VisibleRectOptions) const override; > Optional<LayoutRect> computeVisibleRectInContainer(const LayoutRect&, const RenderLayerModelObject* container, VisibleRectContext) const > override; > void repaintDuringLayoutIfMoved(const LayoutRect&); >@@ -590,7 +590,7 @@ override; > > // Returns false if the rect has no intersection with the applied clip rect. When the context specifies edge-inclusive > // intersection, this return value allows distinguishing between no intersection and zero-area intersection. >- bool applyCachedClipAndScrollPosition(LayoutRect&, const RenderLayerModelObject* container, VisibleRectContext) const; >+ bool applyCachedClipAndScrollPosition(LayoutRect&, const RenderLayerModelObject* container, VisibleRectOptions) const; > > virtual bool hasRelativeDimensions() const; > virtual bool hasRelativeLogicalHeight() const; >diff --git a/Source/WebCore/rendering/RenderElement.cpp b/Source/WebCore/rendering/RenderElement.cpp >index 292cd39d0aa9c29129ec6ac768c4af7278a2719d..686632597bc7b87e1f6f27d087c5b53775166095 100644 >--- a/Source/WebCore/rendering/RenderElement.cpp >+++ b/Source/WebCore/rendering/RenderElement.cpp >@@ -1083,8 +1083,8 @@ bool RenderElement::repaintAfterLayoutIfNeeded(const RenderLayerModelObject* rep > return false; // Don't repaint if we're printing. > > // This ASSERT fails due to animations. See https://bugs.webkit.org/show_bug.cgi?id=37048 >- // ASSERT(!newBoundsPtr || *newBoundsPtr == clippedOverflowRectForRepaint(repaintContainer)); >- LayoutRect newBounds = newBoundsPtr ? *newBoundsPtr : clippedOverflowRectForRepaint(repaintContainer); >+ // ASSERT(!newBoundsPtr || *newBoundsPtr == clippedOverflowRectForRepaint(repaintContainer, visibleRectOptionsForRepaint())); >+ LayoutRect newBounds = newBoundsPtr ? *newBoundsPtr : clippedOverflowRectForRepaint(repaintContainer, visibleRectOptionsForRepaint()); > LayoutRect newOutlineBox; > > bool fullRepaint = selfNeedsLayout(); >diff --git a/Source/WebCore/rendering/RenderFrameSet.cpp b/Source/WebCore/rendering/RenderFrameSet.cpp >index 4c3167701870919bfd911d3aff8cc541764126a9..e33b84bf213f097cf59c9f9454711eca5b947c02 100644 >--- a/Source/WebCore/rendering/RenderFrameSet.cpp >+++ b/Source/WebCore/rendering/RenderFrameSet.cpp >@@ -453,7 +453,7 @@ void RenderFrameSet::layout() > RenderLayerModelObject* repaintContainer = 0; > if (doFullRepaint) { > repaintContainer = containerForRepaint(); >- oldBounds = clippedOverflowRectForRepaint(repaintContainer); >+ oldBounds = clippedOverflowRectForRepaint(repaintContainer, visibleRectOptionsForRepaint()); > } > > if (!parent()->isFrameSet() && !document().printing()) { >@@ -486,7 +486,7 @@ void RenderFrameSet::layout() > > if (doFullRepaint) { > repaintUsingContainer(repaintContainer, snappedIntRect(oldBounds)); >- LayoutRect newBounds = clippedOverflowRectForRepaint(repaintContainer); >+ LayoutRect newBounds = clippedOverflowRectForRepaint(repaintContainer, visibleRectOptionsForRepaint()); > if (newBounds != oldBounds) > repaintUsingContainer(repaintContainer, snappedIntRect(newBounds)); > } >diff --git a/Source/WebCore/rendering/RenderInline.cpp b/Source/WebCore/rendering/RenderInline.cpp >index 9d8a65934ba3fd25474c39c91feec43aa0c9f9f5..ec9aa233f2d00d55238c3d9b6016a9459ebac170 100644 >--- a/Source/WebCore/rendering/RenderInline.cpp >+++ b/Source/WebCore/rendering/RenderInline.cpp >@@ -812,7 +812,7 @@ LayoutRect RenderInline::linesVisualOverflowBoundingBoxInFragment(const RenderFr > return rect; > } > >-LayoutRect RenderInline::clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const >+LayoutRect RenderInline::clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer, VisibleRectOptions options) const > { > // Only first-letter renderers are allowed in here during layout. They mutate the tree triggering repaints. > ASSERT(!view().frameView().layoutContext().isPaintOffsetCacheEnabled() || style().styleType() == PseudoId::FirstLetter || hasSelfPaintingLayer()); >@@ -843,9 +843,9 @@ LayoutRect RenderInline::clippedOverflowRectForRepaint(const RenderLayerModelObj > return repaintRect; > > if (containingBlock->hasOverflowClip()) >- containingBlock->applyCachedClipAndScrollPosition(repaintRect, repaintContainer, visibleRectContextForRepaint()); >+ containingBlock->applyCachedClipAndScrollPosition(repaintRect, repaintContainer, options); > >- repaintRect = containingBlock->computeRectForRepaint(repaintRect, repaintContainer); >+ repaintRect = containingBlock->computeRectForRepaint(repaintRect, repaintContainer, options); > > if (outlineSize) { > for (auto& child : childrenOfType<RenderElement>(*this)) >@@ -883,7 +883,7 @@ LayoutRect RenderInline::computeVisibleRectUsingPaintOffset(const LayoutRect& re > Optional<LayoutRect> RenderInline::computeVisibleRectInContainer(const LayoutRect& rect, const RenderLayerModelObject* container, VisibleRectContext context) const > { > // Repaint offset cache is only valid for root-relative repainting >- if (view().frameView().layoutContext().isPaintOffsetCacheEnabled() && !container && !context.m_options.contains(VisibleRectContextOption::UseEdgeInclusiveIntersection)) >+ if (view().frameView().layoutContext().isPaintOffsetCacheEnabled() && !container && !context.options.contains(VisibleRectOption::UseEdgeInclusiveIntersection)) > return computeVisibleRectUsingPaintOffset(rect); > > if (container == this) >@@ -909,11 +909,10 @@ Optional<LayoutRect> RenderInline::computeVisibleRectInContainer(const LayoutRec > // its controlClipRect will be wrong. For overflow clip we use the values cached by the layer. > adjustedRect.setLocation(topLeft); > if (localContainer->hasOverflowClip()) { >- // FIXME: Respect the value of context.m_options. >- SetForScope<OptionSet<VisibleRectContextOption>> change(context.m_options, context.m_options | VisibleRectContextOption::ApplyCompositedContainerScrolls); >- bool isEmpty = !downcast<RenderBox>(*localContainer).applyCachedClipAndScrollPosition(adjustedRect, container, context); >+ // FIXME: Respect the value of context.options. >+ bool isEmpty = !downcast<RenderBox>(*localContainer).applyCachedClipAndScrollPosition(adjustedRect, container, { context.options | VisibleRectOption::ApplyCompositedContainerScrolls }); > if (isEmpty) { >- if (context.m_options.contains(VisibleRectContextOption::UseEdgeInclusiveIntersection)) >+ if (context.options.contains(VisibleRectOption::UseEdgeInclusiveIntersection)) > return WTF::nullopt; > return adjustedRect; > } >diff --git a/Source/WebCore/rendering/RenderInline.h b/Source/WebCore/rendering/RenderInline.h >index 74950072b5eb54d04f9c02be96a4cc25c9c8a506..b7ae82afba5ddb8bce9c9dfd17b85c030474875f 100644 >--- a/Source/WebCore/rendering/RenderInline.h >+++ b/Source/WebCore/rendering/RenderInline.h >@@ -127,7 +127,7 @@ private: > LayoutUnit offsetWidth() const final { return linesBoundingBox().width(); } > LayoutUnit offsetHeight() const final { return linesBoundingBox().height(); } > >- LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const override; >+ LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer, VisibleRectOptions) const override; > LayoutRect rectWithOutlineForRepaint(const RenderLayerModelObject* repaintContainer, LayoutUnit outlineWidth) const final; > > Optional<LayoutRect> computeVisibleRectInContainer(const LayoutRect&, const RenderLayerModelObject* container, VisibleRectContext) const final; >diff --git a/Source/WebCore/rendering/RenderLayer.cpp b/Source/WebCore/rendering/RenderLayer.cpp >index 79b1c872f24db5eb66b0cc56f79f8c431169b4f7..badc4710ff3fbf8b5e41cb16db4e14b29c8a360f 100644 >--- a/Source/WebCore/rendering/RenderLayer.cpp >+++ b/Source/WebCore/rendering/RenderLayer.cpp >@@ -1120,7 +1120,7 @@ void RenderLayer::updateLayerPositionsAfterScroll(RenderGeometryMap* geometryMap > // When ScrollView's m_paintsEntireContents flag flips due to layer backing changes, the repaint area transitions from > // visual to layout overflow. When this happens the cached repaint rects become invalid and they need to be recomputed (see webkit.org/b/188121). > // Check that our cached rects are correct. >- ASSERT(!renderer().hasRepaintLayoutRects() || renderer().repaintLayoutRects().m_repaintRect == renderer().clippedOverflowRectForRepaint(renderer().containerForRepaint())); >+ ASSERT(!renderer().hasRepaintLayoutRects() || renderer().repaintLayoutRects().m_repaintRect == renderer().clippedOverflowRectForRepaint(renderer().containerForRepaint(), visibleRectOptionsForRepaint())); > ASSERT(!renderer().hasRepaintLayoutRects() || renderer().repaintLayoutRects().m_outlineBox == renderer().outlineBoundsForRepaint(renderer().containerForRepaint())); > } > >@@ -2537,7 +2537,7 @@ void RenderLayer::scrollTo(const ScrollPosition& position) > // The caret rect needs to be invalidated after scrolling > frame.selection().setCaretRectNeedsUpdate(); > >- LayoutRect rectForRepaint = renderer().hasRepaintLayoutRects() ? renderer().repaintLayoutRects().m_repaintRect : renderer().clippedOverflowRectForRepaint(repaintContainer); >+ LayoutRect rectForRepaint = renderer().hasRepaintLayoutRects() ? renderer().repaintLayoutRects().m_repaintRect : renderer().clippedOverflowRectForRepaint(repaintContainer, visibleRectOptionsForRepaint()); > > FloatQuad quadForFakeMouseMoveEvent = FloatQuad(rectForRepaint); > if (repaintContainer) >@@ -6268,7 +6268,7 @@ void RenderLayer::setBackingNeedsRepaintInRect(const LayoutRect& r, GraphicsLaye > // Since we're only painting non-composited layers, we know that they all share the same repaintContainer. > void RenderLayer::repaintIncludingNonCompositingDescendants(RenderLayerModelObject* repaintContainer) > { >- renderer().repaintUsingContainer(repaintContainer, renderer().clippedOverflowRectForRepaint(repaintContainer)); >+ renderer().repaintUsingContainer(repaintContainer, renderer().clippedOverflowRectForRepaint(repaintContainer, visibleRectOptionsForRepaint())); > > for (RenderLayer* curr = firstChild(); curr; curr = curr->nextSibling()) { > if (!curr->isComposited()) >diff --git a/Source/WebCore/rendering/RenderLayerModelObject.cpp b/Source/WebCore/rendering/RenderLayerModelObject.cpp >index 4b86fe2ad175dce86ad3852bdfc152fd1308d45e..4d2fedbff04b0e6d5a15c2e20f649fff532cb2f2 100644 >--- a/Source/WebCore/rendering/RenderLayerModelObject.cpp >+++ b/Source/WebCore/rendering/RenderLayerModelObject.cpp >@@ -46,7 +46,7 @@ typedef WTF::HashMap<const RenderLayerModelObject*, RepaintLayoutRects> RepaintL > static RepaintLayoutRectsMap* gRepaintLayoutRectsMap = nullptr; > > RepaintLayoutRects::RepaintLayoutRects(const RenderLayerModelObject& renderer, const RenderLayerModelObject* repaintContainer, const RenderGeometryMap* geometryMap) >- : m_repaintRect(renderer.clippedOverflowRectForRepaint(repaintContainer)) >+ : m_repaintRect(renderer.clippedOverflowRectForRepaint(repaintContainer, visibleRectOptionsForRepaint())) > , m_outlineBox(renderer.outlineBoundsForRepaint(repaintContainer, geometryMap)) > { > } >diff --git a/Source/WebCore/rendering/RenderLineBreak.h b/Source/WebCore/rendering/RenderLineBreak.h >index c95a1f8ef7f4127cac206e6bd03aa87e8f296ecc..331a05f811a008b3c8a36a9a7d5d3baba1d3624e 100644 >--- a/Source/WebCore/rendering/RenderLineBreak.h >+++ b/Source/WebCore/rendering/RenderLineBreak.h >@@ -84,8 +84,8 @@ private: > LayoutUnit offsetWidth() const override { return linesBoundingBox().width(); } > LayoutUnit offsetHeight() const override { return linesBoundingBox().height(); } > LayoutRect borderBoundingBox() const override { return LayoutRect(LayoutPoint(), linesBoundingBox().size()); } >- LayoutRect frameRectForStickyPositioning() const override { ASSERT_NOT_REACHED(); return LayoutRect(); } >- LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject*) const override { return LayoutRect(); } >+ LayoutRect frameRectForStickyPositioning() const override { ASSERT_NOT_REACHED(); return { }; } >+ LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject*, VisibleRectOptions) const override { return { }; } > > void updateFromStyle() override; > bool requiresLayer() const override { return false; } >diff --git a/Source/WebCore/rendering/RenderObject.cpp b/Source/WebCore/rendering/RenderObject.cpp >index 78c0958db31b449967c960e0a3d505b61461e60d..59be3f8b373da13c1847979f5de4430bd673feac 100644 >--- a/Source/WebCore/rendering/RenderObject.cpp >+++ b/Source/WebCore/rendering/RenderObject.cpp >@@ -956,33 +956,38 @@ void RenderObject::repaintSlowRepaintObject() const > > repaintUsingContainer(repaintContainer, repaintRect, shouldClipToLayer); > } >- >-IntRect RenderObject::pixelSnappedAbsoluteClippedOverflowRect() const >-{ >- return snappedIntRect(absoluteClippedOverflowRect()); >-} > > LayoutRect RenderObject::rectWithOutlineForRepaint(const RenderLayerModelObject* repaintContainer, LayoutUnit outlineWidth) const > { >- LayoutRect r(clippedOverflowRectForRepaint(repaintContainer)); >- r.inflate(outlineWidth); >- return r; >+ LayoutRect rect = clippedOverflowRectForRepaint(repaintContainer); >+ rect.inflate(outlineWidth); >+ return rect; > } > >-LayoutRect RenderObject::clippedOverflowRectForRepaint(const RenderLayerModelObject*) const >+LayoutRect RenderObject::clippedOverflowRectForRepaint(const RenderLayerModelObject*, VisibleRectOptions) const > { > ASSERT_NOT_REACHED(); >- return LayoutRect(); >+ return { }; >+} >+ >+LayoutRect RenderObject::absoluteClippedOverflowRect() const >+{ >+ return clippedOverflowRectForRepaint(nullptr, visibleRectOptionsForClipGeometry()); >+} >+ >+IntRect RenderObject::pixelSnappedAbsoluteClippedOverflowRect() const >+{ >+ return snappedIntRect(absoluteClippedOverflowRect()); > } > >-LayoutRect RenderObject::computeRectForRepaint(const LayoutRect& rect, const RenderLayerModelObject* repaintContainer) const >+LayoutRect RenderObject::computeRectForRepaint(const LayoutRect& rect, const RenderLayerModelObject* repaintContainer, VisibleRectOptions options) const > { >- return *computeVisibleRectInContainer(rect, repaintContainer, visibleRectContextForRepaint()); >+ return *computeVisibleRectInContainer(rect, repaintContainer, { options }); > } > >-FloatRect RenderObject::computeFloatRectForRepaint(const FloatRect& rect, const RenderLayerModelObject* repaintContainer) const >+FloatRect RenderObject::computeFloatRectForRepaint(const FloatRect& rect, const RenderLayerModelObject* repaintContainer, VisibleRectOptions options) const > { >- return *computeFloatVisibleRectInContainer(rect, repaintContainer, visibleRectContextForRepaint()); >+ return *computeFloatVisibleRectInContainer(rect, repaintContainer, { options }); > } > > Optional<LayoutRect> RenderObject::computeVisibleRectInContainer(const LayoutRect& rect, const RenderLayerModelObject* container, VisibleRectContext context) const >@@ -996,9 +1001,9 @@ Optional<LayoutRect> RenderObject::computeVisibleRectInContainer(const LayoutRec > > LayoutRect adjustedRect = rect; > if (parent->hasOverflowClip()) { >- bool isEmpty = !downcast<RenderBox>(*parent).applyCachedClipAndScrollPosition(adjustedRect, container, context); >+ bool isEmpty = !downcast<RenderBox>(*parent).applyCachedClipAndScrollPosition(adjustedRect, container, context.options); > if (isEmpty) { >- if (context.m_options.contains(VisibleRectContextOption::UseEdgeInclusiveIntersection)) >+ if (context.options.contains(VisibleRectOption::UseEdgeInclusiveIntersection)) > return WTF::nullopt; > return adjustedRect; > } >@@ -1009,7 +1014,7 @@ Optional<LayoutRect> RenderObject::computeVisibleRectInContainer(const LayoutRec > Optional<FloatRect> RenderObject::computeFloatVisibleRectInContainer(const FloatRect&, const RenderLayerModelObject*, VisibleRectContext) const > { > ASSERT_NOT_REACHED(); >- return FloatRect(); >+ return { }; > } > > #if ENABLE(TREE_DEBUGGING) >diff --git a/Source/WebCore/rendering/RenderObject.h b/Source/WebCore/rendering/RenderObject.h >index 64cf0e8da7d6172a7ff3976810e5a5182ac45fac..5d326bf456cdb08e098d789664c722439ba51f45 100644 >--- a/Source/WebCore/rendering/RenderObject.h >+++ b/Source/WebCore/rendering/RenderObject.h >@@ -85,6 +85,31 @@ enum class ShouldAllowCrossOriginScrolling { No, Yes }; > > struct ScrollRectToVisibleOptions; > >+enum class VisibleRectOption { >+ UseEdgeInclusiveIntersection = 1 << 0, >+ ApplyCompositedClips = 1 << 1, >+ ApplyCompositedContainerScrolls = 1 << 2, >+ ApplyContainerClip = 1 << 3, >+}; >+ >+using VisibleRectOptions = OptionSet<VisibleRectOption>; >+ >+struct VisibleRectContext { >+ VisibleRectOptions options; >+ bool hasPositionFixedDescendant { false }; >+ bool dirtyRectIsFlipped { false }; >+}; >+ >+static constexpr VisibleRectOptions visibleRectOptionsForRepaint() >+{ >+ return { VisibleRectOption::ApplyContainerClip, VisibleRectOption::ApplyCompositedContainerScrolls }; >+} >+ >+static constexpr VisibleRectOptions visibleRectOptionsForClipGeometry() >+{ >+ return { VisibleRectOption::ApplyContainerClip, VisibleRectOption::ApplyCompositedClips, VisibleRectOption::ApplyCompositedContainerScrolls }; >+} >+ > // Base class for all rendering tree objects. > class RenderObject : public CachedImageClient, public CanMakeWeakPtr<RenderObject> { > WTF_MAKE_ISO_ALLOCATED(RenderObject); >@@ -380,7 +405,7 @@ public: > virtual const AffineTransform& localToParentTransform() const; > > // SVG uses FloatPoint precise hit testing, and passes the point in parent >- // coordinates instead of in repaint container coordinates. Eventually the >+ // coordinates instead of in repaint container coordinates. Eventually the > // rest of the rendering tree will move to a similar model. > virtual bool nodeAtFloatPoint(const HitTestRequest&, HitTestResult&, const FloatPoint& pointInParent, HitTestAction); > >@@ -629,58 +654,33 @@ public: > // of repaintContainer. If repaintContainer is nullptr, repaint via the view. > void repaintUsingContainer(const RenderLayerModelObject* repaintContainer, const LayoutRect&, bool shouldClipToLayer = true) const; > >- // Repaint the entire object. Called when, e.g., the color of a border changes, or when a border >+ // Repaint the entire object. Called when, e.g., the color of a border changes, or when a border > // style changes. > void repaint() const; > >- // Repaint a specific subrectangle within a given object. The rect |r| is in the object's coordinate space. >+ // Repaint a specific subrectangle within a given object. The rect |r| is in the object's coordinate space. > WEBCORE_EXPORT void repaintRectangle(const LayoutRect&, bool shouldClipToLayer = true) const; > > // Repaint a slow repaint object, which, at this time, means we are repainting an object with background-attachment:fixed. > void repaintSlowRepaintObject() const; > >- // Returns the rect that should be repainted whenever this object changes. The rect is in the view's >- // coordinate space. This method deals with outlines and overflow. >- LayoutRect absoluteClippedOverflowRect() const >- { >- return clippedOverflowRectForRepaint(nullptr); >- } >+ // Returns the rect that should be repainted whenever this object changes. The rect is in the view's >+ // coordinate space. This method deals with outlines and overflow. >+ LayoutRect absoluteClippedOverflowRect() const; > WEBCORE_EXPORT IntRect pixelSnappedAbsoluteClippedOverflowRect() const; >- virtual LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const; >+ >+ virtual LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer, VisibleRectOptions = visibleRectOptionsForRepaint()) const; > virtual LayoutRect rectWithOutlineForRepaint(const RenderLayerModelObject* repaintContainer, LayoutUnit outlineWidth) const; > virtual LayoutRect outlineBoundsForRepaint(const RenderLayerModelObject* /*repaintContainer*/, const RenderGeometryMap* = nullptr) const { return LayoutRect(); } > >- // Given a rect in the object's coordinate space, compute a rect suitable for repainting >- // that rect in view coordinates. >- LayoutRect computeAbsoluteRepaintRect(const LayoutRect& r) const >- { >- return computeRectForRepaint(r, nullptr); >- } > // Given a rect in the object's coordinate space, compute a rect suitable for repainting > // that rect in the coordinate space of repaintContainer. >- LayoutRect computeRectForRepaint(const LayoutRect&, const RenderLayerModelObject* repaintContainer) const; >- FloatRect computeFloatRectForRepaint(const FloatRect&, const RenderLayerModelObject* repaintContainer) const; >+ LayoutRect computeRectForRepaint(const LayoutRect&, const RenderLayerModelObject* repaintContainer, VisibleRectOptions = visibleRectOptionsForRepaint()) const; >+ FloatRect computeFloatRectForRepaint(const FloatRect&, const RenderLayerModelObject* repaintContainer, VisibleRectOptions = visibleRectOptionsForRepaint()) const; > > // Given a rect in the object's coordinate space, compute the location in container space where this rect is visible, > // when clipping and scrolling as specified by the context. When using edge-inclusive intersection, return WTF::nullopt > // rather than an empty rect if the rect is completely clipped out in container space. >- enum class VisibleRectContextOption { >- UseEdgeInclusiveIntersection = 1 << 0, >- ApplyCompositedClips = 1 << 1, >- ApplyCompositedContainerScrolls = 1 << 2, >- ApplyContainerClip = 1 << 3, >- }; >- struct VisibleRectContext { >- VisibleRectContext(bool hasPositionFixedDescendant = false, bool dirtyRectIsFlipped = false, OptionSet<VisibleRectContextOption> options = { }) >- : m_hasPositionFixedDescendant(hasPositionFixedDescendant) >- , m_dirtyRectIsFlipped(dirtyRectIsFlipped) >- , m_options(options) >- { >- } >- bool m_hasPositionFixedDescendant; >- bool m_dirtyRectIsFlipped; >- OptionSet<VisibleRectContextOption> m_options; >- }; > virtual Optional<LayoutRect> computeVisibleRectInContainer(const LayoutRect&, const RenderLayerModelObject* repaintContainer, VisibleRectContext) const; > virtual Optional<FloatRect> computeFloatVisibleRectInContainer(const FloatRect&, const RenderLayerModelObject* repaintContainer, VisibleRectContext) const; > >@@ -696,14 +696,14 @@ public: > SelectionBoth // The object contains an entire run or is the sole selected object in that run > }; > >- // The current selection state for an object. For blocks, the state refers to the state of the leaf >+ // The current selection state for an object. For blocks, the state refers to the state of the leaf > // descendants (as described above in the SelectionState enum declaration). > SelectionState selectionState() const { return m_bitfields.selectionState(); } > virtual void setSelectionState(SelectionState state) { m_bitfields.setSelectionState(state); } > inline void setSelectionStateIfNeeded(SelectionState); > bool canUpdateSelectionOnRootLineBoxes(); > >- // A single rectangle that encompasses all of the selected objects within this object. Used to determine the tightest >+ // A single rectangle that encompasses all of the selected objects within this object. Used to determine the tightest > // possible bounding box for the selection. > LayoutRect selectionRect(bool clipToVisibleContent = true) { return selectionRectForRepaint(nullptr, clipToVisibleContent); } > virtual LayoutRect selectionRectForRepaint(const RenderLayerModelObject* /*repaintContainer*/, bool /*clipToVisibleContent*/ = true) { return LayoutRect(); } >@@ -802,11 +802,6 @@ protected: > > static bool shouldApplyCompositedContainerScrollsForRepaint(); > >- static VisibleRectContext visibleRectContextForRepaint() >- { >- return VisibleRectContext(false, false, { VisibleRectContextOption::ApplyContainerClip, VisibleRectContextOption::ApplyCompositedContainerScrolls }); >- } >- > private: > #ifndef NDEBUG > bool isSetNeedsLayoutForbidden() const { return m_setNeedsLayoutForbidden; } >diff --git a/Source/WebCore/rendering/RenderReplaced.cpp b/Source/WebCore/rendering/RenderReplaced.cpp >index d1e144eb3f9b385502354e891e9fd20e7e5e8bef..5117ec8ccaedeb67f096ee0f45d1b024730dd3b7 100644 >--- a/Source/WebCore/rendering/RenderReplaced.cpp >+++ b/Source/WebCore/rendering/RenderReplaced.cpp >@@ -669,7 +669,7 @@ bool RenderReplaced::isSelected() const > return false; > } > >-LayoutRect RenderReplaced::clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const >+LayoutRect RenderReplaced::clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer, VisibleRectOptions options) const > { > if (style().visibility() != Visibility::Visible && !enclosingLayer()->hasVisibleContent()) > return LayoutRect(); >@@ -680,7 +680,7 @@ LayoutRect RenderReplaced::clippedOverflowRectForRepaint(const RenderLayerModelO > // FIXME: layoutDelta needs to be applied in parts before/after transforms and > // repaint containers. https://bugs.webkit.org/show_bug.cgi?id=23308 > r.move(view().frameView().layoutContext().layoutDelta()); >- return computeRectForRepaint(r, repaintContainer); >+ return computeRectForRepaint(r, repaintContainer, options); > } > > } >diff --git a/Source/WebCore/rendering/RenderReplaced.h b/Source/WebCore/rendering/RenderReplaced.h >index 2cf0b87e1cfc3bb79617f819579985725b1846e0..b162ec66706f5c7ca44e7ea356e8e115570f4119 100644 >--- a/Source/WebCore/rendering/RenderReplaced.h >+++ b/Source/WebCore/rendering/RenderReplaced.h >@@ -82,7 +82,7 @@ private: > void computePreferredLogicalWidths() final; > virtual void paintReplaced(PaintInfo&, const LayoutPoint&) { } > >- LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const override; >+ LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer, VisibleRectOptions) const override; > > VisiblePosition positionForPoint(const LayoutPoint&, const RenderFragmentContainer*) final; > >diff --git a/Source/WebCore/rendering/RenderTableCell.cpp b/Source/WebCore/rendering/RenderTableCell.cpp >index 7fc230c313840e39f2c9b019f5d38690cd54a75c..a7a36c6c5c446de959793b1d82a8921d8456bb06 100644 >--- a/Source/WebCore/rendering/RenderTableCell.cpp >+++ b/Source/WebCore/rendering/RenderTableCell.cpp >@@ -347,14 +347,14 @@ LayoutSize RenderTableCell::offsetFromContainer(RenderElement& container, const > return offset; > } > >-LayoutRect RenderTableCell::clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const >+LayoutRect RenderTableCell::clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer, VisibleRectOptions options) const > { > // If the table grid is dirty, we cannot get reliable information about adjoining cells, > // so we ignore outside borders. This should not be a problem because it means that > // the table is going to recalculate the grid, relayout and repaint its current rect, which > // includes any outside borders of this cell. > if (!table()->collapseBorders() || table()->needsSectionRecalc()) >- return RenderBlockFlow::clippedOverflowRectForRepaint(repaintContainer); >+ return RenderBlockFlow::clippedOverflowRectForRepaint(repaintContainer, options); > > bool rtl = !styleForCellFlow().isLeftToRightDirection(); > LayoutUnit outlineSize { style().outlineSize() }; >@@ -392,7 +392,7 @@ LayoutRect RenderTableCell::clippedOverflowRectForRepaint(const RenderLayerModel > // FIXME: layoutDelta needs to be applied in parts before/after transforms and > // repaint containers. https://bugs.webkit.org/show_bug.cgi?id=23308 > r.move(view().frameView().layoutContext().layoutDelta()); >- return computeRectForRepaint(r, repaintContainer); >+ return computeRectForRepaint(r, repaintContainer, options); > } > > Optional<LayoutRect> RenderTableCell::computeVisibleRectInContainer(const LayoutRect& rect, const RenderLayerModelObject* container, VisibleRectContext context) const >@@ -400,7 +400,7 @@ Optional<LayoutRect> RenderTableCell::computeVisibleRectInContainer(const Layout > if (container == this) > return rect; > LayoutRect adjustedRect = rect; >- if ((!view().frameView().layoutContext().isPaintOffsetCacheEnabled() || container || context.m_options.contains(VisibleRectContextOption::UseEdgeInclusiveIntersection)) && parent()) >+ if ((!view().frameView().layoutContext().isPaintOffsetCacheEnabled() || container || context.options.contains(VisibleRectOption::UseEdgeInclusiveIntersection)) && parent()) > adjustedRect.moveBy(-parentBox()->location()); // Rows are in the same coordinate space, so don't add their offset in. > return RenderBlockFlow::computeVisibleRectInContainer(adjustedRect, container, context); > } >diff --git a/Source/WebCore/rendering/RenderTableCell.h b/Source/WebCore/rendering/RenderTableCell.h >index 03925f4f70c3142011bb57bb160d63103e427a14..2db5c4151a3cfba14a90fa7e3972155b6ded20f5 100644 >--- a/Source/WebCore/rendering/RenderTableCell.h >+++ b/Source/WebCore/rendering/RenderTableCell.h >@@ -129,7 +129,7 @@ public: > bool isFirstOrLastCellInRow() const { return !table()->cellAfter(this) || !table()->cellBefore(this); } > #endif > >- LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const override; >+ LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer, VisibleRectOptions) const override; > > void invalidateHasEmptyCollapsedBorders(); > void setHasEmptyCollapsedBorder(CollapsedBorderSide, bool empty) const; >diff --git a/Source/WebCore/rendering/RenderTableCol.cpp b/Source/WebCore/rendering/RenderTableCol.cpp >index 9dc37963962b06630d32cd54b841bcb508e98332..337fc1bd03ee42ed266af68d3429663d1acfd3c6 100644 >--- a/Source/WebCore/rendering/RenderTableCol.cpp >+++ b/Source/WebCore/rendering/RenderTableCol.cpp >@@ -112,7 +112,7 @@ bool RenderTableCol::canHaveChildren() const > return isTableColumnGroup(); > } > >-LayoutRect RenderTableCol::clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const >+LayoutRect RenderTableCol::clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer, VisibleRectOptions options) const > { > // For now, just repaint the whole table. > // FIXME: Find a better way to do this, e.g., need to repaint all the cells that we >@@ -122,7 +122,7 @@ LayoutRect RenderTableCol::clippedOverflowRectForRepaint(const RenderLayerModelO > RenderTable* parentTable = table(); > if (!parentTable) > return LayoutRect(); >- return parentTable->clippedOverflowRectForRepaint(repaintContainer); >+ return parentTable->clippedOverflowRectForRepaint(repaintContainer, options); > } > > void RenderTableCol::imageChanged(WrappedImagePtr, const IntRect*) >diff --git a/Source/WebCore/rendering/RenderTableCol.h b/Source/WebCore/rendering/RenderTableCol.h >index 5ccf6c77b53cbbd14194f2f249ca6be0e9a6b91f..8ac7f1dd957ecff53f5a5e20e99d0da2cf989549 100644 >--- a/Source/WebCore/rendering/RenderTableCol.h >+++ b/Source/WebCore/rendering/RenderTableCol.h >@@ -77,7 +77,7 @@ private: > bool canHaveChildren() const override; > bool requiresLayer() const override { return false; } > >- LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const override; >+ LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer, VisibleRectOptions) const override; > void imageChanged(WrappedImagePtr, const IntRect* = 0) override; > > void styleDidChange(StyleDifference, const RenderStyle* oldStyle) override; >diff --git a/Source/WebCore/rendering/RenderTableRow.cpp b/Source/WebCore/rendering/RenderTableRow.cpp >index 02d03eaaf3281e27a785a20d556f742f2f7b9b17..4f51446626038c9503abc2790f6ac3824f17aad8 100644 >--- a/Source/WebCore/rendering/RenderTableRow.cpp >+++ b/Source/WebCore/rendering/RenderTableRow.cpp >@@ -160,17 +160,17 @@ void RenderTableRow::layout() > clearNeedsLayout(); > } > >-LayoutRect RenderTableRow::clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const >+LayoutRect RenderTableRow::clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer, VisibleRectOptions options) const > { > ASSERT(parent()); > // Rows and cells are in the same coordinate space. We need to both compute our overflow rect (which > // will accommodate a row outline and any visual effects on the row itself), but we also need to add in > // the repaint rects of cells. >- LayoutRect result = RenderBox::clippedOverflowRectForRepaint(repaintContainer); >+ LayoutRect result = RenderBox::clippedOverflowRectForRepaint(repaintContainer, options); > for (RenderTableCell* cell = firstCell(); cell; cell = cell->nextCell()) { > // Even if a cell is a repaint container, it's the row that paints the background behind it. > // So we don't care if a cell is a repaintContainer here. >- result.uniteIfNonZero(cell->clippedOverflowRectForRepaint(repaintContainer)); >+ result.uniteIfNonZero(cell->clippedOverflowRectForRepaint(repaintContainer, options)); > } > return result; > } >diff --git a/Source/WebCore/rendering/RenderTableRow.h b/Source/WebCore/rendering/RenderTableRow.h >index aa5fa2185bb9c910315637297a234d2822d9b046..b8e686ac7548486c779f69b7cd4aa8ba6a61034e 100644 >--- a/Source/WebCore/rendering/RenderTableRow.h >+++ b/Source/WebCore/rendering/RenderTableRow.h >@@ -76,7 +76,7 @@ private: > void willBeRemovedFromTree() override; > > void layout() override; >- LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const override; >+ LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer, VisibleRectOptions) const override; > > bool requiresLayer() const override { return hasOverflowClip() || hasTransformRelatedProperty() || hasHiddenBackface() || hasClipPath() || createsGroup() || isStickilyPositioned(); } > >diff --git a/Source/WebCore/rendering/RenderText.cpp b/Source/WebCore/rendering/RenderText.cpp >index 24d21f62157915b1c0f57c24dab8792e4782a7f5..3eaf0e66f9777381a44d69174f67ea27300cd240 100644 >--- a/Source/WebCore/rendering/RenderText.cpp >+++ b/Source/WebCore/rendering/RenderText.cpp >@@ -1395,7 +1395,7 @@ LayoutRect RenderText::linesVisualOverflowBoundingBox() const > return m_lineBoxes.visualOverflowBoundingBox(*this); > } > >-LayoutRect RenderText::clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const >+LayoutRect RenderText::clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer, VisibleRectOptions options) const > { > RenderObject* rendererToRepaint = containingBlock(); > >@@ -1406,9 +1406,9 @@ LayoutRect RenderText::clippedOverflowRectForRepaint(const RenderLayerModelObjec > > // The renderer we chose to repaint may be an ancestor of repaintContainer, but we need to do a repaintContainer-relative repaint. > if (repaintContainer && repaintContainer != rendererToRepaint && !rendererToRepaint->isDescendantOf(repaintContainer)) >- return repaintContainer->clippedOverflowRectForRepaint(repaintContainer); >+ return repaintContainer->clippedOverflowRectForRepaint(repaintContainer, options); > >- return rendererToRepaint->clippedOverflowRectForRepaint(repaintContainer); >+ return rendererToRepaint->clippedOverflowRectForRepaint(repaintContainer, options); > } > > LayoutRect RenderText::collectSelectionRectsForLineBoxes(const RenderLayerModelObject* repaintContainer, bool clipToVisibleContent, Vector<LayoutRect>* rects) >diff --git a/Source/WebCore/rendering/RenderText.h b/Source/WebCore/rendering/RenderText.h >index c50feb239db42aff0ad1052a03ec15c86bca4b25..e8197904acd2bcba79ebc8ef2a8818066b5c22a1 100644 >--- a/Source/WebCore/rendering/RenderText.h >+++ b/Source/WebCore/rendering/RenderText.h >@@ -203,7 +203,7 @@ private: > void setSelectionState(SelectionState) final; > LayoutRect selectionRectForRepaint(const RenderLayerModelObject* repaintContainer, bool clipToVisibleContent = true) final; > LayoutRect localCaretRect(InlineBox*, unsigned caretOffset, LayoutUnit* extraWidthToEndOfLine = nullptr) override; >- LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const final; >+ LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer, VisibleRectOptions) const final; > > void computePreferredLogicalWidths(float leadWidth, HashSet<const Font*>& fallbackFonts, GlyphOverflow&); > >diff --git a/Source/WebCore/rendering/RenderView.cpp b/Source/WebCore/rendering/RenderView.cpp >index c14451a18eea7a571a2777898a79cc8b43ff3142..487ba04dae64a4cc1d7d788b4590b03479fbe341 100644 >--- a/Source/WebCore/rendering/RenderView.cpp >+++ b/Source/WebCore/rendering/RenderView.cpp >@@ -541,7 +541,7 @@ Optional<LayoutRect> RenderView::computeVisibleRectInContainer(const LayoutRect& > adjustedRect.setX(viewWidth() - adjustedRect.maxX()); > } > >- if (context.m_hasPositionFixedDescendant) >+ if (context.hasPositionFixedDescendant) > adjustedRect.moveBy(frameView().scrollPositionRespectingCustomFixedPosition()); > > // Apply our transform if we have one (because of full page zooming). >diff --git a/Source/WebCore/rendering/svg/RenderSVGForeignObject.cpp b/Source/WebCore/rendering/svg/RenderSVGForeignObject.cpp >index 585c7be797eaa4cb22ee214c010a766f68f6b407..68e387f05c0ebda7e188691f63febd4aa76fd8f8 100644 >--- a/Source/WebCore/rendering/svg/RenderSVGForeignObject.cpp >+++ b/Source/WebCore/rendering/svg/RenderSVGForeignObject.cpp >@@ -93,9 +93,9 @@ void RenderSVGForeignObject::paint(PaintInfo& paintInfo, const LayoutPoint&) > RenderBlock::paint(childPaintInfo, childPoint); > } > >-LayoutRect RenderSVGForeignObject::clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const >+LayoutRect RenderSVGForeignObject::clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer, VisibleRectOptions options) const > { >- return SVGRenderSupport::clippedOverflowRectForRepaint(*this, repaintContainer); >+ return SVGRenderSupport::clippedOverflowRectForRepaint(*this, repaintContainer, options); > } > > Optional<FloatRect> RenderSVGForeignObject::computeFloatVisibleRectInContainer(const FloatRect& rect, const RenderLayerModelObject* container, VisibleRectContext context) const >diff --git a/Source/WebCore/rendering/svg/RenderSVGForeignObject.h b/Source/WebCore/rendering/svg/RenderSVGForeignObject.h >index c281e1c52af841b2d7d0f0c6ba9ad012af12cd0e..a0bc3af0dbb91310d4b58be6b71d3d5ab5a780b6 100644 >--- a/Source/WebCore/rendering/svg/RenderSVGForeignObject.h >+++ b/Source/WebCore/rendering/svg/RenderSVGForeignObject.h >@@ -39,7 +39,7 @@ public: > > void paint(PaintInfo&, const LayoutPoint&) override; > >- LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const override; >+ LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer, VisibleRectOptions) const override; > Optional<FloatRect> computeFloatVisibleRectInContainer(const FloatRect&, const RenderLayerModelObject* container, VisibleRectContext) const override; > Optional<LayoutRect> computeVisibleRectInContainer(const LayoutRect&, const RenderLayerModelObject* container, VisibleRectContext) const override; > >diff --git a/Source/WebCore/rendering/svg/RenderSVGGradientStop.h b/Source/WebCore/rendering/svg/RenderSVGGradientStop.h >index 3550ed15fb3d37e65da80a7b185e06f0fc4fd224..b7d391be596dead4071ef078ed5eab335081102c 100644 >--- a/Source/WebCore/rendering/svg/RenderSVGGradientStop.h >+++ b/Source/WebCore/rendering/svg/RenderSVGGradientStop.h >@@ -45,7 +45,7 @@ private: > // These overrides are needed to prevent ASSERTs on <svg><stop /></svg> > // RenderObject's default implementations ASSERT_NOT_REACHED() > // https://bugs.webkit.org/show_bug.cgi?id=20400 >- LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject*) const override { return LayoutRect(); } >+ LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject*, VisibleRectOptions) const override { return { }; } > FloatRect objectBoundingBox() const override { return FloatRect(); } > FloatRect strokeBoundingBox() const override { return FloatRect(); } > FloatRect repaintRectInLocalCoordinates() const override { return FloatRect(); } >diff --git a/Source/WebCore/rendering/svg/RenderSVGHiddenContainer.h b/Source/WebCore/rendering/svg/RenderSVGHiddenContainer.h >index 3f08195f1facb223e99246e5fcc1fef0b2940705..04d04dd0b3b2b4bca4747fe05887ea95fefb6dc2 100644 >--- a/Source/WebCore/rendering/svg/RenderSVGHiddenContainer.h >+++ b/Source/WebCore/rendering/svg/RenderSVGHiddenContainer.h >@@ -41,7 +41,7 @@ private: > > void paint(PaintInfo&, const LayoutPoint&) final; > >- LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject*) const final { return LayoutRect(); } >+ LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject*, VisibleRectOptions) const final { return { }; } > void absoluteQuads(Vector<FloatQuad>&, bool* wasFixed) const final; > > bool nodeAtFloatPoint(const HitTestRequest&, HitTestResult&, const FloatPoint& pointInParent, HitTestAction) final; >diff --git a/Source/WebCore/rendering/svg/RenderSVGInline.cpp b/Source/WebCore/rendering/svg/RenderSVGInline.cpp >index 3c31056d1cab1fea10490780d00c8dcd2c798068..2f7fcf26e41b9f614159ca61a42f55d11263db49 100644 >--- a/Source/WebCore/rendering/svg/RenderSVGInline.cpp >+++ b/Source/WebCore/rendering/svg/RenderSVGInline.cpp >@@ -70,9 +70,9 @@ FloatRect RenderSVGInline::repaintRectInLocalCoordinates() const > return FloatRect(); > } > >-LayoutRect RenderSVGInline::clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const >+LayoutRect RenderSVGInline::clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer, VisibleRectOptions options) const > { >- return SVGRenderSupport::clippedOverflowRectForRepaint(*this, repaintContainer); >+ return SVGRenderSupport::clippedOverflowRectForRepaint(*this, repaintContainer, options); > } > > Optional<FloatRect> RenderSVGInline::computeFloatVisibleRectInContainer(const FloatRect& rect, const RenderLayerModelObject* container, VisibleRectContext context) const >diff --git a/Source/WebCore/rendering/svg/RenderSVGInline.h b/Source/WebCore/rendering/svg/RenderSVGInline.h >index 5ba4b47f939e3b2703433c536a23f4bbb0e0c6bd..bd45a2545a7c6fe0b94916dab06a6b0ceb5f72b3 100644 >--- a/Source/WebCore/rendering/svg/RenderSVGInline.h >+++ b/Source/WebCore/rendering/svg/RenderSVGInline.h >@@ -50,7 +50,7 @@ private: > FloatRect strokeBoundingBox() const final; > FloatRect repaintRectInLocalCoordinates() const final; > >- LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const final; >+ LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer, VisibleRectOptions) const final; > Optional<FloatRect> computeFloatVisibleRectInContainer(const FloatRect&, const RenderLayerModelObject* container, VisibleRectContext) const final; > void mapLocalToContainer(const RenderLayerModelObject* repaintContainer, TransformState&, MapCoordinatesFlags, bool* wasFixed) const final; > const RenderObject* pushMappingToContainer(const RenderLayerModelObject* ancestorToStopAt, RenderGeometryMap&) const final; >diff --git a/Source/WebCore/rendering/svg/RenderSVGModelObject.cpp b/Source/WebCore/rendering/svg/RenderSVGModelObject.cpp >index 64069c479d254fc43aeaefc6b05a1830cdef8d48..f58adc63b4d0fbc2f3f3ddeb42abf495815cdb2e 100644 >--- a/Source/WebCore/rendering/svg/RenderSVGModelObject.cpp >+++ b/Source/WebCore/rendering/svg/RenderSVGModelObject.cpp >@@ -47,9 +47,9 @@ RenderSVGModelObject::RenderSVGModelObject(SVGElement& element, RenderStyle&& st > { > } > >-LayoutRect RenderSVGModelObject::clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const >+LayoutRect RenderSVGModelObject::clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer, VisibleRectOptions options) const > { >- return SVGRenderSupport::clippedOverflowRectForRepaint(*this, repaintContainer); >+ return SVGRenderSupport::clippedOverflowRectForRepaint(*this, repaintContainer, options); > } > > Optional<FloatRect> RenderSVGModelObject::computeFloatVisibleRectInContainer(const FloatRect& rect, const RenderLayerModelObject* container, VisibleRectContext context) const >diff --git a/Source/WebCore/rendering/svg/RenderSVGModelObject.h b/Source/WebCore/rendering/svg/RenderSVGModelObject.h >index 4d4f453e317e3a579d79e053c01cf754a0ed6191..e477483cc6d44ef9eb6591399760516538a17264 100644 >--- a/Source/WebCore/rendering/svg/RenderSVGModelObject.h >+++ b/Source/WebCore/rendering/svg/RenderSVGModelObject.h >@@ -46,7 +46,7 @@ class SVGElement; > class RenderSVGModelObject : public RenderElement { > WTF_MAKE_ISO_ALLOCATED(RenderSVGModelObject); > public: >- LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const override; >+ LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer, VisibleRectOptions) const override; > Optional<FloatRect> computeFloatVisibleRectInContainer(const FloatRect&, const RenderLayerModelObject* container, VisibleRectContext) const final; > LayoutRect outlineBoundsForRepaint(const RenderLayerModelObject* repaintContainer, const RenderGeometryMap*) const final; > >diff --git a/Source/WebCore/rendering/svg/RenderSVGRoot.cpp b/Source/WebCore/rendering/svg/RenderSVGRoot.cpp >index df0ef6f6f3ed8e3d4212994a9e0337642510cb59..3b47ac09417514b0af569917c3c8ec193dd097ce 100644 >--- a/Source/WebCore/rendering/svg/RenderSVGRoot.cpp >+++ b/Source/WebCore/rendering/svg/RenderSVGRoot.cpp >@@ -326,7 +326,7 @@ const AffineTransform& RenderSVGRoot::localToParentTransform() const > return m_localToParentTransform; > } > >-LayoutRect RenderSVGRoot::clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const >+LayoutRect RenderSVGRoot::clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer, VisibleRectOptions options) const > { > if (style().visibility() != Visibility::Visible && !enclosingLayer()->hasVisibleContent()) > return LayoutRect(); >@@ -338,7 +338,7 @@ LayoutRect RenderSVGRoot::clippedOverflowRectForRepaint(const RenderLayerModelOb > if (m_hasBoxDecorations || hasRenderOverflow()) > repaintRect.unite(unionRect(localSelectionRect(false), visualOverflowRect())); > >- return RenderReplaced::computeRectForRepaint(enclosingIntRect(repaintRect), repaintContainer); >+ return RenderReplaced::computeRectForRepaint(enclosingIntRect(repaintRect), repaintContainer, options); > } > > Optional<FloatRect> RenderSVGRoot::computeFloatVisibleRectInContainer(const FloatRect& rect, const RenderLayerModelObject* container, VisibleRectContext context) const >@@ -353,7 +353,7 @@ Optional<FloatRect> RenderSVGRoot::computeFloatVisibleRectInContainer(const Floa > > // Apply initial viewport clip > if (shouldApplyViewportClip()) { >- if (context.m_options.contains(VisibleRectContextOption::UseEdgeInclusiveIntersection)) { >+ if (context.options.contains(VisibleRectOption::UseEdgeInclusiveIntersection)) { > if (!adjustedRect.edgeInclusiveIntersect(snappedIntRect(borderBoxRect()))) > return WTF::nullopt; > } else >diff --git a/Source/WebCore/rendering/svg/RenderSVGRoot.h b/Source/WebCore/rendering/svg/RenderSVGRoot.h >index c7635b7dc58971695038b41a75a5c93ae82b8f32..c0ac6ec5f816a55bfce4c08f2ec7f3019b570481 100644 >--- a/Source/WebCore/rendering/svg/RenderSVGRoot.h >+++ b/Source/WebCore/rendering/svg/RenderSVGRoot.h >@@ -91,7 +91,7 @@ private: > > bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction) override; > >- LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const override; >+ LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer, VisibleRectOptions) const override; > Optional<FloatRect> computeFloatVisibleRectInContainer(const FloatRect&, const RenderLayerModelObject* container, VisibleRectContext) const override; > > void mapLocalToContainer(const RenderLayerModelObject* repaintContainer, TransformState&, MapCoordinatesFlags, bool* wasFixed) const override; >diff --git a/Source/WebCore/rendering/svg/RenderSVGText.cpp b/Source/WebCore/rendering/svg/RenderSVGText.cpp >index 10f8eb2d83fc6432cc00fefd18777e1ac7860327..95c4999fb509633a35c09318cb688d43a83b03e8 100644 >--- a/Source/WebCore/rendering/svg/RenderSVGText.cpp >+++ b/Source/WebCore/rendering/svg/RenderSVGText.cpp >@@ -87,9 +87,9 @@ const RenderSVGText* RenderSVGText::locateRenderSVGTextAncestor(const RenderObje > return lineageOfType<RenderSVGText>(start).first(); > } > >-LayoutRect RenderSVGText::clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const >+LayoutRect RenderSVGText::clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer, VisibleRectOptions options) const > { >- return SVGRenderSupport::clippedOverflowRectForRepaint(*this, repaintContainer); >+ return SVGRenderSupport::clippedOverflowRectForRepaint(*this, repaintContainer, options); > } > > Optional<LayoutRect> RenderSVGText::computeVisibleRectInContainer(const LayoutRect& rect, const RenderLayerModelObject* container, VisibleRectContext context) const >diff --git a/Source/WebCore/rendering/svg/RenderSVGText.h b/Source/WebCore/rendering/svg/RenderSVGText.h >index 64c47a12bdcda956ec8b8f6c9c16ee40940e49f2..4cf61047dadb3c9d955eee14fec6eff231e777d3 100644 >--- a/Source/WebCore/rendering/svg/RenderSVGText.h >+++ b/Source/WebCore/rendering/svg/RenderSVGText.h >@@ -77,7 +77,7 @@ private: > > void absoluteQuads(Vector<FloatQuad>&, bool* wasFixed) const override; > >- LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer) const override; >+ LayoutRect clippedOverflowRectForRepaint(const RenderLayerModelObject* repaintContainer, VisibleRectOptions) const override; > Optional<LayoutRect> computeVisibleRectInContainer(const LayoutRect&, const RenderLayerModelObject* container, VisibleRectContext) const override; > Optional<FloatRect> computeFloatVisibleRectInContainer(const FloatRect&, const RenderLayerModelObject* container, VisibleRectContext) const override; > >diff --git a/Source/WebCore/rendering/svg/SVGRenderSupport.cpp b/Source/WebCore/rendering/svg/SVGRenderSupport.cpp >index ef46a5a85ce8181e3fe0aa5286e9aa10e5a8ee41..130e73a6ff0fdb7dfa763a2ca59daddb7f210c17 100644 >--- a/Source/WebCore/rendering/svg/SVGRenderSupport.cpp >+++ b/Source/WebCore/rendering/svg/SVGRenderSupport.cpp >@@ -47,11 +47,11 @@ > > namespace WebCore { > >-LayoutRect SVGRenderSupport::clippedOverflowRectForRepaint(const RenderElement& renderer, const RenderLayerModelObject* repaintContainer) >+LayoutRect SVGRenderSupport::clippedOverflowRectForRepaint(const RenderElement& renderer, const RenderLayerModelObject* repaintContainer, VisibleRectOptions options) > { > // Return early for any cases where we don't actually paint > if (renderer.style().visibility() != Visibility::Visible && !renderer.enclosingLayer()->hasVisibleContent()) >- return LayoutRect(); >+ return { }; > > // Pass our local paint rect to computeFloatVisibleRectInContainer() which will > // map to parent coords and recurse up the parent chain. >@@ -59,10 +59,10 @@ LayoutRect SVGRenderSupport::clippedOverflowRectForRepaint(const RenderElement& > const SVGRenderStyle& svgStyle = renderer.style().svgStyle(); > if (const ShadowData* shadow = svgStyle.shadow()) > shadow->adjustRectForShadow(repaintRect); >- return enclosingLayoutRect(renderer.computeFloatRectForRepaint(repaintRect, repaintContainer)); >+ return enclosingLayoutRect(renderer.computeFloatRectForRepaint(repaintRect, repaintContainer, options)); > } > >-Optional<FloatRect> SVGRenderSupport::computeFloatVisibleRectInContainer(const RenderElement& renderer, const FloatRect& rect, const RenderLayerModelObject* container, RenderObject::VisibleRectContext context) >+Optional<FloatRect> SVGRenderSupport::computeFloatVisibleRectInContainer(const RenderElement& renderer, const FloatRect& rect, const RenderLayerModelObject* container, VisibleRectContext context) > { > FloatRect adjustedRect = rect; > const SVGRenderStyle& svgStyle = renderer.style().svgStyle(); >diff --git a/Source/WebCore/rendering/svg/SVGRenderSupport.h b/Source/WebCore/rendering/svg/SVGRenderSupport.h >index cc336e7fcd8d04ad9be8d44e6be47e7c340f05fc..090747ec75183ca761fd10cc929b766eff73376e 100644 >--- a/Source/WebCore/rendering/svg/SVGRenderSupport.h >+++ b/Source/WebCore/rendering/svg/SVGRenderSupport.h >@@ -64,8 +64,8 @@ public: > static bool paintInfoIntersectsRepaintRect(const FloatRect& localRepaintRect, const AffineTransform& localTransform, const PaintInfo&); > > // Important functions used by nearly all SVG renderers centralizing coordinate transformations / repaint rect calculations >- static LayoutRect clippedOverflowRectForRepaint(const RenderElement&, const RenderLayerModelObject* repaintContainer); >- static Optional<FloatRect> computeFloatVisibleRectInContainer(const RenderElement&, const FloatRect&, const RenderLayerModelObject* container, RenderObject::VisibleRectContext); >+ static LayoutRect clippedOverflowRectForRepaint(const RenderElement&, const RenderLayerModelObject* repaintContainer, VisibleRectOptions); >+ static Optional<FloatRect> computeFloatVisibleRectInContainer(const RenderElement&, const FloatRect&, const RenderLayerModelObject* container, VisibleRectContext); > static const RenderElement& localToParentTransform(const RenderElement&, AffineTransform &); > static void mapLocalToContainer(const RenderElement&, const RenderLayerModelObject* repaintContainer, TransformState&, bool* wasFixed); > static const RenderElement* pushMappingToContainer(const RenderElement&, const RenderLayerModelObject* ancestorToStopAt, RenderGeometryMap&); >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index b46c535afa013b8359d34f32d33f7b5b8e808811..9f7aa280a8c5a243c224ab7901c70d5b3c836788 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,15 @@ >+2019-07-01 Simon Fraser <simon.fraser@apple.com> >+ >+ RenderObject::absoluteClippedOverflowRect() should not be affected by whether composited scrolling is enabled >+ https://bugs.webkit.org/show_bug.cgi?id=199344 >+ >+ Reviewed by Tim Horton. >+ >+ * fast/text/mark-matches-overflow-clip-async-scrolling-expected.txt: Added. >+ * fast/text/mark-matches-overflow-clip-async-scrolling.html: Added. >+ Add a test ensuring that text match markers' rendered rects are clipped >+ when inside an `overflow: scroll` area. >+ > 2019-07-01 Chris Dumez <cdumez@apple.com> > > It should not be possible to trigger a load while in the middle of restoring a page in PageCache >diff --git a/LayoutTests/fast/text/mark-matches-overflow-clip-async-scrolling-expected.txt b/LayoutTests/fast/text/mark-matches-overflow-clip-async-scrolling-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..9ee6d51720018be7661ed7893686dff229922679 >--- /dev/null >+++ b/LayoutTests/fast/text/mark-matches-overflow-clip-async-scrolling-expected.txt >@@ -0,0 +1,3 @@ >+Quo usque tandem abutere, Catilina, patientia nostra? >+Before scrolling: marker rects: >+After scrolling: marker rects: (8, 11, 48, 16) >diff --git a/LayoutTests/fast/text/mark-matches-overflow-clip-async-scrolling.html b/LayoutTests/fast/text/mark-matches-overflow-clip-async-scrolling.html >new file mode 100644 >index 0000000000000000000000000000000000000000..7e44bbc95dfc76178a7008b38fba53dc04f1bc53 >--- /dev/null >+++ b/LayoutTests/fast/text/mark-matches-overflow-clip-async-scrolling.html >@@ -0,0 +1,32 @@ >+<!DOCTYPE html> <!-- webkit-test-runner [ internal:AsyncOverflowScrollingEnabled=true ] --> >+<style> >+#scroller { >+ display: inline-block; >+ overflow: scroll; >+ width: 500px; >+ height: 50px; >+ font-family: Ahem; >+} >+</style> >+<div id="scroller"> >+<div style="width: 100px; height: 100px;"></div> >+<span style="position: relative;">Quo usque tandem abutere, Catilina, patientia nostra?</span> >+</div> >+<script> >+window.onload = function () { >+ if (!window.internals) { >+ document.write("This test requires internals + testRunner to run."); >+ return; >+ } >+ >+ testRunner.dumpAsText(); >+ internals.countMatchesForText("Quo", [], "mark"); >+ >+ var markedNode = document.getElementsByTagName("span")[0].firstChild; >+ log.innerText += "Before scrolling: " + internals.dumpMarkerRects("TextMatch") + "\n"; >+ >+ scroller.scrollTo(0, 150); >+ log.innerText += "After scrolling: " + internals.dumpMarkerRects("TextMatch"); >+} >+</script> >+<div id="log"></div> >diff --git a/LayoutTests/platform/ios/fast/text/mark-matches-overflow-clip-async-scrolling-expected.txt b/LayoutTests/platform/ios/fast/text/mark-matches-overflow-clip-async-scrolling-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..90f25613b51134ffbe808445835b14d7b83513c9 >--- /dev/null >+++ b/LayoutTests/platform/ios/fast/text/mark-matches-overflow-clip-async-scrolling-expected.txt >@@ -0,0 +1,3 @@ >+Quo usque tandem abutere, Catilina, patientia nostra? >+Before scrolling: marker rects: >+After scrolling: marker rects: (8, 24, 48, 17)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 199344
:
373179
|
373273
|
373276
|
373277
|
373282
|
373283
|
373295
|
373297
|
373298
| 373299