Skip to content

Commit

Permalink
[cleanup] Remove flips in LocalBoundingBoxRectForAccessibility
Browse files Browse the repository at this point in the history
This doesn't appear to be needed anymore - remove.

Bug: 1229581
Change-Id: I442b44bdfb6901c82c1ab1b8878d3735cc1b098c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5050946
Commit-Queue: Ian Kilpatrick <ikilpatrick@chromium.org>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1229933}
  • Loading branch information
bfgeek authored and Chromium LUCI CQ committed Nov 28, 2023
1 parent c84f53c commit adde2e2
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 19 deletions.
3 changes: 1 addition & 2 deletions third_party/blink/renderer/core/layout/layout_inline.cc
Original file line number Diff line number Diff line change
Expand Up @@ -931,8 +931,7 @@ gfx::RectF LayoutInline::LocalBoundingBoxRectForAccessibility() const {
UnionOutlineRectCollector collector;
AddOutlineRects(collector, nullptr, PhysicalOffset(),
OutlineType::kIncludeBlockInkOverflow);

return gfx::RectF(FlipForWritingMode(collector.Rect().ToLayoutRect()));
return gfx::RectF(collector.Rect());
}

void LayoutInline::AddAnnotatedRegions(Vector<AnnotatedRegionValue>& regions) {
Expand Down
9 changes: 0 additions & 9 deletions third_party/blink/renderer/core/layout/layout_object.h
Original file line number Diff line number Diff line change
Expand Up @@ -1462,15 +1462,6 @@ class CORE_EXPORT LayoutObject : public GarbageCollected<LayoutObject>,
// For non-boxes, for better performance, the caller can prepare
// |block_for_flipping| (= ContainingBlock()) if it will loop through many
// rects/points to flip to avoid the cost of repeated ContainingBlock() calls.
[[nodiscard]] DeprecatedLayoutRect FlipForWritingMode(
const PhysicalRect& r,
const LayoutBox* box_for_flipping = nullptr) const {
NOT_DESTROYED();
if (LIKELY(!HasFlippedBlocksWritingMode()))
return r.ToLayoutRect();
return {FlipForWritingModeInternal(r.X(), r.Width(), box_for_flipping),
r.Y(), r.Width(), r.Height()};
}
[[nodiscard]] PhysicalRect FlipForWritingMode(
const DeprecatedLayoutRect& r,
const LayoutBox* box_for_flipping = nullptr) const {
Expand Down
9 changes: 1 addition & 8 deletions third_party/blink/renderer/core/layout/layout_text.cc
Original file line number Diff line number Diff line change
Expand Up @@ -647,16 +647,9 @@ void LayoutText::AbsoluteQuadsForRange(Vector<gfx::QuadF>& quads,
gfx::RectF LayoutText::LocalBoundingBoxRectForAccessibility() const {
NOT_DESTROYED();
gfx::RectF result;
const LayoutBlock* block_for_flipping =
UNLIKELY(HasFlippedBlocksWritingMode()) ? ContainingBlock() : nullptr;
CollectLineBoxRects(
[this, &result, block_for_flipping](const PhysicalRect& r) {
DeprecatedLayoutRect rect = FlipForWritingMode(r, block_for_flipping);
result.Union(gfx::RectF(rect));
},
[&result](const PhysicalRect& rect) { result.Union(gfx::RectF(rect)); },
kClipToEllipsis);
// TODO(wangxianzhu): This is one of a few cases that a gfx::RectF is required
// to be in flipped blocks direction. Should eliminite them.
return result;
}

Expand Down

0 comments on commit adde2e2

Please sign in to comment.