less legacy
Created attachment 430753 [details] patch
Comment on attachment 430753 [details] 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.
> 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. Is there a meaningful efficiency difference? Moving into an empty vector is just setting a pointer? But yeah, I went for symmetry here. > 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. There is lots of cleanup potential here but I'll try to stay focused on getting stuff out from legacy lines for now. Should be easier to see what to do when everything has been moved out.
Committed r278621 (238606@main): <https://commits.webkit.org/238606@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 430753 [details].
<rdar://problem/79021715>
Reopening to attach new patch.
Created attachment 430878 [details] Patch for landing
Committed r278627 (238611@main): <https://commits.webkit.org/238611@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 430878 [details].