DescriptionAdd a "logical query mode" to SVGTextQuery
This CL adds an additional query "mode" to use for some of the query
functions. This new methods searches "logically" - using the layout
objects rather than the line boxes to guide the search. The existing
method is renamed to spatialQuery, leaving us with:
spatialQuery() - for point -> something
logicalQuery() - for character (code unit) -> something
This new search-order is needed to handle bi-directionality correctly.
Previously the direction of the text would influence the search, since
the line boxes would be processed in their spatial-ordering and the
search position would be adjusted based on that ordering. (As an
example, this would mean that given:
<text direction="rtl">ltrRTL</text>
and a query range [2, 4], the third character of the RTL run and the
first character of the ltr run would be included rather than the other
way around. See also new test in bidi-getsubstringlength.html)
The value returned by getCharNumAtPosition() is adjusted such that the
layout object of the intersected glyph is used to determine the
character index based on the query root (the element on which the
method is called.) This means that the value returned is in the same
query space as that handled by logicalQuery().
BUG=471205, 470326
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=193944
Patch Set 1 #Patch Set 2 : Fix "final tweaking" breakage. #Patch Set 3 : Missing TEs. #
Total comments: 16
Patch Set 4 : Fix WS-handling; Add additional (WS-)test. #
Total comments: 2
Patch Set 5 : Older URL. #Messages
Total messages: 10 (3 generated)
|