Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: ec4c328ee08b66cae29d2c266b6c1cd7b2972c8d
https://github.com/WebKit/WebKit/commit/ec4c328ee08b66cae29d2c266b6c1cd7b2972c8d
Author: Ahmad Saleem <[email protected]>
Date: 2026-06-29 (Mon, 29 Jun 2026)
Changed paths:
M Source/WebCore/rendering/InlineBoxPainter.cpp
M Source/WebCore/rendering/InlineBoxPainter.h
Log Message:
-----------
Deduplicate the multi-line nine-piece image strip computation in
InlineBoxPainter
https://bugs.webkit.org/show_bug.cgi?id=318104
rdar://180896838
Reviewed by Simon Fraser.
InlineBoxPainter::paintMask() and InlineBoxPainter::paintDecorations() each
contained an identical copy of the math that lays out a border/mask nine-piece
image as one continuous strip across the fragments of an inline box that has
been split over multiple lines (the line-leftward/rightward width accumulation
plus the
stripX/stripY/stripWidth/stripHeight derivation).
Extract that shared computation into a new helper,
InlineBoxPainter::computeNinePieceImageStrip(), and call it from both sites.
This is a pure refactor with no behavior change: the helper preserves the
existing math verbatim (including the pre-existing RTL FIXME), and each caller
keeps its own clip-rect setup since those differ (mask vs. border image,
different graphics contexts).
* Source/WebCore/rendering/InlineBoxPainter.cpp:
(WebCore::InlineBoxPainter::computeNinePieceImageStrip const):
(WebCore::InlineBoxPainter::paintMask):
(WebCore::InlineBoxPainter::paintDecorations):
* Source/WebCore/rendering/InlineBoxPainter.h:
Canonical link:
https://flagged.apple.com:443/proxy?t2=Db3f2I2hi9&o=aHR0cHM6Ly9jb21taXRzLndlYmtpdC5vcmcvMzE2MDQ1QG1haW4=&emid=cacec87d-1422-4b53-8e4d-5dc6e17930f2&c=11
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications