[webkit-changes] [WebKit/WebKit] c01837: Add per-fragment early-out for getCharNumAtPosition

Ahmad Saleem noreply at github.com
Mon Oct 2 08:35:22 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: c0183789bb8ac1b802477e2dded4578350b6a907
      https://github.com/WebKit/WebKit/commit/c0183789bb8ac1b802477e2dded4578350b6a907
  Author: Ahmad Saleem <ahmad.saleem792+github at gmail.com>
  Date:   2023-10-02 (Mon, 02 Oct 2023)

  Changed paths:
    M Source/WebCore/rendering/svg/SVGTextQuery.cpp

  Log Message:
  -----------
  Add per-fragment early-out for getCharNumAtPosition

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

Reviewed by Chris Dumez.

Merge: https://src.chromium.org/viewvc/blink?view=revision&revision=177230

Since this is a spatial query, and a SVGTextFragment already contain an
approximation of it's own bounds, we can use those to perform a reasonably
efficient early-rejection test.
As an example: A test case using the textPath-data from bug 261651 and a
mouse-move handler that uses getCharNumAtPosition to check which
"character" (glyph) is under the pointer consumes 0.005-0.2ms, compared to
0.2-0.5ms without this patch (test case - above bug, this was 5-10ms!).

* Source/WebCore/rendering/svg/SVGTextQuery.cpp:
(calculateFragmentBoundaries):
(SVGTextQuery::characterNumberAtPositionCallback):

Canonical link: https://commits.webkit.org/268730@main




More information about the webkit-changes mailing list