Commit 7517ac4a authored by Fredrik Söderquist's avatar Fredrik Söderquist Committed by Commit Bot

[PE] Fix text selection of <svg:text> subject to 'textLength'

With 'textLength' and 'lengthAdjust' with the value 'spacingAndGlyphs',
each SVGTextFragment is subject to an additional scale factor that
stretches the glyphs along the x- or y-axis.
This scale factor was not (any longer) taken into account by
SVGInlineTextBox::OffsetForPositionInFragment, which resulted in the
incorrect offset being calculcated.
Apply the (inverse) length_adjust_scale from SVGTextFragment before
querying the font for an offset.

Remove the |include_partial_glyphs| argument from
SVGInlineTextBox::OffsetForPositionInFragment since it's always true,
and also use 'float' rather LayoutUnit for the position.
Remove the dead |horizontal_glyph_stretch_| member variable from TextRun
since it's no longer used (since the simple shaper path was removed.)

Bug: 793075
Change-Id: Ia7d369d914f5afd87d198b7b21077e180fc8bc59
Reviewed-on: https://chromium-review.googlesource.com/824162
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Reviewed-by: default avatarStephen Chenney <schenney@chromium.org>
Cr-Commit-Position: refs/heads/master@{#523787}
parent 90553fe6
......@@ -2,15 +2,12 @@ layer at (0,0) size 800x600
LayoutView at (0,0) size 800x600
layer at (0,0) size 800x600
LayoutSVGRoot {svg} at (0,0) size 800x600
LayoutSVGContainer {g} at (0,0.80) size 62.84x17.69
LayoutSVGContainer {g} at (10,0.80) size 12.83x11.60
LayoutSVGPath {svg:line} at (10,0.80) size 0x11.60 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#000000]}] [x1=10.00] [y1=0.80] [x2=10.00] [y2=12.40]
LayoutSVGPath {svg:line} at (22.83,0.80) size 0x11.60 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#000000]}] [x1=22.83] [y1=0.80] [x2=22.83] [y2=12.40]
LayoutSVGRect {svg:rect} at (10,0.80) size 12.83x11.40 [fill={[type=SOLID] [color=#FF0000] [opacity=0.40]}] [x=10.00] [y=0.80] [width=12.83] [height=11.40]
LayoutSVGText {svg:text} at (0,28.19) size 125.67x8.80 [transform={m=((0.50,0.00)(0.00,0.50)) t=(0.00,0.00)}] contains 1 chunk(s)
LayoutSVGInlineText {#text} at (0,28.19) size 125.67x8.80
chunk 1 text run 1 at (0.00,35.00) startOffset 0 endOffset 41 width 125.68: "Expected 'Text' to be selected, got: 'Te'"
LayoutSVGText {text} at (10,0.80) size 50x11.39 contains 1 chunk(s)
LayoutSVGInlineText {#text} at (10,0.80) size 50x11.39
chunk 1 text run 1 at (10.00,10.00) startOffset 0 endOffset 15 width 72.09: "Text to Squeeze"
selection start: position 0 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
selection end: position 2 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
selection end: position 4 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
......@@ -2,15 +2,12 @@ layer at (0,0) size 800x600
LayoutView at (0,0) size 800x600
layer at (0,0) size 800x600
LayoutSVGRoot {svg} at (0,0) size 800x600
LayoutSVGContainer {g} at (0,0.80) size 56.20x17.69
LayoutSVGContainer {g} at (24.77,0.80) size 5.83x11.60
LayoutSVGPath {svg:line} at (24.77,0.80) size 0x11.60 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#000000]}] [x1=24.77] [y1=0.80] [x2=24.77] [y2=12.40]
LayoutSVGPath {svg:line} at (30.59,0.80) size 0x11.60 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#000000]}] [x1=30.59] [y1=0.80] [x2=30.59] [y2=12.40]
LayoutSVGRect {svg:rect} at (24.77,0.80) size 5.83x11.40 [fill={[type=SOLID] [color=#FF0000] [opacity=0.40]}] [x=24.77] [y=0.80] [width=5.83] [height=11.40]
LayoutSVGText {svg:text} at (0,28.19) size 112.39x8.80 [transform={m=((0.50,0.00)(0.00,0.50)) t=(0.00,0.00)}] contains 1 chunk(s)
LayoutSVGInlineText {#text} at (0,28.19) size 112.39x8.80
chunk 1 text run 1 at (0.00,35.00) startOffset 0 endOffset 38 width 112.40: "Expected 'to' to be selected, got: 't'"
LayoutSVGText {text} at (10,0.80) size 50x11.39 contains 1 chunk(s)
LayoutSVGInlineText {#text} at (10,0.80) size 50x11.39
chunk 1 text run 1 at (10.00,10.00) startOffset 0 endOffset 15 width 72.09: "Text to Squeeze"
selection start: position 3 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
selection end: position 4 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
selection start: position 5 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
selection end: position 7 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
......@@ -2,15 +2,12 @@ layer at (0,0) size 800x600
LayoutView at (0,0) size 800x600
layer at (0,0) size 800x600
LayoutSVGRoot {svg} at (0,0) size 800x600
LayoutSVGContainer {g} at (0,0.80) size 61x17.69
LayoutSVGContainer {g} at (32.53,0.80) size 12.35x11.60
LayoutSVGPath {svg:line} at (32.53,0.80) size 0x11.60 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#000000]}] [x1=32.53] [y1=0.80] [x2=32.53] [y2=12.40]
LayoutSVGPath {svg:line} at (44.88,0.80) size 0x11.60 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#000000]}] [x1=44.88] [y1=0.80] [x2=44.88] [y2=12.40]
LayoutSVGRect {svg:rect} at (32.53,0.80) size 12.35x11.40 [fill={[type=SOLID] [color=#FF0000] [opacity=0.40]}] [x=32.53] [y=0.80] [width=12.35] [height=11.40]
LayoutSVGText {svg:text} at (0,28.19) size 122x8.80 [transform={m=((0.50,0.00)(0.00,0.50)) t=(0.00,0.00)}] contains 1 chunk(s)
LayoutSVGInlineText {#text} at (0,28.19) size 122x8.80
chunk 1 text run 1 at (0.00,35.00) startOffset 0 endOffset 40 width 122.00: "Expected 'Squ' to be selected, got: 'o '"
LayoutSVGText {text} at (10,0.80) size 50x11.39 contains 1 chunk(s)
LayoutSVGInlineText {#text} at (10,0.80) size 50x11.39
chunk 1 text run 1 at (10.00,10.00) startOffset 0 endOffset 15 width 72.09: "Text to Squeeze"
selection start: position 6 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
selection end: position 8 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
selection start: position 8 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
selection end: position 11 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
......@@ -2,15 +2,12 @@ layer at (0,0) size 800x600
LayoutView at (0,0) size 800x600
layer at (0,0) size 800x600
LayoutSVGRoot {svg} at (0,0) size 800x600
LayoutSVGContainer {g} at (0,0.80) size 96.04x17.69
LayoutSVGContainer {g} at (10,0.80) size 50x11.60
LayoutSVGPath {svg:line} at (10,0.80) size 0x11.60 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#000000]}] [x1=10.00] [y1=0.80] [x2=10.00] [y2=12.40]
LayoutSVGPath {svg:line} at (60,0.80) size 0x11.60 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#000000]}] [x1=60.00] [y1=0.80] [x2=60.00] [y2=12.40]
LayoutSVGRect {svg:rect} at (10,0.80) size 50x11.40 [fill={[type=SOLID] [color=#FF0000] [opacity=0.40]}] [x=10.00] [y=0.80] [width=50.00] [height=11.40]
LayoutSVGText {svg:text} at (0,28.19) size 192.08x8.80 [transform={m=((0.50,0.00)(0.00,0.50)) t=(0.00,0.00)}] contains 1 chunk(s)
LayoutSVGInlineText {#text} at (0,28.19) size 192.08x8.80
chunk 1 text run 1 at (0.00,35.00) startOffset 0 endOffset 61 width 192.08: "Expected 'Text to Squeeze' to be selected, got: 'Text to Squ'"
LayoutSVGText {text} at (10,0.80) size 50x11.39 contains 1 chunk(s)
LayoutSVGInlineText {#text} at (10,0.80) size 50x11.39
chunk 1 text run 1 at (10.00,10.00) startOffset 0 endOffset 15 width 72.09: "Text to Squeeze"
selection start: position 0 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
selection end: position 11 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
selection end: position 15 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
......@@ -2,15 +2,12 @@ layer at (0,0) size 800x600
LayoutView at (0,0) size 800x600
layer at (0,0) size 800x600
LayoutSVGRoot {svg} at (0,0) size 800x600
LayoutSVGContainer {g} at (0,0.80) size 73.44x17.69
LayoutSVGContainer {g} at (10,0.80) size 40.27x11.60
LayoutSVGPath {svg:line} at (10,0.80) size 0x11.60 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#000000]}] [x1=10.00] [y1=0.80] [x2=10.00] [y2=12.40]
LayoutSVGPath {svg:line} at (50.27,0.80) size 0x11.60 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#000000]}] [x1=50.27] [y1=0.80] [x2=50.27] [y2=12.40]
LayoutSVGRect {svg:rect} at (10,0.80) size 40.27x11.40 [fill={[type=SOLID] [color=#FF0000] [opacity=0.40]}] [x=10.00] [y=0.80] [width=40.27] [height=11.40]
LayoutSVGText {svg:text} at (0,28.19) size 146.88x8.80 [transform={m=((0.50,0.00)(0.00,0.50)) t=(0.00,0.00)}] contains 1 chunk(s)
LayoutSVGInlineText {#text} at (0,28.19) size 146.88x8.80
chunk 1 text run 1 at (0.00,35.00) startOffset 0 endOffset 48 width 146.88: "Expected 'Text' to be selected, got: 'Text to S'"
LayoutSVGText {text} at (10,0.80) size 140x11.39 contains 1 chunk(s)
LayoutSVGInlineText {#text} at (10,0.80) size 140x11.39
chunk 1 text run 1 at (10.00,10.00) startOffset 0 endOffset 15 width 64.29: "Text to Stretch"
selection start: position 0 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
selection end: position 9 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
selection end: position 4 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
......@@ -2,15 +2,12 @@ layer at (0,0) size 800x600
LayoutView at (0,0) size 800x600
layer at (0,0) size 800x600
LayoutSVGRoot {svg} at (0,0) size 800x600
LayoutSVGContainer {g} at (0,0.80) size 74.66x17.69
LayoutSVGContainer {g} at (56.36,0.80) size 18.29x11.60
LayoutSVGPath {svg:line} at (56.36,0.80) size 0x11.60 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#000000]}] [x1=56.36] [y1=0.80] [x2=56.36] [y2=12.40]
LayoutSVGPath {svg:line} at (74.66,0.80) size 0x11.60 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#000000]}] [x1=74.66] [y1=0.80] [x2=74.66] [y2=12.40]
LayoutSVGRect {svg:rect} at (56.36,0.80) size 18.29x11.40 [fill={[type=SOLID] [color=#FF0000] [opacity=0.40]}] [x=56.36] [y=0.80] [width=18.29] [height=11.40]
LayoutSVGText {svg:text} at (0,28.19) size 119.59x8.80 [transform={m=((0.50,0.00)(0.00,0.50)) t=(0.00,0.00)}] contains 1 chunk(s)
LayoutSVGInlineText {#text} at (0,28.19) size 119.59x8.80
chunk 1 text run 1 at (0.00,35.00) startOffset 0 endOffset 40 width 119.60: "Expected 'to' to be selected, got: 'etc'"
LayoutSVGText {text} at (10,0.80) size 140x11.39 contains 1 chunk(s)
LayoutSVGInlineText {#text} at (10,0.80) size 140x11.39
chunk 1 text run 1 at (10.00,10.00) startOffset 0 endOffset 15 width 64.29: "Text to Stretch"
selection start: position 11 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
selection end: position 14 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
selection start: position 5 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
selection end: position 7 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
......@@ -2,14 +2,12 @@ layer at (0,0) size 800x600
LayoutView at (0,0) size 800x600
layer at (0,0) size 800x600
LayoutSVGRoot {svg} at (0,0) size 800x600
LayoutSVGContainer {g} at (0,0.80) size 108.63x17.69
LayoutSVGContainer {g} at (80.75,0.80) size 27.87x11.60
LayoutSVGPath {svg:line} at (80.75,0.80) size 0x11.60 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#000000]}] [x1=80.75] [y1=0.80] [x2=80.75] [y2=12.40]
LayoutSVGPath {svg:line} at (108.63,0.80) size 0x11.60 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#000000]}] [x1=108.63] [y1=0.80] [x2=108.63] [y2=12.40]
LayoutSVGRect {svg:rect} at (80.75,0.80) size 27.87x11.40 [fill={[type=SOLID] [color=#FF0000] [opacity=0.40]}] [x=80.75] [y=0.80] [width=27.87] [height=11.40]
LayoutSVGText {svg:text} at (0,28.19) size 113.19x8.80 [transform={m=((0.50,0.00)(0.00,0.50)) t=(0.00,0.00)}] contains 1 chunk(s)
LayoutSVGInlineText {#text} at (0,28.19) size 113.19x8.80
chunk 1 text run 1 at (0.00,35.00) startOffset 0 endOffset 38 width 113.20: "Expected 'Str' to be selected, got: ''"
LayoutSVGText {text} at (10,0.80) size 140x11.39 contains 1 chunk(s)
LayoutSVGInlineText {#text} at (10,0.80) size 140x11.39
chunk 1 text run 1 at (10.00,10.00) startOffset 0 endOffset 15 width 64.29: "Text to Stretch"
caret: position 15 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
selection start: position 8 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
selection end: position 11 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
......@@ -2,15 +2,12 @@ layer at (0,0) size 800x600
LayoutView at (0,0) size 800x600
layer at (0,0) size 800x600
LayoutSVGRoot {svg} at (0,0) size 800x600
LayoutSVGContainer {g} at (0,1) size 61.74x17.49
LayoutSVGContainer {g} at (10,1) size 12.79x11.20
LayoutSVGPath {svg:line} at (10,1) size 0x11.20 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#000000]}] [x1=10.00] [y1=1.00] [x2=10.00] [y2=12.20]
LayoutSVGPath {svg:line} at (22.79,1) size 0x11.20 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#000000]}] [x1=22.79] [y1=1.00] [x2=22.79] [y2=12.20]
LayoutSVGRect {svg:rect} at (10,1) size 12.79x11.20 [fill={[type=SOLID] [color=#FF0000] [opacity=0.40]}] [x=10.00] [y=1.00] [width=12.79] [height=11.20]
LayoutSVGText {svg:text} at (0,27.80) size 123.48x9.19 [transform={m=((0.50,0.00)(0.00,0.50)) t=(0.00,0.00)}] contains 1 chunk(s)
LayoutSVGInlineText {#text} at (0,27.80) size 123.48x9.19
chunk 1 text run 1 at (0.00,35.00) startOffset 0 endOffset 41 width 123.49: "Expected 'Text' to be selected, got: 'Te'"
LayoutSVGText {text} at (10,1) size 50x11.19 contains 1 chunk(s)
LayoutSVGInlineText {#text} at (10,1) size 50x11.19
chunk 1 text run 1 at (10.00,10.00) startOffset 0 endOffset 15 width 71.71: "Text to Squeeze"
selection start: position 0 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
selection end: position 2 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
selection end: position 4 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
......@@ -2,15 +2,12 @@ layer at (0,0) size 800x600
LayoutView at (0,0) size 800x600
layer at (0,0) size 800x600
LayoutSVGRoot {svg} at (0,0) size 800x600
LayoutSVGContainer {g} at (0,1) size 54.98x17.49
LayoutSVGContainer {g} at (24.72,1) size 5.81x11.20
LayoutSVGPath {svg:line} at (24.72,1) size 0x11.20 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#000000]}] [x1=24.72] [y1=1.00] [x2=24.72] [y2=12.20]
LayoutSVGPath {svg:line} at (30.54,1) size 0x11.20 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#000000]}] [x1=30.54] [y1=1.00] [x2=30.54] [y2=12.20]
LayoutSVGRect {svg:rect} at (24.72,1) size 5.81x11.20 [fill={[type=SOLID] [color=#FF0000] [opacity=0.40]}] [x=24.72] [y=1.00] [width=5.81] [height=11.20]
LayoutSVGText {svg:text} at (0,27.80) size 109.95x9.19 [transform={m=((0.50,0.00)(0.00,0.50)) t=(0.00,0.00)}] contains 1 chunk(s)
LayoutSVGInlineText {#text} at (0,27.80) size 109.95x9.19
chunk 1 text run 1 at (0.00,35.00) startOffset 0 endOffset 38 width 109.95: "Expected 'to' to be selected, got: 't'"
LayoutSVGText {text} at (10,1) size 50x11.19 contains 1 chunk(s)
LayoutSVGInlineText {#text} at (10,1) size 50x11.19
chunk 1 text run 1 at (10.00,10.00) startOffset 0 endOffset 15 width 71.71: "Text to Squeeze"
selection start: position 3 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
selection end: position 4 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
selection start: position 5 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
selection end: position 7 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
......@@ -2,15 +2,12 @@ layer at (0,0) size 800x600
LayoutView at (0,0) size 800x600
layer at (0,0) size 800x600
LayoutSVGRoot {svg} at (0,0) size 800x600
LayoutSVGContainer {g} at (0,1) size 59.98x17.49
LayoutSVGContainer {g} at (32.48,1) size 12.41x11.20
LayoutSVGPath {svg:line} at (32.48,1) size 0x11.20 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#000000]}] [x1=32.48] [y1=1.00] [x2=32.48] [y2=12.20]
LayoutSVGPath {svg:line} at (44.88,1) size 0x11.20 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#000000]}] [x1=44.88] [y1=1.00] [x2=44.88] [y2=12.20]
LayoutSVGRect {svg:rect} at (32.48,1) size 12.41x11.20 [fill={[type=SOLID] [color=#FF0000] [opacity=0.40]}] [x=32.48] [y=1.00] [width=12.41] [height=11.20]
LayoutSVGText {svg:text} at (0,27.80) size 119.95x9.19 [transform={m=((0.50,0.00)(0.00,0.50)) t=(0.00,0.00)}] contains 1 chunk(s)
LayoutSVGInlineText {#text} at (0,27.80) size 119.95x9.19
chunk 1 text run 1 at (0.00,35.00) startOffset 0 endOffset 40 width 119.96: "Expected 'Squ' to be selected, got: 'o '"
LayoutSVGText {text} at (10,1) size 50x11.19 contains 1 chunk(s)
LayoutSVGInlineText {#text} at (10,1) size 50x11.19
chunk 1 text run 1 at (10.00,10.00) startOffset 0 endOffset 15 width 71.71: "Text to Squeeze"
selection start: position 6 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
selection end: position 8 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
selection start: position 8 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
selection end: position 11 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
......@@ -2,15 +2,12 @@ layer at (0,0) size 800x600
LayoutView at (0,0) size 800x600
layer at (0,0) size 800x600
LayoutSVGRoot {svg} at (0,0) size 800x600
LayoutSVGContainer {g} at (0,1) size 94.63x17.49
LayoutSVGContainer {g} at (10,1) size 50x11.20
LayoutSVGPath {svg:line} at (10,1) size 0x11.20 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#000000]}] [x1=10.00] [y1=1.00] [x2=10.00] [y2=12.20]
LayoutSVGPath {svg:line} at (60,1) size 0x11.20 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#000000]}] [x1=60.00] [y1=1.00] [x2=60.00] [y2=12.20]
LayoutSVGRect {svg:rect} at (10,1) size 50x11.20 [fill={[type=SOLID] [color=#FF0000] [opacity=0.40]}] [x=10.00] [y=1.00] [width=50.00] [height=11.20]
LayoutSVGText {svg:text} at (0,27.80) size 189.25x9.19 [transform={m=((0.50,0.00)(0.00,0.50)) t=(0.00,0.00)}] contains 1 chunk(s)
LayoutSVGInlineText {#text} at (0,27.80) size 189.25x9.19
chunk 1 text run 1 at (0.00,35.00) startOffset 0 endOffset 61 width 189.26: "Expected 'Text to Squeeze' to be selected, got: 'Text to Squ'"
LayoutSVGText {text} at (10,1) size 50x11.19 contains 1 chunk(s)
LayoutSVGInlineText {#text} at (10,1) size 50x11.19
chunk 1 text run 1 at (10.00,10.00) startOffset 0 endOffset 15 width 71.71: "Text to Squeeze"
selection start: position 0 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
selection end: position 11 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
selection end: position 15 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
......@@ -2,15 +2,12 @@ layer at (0,0) size 800x600
LayoutView at (0,0) size 800x600
layer at (0,0) size 800x600
LayoutSVGRoot {svg} at (0,0) size 800x600
LayoutSVGContainer {g} at (0,1) size 72.19x17.49
LayoutSVGContainer {g} at (10,1) size 40.17x11.20
LayoutSVGPath {svg:line} at (10,1) size 0x11.20 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#000000]}] [x1=10.00] [y1=1.00] [x2=10.00] [y2=12.20]
LayoutSVGPath {svg:line} at (50.17,1) size 0x11.20 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#000000]}] [x1=50.17] [y1=1.00] [x2=50.17] [y2=12.20]
LayoutSVGRect {svg:rect} at (10,1) size 40.17x11.20 [fill={[type=SOLID] [color=#FF0000] [opacity=0.40]}] [x=10.00] [y=1.00] [width=40.17] [height=11.20]
LayoutSVGText {svg:text} at (0,27.80) size 144.38x9.19 [transform={m=((0.50,0.00)(0.00,0.50)) t=(0.00,0.00)}] contains 1 chunk(s)
LayoutSVGInlineText {#text} at (0,27.80) size 144.38x9.19
chunk 1 text run 1 at (0.00,35.00) startOffset 0 endOffset 48 width 144.38: "Expected 'Text' to be selected, got: 'Text to S'"
LayoutSVGText {text} at (10,1) size 140x11.19 contains 1 chunk(s)
LayoutSVGInlineText {#text} at (10,1) size 140x11.19
chunk 1 text run 1 at (10.00,10.00) startOffset 0 endOffset 15 width 63.92: "Text to Stretch"
selection start: position 0 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
selection end: position 9 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
selection end: position 4 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
......@@ -2,15 +2,12 @@ layer at (0,0) size 800x600
LayoutView at (0,0) size 800x600
layer at (0,0) size 800x600
LayoutSVGRoot {svg} at (0,0) size 800x600
LayoutSVGContainer {g} at (0,1) size 74.52x17.49
LayoutSVGContainer {g} at (56.26,1) size 18.27x11.20
LayoutSVGPath {svg:line} at (56.26,1) size 0x11.20 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#000000]}] [x1=56.26] [y1=1.00] [x2=56.26] [y2=12.20]
LayoutSVGPath {svg:line} at (74.52,1) size 0x11.20 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#000000]}] [x1=74.52] [y1=1.00] [x2=74.52] [y2=12.20]
LayoutSVGRect {svg:rect} at (56.26,1) size 18.27x11.20 [fill={[type=SOLID] [color=#FF0000] [opacity=0.40]}] [x=56.26] [y=1.00] [width=18.27] [height=11.20]
LayoutSVGText {svg:text} at (0,27.80) size 117.05x9.19 [transform={m=((0.50,0.00)(0.00,0.50)) t=(0.00,0.00)}] contains 1 chunk(s)
LayoutSVGInlineText {#text} at (0,27.80) size 117.05x9.19
chunk 1 text run 1 at (0.00,35.00) startOffset 0 endOffset 40 width 117.05: "Expected 'to' to be selected, got: 'etc'"
LayoutSVGText {text} at (10,1) size 140x11.19 contains 1 chunk(s)
LayoutSVGInlineText {#text} at (10,1) size 140x11.19
chunk 1 text run 1 at (10.00,10.00) startOffset 0 endOffset 15 width 63.92: "Text to Stretch"
selection start: position 11 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
selection end: position 14 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
selection start: position 5 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
selection end: position 7 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
......@@ -2,14 +2,12 @@ layer at (0,0) size 800x600
LayoutView at (0,0) size 800x600
layer at (0,0) size 800x600
LayoutSVGRoot {svg} at (0,0) size 800x600
LayoutSVGContainer {g} at (0,1) size 108.60x17.49
LayoutSVGContainer {g} at (80.61,1) size 28x11.20
LayoutSVGPath {svg:line} at (80.61,1) size 0x11.20 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#000000]}] [x1=80.61] [y1=1.00] [x2=80.61] [y2=12.20]
LayoutSVGPath {svg:line} at (108.60,1) size 0x11.20 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#000000]}] [x1=108.60] [y1=1.00] [x2=108.60] [y2=12.20]
LayoutSVGRect {svg:rect} at (80.61,1) size 28x11.20 [fill={[type=SOLID] [color=#FF0000] [opacity=0.40]}] [x=80.61] [y=1.00] [width=27.99] [height=11.20]
LayoutSVGText {svg:text} at (0,27.80) size 110.84x9.19 [transform={m=((0.50,0.00)(0.00,0.50)) t=(0.00,0.00)}] contains 1 chunk(s)
LayoutSVGInlineText {#text} at (0,27.80) size 110.84x9.19
chunk 1 text run 1 at (0.00,35.00) startOffset 0 endOffset 38 width 110.84: "Expected 'Str' to be selected, got: ''"
LayoutSVGText {text} at (10,1) size 140x11.19 contains 1 chunk(s)
LayoutSVGInlineText {#text} at (10,1) size 140x11.19
chunk 1 text run 1 at (10.00,10.00) startOffset 0 endOffset 15 width 63.92: "Text to Stretch"
caret: position 15 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
selection start: position 8 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
selection end: position 11 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
......@@ -2,15 +2,12 @@ layer at (0,0) size 800x600
LayoutView at (0,0) size 800x600
layer at (0,0) size 800x600
LayoutSVGRoot {svg} at (0,0) size 800x600
LayoutSVGContainer {g} at (0,0.80) size 61.23x17.69
LayoutSVGContainer {g} at (10,0.80) size 12.72x11.60
LayoutSVGPath {svg:line} at (10,0.80) size 0x11.60 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#000000]}] [x1=10.00] [y1=0.80] [x2=10.00] [y2=12.40]
LayoutSVGPath {svg:line} at (22.72,0.80) size 0x11.60 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#000000]}] [x1=22.72] [y1=0.80] [x2=22.72] [y2=12.40]
LayoutSVGRect {svg:rect} at (10,0.80) size 12.72x11.40 [fill={[type=SOLID] [color=#FF0000] [opacity=0.40]}] [x=10.00] [y=0.80] [width=12.72] [height=11.40]
LayoutSVGText {svg:text} at (0,28.19) size 122.47x8.80 [transform={m=((0.50,0.00)(0.00,0.50)) t=(0.00,0.00)}] contains 1 chunk(s)
LayoutSVGInlineText {#text} at (0,28.19) size 122.47x8.80
chunk 1 text run 1 at (0.00,35.00) startOffset 0 endOffset 41 width 122.48: "Expected 'Text' to be selected, got: 'Te'"
LayoutSVGText {text} at (10,0.80) size 50x11.39 contains 1 chunk(s)
LayoutSVGInlineText {#text} at (10,0.80) size 50x11.39
chunk 1 text run 1 at (10.00,10.00) startOffset 0 endOffset 15 width 71.89: "Text to Squeeze"
selection start: position 0 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
selection end: position 2 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
selection end: position 4 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
......@@ -2,15 +2,12 @@ layer at (0,0) size 800x600
LayoutView at (0,0) size 800x600
layer at (0,0) size 800x600
LayoutSVGRoot {svg} at (0,0) size 800x600
LayoutSVGContainer {g} at (0,0.80) size 54.59x17.69
LayoutSVGContainer {g} at (24.67,0.80) size 5.84x11.60
LayoutSVGPath {svg:line} at (24.67,0.80) size 0x11.60 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#000000]}] [x1=24.67] [y1=0.80] [x2=24.67] [y2=12.40]
LayoutSVGPath {svg:line} at (30.51,0.80) size 0x11.60 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#000000]}] [x1=30.51] [y1=0.80] [x2=30.51] [y2=12.40]
LayoutSVGRect {svg:rect} at (24.67,0.80) size 5.84x11.40 [fill={[type=SOLID] [color=#FF0000] [opacity=0.40]}] [x=24.67] [y=0.80] [width=5.84] [height=11.40]
LayoutSVGText {svg:text} at (0,28.19) size 109.19x8.80 [transform={m=((0.50,0.00)(0.00,0.50)) t=(0.00,0.00)}] contains 1 chunk(s)
LayoutSVGInlineText {#text} at (0,28.19) size 109.19x8.80
chunk 1 text run 1 at (0.00,35.00) startOffset 0 endOffset 38 width 109.20: "Expected 'to' to be selected, got: 't'"
LayoutSVGText {text} at (10,0.80) size 50x11.39 contains 1 chunk(s)
LayoutSVGInlineText {#text} at (10,0.80) size 50x11.39
chunk 1 text run 1 at (10.00,10.00) startOffset 0 endOffset 15 width 71.89: "Text to Squeeze"
selection start: position 3 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
selection end: position 4 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
selection start: position 5 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
selection end: position 7 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
......@@ -2,15 +2,12 @@ layer at (0,0) size 800x600
LayoutView at (0,0) size 800x600
layer at (0,0) size 800x600
LayoutSVGRoot {svg} at (0,0) size 800x600
LayoutSVGContainer {g} at (0,0.80) size 59.59x17.69
LayoutSVGContainer {g} at (32.46,0.80) size 12.38x11.60
LayoutSVGPath {svg:line} at (32.46,0.80) size 0x11.60 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#000000]}] [x1=32.46] [y1=0.80] [x2=32.46] [y2=12.40]
LayoutSVGPath {svg:line} at (44.84,0.80) size 0x11.60 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#000000]}] [x1=44.84] [y1=0.80] [x2=44.84] [y2=12.40]
LayoutSVGRect {svg:rect} at (32.46,0.80) size 12.38x11.40 [fill={[type=SOLID] [color=#FF0000] [opacity=0.40]}] [x=32.46] [y=0.80] [width=12.38] [height=11.40]
LayoutSVGText {svg:text} at (0,28.19) size 119.19x8.80 [transform={m=((0.50,0.00)(0.00,0.50)) t=(0.00,0.00)}] contains 1 chunk(s)
LayoutSVGInlineText {#text} at (0,28.19) size 119.19x8.80
chunk 1 text run 1 at (0.00,35.00) startOffset 0 endOffset 40 width 119.20: "Expected 'Squ' to be selected, got: 'o '"
LayoutSVGText {text} at (10,0.80) size 50x11.39 contains 1 chunk(s)
LayoutSVGInlineText {#text} at (10,0.80) size 50x11.39
chunk 1 text run 1 at (10.00,10.00) startOffset 0 endOffset 15 width 71.89: "Text to Squeeze"
selection start: position 6 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
selection end: position 8 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
selection start: position 8 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
selection end: position 11 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
......@@ -2,15 +2,12 @@ layer at (0,0) size 800x600
LayoutView at (0,0) size 800x600
layer at (0,0) size 800x600
LayoutSVGRoot {svg} at (0,0) size 800x600
LayoutSVGContainer {g} at (0,0.80) size 93.04x17.69
LayoutSVGContainer {g} at (10,0.80) size 50x11.60
LayoutSVGPath {svg:line} at (10,0.80) size 0x11.60 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#000000]}] [x1=10.00] [y1=0.80] [x2=10.00] [y2=12.40]
LayoutSVGPath {svg:line} at (60,0.80) size 0x11.60 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#000000]}] [x1=60.00] [y1=0.80] [x2=60.00] [y2=12.40]
LayoutSVGRect {svg:rect} at (10,0.80) size 50x11.40 [fill={[type=SOLID] [color=#FF0000] [opacity=0.40]}] [x=10.00] [y=0.80] [width=50.00] [height=11.40]
LayoutSVGText {svg:text} at (0,28.19) size 186.08x8.80 [transform={m=((0.50,0.00)(0.00,0.50)) t=(0.00,0.00)}] contains 1 chunk(s)
LayoutSVGInlineText {#text} at (0,28.19) size 186.08x8.80
chunk 1 text run 1 at (0.00,35.00) startOffset 0 endOffset 61 width 186.08: "Expected 'Text to Squeeze' to be selected, got: 'Text to Squ'"
LayoutSVGText {text} at (10,0.80) size 50x11.39 contains 1 chunk(s)
LayoutSVGInlineText {#text} at (10,0.80) size 50x11.39
chunk 1 text run 1 at (10.00,10.00) startOffset 0 endOffset 15 width 71.89: "Text to Squeeze"
selection start: position 0 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
selection end: position 11 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
selection end: position 15 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
......@@ -2,15 +2,12 @@ layer at (0,0) size 800x600
LayoutView at (0,0) size 800x600
layer at (0,0) size 800x600
LayoutSVGRoot {svg} at (0,0) size 800x600
LayoutSVGContainer {g} at (0,0.80) size 71.23x17.69
LayoutSVGContainer {g} at (10,0.80) size 39.96x11.60
LayoutSVGPath {svg:line} at (10,0.80) size 0x11.60 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#000000]}] [x1=10.00] [y1=0.80] [x2=10.00] [y2=12.40]
LayoutSVGPath {svg:line} at (49.96,0.80) size 0x11.60 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#000000]}] [x1=49.96] [y1=0.80] [x2=49.96] [y2=12.40]
LayoutSVGRect {svg:rect} at (10,0.80) size 39.96x11.40 [fill={[type=SOLID] [color=#FF0000] [opacity=0.40]}] [x=10.00] [y=0.80] [width=39.96] [height=11.40]
LayoutSVGText {svg:text} at (0,28.19) size 142.47x8.80 [transform={m=((0.50,0.00)(0.00,0.50)) t=(0.00,0.00)}] contains 1 chunk(s)
LayoutSVGInlineText {#text} at (0,28.19) size 142.47x8.80
chunk 1 text run 1 at (0.00,35.00) startOffset 0 endOffset 48 width 142.48: "Expected 'Text' to be selected, got: 'Text to S'"
LayoutSVGText {text} at (10,0.80) size 140x11.39 contains 1 chunk(s)
LayoutSVGInlineText {#text} at (10,0.80) size 140x11.39
chunk 1 text run 1 at (10.00,10.00) startOffset 0 endOffset 15 width 64.09: "Text to Stretch"
selection start: position 0 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
selection end: position 9 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
selection end: position 4 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
......@@ -2,15 +2,12 @@ layer at (0,0) size 800x600
LayoutView at (0,0) size 800x600
layer at (0,0) size 800x600
LayoutSVGRoot {svg} at (0,0) size 800x600
LayoutSVGContainer {g} at (0,0.80) size 74.42x17.69
LayoutSVGContainer {g} at (56.07,0.80) size 18.35x11.60
LayoutSVGPath {svg:line} at (56.07,0.80) size 0x11.60 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#000000]}] [x1=56.07] [y1=0.80] [x2=56.07] [y2=12.40]
LayoutSVGPath {svg:line} at (74.42,0.80) size 0x11.60 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#000000]}] [x1=74.42] [y1=0.80] [x2=74.42] [y2=12.40]
LayoutSVGRect {svg:rect} at (56.07,0.80) size 18.35x11.40 [fill={[type=SOLID] [color=#FF0000] [opacity=0.40]}] [x=56.07] [y=0.80] [width=18.35] [height=11.40]
LayoutSVGText {svg:text} at (0,28.19) size 116.39x8.80 [transform={m=((0.50,0.00)(0.00,0.50)) t=(0.00,0.00)}] contains 1 chunk(s)
LayoutSVGInlineText {#text} at (0,28.19) size 116.39x8.80
chunk 1 text run 1 at (0.00,35.00) startOffset 0 endOffset 40 width 116.40: "Expected 'to' to be selected, got: 'etc'"
LayoutSVGText {text} at (10,0.80) size 140x11.39 contains 1 chunk(s)
LayoutSVGInlineText {#text} at (10,0.80) size 140x11.39
chunk 1 text run 1 at (10.00,10.00) startOffset 0 endOffset 15 width 64.09: "Text to Stretch"
selection start: position 11 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
selection end: position 14 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
selection start: position 5 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
selection end: position 7 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
......@@ -2,14 +2,12 @@ layer at (0,0) size 800x600
LayoutView at (0,0) size 800x600
layer at (0,0) size 800x600
LayoutSVGRoot {svg} at (0,0) size 800x600
LayoutSVGContainer {g} at (0,0.80) size 108.50x17.69
LayoutSVGContainer {g} at (80.54,0.80) size 27.96x11.60
LayoutSVGPath {svg:line} at (80.54,0.80) size 0x11.60 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#000000]}] [x1=80.54] [y1=0.80] [x2=80.54] [y2=12.40]
LayoutSVGPath {svg:line} at (108.50,0.80) size 0x11.60 [stroke={[type=SOLID] [color=#008000]}] [fill={[type=SOLID] [color=#000000]}] [x1=108.50] [y1=0.80] [x2=108.50] [y2=12.40]
LayoutSVGRect {svg:rect} at (80.54,0.80) size 27.96x11.40 [fill={[type=SOLID] [color=#FF0000] [opacity=0.40]}] [x=80.54] [y=0.80] [width=27.96] [height=11.40]
LayoutSVGText {svg:text} at (0,28.19) size 110.39x8.80 [transform={m=((0.50,0.00)(0.00,0.50)) t=(0.00,0.00)}] contains 1 chunk(s)
LayoutSVGInlineText {#text} at (0,28.19) size 110.39x8.80
chunk 1 text run 1 at (0.00,35.00) startOffset 0 endOffset 38 width 110.40: "Expected 'Str' to be selected, got: ''"
LayoutSVGText {text} at (10,0.80) size 140x11.39 contains 1 chunk(s)
LayoutSVGInlineText {#text} at (10,0.80) size 140x11.39
chunk 1 text run 1 at (10.00,10.00) startOffset 0 endOffset 15 width 64.09: "Text to Stretch"
caret: position 15 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
selection start: position 8 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
selection end: position 11 of child 0 {#text} of child 5 {text} of child 0 {svg} of document
......@@ -203,7 +203,7 @@ PositionWithAffinity LayoutSVGInlineText::PositionForPoint(
int offset = closest_distance_box->OffsetForPositionInFragment(
*closest_distance_fragment,
LayoutUnit(absolute_point.X() - closest_distance_position), true);
absolute_point.X() - closest_distance_position);
return CreatePositionWithAffinity(offset + closest_distance_box->Start(),
offset > 0
? TextAffinity::kUpstreamIfPossible
......
......@@ -82,6 +82,8 @@ struct SVGTextFragment {
return BuildNormalFragmentTransform();
}
bool AffectedByTextLength() const { return length_adjust_scale != 1; }
bool IsTransformed() const {
return AffectedByTextLength() || !transform.IsIdentity();
}
......@@ -106,7 +108,7 @@ struct SVGTextFragment {
// (see SVGTextLayoutEngine, which builds this transformation).
AffineTransform transform;
// Contains lengthAdjust related transformations, which are not allowd to
// Contains lengthAdjust related transformations, which are not allowed to
// influence the SVGTextQuery code.
float length_adjust_scale;
float length_adjust_bias;
......@@ -118,8 +120,6 @@ struct SVGTextFragment {
return BuildTransformForTextOnLine();
}
bool AffectedByTextLength() const { return length_adjust_scale != 1; }
void TransformAroundOrigin(AffineTransform& result) const {
// Returns (translate(x, y) * result) * translate(-x, -y).
result.SetE(result.E() + x);
......
......@@ -67,29 +67,24 @@ int SVGInlineTextBox::OffsetForPosition(LayoutUnit, bool) const {
int SVGInlineTextBox::OffsetForPositionInFragment(
const SVGTextFragment& fragment,
LayoutUnit position,
bool include_partial_glyphs) const {
float position) const {
LineLayoutSVGInlineText line_layout_item =
LineLayoutSVGInlineText(GetLineLayoutItem());
float scaling_factor = line_layout_item.ScalingFactor();
DCHECK(scaling_factor);
const ComputedStyle& style = line_layout_item.StyleRef();
TextRun text_run = ConstructTextRun(style, fragment);
// Adjust position for the scaled font size.
DCHECK(line_layout_item.ScalingFactor());
position *= line_layout_item.ScalingFactor();
// Eventually handle lengthAdjust="spacingAndGlyphs".
// FIXME: Handle vertical text.
if (fragment.IsTransformed()) {
AffineTransform fragment_transform = fragment.BuildFragmentTransform();
text_run.SetHorizontalGlyphStretch(
clampTo<float>(fragment_transform.XScale()));
}
// If this fragment is subjected to 'textLength' glyph adjustments, then
// apply the inverse to the position within the fragment.
if (fragment.AffectedByTextLength())
position /= fragment.length_adjust_scale;
const bool include_partial_glyphs = true;
TextRun text_run = ConstructTextRun(line_layout_item.StyleRef(), fragment);
return fragment.character_offset - Start() +
line_layout_item.ScaledFont().OffsetForPosition(
text_run, position * scaling_factor, include_partial_glyphs);
text_run, position, include_partial_glyphs);
}
LayoutUnit SVGInlineTextBox::PositionForOffset(int) const {
......
......@@ -71,9 +71,7 @@ class SVGInlineTextBox final : public InlineTextBox {
starts_new_text_chunk_ = new_text_chunk;
}
int OffsetForPositionInFragment(const SVGTextFragment&,
LayoutUnit position,
bool include_partial_glyphs) const;
int OffsetForPositionInFragment(const SVGTextFragment&, float position) const;
FloatRect SelectionRectForTextFragment(const SVGTextFragment&,
int fragment_start_position,
int fragment_end_position,
......
......@@ -34,9 +34,7 @@ struct ExpectedTextRunSize {
DISALLOW_NEW();
const void* pointer;
int integers[2];
float float1;
float float2;
float float3;
float floats[2];
uint32_t bitfields : 10;
TabSize tab_size;
};
......
......@@ -67,7 +67,6 @@ class PLATFORM_EXPORT TextRun final {
: characters_length_(len),
len_(len),
xpos_(xpos),
horizontal_glyph_stretch_(1),
expansion_(expansion),
expansion_behavior_(expansion_behavior),
is8_bit_(true),
......@@ -92,7 +91,6 @@ class PLATFORM_EXPORT TextRun final {
: characters_length_(len),
len_(len),
xpos_(xpos),
horizontal_glyph_stretch_(1),
expansion_(expansion),
expansion_behavior_(expansion_behavior),
is8_bit_(false),
......@@ -116,7 +114,6 @@ class PLATFORM_EXPORT TextRun final {
: characters_length_(string.length()),
len_(string.length()),
xpos_(xpos),
horizontal_glyph_stretch_(1),
expansion_(expansion),
expansion_behavior_(expansion_behavior),
allow_tabs_(false),
......@@ -226,10 +223,6 @@ class PLATFORM_EXPORT TextRun final {
void SetExpansionBehavior(ExpansionBehavior behavior) {
expansion_behavior_ = behavior;
}
float HorizontalGlyphStretch() const { return horizontal_glyph_stretch_; }
void SetHorizontalGlyphStretch(float scale) {
horizontal_glyph_stretch_ = scale;
}
bool AllowTabs() const { return allow_tabs_; }
TabSize GetTabSize() const { return tab_size_; }
......@@ -288,7 +281,6 @@ class PLATFORM_EXPORT TextRun final {
// alignment or center alignment, left start of the text line is not the same
// as left start of the containing block.
float xpos_;
float horizontal_glyph_stretch_;
float expansion_;
ExpansionBehavior expansion_behavior_ : 2;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment