[webkit-changes] [WebKit/WebKit] da2a3c: Drop early-outs for "no boxes" in SVGTextQuery ent...

Ahmad Saleem noreply at github.com
Sun Oct 1 01:50:40 PDT 2023


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

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

  Log Message:
  -----------
  Drop early-outs for "no boxes" in SVGTextQuery entrypoints

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

Reviewed by Nikolas Zimmermann.

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

All entrypoints in SVGTextQuery start with check if the text content
element has any boxes. If it doesn't, a value representing "empty" is
returned. In all cases this value is the same as the default value of the
corresponding query-data. SVGTextQuery::executeQuery itself has no
problems handling this case (and will return 'false' as expected.)
Removing these early-outs means a few more cycles is needed in these
"degenerate" cases, although that seems like a small (and hopefully
reasonable) price to pay for less code (and duplication/exit-paths).

* Source/WebCore/rendering/svg/SVGTextQuery.cpp:
(SVGTextQuery::executeQuery):
(SVGTextQuery::numberOfCharacters):
(SVGTextQuery::subStringLength):
(SVGTextQuery::startPositionOfCharacter):
(SVGTextQuery::endPositionOfCharacter):
(SVGTextQuery::rotationOfCharacter):
(SVGTextQuery::extentOfCharacter):
(SVGTextQuery::characterNumberAtPosition):

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




More information about the webkit-changes mailing list