[webkit-reviews] review granted: [Bug 235695] DocumentContext gives empty rects for blank lines. : [Attachment 450110] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jan 27 09:22:25 PST 2022

Wenson Hsieh <wenson_hsieh at apple.com> has granted Megan Gardner
<megan_gardner at apple.com>'s request for review:
Bug 235695: DocumentContext gives empty rects for blank lines.

Attachment 450110: Patch


--- Comment #3 from Wenson Hsieh <wenson_hsieh at apple.com> ---
Comment on attachment 450110
  --> https://bugs.webkit.org/attachment.cgi?id=450110

View in context: https://bugs.webkit.org/attachment.cgi?id=450110&action=review

This should be API-testable (there are existing examples in

>> Source/WebCore/platform/graphics/GeometryUtilities.cpp:108
>> +FloatRect unionRectIfNonZero(const Vector<FloatRect>& rects)
> This looks the same as `unionRectIgnoringZeroRects`!
> Maybe just add a new method for `const Vector<IntRect>&` and give it the same
name as the existing method?


Could also consider consolidating both into a template function and letting
type deduction do it's thing:

template <typename RectType>
RectType unionRectIgnoringZeroRects(const Vector<RectType>& rects)
    RectType result;
    for (auto& rect : rects)
    return result;

More information about the webkit-reviews mailing list