Skip to content

Commit 1dedd55

Browse files
Merge pull request #21061 from emberjs/nvp/text-node-merging-fix-no-longer-needed
Remove 'text-node-merging-fix'
2 parents 60c99c2 + 1ef2bcc commit 1dedd55

4 files changed

Lines changed: 2 additions & 110 deletions

File tree

packages/@glimmer/runtime/lib/compat/text-node-merging-fix.ts

Lines changed: 0 additions & 84 deletions
This file was deleted.

packages/@glimmer/runtime/lib/dom/api.ts

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,11 @@ import type {
33
ElementNamespace,
44
GlimmerTreeConstruction,
55
Nullable,
6-
SimpleDocument,
76
SimpleElement,
87
} from '@glimmer/interfaces';
9-
import { castToSimple } from '@glimmer/debug-util';
108

11-
import { applyTextNodeMergingFix } from '../compat/text-node-merging-fix';
129
import { DOMOperations } from './operations';
1310

14-
const doc: Nullable<SimpleDocument> =
15-
typeof document === 'undefined' ? null : castToSimple(document);
16-
1711
export class TreeConstruction extends DOMOperations implements GlimmerTreeConstruction {
1812
createElementNS(namespace: ElementNamespace, tag: string): SimpleElement {
1913
return this.document.createElementNS(namespace, tag);
@@ -33,11 +27,5 @@ export class TreeConstruction extends DOMOperations implements GlimmerTreeConstr
3327
}
3428
}
3529

36-
let appliedTreeConstruction = TreeConstruction;
37-
appliedTreeConstruction = applyTextNodeMergingFix(
38-
doc,
39-
appliedTreeConstruction
40-
) as typeof TreeConstruction;
41-
42-
export const DOMTreeConstruction = appliedTreeConstruction;
30+
export const DOMTreeConstruction = TreeConstruction;
4331
export type DOMTreeConstruction = TreeConstruction;

packages/@glimmer/runtime/lib/dom/helper.ts

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ import type {
55
SimpleElement,
66
SimpleNode,
77
} from '@glimmer/interfaces';
8-
import { castToSimple } from '@glimmer/debug-util';
98

10-
import { applyTextNodeMergingFix } from '../compat/text-node-merging-fix';
119
import { BLACKLIST_TABLE, DOMOperations } from './operations';
1210

1311
[
@@ -60,9 +58,6 @@ import { BLACKLIST_TABLE, DOMOperations } from './operations';
6058
const WHITESPACE =
6159
/[\t\n\v\f\r \xa0\u{1680}\u{180e}\u{2000}-\u{200a}\u{2028}\u{2029}\u{202f}\u{205f}\u{3000}\u{feff}]/u;
6260

63-
const doc: Nullable<SimpleDocument> =
64-
typeof document === 'undefined' ? null : castToSimple(document);
65-
6661
export function isWhitespace(string: string) {
6762
return WHITESPACE.test(string);
6863
}
@@ -88,9 +83,5 @@ export class DOMChangesImpl extends DOMOperations implements GlimmerTreeChanges
8883
}
8984
}
9085

91-
let helper = DOMChangesImpl;
92-
93-
helper = applyTextNodeMergingFix(doc, helper) as typeof DOMChangesImpl;
94-
95-
export const DOMChanges = helper;
86+
export const DOMChanges = DOMChangesImpl;
9687
export { DOMTreeConstruction } from './api';

packages/@glimmer/runtime/lib/dom/operations.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,6 @@ export class DOMOperations {
9797
} else {
9898
// Non-element nodes do not support insertAdjacentHTML, so add an
9999
// element and call it on that element. Then remove the element.
100-
//
101-
// This also protects Edge, IE and Firefox w/o the inspector open
102-
// from merging adjacent text nodes. See ./compat/text-node-merging-fix.ts
103100
const { uselessElement } = this;
104101

105102
parent.insertBefore(uselessElement, nextSibling);

0 commit comments

Comments
 (0)