本文整理汇总了C++中LayoutRect::intersect方法的典型用法代码示例。如果您正苦于以下问题:C++ LayoutRect::intersect方法的具体用法?C++ LayoutRect::intersect怎么用?C++ LayoutRect::intersect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LayoutRect
的用法示例。
在下文中一共展示了LayoutRect::intersect方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: clippedOverflowRectForPaintInvalidation
LayoutRect SVGRenderSupport::clippedOverflowRectForPaintInvalidation(const RenderObject* object, const RenderLayerModelObject* paintInvalidationContainer, const PaintInvalidationState* paintInvalidationState)
{
// Return early for any cases where we don't actually paint
if (object->style()->visibility() != VISIBLE && !object->enclosingLayer()->hasVisibleContent())
return LayoutRect();
// Pass our local paint rect to computeRectForPaintInvalidation() which will
// map to parent coords and recurse up the parent chain.
FloatRect paintInvalidationRect = object->paintInvalidationRectInLocalCoordinates();
paintInvalidationRect.inflate(object->style()->outlineWidth());
if (paintInvalidationState && paintInvalidationState->canMapToContainer(paintInvalidationContainer)) {
// Compute accumulated SVG transform and apply to local paint rect.
AffineTransform transform = paintInvalidationState->svgTransform() * object->localToParentTransform();
paintInvalidationRect = transform.mapRect(paintInvalidationRect);
// FIXME: These are quirks carried forward from the old paint invalidation infrastructure.
LayoutRect rect = enclosingIntRectIfNotEmpty(paintInvalidationRect);
// Offset by SVG root paint offset and apply clipping as needed.
rect.move(paintInvalidationState->paintOffset());
if (paintInvalidationState->isClipped())
rect.intersect(paintInvalidationState->clipRect());
return rect;
}
LayoutRect rect;
const RenderSVGRoot& svgRoot = mapRectToSVGRootForPaintInvalidation(object, paintInvalidationRect, rect);
svgRoot.mapRectToPaintInvalidationBacking(paintInvalidationContainer, rect, paintInvalidationState);
return rect;
}
示例2: rectFlowPortionForBox
LayoutRect RenderRegion::rectFlowPortionForBox(const RenderBox* box, const LayoutRect& rect) const
{
RenderRegion* startRegion = 0;
RenderRegion* endRegion = 0;
m_flowThread->getRegionRangeForBox(box, startRegion, endRegion);
LayoutRect mappedRect = m_flowThread->mapFromLocalToFlowThread(box, rect);
if (flowThread()->isHorizontalWritingMode()) {
if (this != startRegion)
mappedRect.shiftYEdgeTo(std::max<LayoutUnit>(logicalTopForFlowThreadContent(), mappedRect.y()));
if (this != endRegion)
mappedRect.setHeight(std::max<LayoutUnit>(0, std::min<LayoutUnit>(logicalBottomForFlowThreadContent() - mappedRect.y(), mappedRect.height())));
} else {
if (this != startRegion)
mappedRect.shiftXEdgeTo(std::max<LayoutUnit>(logicalTopForFlowThreadContent(), mappedRect.x()));
if (this != endRegion)
mappedRect.setWidth(std::max<LayoutUnit>(0, std::min<LayoutUnit>(logicalBottomForFlowThreadContent() - mappedRect.x(), mappedRect.width())));
}
bool isLastRegionWithRegionFragmentBreak = (isLastRegion() && (style().regionFragment() == BreakRegionFragment));
if (hasOverflowClip() || isLastRegionWithRegionFragmentBreak)
mappedRect.intersect(flowThreadPortionRect());
return mappedRect.isEmpty() ? mappedRect : m_flowThread->mapFromFlowThreadToLocal(box, mappedRect);
}
示例3: invalidatePaintForOverflow
void RenderBlockFlow::invalidatePaintForOverflow()
{
// FIXME: We could tighten up the left and right invalidation points if we let layoutInlineChildren fill them in based off the particular lines
// it had to lay out. We wouldn't need the hasOverflowClip() hack in that case either.
LayoutUnit paintInvalidationLogicalLeft = logicalLeftVisualOverflow();
LayoutUnit paintInvalidationLogicalRight = logicalRightVisualOverflow();
if (hasOverflowClip()) {
// If we have clipped overflow, we should use layout overflow as well, since visual overflow from lines didn't propagate to our block's overflow.
// Note the old code did this as well but even for overflow:visible. The addition of hasOverflowClip() at least tightens up the hack a bit.
// layoutInlineChildren should be patched to compute the entire paint invalidation rect.
paintInvalidationLogicalLeft = std::min(paintInvalidationLogicalLeft, logicalLeftLayoutOverflow());
paintInvalidationLogicalRight = std::max(paintInvalidationLogicalRight, logicalRightLayoutOverflow());
}
LayoutRect paintInvalidationRect = LayoutRect(paintInvalidationLogicalLeft, m_paintInvalidationLogicalTop, paintInvalidationLogicalRight - paintInvalidationLogicalLeft, m_paintInvalidationLogicalBottom - m_paintInvalidationLogicalTop);
if (hasOverflowClip()) {
// Adjust the paint invalidation rect for scroll offset
paintInvalidationRect.move(-scrolledContentOffset());
// Don't allow this rect to spill out of our overflow box.
paintInvalidationRect.intersect(LayoutRect(LayoutPoint(), size()));
}
// Make sure the rect is still non-empty after intersecting for overflow above
if (!paintInvalidationRect.isEmpty()) {
// Hits in media/event-attributes.html
DisableCompositingQueryAsserts disabler;
invalidatePaintRectangle(paintInvalidationRect); // We need to do a partial paint invalidation of our content.
}
m_paintInvalidationLogicalTop = 0;
m_paintInvalidationLogicalBottom = 0;
}
示例4: rectFlowPortionForBox
LayoutRect RenderRegion::rectFlowPortionForBox(const RenderBox* box, const LayoutRect& rect) const
{
RenderRegion* startRegion = 0;
RenderRegion* endRegion = 0;
m_flowThread->getRegionRangeForBox(box, startRegion, endRegion);
LayoutRect mappedRect = m_flowThread->mapFromLocalToFlowThread(box, rect);
if (flowThread()->isHorizontalWritingMode()) {
if (this != startRegion)
mappedRect.shiftYEdgeTo(std::max<LayoutUnit>(logicalTopForFlowThreadContent(), mappedRect.y()));
if (this != endRegion)
mappedRect.setHeight(std::max<LayoutUnit>(0, std::min<LayoutUnit>(logicalBottomForFlowThreadContent() - mappedRect.y(), mappedRect.height())));
} else {
if (this != startRegion)
mappedRect.shiftXEdgeTo(std::max<LayoutUnit>(logicalTopForFlowThreadContent(), mappedRect.x()));
if (this != endRegion)
mappedRect.setWidth(std::max<LayoutUnit>(0, std::min<LayoutUnit>(logicalBottomForFlowThreadContent() - mappedRect.x(), mappedRect.width())));
}
if (shouldClipFlowThreadContent()) {
LayoutRect portionRect;
if (isRenderNamedFlowFragment())
portionRect = toRenderNamedFlowFragment(this)->flowThreadPortionRectForClipping(this == startRegion, this == endRegion);
else
portionRect = flowThreadPortionRect();
mappedRect.intersect(portionRect);
}
return mappedRect.isEmpty() ? mappedRect : m_flowThread->mapFromFlowThreadToLocal(box, mappedRect);
}
示例5: mapToVisualRectInAncestorSpace
bool SVGLayoutSupport::mapToVisualRectInAncestorSpace(
const LayoutObject& object,
const LayoutBoxModelObject* ancestor,
const FloatRect& localPaintInvalidationRect,
LayoutRect& resultRect,
VisualRectFlags visualRectFlags) {
AffineTransform rootBorderBoxTransform;
const LayoutSVGRoot& svgRoot =
computeTransformToSVGRoot(object, rootBorderBoxTransform);
resultRect = transformPaintInvalidationRect(object, rootBorderBoxTransform,
localPaintInvalidationRect);
// Apply initial viewport clip.
if (svgRoot.shouldApplyViewportClip()) {
LayoutRect clipRect(svgRoot.overflowClipRect(LayoutPoint()));
if (visualRectFlags & EdgeInclusive) {
if (!resultRect.inclusiveIntersect(clipRect))
return false;
} else {
resultRect.intersect(clipRect);
}
}
return svgRoot.mapToVisualRectInAncestorSpace(ancestor, resultRect,
visualRectFlags);
}
示例6: repaintOrMarkForLayout
void RenderImage::repaintOrMarkForLayout(bool imageSizeChangedToAccomodateAltText, const IntRect* rect)
{
LayoutSize oldIntrinsicSize = intrinsicSize();
LayoutSize newIntrinsicSize = m_imageResource->intrinsicSize(style()->effectiveZoom());
updateIntrinsicSizeIfNeeded(newIntrinsicSize);
// In the case of generated image content using :before/:after/content, we might not be
// in the render tree yet. In that case, we just need to update our intrinsic size.
// layout() will be called after we are inserted in the tree which will take care of
// what we are doing here.
if (!containingBlock())
return;
bool imageSourceHasChangedSize = oldIntrinsicSize != newIntrinsicSize || imageSizeChangedToAccomodateAltText;
if (imageSourceHasChangedSize)
setPreferredLogicalWidthsDirty();
// If the actual area occupied by the image has changed and it is not constrained by style then a layout is required.
bool imageSizeIsConstrained = style()->logicalWidth().isSpecified() && style()->logicalHeight().isSpecified();
bool needsLayout = !imageSizeIsConstrained && imageSourceHasChangedSize;
// FIXME: We only need to recompute the containing block's preferred size if the containing block's size
// depends on the image's size (i.e., the container uses shrink-to-fit sizing).
// There's no easy way to detect that shrink-to-fit is needed, always force a layout.
bool containingBlockNeedsToRecomputePreferredSize = style()->logicalWidth().isPercent() || style()->logicalMaxWidth().isPercent() || style()->logicalMinWidth().isPercent();
if (needsLayout || containingBlockNeedsToRecomputePreferredSize) {
setNeedsLayout();
return;
}
// The image hasn't changed in size or its style constrains its size, so a repaint will suffice.
if (everHadLayout() && !selfNeedsLayout()) {
// The inner content rectangle is calculated during layout, but may need an update now
// (unless the box has already been scheduled for layout). In order to calculate it, we
// may need values from the containing block, though, so make sure that we're not too
// early. It may be that layout hasn't even taken place once yet.
updateInnerContentRect();
}
LayoutRect repaintRect;
if (rect) {
// The image changed rect is in source image coordinates (pre-zooming),
// so map from the bounds of the image to the contentsBox.
repaintRect = enclosingIntRect(mapRect(*rect, FloatRect(FloatPoint(), m_imageResource->imageSize(1.0f)), contentBoxRect()));
// Guard against too-large changed rects.
repaintRect.intersect(contentBoxRect());
} else {
repaintRect = contentBoxRect();
}
{
// FIXME: We should not be allowing repaint during layout. crbug.com/339584
AllowRepaintScope scoper(frameView());
repaintRectangle(repaintRect);
}
// Tell any potential compositing layers that the image needs updating.
contentChanged(ImageChanged);
}
示例7: updateImageLoadingPriorities
bool LayoutImage::updateImageLoadingPriorities()
{
if (!m_imageResource || !m_imageResource->cachedImage() || m_imageResource->cachedImage()->isLoaded())
return false;
LayoutRect viewBounds = viewRect();
LayoutRect objectBounds = LayoutRect(absoluteContentBox());
// The object bounds might be empty right now, so intersects will fail since it doesn't deal
// with empty rects. Use LayoutRect::contains in that case.
bool isVisible;
if (!objectBounds.isEmpty())
isVisible = viewBounds.intersects(objectBounds);
else
isVisible = viewBounds.contains(objectBounds);
ResourceLoadPriorityOptimizer::VisibilityStatus status = isVisible ?
ResourceLoadPriorityOptimizer::Visible : ResourceLoadPriorityOptimizer::NotVisible;
LayoutRect screenArea;
if (!objectBounds.isEmpty()) {
screenArea = viewBounds;
screenArea.intersect(objectBounds);
}
ResourceLoadPriorityOptimizer::resourceLoadPriorityOptimizer()->notifyImageResourceVisibility(m_imageResource->cachedImage(), status, screenArea);
return true;
}
示例8: imageDimensionsChanged
void RenderImage::imageDimensionsChanged(bool imageSizeChanged, const IntRect* rect)
{
bool intrinsicSizeChanged = updateIntrinsicSizeIfNeeded(m_imageResource->imageSize(style()->effectiveZoom()), imageSizeChanged);
// In the case of generated image content using :before/:after/content, we might not be
// in the render tree yet. In that case, we just need to update our intrinsic size.
// layout() will be called after we are inserted in the tree which will take care of
// what we are doing here.
if (!containingBlock())
return;
bool shouldRepaint = true;
if (intrinsicSizeChanged) {
if (!preferredLogicalWidthsDirty())
setPreferredLogicalWidthsDirty(true);
bool hasOverrideSize = hasOverrideHeight() || hasOverrideWidth();
if (!hasOverrideSize && !imageSizeChanged) {
LogicalExtentComputedValues computedValues;
computeLogicalWidthInRegion(computedValues);
LayoutUnit newWidth = computedValues.m_extent;
computeLogicalHeight(height(), 0, computedValues);
LayoutUnit newHeight = computedValues.m_extent;
imageSizeChanged = width() != newWidth || height() != newHeight;
}
// FIXME: We only need to recompute the containing block's preferred size
// if the containing block's size depends on the image's size (i.e., the container uses shrink-to-fit sizing).
// There's no easy way to detect that shrink-to-fit is needed, always force a layout.
bool containingBlockNeedsToRecomputePreferredSize =
style()->logicalWidth().isPercent()
|| style()->logicalMaxWidth().isPercent()
|| style()->logicalMinWidth().isPercent();
if (imageSizeChanged || hasOverrideSize || containingBlockNeedsToRecomputePreferredSize) {
shouldRepaint = false;
if (!selfNeedsLayout())
setNeedsLayout();
}
}
if (shouldRepaint) {
LayoutRect repaintRect;
if (rect) {
// The image changed rect is in source image coordinates (pre-zooming),
// so map from the bounds of the image to the contentsBox.
repaintRect = enclosingIntRect(mapRect(*rect, FloatRect(FloatPoint(), m_imageResource->imageSize(1.0f)), contentBoxRect()));
// Guard against too-large changed rects.
repaintRect.intersect(contentBoxRect());
} else
repaintRect = contentBoxRect();
repaintRectangle(repaintRect);
// Tell any potential compositing layers that the image needs updating.
contentChanged(ImageChanged);
}
}
开发者ID:IllusionRom-deprecated,项目名称:android_platform_external_chromium_org_third_party_WebKit,代码行数:59,代码来源:RenderImage.cpp
示例9: properties
BoxClipper::BoxClipper(const LayoutBox& box, const PaintInfo& paintInfo, const LayoutPoint& accumulatedOffset, ContentsClipBehavior contentsClipBehavior)
: m_box(box)
, m_paintInfo(paintInfo)
, m_clipType(DisplayItem::UninitializedType)
{
ASSERT(m_paintInfo.phase != PaintPhaseSelfBlockBackgroundOnly && m_paintInfo.phase != PaintPhaseSelfOutlineOnly);
if (m_paintInfo.phase == PaintPhaseMask)
return;
if (RuntimeEnabledFeatures::slimmingPaintV2Enabled()) {
const auto* objectProperties = m_box.objectPaintProperties();
if (objectProperties && objectProperties->overflowClip()) {
PaintChunkProperties properties(paintInfo.context.getPaintController().currentPaintChunkProperties());
properties.clip = objectProperties->overflowClip();
m_scopedClipProperty.emplace(paintInfo.context.getPaintController(), properties);
}
return;
}
bool isControlClip = m_box.hasControlClip();
bool isOverflowOrContainmentClip = (m_box.hasOverflowClip() && !m_box.layer()->isSelfPaintingLayer())
|| m_box.style()->containsPaint();
if (!isControlClip && !isOverflowOrContainmentClip)
return;
LayoutRect clipRect = isControlClip ? m_box.controlClipRect(accumulatedOffset) : m_box.overflowClipRect(accumulatedOffset);
FloatRoundedRect clipRoundedRect(0, 0, 0, 0);
bool hasBorderRadius = m_box.style()->hasBorderRadius();
if (hasBorderRadius)
clipRoundedRect = m_box.style()->getRoundedInnerBorderFor(LayoutRect(accumulatedOffset, m_box.size()));
// Selection does not affect visual overflow, so this optimization is invalid if selection
// is present.
if (contentsClipBehavior == SkipContentsClipIfPossible && box.getSelectionState() == SelectionNone) {
LayoutRect contentsVisualOverflow = m_box.contentsVisualOverflowRect();
if (contentsVisualOverflow.isEmpty())
return;
LayoutRect conservativeClipRect = clipRect;
if (hasBorderRadius)
conservativeClipRect.intersect(LayoutRect(clipRoundedRect.radiusCenterRect()));
conservativeClipRect.moveBy(-accumulatedOffset);
if (m_box.hasLayer())
conservativeClipRect.move(m_box.scrolledContentOffset());
if (conservativeClipRect.contains(contentsVisualOverflow))
return;
}
if (!m_paintInfo.context.getPaintController().displayItemConstructionIsDisabled()) {
m_clipType = m_paintInfo.displayItemTypeForClipping();
Vector<FloatRoundedRect> roundedRects;
if (hasBorderRadius)
roundedRects.append(clipRoundedRect);
m_paintInfo.context.getPaintController().createAndAppend<ClipDisplayItem>(m_box, m_clipType, pixelSnappedIntRect(clipRect), roundedRects);
}
}
示例10: paintInvalidationOrMarkForLayout
void RenderImage::paintInvalidationOrMarkForLayout(const IntRect* rect)
{
ASSERT(isRooted());
LayoutSize oldIntrinsicSize = intrinsicSize();
LayoutSize newIntrinsicSize = m_imageResource->intrinsicSize();
updateIntrinsicSizeIfNeeded(newIntrinsicSize);
bool imageSourceHasChangedSize = oldIntrinsicSize != newIntrinsicSize;
if (imageSourceHasChangedSize)
setPreferredLogicalWidthsDirty();
// If the actual area occupied by the image has changed and it is not constrained by style then a layout is required.
bool imageSizeIsConstrained = style()->logicalWidth().isSpecified() && style()->logicalHeight().isSpecified();
// FIXME: We only need to recompute the containing block's preferred size if the containing block's size
// depends on the image's size (i.e., the container uses shrink-to-fit sizing).
// There's no easy way to detect that shrink-to-fit is needed, always force a layout.
bool containingBlockNeedsToRecomputePreferredSize = style()->logicalWidth().isPercent() || style()->logicalMaxWidth().isPercent() || style()->logicalMinWidth().isPercent();
if (imageSourceHasChangedSize && (!imageSizeIsConstrained || containingBlockNeedsToRecomputePreferredSize)) {
setNeedsLayoutAndFullPaintInvalidation();
return;
}
// The image hasn't changed in size or its style constrains its size, so a paint invalidation will suffice.
if (everHadLayout() && !selfNeedsLayout()) {
// The inner content rectangle is calculated during layout, but may need an update now
// (unless the box has already been scheduled for layout). In order to calculate it, we
// may need values from the containing block, though, so make sure that we're not too
// early. It may be that layout hasn't even taken place once yet.
updateInnerContentRect();
}
LayoutRect paintInvalidationRect;
if (rect) {
// The image changed rect is in source image coordinates,
// so map from the bounds of the image to the contentsBox.
paintInvalidationRect = enclosingIntRect(mapRect(*rect, FloatRect(FloatPoint(), m_imageResource->imageSize()), contentBoxRect()));
// Guard against too-large changed rects.
paintInvalidationRect.intersect(contentBoxRect());
} else {
paintInvalidationRect = contentBoxRect();
}
{
// FIXME: We should not be allowing paint invalidations during layout. crbug.com/339584
AllowPaintInvalidationScope scoper(frameView());
DisableCompositingQueryAsserts disabler;
invalidatePaintRectangle(paintInvalidationRect);
}
// Tell any potential compositing layers that the image needs updating.
contentChanged(ImageChanged);
}
示例11: mapToVisibleRectInAncestorSpace
void LayoutSVGRoot::mapToVisibleRectInAncestorSpace(const LayoutBoxModelObject* ancestor, LayoutRect& rect, const PaintInvalidationState* paintInvalidationState) const
{
// Note that we don't apply the border-box transform here - it's assumed
// that whoever called us has done that already.
// Apply initial viewport clip
if (shouldApplyViewportClip())
rect.intersect(LayoutRect(pixelSnappedBorderBoxRect()));
LayoutReplaced::mapToVisibleRectInAncestorSpace(ancestor, rect, paintInvalidationState);
}
示例12: computeSourceImageRectForDirtyRect
LayoutRect FilterEffectRenderer::computeSourceImageRectForDirtyRect(const LayoutRect& filterBoxRect, const LayoutRect& dirtyRect)
{
// The result of this function is the area in the "filterBoxRect" that needs to be repainted, so that we fully cover the "dirtyRect".
LayoutRect rectForRepaint = dirtyRect;
if (hasFilterThatMovesPixels()) {
// Note that the outsets are reversed here because we are going backwards -> we have the dirty rect and
// need to find out what is the rectangle that might influence the result inside that dirty rect.
rectForRepaint.move(-m_outsets.right(), -m_outsets.bottom());
rectForRepaint.expand(m_outsets.left() + m_outsets.right(), m_outsets.top() + m_outsets.bottom());
}
rectForRepaint.intersect(filterBoxRect);
return rectForRepaint;
}
示例13: computeRectForRepaint
void RenderSVGRoot::computeRectForRepaint(RenderBoxModelObject* repaintContainer, LayoutRect& repaintRect, bool fixed) const
{
// Apply our local transforms (except for x/y translation), then our shadow,
// and then call RenderBox's method to handle all the normal CSS Box model bits
repaintRect = localToBorderBoxTransform().mapRect(repaintRect);
// Apply initial viewport clip - not affected by overflow settings
repaintRect.intersect(enclosingLayoutRect(FloatRect(FloatPoint(), m_viewportSize)));
const SVGRenderStyle* svgStyle = style()->svgStyle();
if (const ShadowData* shadow = svgStyle->shadow())
shadow->adjustRectForShadow(repaintRect);
RenderBox::computeRectForRepaint(repaintContainer, repaintRect, fixed);
}
示例14: imageDimensionsChanged
void RenderImage::imageDimensionsChanged(bool imageSizeChanged, const IntRect* rect)
{
bool shouldRepaint = true;
if (updateIntrinsicSizeIfNeeded(m_imageResource->imageSize(style()->effectiveZoom()), imageSizeChanged)) {
// In the case of generated image content using :before/:after, we might not be in the
// render tree yet. In that case, we don't need to worry about check for layout, since we'll get a
// layout when we get added in to the render tree hierarchy later.
if (containingBlock()) {
// lets see if we need to relayout at all..
int oldwidth = width();
int oldheight = height();
if (!preferredLogicalWidthsDirty())
setPreferredLogicalWidthsDirty(true);
computeLogicalWidth();
computeLogicalHeight();
if (imageSizeChanged || width() != oldwidth || height() != oldheight) {
shouldRepaint = false;
if (!selfNeedsLayout())
setNeedsLayout(true);
}
setWidth(oldwidth);
setHeight(oldheight);
}
}
if (shouldRepaint) {
LayoutRect repaintRect;
if (rect) {
// The image changed rect is in source image coordinates (pre-zooming),
// so map from the bounds of the image to the contentsBox.
repaintRect = enclosingIntRect(mapRect(*rect, FloatRect(FloatPoint(), m_imageResource->imageSize(1.0f)), contentBoxRect()));
// Guard against too-large changed rects.
repaintRect.intersect(contentBoxRect());
} else
repaintRect = contentBoxRect();
repaintRectangle(repaintRect);
#if USE(ACCELERATED_COMPOSITING)
if (hasLayer()) {
// Tell any potential compositing layers that the image needs updating.
layer()->contentChanged(RenderLayer::ImageChanged);
}
#endif
}
}
示例15: clipToRoot
void IntersectionObservation::clipToRoot(LayoutRect& rect)
{
// Map and clip rect into root element coordinates.
// TODO(szager): the writing mode flipping needs a test.
ASSERT(m_target);
LayoutObject* rootLayoutObject = m_observer->rootLayoutObject();
LayoutObject* targetLayoutObject = target()->layoutObject();
targetLayoutObject->mapToVisibleRectInAncestorSpace(toLayoutBoxModelObject(rootLayoutObject), rect, nullptr);
if (rootLayoutObject->hasOverflowClip()) {
LayoutBox* rootLayoutBox = toLayoutBox(rootLayoutObject);
LayoutRect clipRect(LayoutPoint(), LayoutSize(rootLayoutBox->layer()->size()));
m_observer->applyRootMargin(clipRect);
rootLayoutBox->flipForWritingMode(rect);
rect.intersect(clipRect);
rootLayoutBox->flipForWritingMode(rect);
}
}