[Webkit-unassigned] [Bug 226731] Factor MarkedText collection out of LegacyInlineTextBox

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jun 8 07:40:24 PDT 2021


https://bugs.webkit.org/show_bug.cgi?id=226731

Sam Weinig <sam at webkit.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #430753|review?                     |review+
              Flags|                            |

--- Comment #2 from Sam Weinig <sam at webkit.org> ---
Comment on attachment 430753
  --> https://bugs.webkit.org/attachment.cgi?id=430753
patch

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

> Source/WebCore/rendering/LegacyInlineTextBox.cpp:498
> +        Vector<MarkedText> markedTexts;
> +        markedTexts.appendVector(MarkedText::collectForDocumentMarkers(renderer(), selectableRange, MarkedText::PaintPhase::Background));
> +        markedTexts.appendVector(MarkedText::collectForHighlights(renderer(), parent()->renderer(), selectableRange, MarkedText::PaintPhase::Background));

This would be slightly more efficient if you did this as:

auto markedTexts = MarkedText::collectForDocumentMarkers(renderer(), selectableRange, MarkedText::PaintPhase::Background);
markedTexts.appendVector(MarkedText::collectForHighlights(renderer(), parent()->renderer(), selectableRange, MarkedText::PaintPhase::Background));

though I do like the symmetry in your version.

> Source/WebCore/rendering/LegacyInlineTextBox.cpp:671
> +    auto markedTexts = MarkedText::collectForDocumentMarkers(renderer(), selectableRange(), MarkedText::PaintPhase::Decoration);
> +    for (auto& markedText : MarkedText::subdivide(markedTexts, MarkedText::OverlapStrategy::Frontmost))

I wonder if it would make sense at some point to make collectForDocumentMarkers take a functor that does the subdivide rather than allocating the vector then subdividing.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20210608/0354deaa/attachment.htm>


More information about the webkit-unassigned mailing list