@@ -15,7 +15,8 @@ const String TAB_CHAR = '\t';
15
15
class TextNode extends CharacterData {
16
16
static const String NORMAL_SPACE = '\u 0020' ;
17
17
18
- TextNode (this ._data, [BindingContext ? context]) : super (NodeType .TEXT_NODE , context);
18
+ TextNode (this ._data, [BindingContext ? context])
19
+ : super (NodeType .TEXT_NODE , context);
19
20
20
21
// Must be existed after text node is attached, and all text update will after text attached.
21
22
RenderTextBox ? _renderTextBox;
@@ -58,12 +59,16 @@ class TextNode extends CharacterData {
58
59
_renderTextBox! .renderStyle = _parentElement.renderStyle;
59
60
_renderTextBox! .data = data;
60
61
61
- WebFRenderParagraph renderParagraph = _renderTextBox! .child as WebFRenderParagraph ;
62
+ WebFRenderParagraph renderParagraph =
63
+ _renderTextBox! .child as WebFRenderParagraph ;
62
64
renderParagraph.markNeedsLayout ();
63
65
64
- RenderLayoutBox parentRenderLayoutBox = _parentElement.renderBoxModel as RenderLayoutBox ;
65
- parentRenderLayoutBox = parentRenderLayoutBox.renderScrollingContent ?? parentRenderLayoutBox;
66
- _setTextSizeType (parentRenderLayoutBox.widthSizeType, parentRenderLayoutBox.heightSizeType);
66
+ RenderLayoutBox parentRenderLayoutBox =
67
+ _parentElement.renderBoxModel as RenderLayoutBox ;
68
+ parentRenderLayoutBox =
69
+ parentRenderLayoutBox.renderScrollingContent ?? parentRenderLayoutBox;
70
+ _setTextSizeType (parentRenderLayoutBox.widthSizeType,
71
+ parentRenderLayoutBox.heightSizeType);
67
72
}
68
73
}
69
74
@@ -84,8 +89,10 @@ class TextNode extends CharacterData {
84
89
// If element attach WidgetElement, render object should be attach to render tree when mount.
85
90
if (parent.renderObjectManagerType == RenderObjectManagerType .WEBF_NODE &&
86
91
parent.renderBoxModel is RenderLayoutBox ) {
87
- RenderLayoutBox parentRenderLayoutBox = parent.renderBoxModel as RenderLayoutBox ;
88
- parentRenderLayoutBox = parentRenderLayoutBox.renderScrollingContent ?? parentRenderLayoutBox;
92
+ RenderLayoutBox parentRenderLayoutBox =
93
+ parent.renderBoxModel as RenderLayoutBox ;
94
+ parentRenderLayoutBox =
95
+ parentRenderLayoutBox.renderScrollingContent ?? parentRenderLayoutBox;
89
96
parentRenderLayoutBox.insert (_renderTextBox! , after: after);
90
97
}
91
98
@@ -96,7 +103,8 @@ class TextNode extends CharacterData {
96
103
void _detachRenderTextBox () {
97
104
if (isRendererAttached) {
98
105
RenderTextBox renderTextBox = _renderTextBox! ;
99
- ContainerRenderObjectMixin parent = renderTextBox.parent as ContainerRenderObjectMixin ;
106
+ ContainerRenderObjectMixin parent =
107
+ renderTextBox.parent as ContainerRenderObjectMixin ;
100
108
parent.remove (renderTextBox);
101
109
}
102
110
}
@@ -115,7 +123,10 @@ class TextNode extends CharacterData {
115
123
116
124
@override
117
125
RenderBox createRenderer () {
118
- return _renderTextBox = RenderTextBox (data, renderStyle: parentElement! .renderStyle);
126
+ return _renderTextBox = RenderTextBox (data,
127
+ renderStyle: parentElement! .renderStyle,
128
+ registrar: ownerDocument.controller.registrar,
129
+ selectionColor: ownerDocument.controller.selectionColor);
119
130
}
120
131
121
132
@override
0 commit comments