@@ -396,11 +396,13 @@ class EngineParagraph implements ui.Paragraph {
396
396
397
397
ui.TextBox _getBoxForLine (EngineLineMetrics line, int start, int end) {
398
398
final double widthBeforeBox = start <= line.startIndex
399
- ? 0.0
400
- : _measurementService.measureSubstringWidth (this , line.startIndex, start);
399
+ ? 0.0
400
+ : _measurementService.measureSubstringWidth (
401
+ this , line.startIndex, start);
401
402
final double widthAfterBox = end >= line.endIndexWithoutNewlines
402
- ? 0.0
403
- : _measurementService.measureSubstringWidth (this , end, line.endIndexWithoutNewlines);
403
+ ? 0.0
404
+ : _measurementService.measureSubstringWidth (
405
+ this , end, line.endIndexWithoutNewlines);
404
406
405
407
final double top = line.lineNumber * _lineHeight;
406
408
@@ -488,7 +490,8 @@ class EngineParagraph implements ui.Paragraph {
488
490
int high = lineMetrics.endIndexWithoutNewlines;
489
491
do {
490
492
final int current = (low + high) ~ / 2 ;
491
- final double width = instance.measureSubstringWidth (this , lineMetrics.startIndex, current);
493
+ final double width =
494
+ instance.measureSubstringWidth (this , lineMetrics.startIndex, current);
492
495
if (width < dx) {
493
496
low = current;
494
497
} else if (width > dx) {
@@ -503,8 +506,10 @@ class EngineParagraph implements ui.Paragraph {
503
506
return ui.TextPosition (offset: high, affinity: ui.TextAffinity .upstream);
504
507
}
505
508
506
- final double lowWidth = instance.measureSubstringWidth (this , lineMetrics.startIndex, low);
507
- final double highWidth = instance.measureSubstringWidth (this , lineMetrics.startIndex, high);
509
+ final double lowWidth =
510
+ instance.measureSubstringWidth (this , lineMetrics.startIndex, low);
511
+ final double highWidth =
512
+ instance.measureSubstringWidth (this , lineMetrics.startIndex, high);
508
513
509
514
if (dx - lowWidth < highWidth - dx) {
510
515
// The offset is closer to the low index.
@@ -666,18 +671,17 @@ class EngineParagraphStyle implements ui.ParagraphStyle {
666
671
@override
667
672
int get hashCode {
668
673
return ui.hashValues (
669
- _textAlign,
670
- _textDirection,
671
- _fontWeight,
672
- _fontStyle,
673
- _maxLines,
674
- _fontFamily,
675
- _fontSize,
676
- _height,
677
- _textHeightBehavior,
678
- _ellipsis,
679
- _locale
680
- );
674
+ _textAlign,
675
+ _textDirection,
676
+ _fontWeight,
677
+ _fontStyle,
678
+ _maxLines,
679
+ _fontFamily,
680
+ _fontSize,
681
+ _height,
682
+ _textHeightBehavior,
683
+ _ellipsis,
684
+ _locale);
681
685
}
682
686
683
687
@override
@@ -1500,7 +1504,12 @@ void _applyTextStyleToElement({
1500
1504
final String textDecoration =
1501
1505
_textDecorationToCssString (style._decoration, style._decorationStyle);
1502
1506
if (textDecoration != null ) {
1503
- cssStyle.textDecoration = textDecoration;
1507
+ if (browserEngine == BrowserEngine .webkit) {
1508
+ domRenderer.setElementStyle (
1509
+ element, '-webkit-text-decoration' , textDecoration);
1510
+ } else {
1511
+ cssStyle.textDecoration = textDecoration;
1512
+ }
1504
1513
final ui.Color decorationColor = style._decorationColor;
1505
1514
if (decorationColor != null ) {
1506
1515
cssStyle.textDecorationColor = colorToCssString (decorationColor);
0 commit comments