Adjust glyph positions in RTL runs in SVGTextQuery

When calculating the glyph position of a glyph in an RTL run/line box,
make sure the position is computed from the right of the fragment
within the line box.
Also adjust calls to SVGTextMetrics::measureCharacterRange to pass the
direction of the line box rather than the direction of the layout
object.
Use the SVGTextMetrics stored in the layout attributes to get the
extents for getExtentOfChar to avoid having to redo the somewhat
involved extent computation for cursive scripts.
With this, glyph extents for cursive scripts are better but still far
from perfect/good. This is likely not the fault of the query code
though.

The test svg/text/bidi-text-query.svg is rewritten to better illustrate
the query order and the returned extents.

BUG=470326

Review URL: https://codereview.chromium.org/1041693002

git-svn-id: svn://svn.chromium.org/blink/trunk@192701 bbb929c8-8fbe-4397-9dbb-9b2b20218538
5 files changed
tree: d514d7b968dc977d23abe2296b84ec8f5c08d2c4
  1. third_party/