Skip to content

Commit 42d07b7

Browse files
committed
Rename RenderObject::absoluteRects() to RenderObject::boundingRects()
https://bugs.webkit.org/show_bug.cgi?id=259672 rdar://113175046 Reviewed by Alan Baradlay. `RenderObject::absoluteRects()` didn't return absolute rects; it returns whatever the caller asked for via the second parameter. So rename to `boundingRects()`. Also change the rects to be LayoutRects. * Source/WebCore/accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::elementPath const): * Source/WebCore/html/HTMLAnchorElement.cpp: (WebCore::hasNonEmptyBox): * Source/WebCore/page/LocalFrameView.cpp: (WebCore::LocalFrameView::textFragmentIndicatorTimerFired): p* Source/WebCore/rendering/RenderBlock.cpp: (WebCore::RenderBlock::boundingRects const): (WebCore::RenderBlock::absoluteRects const): Deleted. * Source/WebCore/rendering/RenderBlock.h: * Source/WebCore/rendering/RenderBox.cpp: (WebCore::RenderBox::boundingRects const): (WebCore::RenderBox::absoluteRects const): Deleted. * Source/WebCore/rendering/RenderBox.h: * Source/WebCore/rendering/RenderInline.cpp: (WebCore::RenderInline::boundingRects const): (WebCore::RenderInline::absoluteRects const): Deleted. * Source/WebCore/rendering/RenderInline.h: * Source/WebCore/rendering/RenderLineBreak.cpp: (WebCore::RenderLineBreak::boundingRects const): (WebCore::RenderLineBreak::absoluteRects const): Deleted. * Source/WebCore/rendering/RenderLineBreak.h: * Source/WebCore/rendering/RenderObject.cpp: (WebCore::RenderObject::absoluteBoundingBoxRect const): (WebCore::RenderObject::absoluteTextRects): * Source/WebCore/rendering/RenderObject.h: (WebCore::RenderObject::boundingRects const): (WebCore::RenderObject::absoluteRects const): Deleted. * Source/WebCore/rendering/RenderText.cpp: (WebCore::RenderText::boundingRects const): (WebCore::RenderText::absoluteRects const): Deleted. * Source/WebCore/rendering/RenderText.h: * Source/WebCore/rendering/RenderView.cpp: (WebCore::RenderView::boundingRects const): (WebCore::RenderView::absoluteRects const): Deleted. * Source/WebCore/rendering/RenderView.h: * Source/WebCore/rendering/svg/LegacyRenderSVGModelObject.cpp: (WebCore::LegacyRenderSVGModelObject::boundingRects const): (WebCore::LegacyRenderSVGModelObject::absoluteRects const): Deleted. * Source/WebCore/rendering/svg/LegacyRenderSVGModelObject.h: * Source/WebCore/rendering/svg/RenderSVGBlock.cpp: (WebCore::RenderSVGBlock::boundingRects const): (WebCore::RenderSVGBlock::absoluteRects const): Deleted. * Source/WebCore/rendering/svg/RenderSVGBlock.h: * Source/WebCore/rendering/svg/RenderSVGHiddenContainer.h: * Source/WebCore/rendering/svg/RenderSVGModelObject.cpp: (WebCore::RenderSVGModelObject::boundingRects const): (WebCore::RenderSVGModelObject::absoluteRects const): Deleted. * Source/WebCore/rendering/svg/RenderSVGModelObject.h: * Source/WebCore/rendering/svg/RenderSVGRoot.cpp: (WebCore::RenderSVGRoot::boundingRects const): (WebCore::RenderSVGRoot::absoluteRects const): Deleted. * Source/WebCore/rendering/svg/RenderSVGRoot.h: Canonical link: https://commits.webkit.org/266494@main
1 parent 07b5559 commit 42d07b7

26 files changed

+66
-60
lines changed

Source/WebCore/accessibility/AccessibilityRenderObject.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -877,21 +877,21 @@ bool AccessibilityRenderObject::supportsPath() const
877877
Path AccessibilityRenderObject::elementPath() const
878878
{
879879
if (is<RenderText>(renderer())) {
880-
Vector<IntRect> rects;
881-
downcast<RenderText>(*m_renderer).absoluteRects(rects, flooredLayoutPoint(m_renderer->localToAbsolute()));
880+
Vector<LayoutRect> rects;
881+
downcast<RenderText>(*m_renderer).boundingRects(rects, flooredLayoutPoint(m_renderer->localToAbsolute()));
882882
// If only 1 rect, don't compute path since the bounding rect will be good enough.
883883
if (rects.size() < 2)
884884
return Path();
885885

886886
// Compute the path only if this is the last part of a line followed by the beginning of the next line.
887887
const auto& style = m_renderer->style();
888888
bool rightToLeftText = style.direction() == TextDirection::RTL;
889-
static const int xTolerance = 5;
890-
static const int yTolerance = 5;
889+
static const auto xTolerance = 5_lu;
890+
static const auto yTolerance = 5_lu;
891891
bool needsPath = false;
892-
IntRect unionRect = rects[0];
892+
auto unionRect = rects[0];
893893
for (size_t i = 1; i < rects.size(); ++i) {
894-
needsPath = std::abs(rects[i].y() - unionRect.maxY()) < yTolerance // This rect is in a new line.
894+
needsPath = absoluteValue(rects[i].y() - unionRect.maxY()) < yTolerance // This rect is in a new line.
895895
&& (rightToLeftText ? rects[i].x() - unionRect.x() > xTolerance
896896
: unionRect.x() - rects[i].x() > xTolerance); // And this rect is to right/left of all previous rects.
897897

@@ -922,6 +922,7 @@ Path AccessibilityRenderObject::elementPath() const
922922
return path;
923923

924924
// The SVG path is in terms of the parent's bounding box. The path needs to be offset to frame coordinates.
925+
// FIXME: This seems wrong for SVG inside HTML.
925926
if (auto svgRoot = ancestorsOfType<LegacyRenderSVGRoot>(*m_renderer).first()) {
926927
LayoutPoint parentOffset = cache->getOrCreate(&*svgRoot)->elementRect().location();
927928
path.transform(AffineTransform().translate(parentOffset.x(), parentOffset.y()));

Source/WebCore/html/HTMLAnchorElement.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ static bool hasNonEmptyBox(RenderBoxModelObject* renderer)
127127

128128
// FIXME: Since all we are checking is whether the rects are empty, could we just
129129
// pass in 0,0 for the layout point instead of calling localToAbsolute?
130-
Vector<IntRect> rects;
131-
renderer->absoluteRects(rects, flooredLayoutPoint(renderer->localToAbsolute()));
130+
Vector<LayoutRect> rects;
131+
renderer->boundingRects(rects, flooredLayoutPoint(renderer->localToAbsolute()));
132132
for (auto& rect : rects) {
133133
if (!rect.isEmpty())
134134
return true;

Source/WebCore/page/LocalFrameView.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2597,6 +2597,7 @@ void LocalFrameView::textFragmentIndicatorTimerFired()
25972597
if (textIndicator) {
25982598
constexpr OptionSet<HitTestRequest::Type> hitType { HitTestRequest::Type::ReadOnly, HitTestRequest::Type::Active, HitTestRequest::Type::AllowVisibleChildFrameContentOnly };
25992599

2600+
// FIXME: Why is this using RenderFlexibleBox?
26002601
auto textRects = RenderFlexibleBox::absoluteTextRects(range);
26012602

26022603
HitTestResult result;

Source/WebCore/rendering/RenderBlock.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2747,18 +2747,18 @@ void RenderBlock::setPageLogicalOffset(LayoutUnit logicalOffset)
27472747
rareData->m_pageLogicalOffset = logicalOffset;
27482748
}
27492749

2750-
void RenderBlock::absoluteRects(Vector<IntRect>& rects, const LayoutPoint& accumulatedOffset) const
2750+
void RenderBlock::boundingRects(Vector<LayoutRect>& rects, const LayoutPoint& accumulatedOffset) const
27512751
{
27522752
// For blocks inside inlines, we include margins so that we run right up to the inline boxes
27532753
// above and below us (thus getting merged with them to form a single irregular shape).
27542754
if (auto* continuation = this->continuation()) {
27552755
// FIXME: This is wrong for block-flows that are horizontal.
27562756
// https://bugs.webkit.org/show_bug.cgi?id=46781
2757-
rects.append(snappedIntRect(accumulatedOffset.x(), accumulatedOffset.y() - collapsedMarginBefore(), width(), height() + collapsedMarginBefore() + collapsedMarginAfter()));
2757+
rects.append(LayoutRect(accumulatedOffset.x(), accumulatedOffset.y() - collapsedMarginBefore(), width(), height() + collapsedMarginBefore() + collapsedMarginAfter()));
27582758
auto* containingBlock = inlineContinuation()->containingBlock();
2759-
continuation->absoluteRects(rects, accumulatedOffset - locationOffset() + containingBlock->locationOffset());
2759+
continuation->boundingRects(rects, accumulatedOffset - locationOffset() + containingBlock->locationOffset());
27602760
} else
2761-
rects.append(snappedIntRect(accumulatedOffset, size()));
2761+
rects.append({ accumulatedOffset, size() });
27622762
}
27632763

27642764
void RenderBlock::absoluteQuads(Vector<FloatQuad>& quads, bool* wasFixed) const

Source/WebCore/rendering/RenderBlock.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ class RenderBlock : public RenderBox {
368368
LayoutRect paintRectToClipOutFromBorder(const LayoutRect&) override;
369369
bool isInlineBlockOrInlineTable() const final { return isInline() && isReplacedOrInlineBlock(); }
370370

371-
void absoluteRects(Vector<IntRect>&, const LayoutPoint& accumulatedOffset) const override;
371+
void boundingRects(Vector<LayoutRect>&, const LayoutPoint& accumulatedOffset) const override;
372372
void absoluteQuads(Vector<FloatQuad>&, bool* wasFixed) const override;
373373

374374
// Public for LegacyEllipsisBox

Source/WebCore/rendering/RenderBox.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -620,9 +620,9 @@ void RenderBox::setScrollPosition(const ScrollPosition& position, const ScrollPo
620620
scrollableArea->setScrollPosition(position, options);
621621
}
622622

623-
void RenderBox::absoluteRects(Vector<IntRect>& rects, const LayoutPoint& accumulatedOffset) const
623+
void RenderBox::boundingRects(Vector<LayoutRect>& rects, const LayoutPoint& accumulatedOffset) const
624624
{
625-
rects.append(snappedIntRect(accumulatedOffset, size()));
625+
rects.append({ accumulatedOffset, size() });
626626
}
627627

628628
void RenderBox::absoluteQuads(Vector<FloatQuad>& quads, bool* wasFixed) const

Source/WebCore/rendering/RenderBox.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ class RenderBox : public RenderBoxModelObject {
260260

261261
LayoutUnit constrainBlockMarginInAvailableSpaceOrTrim(const RenderBox& containingBlock, LayoutUnit availableSpace, MarginTrimType marginSide) const;
262262

263-
void absoluteRects(Vector<IntRect>&, const LayoutPoint& accumulatedOffset) const override;
263+
void boundingRects(Vector<LayoutRect>&, const LayoutPoint& accumulatedOffset) const override;
264264
void absoluteQuads(Vector<FloatQuad>&, bool* wasFixed) const override;
265265

266266
int reflectionOffset() const;

Source/WebCore/rendering/RenderInline.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -276,20 +276,17 @@ class AbsoluteRectsGeneratorContext {
276276
const LayoutPoint& m_accumulatedOffset;
277277
};
278278

279-
void RenderInline::absoluteRects(Vector<IntRect>& rects, const LayoutPoint& accumulatedOffset) const
279+
void RenderInline::boundingRects(Vector<LayoutRect>& rects, const LayoutPoint& accumulatedOffset) const
280280
{
281-
Vector<LayoutRect> lineboxRects;
282-
AbsoluteRectsGeneratorContext context(lineboxRects, accumulatedOffset);
281+
AbsoluteRectsGeneratorContext context(rects, accumulatedOffset);
283282
generateLineBoxRects(context);
284-
for (const auto& rect : lineboxRects)
285-
rects.append(snappedIntRect(rect));
286283

287-
if (RenderBoxModelObject* continuation = this->continuation()) {
284+
if (auto* continuation = this->continuation()) {
288285
if (is<RenderBox>(*continuation)) {
289286
auto& box = downcast<RenderBox>(*continuation);
290-
continuation->absoluteRects(rects, toLayoutPoint(accumulatedOffset - containingBlock()->location() + box.locationOffset()));
287+
continuation->boundingRects(rects, toLayoutPoint(accumulatedOffset - containingBlock()->location() + box.locationOffset()));
291288
} else
292-
continuation->absoluteRects(rects, toLayoutPoint(accumulatedOffset - containingBlock()->location()));
289+
continuation->boundingRects(rects, toLayoutPoint(accumulatedOffset - containingBlock()->location()));
293290
}
294291
}
295292

Source/WebCore/rendering/RenderInline.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class RenderInline : public RenderBoxModelObject {
4545
LayoutUnit marginStart(const RenderStyle* otherStyle = 0) const final;
4646
LayoutUnit marginEnd(const RenderStyle* otherStyle = 0) const final;
4747

48-
void absoluteRects(Vector<IntRect>&, const LayoutPoint& accumulatedOffset) const final;
48+
void boundingRects(Vector<LayoutRect>&, const LayoutPoint& accumulatedOffset) const final;
4949
void absoluteQuads(Vector<FloatQuad>&, bool* wasFixed) const override;
5050

5151
LayoutSize offsetFromContainer(RenderElement&, const LayoutPoint&, bool* offsetDependsOnPoint = nullptr) const final;

Source/WebCore/rendering/RenderLineBreak.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,14 +152,15 @@ IntRect RenderLineBreak::linesBoundingBox() const
152152
return enclosingIntRect(run->visualRectIgnoringBlockDirection());
153153
}
154154

155-
void RenderLineBreak::absoluteRects(Vector<IntRect>& rects, const LayoutPoint& accumulatedOffset) const
155+
void RenderLineBreak::boundingRects(Vector<LayoutRect>& rects, const LayoutPoint& accumulatedOffset) const
156156
{
157157
auto box = InlineIterator::boxFor(*this);
158158
if (!box)
159159
return;
160160

161-
auto rect = box->visualRectIgnoringBlockDirection();
162-
rects.append(enclosingIntRect(FloatRect(accumulatedOffset + rect.location(), rect.size())));
161+
auto rect = LayoutRect { box->visualRectIgnoringBlockDirection() };
162+
rect.moveBy(accumulatedOffset);
163+
rects.append(rect);
163164
}
164165

165166
void RenderLineBreak::absoluteQuads(Vector<FloatQuad>& quads, bool* wasFixed) const

Source/WebCore/rendering/RenderLineBreak.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class RenderLineBreak final : public RenderBoxModelObject {
4949

5050
IntRect linesBoundingBox() const;
5151

52-
void absoluteRects(Vector<IntRect>&, const LayoutPoint& accumulatedOffset) const final;
52+
void boundingRects(Vector<LayoutRect>&, const LayoutPoint& accumulatedOffset) const final;
5353
void absoluteQuads(Vector<FloatQuad>&, bool* wasFixed = nullptr) const final;
5454
#if PLATFORM(IOS_FAMILY)
5555
void collectSelectionGeometries(Vector<SelectionGeometry>&, unsigned startOffset = 0, unsigned endOffset = std::numeric_limits<unsigned>::max()) final;

Source/WebCore/rendering/RenderObject.cpp

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -807,16 +807,14 @@ IntRect RenderObject::absoluteBoundingBoxRect(bool useTransforms, bool* wasFixed
807807
}
808808

809809
FloatPoint absPos = localToAbsolute(FloatPoint(), { } /* ignore transforms */, wasFixed);
810-
Vector<IntRect> rects;
811-
absoluteRects(rects, flooredLayoutPoint(absPos));
810+
Vector<LayoutRect> rects;
811+
boundingRects(rects, flooredLayoutPoint(absPos));
812812

813813
size_t n = rects.size();
814814
if (!n)
815815
return IntRect();
816816

817-
LayoutRect result = rects[0];
818-
for (size_t i = 1; i < n; ++i)
819-
result.unite(rects[i]);
817+
LayoutRect result = unionRect(rects);
820818
return snappedIntRect(result);
821819
}
822820

@@ -2230,17 +2228,23 @@ Vector<IntRect> RenderObject::absoluteTextRects(const SimpleRange& range, Option
22302228
{
22312229
ASSERT(!behavior.contains(BoundingRectBehavior::UseVisibleBounds));
22322230
ASSERT(!behavior.contains(BoundingRectBehavior::IgnoreTinyRects));
2233-
Vector<IntRect> rects;
2231+
Vector<LayoutRect> rects;
22342232
for (auto& node : intersectingNodes(range)) {
22352233
auto renderer = node.renderer();
22362234
if (renderer && renderer->isBR())
2237-
downcast<RenderLineBreak>(*renderer).absoluteRects(rects, flooredLayoutPoint(renderer->localToAbsolute()));
2235+
downcast<RenderLineBreak>(*renderer).boundingRects(rects, flooredLayoutPoint(renderer->localToAbsolute()));
22382236
else if (is<Text>(node)) {
22392237
for (auto& rect : absoluteRectsForRangeInText(range, downcast<Text>(node), behavior))
2240-
rects.append(enclosingIntRect(rect));
2238+
rects.append(LayoutRect { rect });
22412239
}
22422240
}
2243-
return rects;
2241+
2242+
Vector<IntRect> result;
2243+
result.reserveInitialCapacity(rects.size());
2244+
for (auto& layoutRect : rects)
2245+
result.uncheckedAppend(enclosingIntRect(layoutRect));
2246+
2247+
return result;
22442248
}
22452249

22462250
static RefPtr<Node> nodeBefore(const BoundaryPoint& point)

Source/WebCore/rendering/RenderObject.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ class RenderObject : public CachedImageClient {
608608
WEBCORE_EXPORT static Vector<SelectionGeometry> collectSelectionGeometriesWithoutUnionInteriorLines(const SimpleRange&);
609609
#endif
610610

611-
virtual void absoluteRects(Vector<IntRect>&, const LayoutPoint&) const { }
611+
virtual void boundingRects(Vector<LayoutRect>&, const LayoutPoint& /* offsetFromRoot */) const { }
612612

613613
WEBCORE_EXPORT IntRect absoluteBoundingBoxRect(bool useTransform = true, bool* wasFixed = nullptr) const;
614614
IntRect absoluteBoundingBoxRectIgnoringTransforms() const { return absoluteBoundingBoxRect(false); }

Source/WebCore/rendering/RenderText.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -374,11 +374,12 @@ String RenderText::originalText() const
374374
return m_originalTextDiffersFromRendered ? originalTextMap().get(this) : m_text;
375375
}
376376

377-
void RenderText::absoluteRects(Vector<IntRect>& rects, const LayoutPoint& accumulatedOffset) const
377+
void RenderText::boundingRects(Vector<LayoutRect>& rects, const LayoutPoint& accumulatedOffset) const
378378
{
379379
for (auto& run : InlineIterator::textBoxesFor(*this)) {
380-
auto rect = run.visualRectIgnoringBlockDirection();
381-
rects.append(enclosingIntRect(FloatRect(accumulatedOffset + rect.location(), rect.size())));
380+
auto rect = LayoutRect { run.visualRectIgnoringBlockDirection() };
381+
rect.moveBy(accumulatedOffset);
382+
rects.append(rect);
382383
}
383384
}
384385

Source/WebCore/rendering/RenderText.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class RenderText : public RenderObject {
7373
void dirtyLineBoxes(bool fullLayout);
7474
void deleteLineBoxes();
7575

76-
void absoluteRects(Vector<IntRect>&, const LayoutPoint& accumulatedOffset) const final;
76+
void boundingRects(Vector<LayoutRect>&, const LayoutPoint& accumulatedOffset) const final;
7777
Vector<IntRect> absoluteRectsForRange(unsigned startOffset = 0, unsigned endOffset = UINT_MAX, bool useSelectionHeight = false, bool* wasFixed = nullptr) const;
7878
#if PLATFORM(IOS_FAMILY)
7979
void collectSelectionGeometries(Vector<SelectionGeometry>&, unsigned startOffset = 0, unsigned endOffset = std::numeric_limits<unsigned>::max()) final;

Source/WebCore/rendering/RenderView.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -610,9 +610,10 @@ bool RenderView::isScrollableOrRubberbandableBox() const
610610
return frameView().isScrollable(defineScrollable);
611611
}
612612

613-
void RenderView::absoluteRects(Vector<IntRect>& rects, const LayoutPoint& accumulatedOffset) const
613+
void RenderView::boundingRects(Vector<LayoutRect>& rects, const LayoutPoint& accumulatedOffset) const
614614
{
615-
rects.append(snappedIntRect(accumulatedOffset, layer()->size()));
615+
// FIXME: It's weird that this gets is size from the layer.
616+
rects.append(LayoutRect { accumulatedOffset, layer()->size() });
616617
}
617618

618619
void RenderView::absoluteQuads(Vector<FloatQuad>& quads, bool* wasFixed) const

Source/WebCore/rendering/RenderView.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ class RenderView final : public RenderBlockFlow {
100100

101101
bool printing() const;
102102

103-
void absoluteRects(Vector<IntRect>&, const LayoutPoint& accumulatedOffset) const override;
103+
void boundingRects(Vector<LayoutRect>&, const LayoutPoint& accumulatedOffset) const override;
104104
void absoluteQuads(Vector<FloatQuad>&, bool* wasFixed) const override;
105105

106106
LayoutRect viewRect() const;

Source/WebCore/rendering/svg/LegacyRenderSVGModelObject.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,10 @@ LayoutRect LegacyRenderSVGModelObject::outlineBoundsForRepaint(const RenderLayer
8383
return LayoutRect(snapRectToDevicePixels(LayoutRect(containerRelativeQuad.boundingBox()), document().deviceScaleFactor()));
8484
}
8585

86-
void LegacyRenderSVGModelObject::absoluteRects(Vector<IntRect>& rects, const LayoutPoint& accumulatedOffset) const
86+
void LegacyRenderSVGModelObject::boundingRects(Vector<LayoutRect>& rects, const LayoutPoint& accumulatedOffset) const
8787
{
88-
IntRect rect = enclosingIntRect(strokeBoundingBox());
89-
rect.moveBy(roundedIntPoint(accumulatedOffset));
88+
auto rect = LayoutRect { strokeBoundingBox() };
89+
rect.moveBy(accumulatedOffset);
9090
rects.append(rect);
9191
}
9292

Source/WebCore/rendering/svg/LegacyRenderSVGModelObject.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class LegacyRenderSVGModelObject : public RenderElement {
5050
std::optional<FloatRect> computeFloatVisibleRectInContainer(const FloatRect&, const RenderLayerModelObject* container, VisibleRectContext) const final;
5151
LayoutRect outlineBoundsForRepaint(const RenderLayerModelObject* repaintContainer, const RenderGeometryMap*) const final;
5252

53-
void absoluteRects(Vector<IntRect>&, const LayoutPoint& accumulatedOffset) const final;
53+
void boundingRects(Vector<LayoutRect>&, const LayoutPoint& accumulatedOffset) const final;
5454
void absoluteQuads(Vector<FloatQuad>&, bool* wasFixed) const override;
5555

5656
void mapLocalToContainer(const RenderLayerModelObject* ancestorContainer, TransformState&, OptionSet<MapCoordinatesMode>, bool* wasFixed) const final;

Source/WebCore/rendering/svg/RenderSVGBlock.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,11 @@ bool RenderSVGBlock::needsHasSVGTransformFlags() const
7474
}
7575
#endif
7676

77-
void RenderSVGBlock::absoluteRects(Vector<IntRect>& rects, const LayoutPoint& accumulatedOffset) const
77+
void RenderSVGBlock::boundingRects(Vector<LayoutRect>& rects, const LayoutPoint& accumulatedOffset) const
7878
{
7979
#if ENABLE(LAYER_BASED_SVG_ENGINE)
8080
if (document().settings().layerBasedSVGEngineEnabled()) {
81-
rects.append(snappedIntRect(LayoutRect(accumulatedOffset, size())));
81+
rects.append({ accumulatedOffset, size() });
8282
return;
8383
}
8484
#else

Source/WebCore/rendering/svg/RenderSVGBlock.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class RenderSVGBlock : public RenderBlockFlow {
4747
void element() const = delete;
4848
bool isRenderSVGBlock() const final { return true; }
4949

50-
void absoluteRects(Vector<IntRect>&, const LayoutPoint& accumulatedOffset) const override;
50+
void boundingRects(Vector<LayoutRect>&, const LayoutPoint& accumulatedOffset) const override;
5151
void absoluteQuads(Vector<FloatQuad>&, bool* wasFixed) const override;
5252

5353
#if ENABLE(LAYER_BASED_SVG_ENGINE)

Source/WebCore/rendering/svg/RenderSVGHiddenContainer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class RenderSVGHiddenContainer : public RenderSVGContainer {
4646
LayoutRect clippedOverflowRect(const RenderLayerModelObject*, VisibleRectContext) const final { return { }; }
4747
std::optional<LayoutRect> computeVisibleRectInContainer(const LayoutRect& rect, const RenderLayerModelObject*, VisibleRectContext) const final { return std::make_optional(rect); }
4848

49-
void absoluteRects(Vector<IntRect>&, const LayoutPoint&) const final { }
49+
void boundingRects(Vector<LayoutRect>&, const LayoutPoint&) const final { }
5050
void absoluteQuads(Vector<FloatQuad>&, bool*) const final { }
5151
void addFocusRingRects(Vector<LayoutRect>&, const LayoutPoint&, const RenderLayerModelObject* = nullptr) const final { }
5252

Source/WebCore/rendering/svg/RenderSVGModelObject.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,9 @@ LayoutRect RenderSVGModelObject::outlineBoundsForRepaint(const RenderLayerModelO
125125
return outlineBounds;
126126
}
127127

128-
void RenderSVGModelObject::absoluteRects(Vector<IntRect>& rects, const LayoutPoint& accumulatedOffset) const
128+
void RenderSVGModelObject::boundingRects(Vector<LayoutRect>& rects, const LayoutPoint& accumulatedOffset) const
129129
{
130-
rects.append(snappedIntRect(accumulatedOffset, m_layoutRect.size()));
130+
rects.append({ accumulatedOffset, m_layoutRect.size() });
131131
}
132132

133133
void RenderSVGModelObject::absoluteQuads(Vector<FloatQuad>& quads, bool* wasFixed) const

Source/WebCore/rendering/svg/RenderSVGModelObject.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ class RenderSVGModelObject : public RenderLayerModelObject {
9595
const RenderObject* pushMappingToContainer(const RenderLayerModelObject*, RenderGeometryMap&) const override;
9696
LayoutSize offsetFromContainer(RenderElement&, const LayoutPoint&, bool* offsetDependsOnPoint = nullptr) const override;
9797

98-
void absoluteRects(Vector<IntRect>&, const LayoutPoint& accumulatedOffset) const override;
98+
void boundingRects(Vector<LayoutRect>&, const LayoutPoint& accumulatedOffset) const override;
9999
void absoluteQuads(Vector<FloatQuad>&, bool* wasFixed) const override;
100100

101101
void addFocusRingRects(Vector<LayoutRect>&, const LayoutPoint& additionalOffset, const RenderLayerModelObject* paintContainer = 0) const override;

Source/WebCore/rendering/svg/RenderSVGRoot.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -634,9 +634,9 @@ LayoutRect RenderSVGRoot::overflowClipRect(const LayoutPoint& location, RenderFr
634634
return clipRect;
635635
}
636636

637-
void RenderSVGRoot::absoluteRects(Vector<IntRect>& rects, const LayoutPoint& accumulatedOffset) const
637+
void RenderSVGRoot::boundingRects(Vector<LayoutRect>& rects, const LayoutPoint& accumulatedOffset) const
638638
{
639-
rects.append(snappedIntRect(accumulatedOffset, borderBoxRect().size()));
639+
rects.append({ accumulatedOffset, borderBoxRect().size() });
640640
}
641641

642642
void RenderSVGRoot::absoluteQuads(Vector<FloatQuad>& quads, bool* wasFixed) const

0 commit comments

Comments
 (0)