This repository was archived by the owner on Apr 4, 2019. It is now read-only.
Commit 13257d7
Ensure templates always have stable boundaries
Previously, if a template’s first (or last) child was a dynamic node
(like a mustache or block), the associated render node’s firstChild or
lastChild would change.
```hbs
{{#if condition}}{{value}}{{/if}}
```
In this case, the render node associated with the `#if` helper cannot
have stable `firstNode` and `lastNode`, because when the nodes
associated with `value` change, the nodes associated with the `if`
helper must change as well.
The solution was to require that templates create fragments with stable
start and end nodes. If the first node is dynamic, we insert a boundary
empty text node to ensure that the template’s boundaries will not
change.1 parent fbfcb65 commit 13257d7
File tree
6 files changed
+109
-13
lines changed- packages
- dom-helper/lib
- htmlbars-compiler
- lib
- tests
6 files changed
+109
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
414 | 414 | | |
415 | 415 | | |
416 | 416 | | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
417 | 423 | | |
418 | 424 | | |
419 | 425 | | |
| |||
Lines changed: 27 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| 33 | + | |
| 34 | + | |
33 | 35 | | |
34 | 36 | | |
35 | 37 | | |
| |||
64 | 66 | | |
65 | 67 | | |
66 | 68 | | |
67 | | - | |
| 69 | + | |
68 | 70 | | |
69 | 71 | | |
70 | 72 | | |
71 | 73 | | |
| 74 | + | |
72 | 75 | | |
73 | | - | |
| 76 | + | |
74 | 77 | | |
75 | | - | |
76 | | - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
77 | 89 | | |
78 | 90 | | |
79 | 91 | | |
80 | | - | |
| 92 | + | |
81 | 93 | | |
82 | 94 | | |
83 | 95 | | |
| 96 | + | |
| 97 | + | |
84 | 98 | | |
85 | 99 | | |
86 | 100 | | |
| |||
104 | 118 | | |
105 | 119 | | |
106 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
107 | 129 | | |
108 | 130 | | |
109 | 131 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
74 | 78 | | |
75 | 79 | | |
76 | 80 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
21 | 27 | | |
22 | 28 | | |
23 | 29 | | |
24 | 30 | | |
25 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
26 | 52 | | |
27 | 53 | | |
28 | 54 | | |
| |||
37 | 63 | | |
38 | 64 | | |
39 | 65 | | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
40 | 70 | | |
41 | 71 | | |
42 | 72 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
87 | 120 | | |
88 | 121 | | |
89 | 122 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
277 | 277 | | |
278 | 278 | | |
279 | 279 | | |
280 | | - | |
| 280 | + | |
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
| |||
287 | 287 | | |
288 | 288 | | |
289 | 289 | | |
290 | | - | |
| 290 | + | |
291 | 291 | | |
292 | 292 | | |
293 | 293 | | |
| |||
301 | 301 | | |
302 | 302 | | |
303 | 303 | | |
304 | | - | |
| 304 | + | |
305 | 305 | | |
306 | 306 | | |
307 | 307 | | |
| |||
316 | 316 | | |
317 | 317 | | |
318 | 318 | | |
319 | | - | |
| 319 | + | |
320 | 320 | | |
321 | 321 | | |
322 | 322 | | |
| |||
1187 | 1187 | | |
1188 | 1188 | | |
1189 | 1189 | | |
| 1190 | + | |
1190 | 1191 | | |
1191 | 1192 | | |
1192 | 1193 | | |
| |||
1246 | 1247 | | |
1247 | 1248 | | |
1248 | 1249 | | |
1249 | | - | |
| 1250 | + | |
1250 | 1251 | | |
1251 | 1252 | | |
1252 | 1253 | | |
1253 | 1254 | | |
1254 | 1255 | | |
1255 | | - | |
| 1256 | + | |
1256 | 1257 | | |
1257 | 1258 | | |
1258 | | - | |
| 1259 | + | |
1259 | 1260 | | |
1260 | 1261 | | |
1261 | 1262 | | |
| |||
0 commit comments