Commit e12f61c
committed
Use textContent, not wholeText, to process text nodes
The wholeText property contains the text of the current text node
together with any text nodes adjacent to it. Given that we’re processing
each text node separately, this doesn’t make sense and means we’re
potentially processing the same text multiple times – we should just
process textContent instead, which is the node’s own text.
I initially thought this bug wouldn’t be reproducible in practice
without manually constructing a DOM with two adjacent text nodes, but
then I realized a v-if with a false condition can easily produce such a
DOM naturally, hence the test case.1 parent 158a0ff commit e12f61c
2 files changed
+11
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | | - | |
| 91 | + | |
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
| 103 | + | |
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
272 | 272 | | |
273 | 273 | | |
274 | 274 | | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
275 | 284 | | |
276 | 285 | | |
277 | 286 | | |
| |||
0 commit comments