[IntersectionObserver] Factor out rect mapping and clipping logic from computeRectFor...
authorajuma@chromium.org <ajuma@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 18 Oct 2018 13:50:55 +0000 (13:50 +0000)
committerajuma@chromium.org <ajuma@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 18 Oct 2018 13:50:55 +0000 (13:50 +0000)
commit765ca0f9390291d32b54736e32ef121cc5c01f2c
tree75305e7fd7dfaa7529473b19cbaa9ddb6f3161d9
parentea92da194ad2b2ff04d727272127c6222f1d8a87
[IntersectionObserver] Factor out rect mapping and clipping logic from computeRectForRepaint
https://bugs.webkit.org/show_bug.cgi?id=189833

Reviewed by Simon Fraser.

Factor out the rect mapping and clipping logic from computeRectForRepaint to a new
computeVisibleRectInContainer method that computeRectForRepaint now calls. Make
computeVisibleRectInContainer take a VisibleRectContext with options to use
edge-inclusive intersection and to apply all clips and scrolls rather than only
the clips and scrolls that are currently applied by the repaint logic. These
options will be used by IntersectionObserver in a future patch.

No new tests, no change in behavior.

* platform/graphics/FloatRect.cpp:
(WebCore::FloatRect::edgeInclusiveIntersect):
* platform/graphics/FloatRect.h:
* platform/graphics/LayoutRect.cpp:
(WebCore::LayoutRect::edgeInclusiveIntersect):
* platform/graphics/LayoutRect.h:
* rendering/RenderBox.cpp:
(WebCore::RenderBox::applyCachedClipAndScrollPosition const):
(WebCore::RenderBox::computeVisibleRectUsingPaintOffset const):
(WebCore::RenderBox::computeVisibleRectInContainer const):
(WebCore::RenderBox::applyCachedClipAndScrollPositionForRepaint const): Deleted.
(WebCore::RenderBox::shouldApplyClipAndScrollPositionForRepaint const): Deleted.
The iOS-specific logic in this method has moved to RenderObject::shouldApplyCompositedContainerScrollsForRepaint.
(WebCore::RenderBox::computeRectForRepaint const): Deleted.
* rendering/RenderBox.h:
(WebCore::RenderBox::computeRectForRepaint): Deleted.
* rendering/RenderInline.cpp:
(WebCore::RenderInline::clippedOverflowRectForRepaint const):
(WebCore::RenderInline::computeVisibleRectUsingPaintOffset const):
(WebCore::RenderInline::computeVisibleRectInContainer const):
(WebCore::RenderInline::computeRectForRepaint const): Deleted.
* rendering/RenderInline.h:
(WebCore::RenderInline::computeRectForRepaint): Deleted.
* rendering/RenderObject.cpp:
(WebCore::RenderObject::shouldApplyCompositedContainerScrollsForRepaint):
(WebCore::RenderObject::visibleRectContextForRepaint):
(WebCore::RenderObject::computeRectForRepaint const):
(WebCore::RenderObject::computeFloatRectForRepaint const):
(WebCore::RenderObject::computeVisibleRectInContainer const):
(WebCore::RenderObject::computeFloatVisibleRectInContainer const):
* rendering/RenderObject.h:
(WebCore::RenderObject::computeAbsoluteRepaintRect const):
(WebCore::RenderObject::VisibleRectContext::VisibleRectContext):
(WebCore::RenderObject::RepaintContext::RepaintContext): Deleted.
(WebCore::RenderObject::computeRectForRepaint): Deleted.
* rendering/RenderTableCell.cpp:
(WebCore::RenderTableCell::computeVisibleRectInContainer const):
(WebCore::RenderTableCell::computeRectForRepaint const): Deleted.
* rendering/RenderTableCell.h:
* rendering/RenderView.cpp:
(WebCore::RenderView::computeVisibleRectInContainer const):
(WebCore::RenderView::computeRectForRepaint const): Deleted.
* rendering/RenderView.h:
* rendering/svg/RenderSVGForeignObject.cpp:
(WebCore::RenderSVGForeignObject::computeFloatVisibleRectInContainer const):
(WebCore::RenderSVGForeignObject::computeVisibleRectInContainer const):
(WebCore::RenderSVGForeignObject::computeFloatRectForRepaint const): Deleted.
(WebCore::RenderSVGForeignObject::computeRectForRepaint const): Deleted.
* rendering/svg/RenderSVGForeignObject.h:
* rendering/svg/RenderSVGInline.cpp:
(WebCore::RenderSVGInline::computeFloatVisibleRectInContainer const):
(WebCore::RenderSVGInline::computeFloatRectForRepaint const): Deleted.
* rendering/svg/RenderSVGInline.h:
* rendering/svg/RenderSVGModelObject.cpp:
(WebCore::RenderSVGModelObject::computeFloatVisibleRectInContainer const):
(WebCore::RenderSVGModelObject::computeFloatRectForRepaint const): Deleted.
* rendering/svg/RenderSVGModelObject.h:
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::computeFloatVisibleRectInContainer const):
(WebCore::RenderSVGRoot::computeFloatRectForRepaint const): Deleted.
* rendering/svg/RenderSVGRoot.h:
* rendering/svg/RenderSVGText.cpp:
(WebCore::RenderSVGText::computeVisibleRectInContainer const):
(WebCore::RenderSVGText::computeFloatVisibleRectInContainer const):
(WebCore::RenderSVGText::computeRectForRepaint const): Deleted.
(WebCore::RenderSVGText::computeFloatRectForRepaint const): Deleted.
* rendering/svg/RenderSVGText.h:
* rendering/svg/SVGRenderSupport.cpp:
(WebCore::SVGRenderSupport::clippedOverflowRectForRepaint):
(WebCore::SVGRenderSupport::computeFloatVisibleRectInContainer):
(WebCore::SVGRenderSupport::computeFloatRectForRepaint): Deleted.
* rendering/svg/SVGRenderSupport.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@237255 268f45cc-cd09-0410-ab3c-d52691b4dbfc
27 files changed:
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/FloatRect.cpp
Source/WebCore/platform/graphics/FloatRect.h
Source/WebCore/platform/graphics/LayoutRect.cpp
Source/WebCore/platform/graphics/LayoutRect.h
Source/WebCore/rendering/RenderBox.cpp
Source/WebCore/rendering/RenderBox.h
Source/WebCore/rendering/RenderInline.cpp
Source/WebCore/rendering/RenderInline.h
Source/WebCore/rendering/RenderObject.cpp
Source/WebCore/rendering/RenderObject.h
Source/WebCore/rendering/RenderTableCell.cpp
Source/WebCore/rendering/RenderTableCell.h
Source/WebCore/rendering/RenderView.cpp
Source/WebCore/rendering/RenderView.h
Source/WebCore/rendering/svg/RenderSVGForeignObject.cpp
Source/WebCore/rendering/svg/RenderSVGForeignObject.h
Source/WebCore/rendering/svg/RenderSVGInline.cpp
Source/WebCore/rendering/svg/RenderSVGInline.h
Source/WebCore/rendering/svg/RenderSVGModelObject.cpp
Source/WebCore/rendering/svg/RenderSVGModelObject.h
Source/WebCore/rendering/svg/RenderSVGRoot.cpp
Source/WebCore/rendering/svg/RenderSVGRoot.h
Source/WebCore/rendering/svg/RenderSVGText.cpp
Source/WebCore/rendering/svg/RenderSVGText.h
Source/WebCore/rendering/svg/SVGRenderSupport.cpp
Source/WebCore/rendering/svg/SVGRenderSupport.h