mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-10 01:08:21 +00:00
Bug 936670 - Position text rendered runs by the first non-trimmed character in the run. r=longsonr
This commit is contained in:
parent
2a2711ccb3
commit
369c16ae68
6
layout/reftests/bugs/936670-1-ref.svg
Normal file
6
layout/reftests/bugs/936670-1-ref.svg
Normal file
@ -0,0 +1,6 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M 100,100 l 4,8 h -8 z" fill="red"/>
|
||||
<g transform="translate(100,100)" style="text-anchor: end; font: 16px sans-serif">
|
||||
<text>hello</text>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 211 B |
6
layout/reftests/bugs/936670-1.svg
Normal file
6
layout/reftests/bugs/936670-1.svg
Normal file
@ -0,0 +1,6 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M 100,100 l 4,8 h -8 z" fill="red"/>
|
||||
<g transform="translate(100,100)" style="text-anchor: end; font: 16px sans-serif">
|
||||
<text> hello</text>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 212 B |
@ -1779,6 +1779,7 @@ fuzzy(1,10000) fuzzy-if(Android&&AndroidVersion>=15,5,10000) == 902330-1.html 90
|
||||
fuzzy-if(Android,8,400) == 906199-1.html 906199-1-ref.html
|
||||
== 921716-1.html 921716-1-ref.html
|
||||
fuzzy-if(cocoaWidget,1,40) == 928607-1.html 928607-1-ref.html
|
||||
== 936670-1.svg 936670-1-ref.svg
|
||||
== 931853.html 931853-ref.html
|
||||
== 931853-quirks.html 931853-quirks-ref.html
|
||||
== 931464-1.html 931464-1-ref.html
|
||||
|
@ -1937,11 +1937,6 @@ TextRenderedRunIterator::Next()
|
||||
|
||||
charIndex = mTextElementCharIndex;
|
||||
|
||||
// Get the position and rotation of the character that begins this
|
||||
// rendered run.
|
||||
pt = Root()->mPositions[mTextElementCharIndex].mPosition;
|
||||
rotate = Root()->mPositions[mTextElementCharIndex].mAngle;
|
||||
|
||||
// Find the end of the rendered run, by looking through the
|
||||
// nsSVGTextFrame2's positions array until we find one that is recorded
|
||||
// as a run boundary.
|
||||
@ -1983,6 +1978,11 @@ TextRenderedRunIterator::Next()
|
||||
TrimOffsets(offset, length, trimmedOffsets);
|
||||
charIndex += offset - untrimmedOffset;
|
||||
|
||||
// Get the position and rotation of the character that begins this
|
||||
// rendered run.
|
||||
pt = Root()->mPositions[charIndex].mPosition;
|
||||
rotate = Root()->mPositions[charIndex].mAngle;
|
||||
|
||||
// Determine if we should skip this rendered run.
|
||||
bool skip = !mFrameIterator.IsWithinSubtree() ||
|
||||
Root()->mPositions[mTextElementCharIndex].mHidden;
|
||||
|
Loading…
x
Reference in New Issue
Block a user