Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit c4629f3

Browse files
committedMar 4, 2025
Cont remove multiElement
1 parent 75aeff4 commit c4629f3

File tree

1 file changed

+2
-91
lines changed

1 file changed

+2
-91
lines changed
 

‎src/core/compile/compile.js

Lines changed: 2 additions & 91 deletions
Original file line numberDiff line numberDiff line change
@@ -983,12 +983,6 @@ export function CompileProvider($provide, $$sanitizeUriProvider) {
983983
j < jj;
984984
j++
985985
) {
986-
/** @type {string|boolean} */
987-
let attrStartName = false;
988-
989-
/** @type {string|boolean} */
990-
let attrEndName = false;
991-
992986
let isNgAttr = false;
993987
let isNgProp = false;
994988
let isNgEvent = false;
@@ -1055,8 +1049,6 @@ export function CompileProvider($provide, $$sanitizeUriProvider) {
10551049
"A",
10561050
maxPriority,
10571051
ignoreDirective,
1058-
attrStartName,
1059-
attrEndName,
10601052
);
10611053
}
10621054
}
@@ -1082,62 +1074,6 @@ export function CompileProvider($provide, $$sanitizeUriProvider) {
10821074
return directives;
10831075
}
10841076

1085-
/**
1086-
* Given a node with a directive-start it collects all of the siblings until it finds
1087-
* directive-end.
1088-
* @param {Element} node
1089-
* @param {string} attrStart
1090-
* @param {string} attrEnd
1091-
* @returns {*}
1092-
*/
1093-
function groupScan(node, attrStart, attrEnd) {
1094-
const nodes = [];
1095-
let depth = 0;
1096-
if (attrStart && node.hasAttribute && node.hasAttribute(attrStart)) {
1097-
do {
1098-
if (!node) {
1099-
throw $compileMinErr(
1100-
"uterdir",
1101-
"Unterminated attribute, found '{0}' but no matching '{1}' found.",
1102-
attrStart,
1103-
attrEnd,
1104-
);
1105-
}
1106-
if (node.nodeType === Node.ELEMENT_NODE) {
1107-
if (node.hasAttribute(attrStart)) depth++;
1108-
if (node.hasAttribute(attrEnd)) depth--;
1109-
}
1110-
nodes.push(node);
1111-
node = /** @type {Element} */ (node.nextSibling);
1112-
} while (depth > 0);
1113-
} else {
1114-
nodes.push(node);
1115-
}
1116-
1117-
return JQLite(nodes);
1118-
}
1119-
1120-
/**
1121-
* Wrapper for linking function which converts normal linking function into a grouped
1122-
* linking function.
1123-
* @param linkFn
1124-
* @param attrStart
1125-
* @param attrEnd
1126-
* @returns {Function}
1127-
*/
1128-
function groupElementsLinkFnWrapper(linkFn, attrStart, attrEnd) {
1129-
return function groupedElementsLink(
1130-
scope,
1131-
element,
1132-
attrs,
1133-
controllers,
1134-
transcludeFn,
1135-
) {
1136-
element = groupScan(element[0], attrStart, attrEnd);
1137-
return linkFn(scope, element, attrs, controllers, transcludeFn);
1138-
};
1139-
}
1140-
11411077
/**
11421078
* A function generator that is used to support both eager and lazy compilation
11431079
* linking function.
@@ -1529,17 +1465,6 @@ export function CompileProvider($provide, $$sanitizeUriProvider) {
15291465
// executes all directives on the current element
15301466
for (let i = 0, ii = directives.length; i < ii; i++) {
15311467
directive = directives[i];
1532-
const attrStart = directive.$$start;
1533-
const attrEnd = directive.$$end;
1534-
1535-
// collect multiblock sections
1536-
if (attrStart) {
1537-
$compileNode = groupScan(
1538-
/** @type {Element} */ (compileNode),
1539-
attrStart,
1540-
attrEnd,
1541-
);
1542-
}
15431468
$template = undefined;
15441469

15451470
if (terminalPriority > directive.priority) {
@@ -1887,13 +1812,11 @@ export function CompileProvider($provide, $$sanitizeUriProvider) {
18871812
);
18881813
const context = directive.$$originalDirective || directive;
18891814
if (isFunction(linkFn)) {
1890-
addLinkFns(null, bind(context, linkFn), attrStart, attrEnd);
1815+
addLinkFns(null, bind(context, linkFn));
18911816
} else if (linkFn) {
18921817
addLinkFns(
18931818
bind(context, linkFn.pre),
18941819
bind(context, linkFn.post),
1895-
attrStart,
1896-
attrEnd,
18971820
);
18981821
}
18991822
} catch (e) {
@@ -1921,10 +1844,8 @@ export function CompileProvider($provide, $$sanitizeUriProvider) {
19211844

19221845
/// /////////////////
19231846

1924-
function addLinkFns(pre, post, attrStart, attrEnd) {
1847+
function addLinkFns(pre, post) {
19251848
if (pre) {
1926-
if (attrStart)
1927-
pre = groupElementsLinkFnWrapper(pre, attrStart, attrEnd);
19281849
pre.require = directive.require;
19291850
pre.directiveName = directiveName;
19301851
if (
@@ -1936,8 +1857,6 @@ export function CompileProvider($provide, $$sanitizeUriProvider) {
19361857
preLinkFns.push(pre);
19371858
}
19381859
if (post) {
1939-
if (attrStart)
1940-
post = groupElementsLinkFnWrapper(post, attrStart, attrEnd);
19411860
post.require = directive.require;
19421861
post.directiveName = directiveName;
19431862
if (
@@ -2106,8 +2025,6 @@ export function CompileProvider($provide, $$sanitizeUriProvider) {
21062025
location,
21072026
maxPriority,
21082027
ignoreDirective,
2109-
startAttrName,
2110-
endAttrName,
21112028
) {
21122029
if (name === ignoreDirective) return false;
21132030
let match = false;
@@ -2125,12 +2042,6 @@ export function CompileProvider($provide, $$sanitizeUriProvider) {
21252042
(isUndefined(maxPriority) || maxPriority > directive.priority) &&
21262043
directive.restrict.indexOf(location) !== -1
21272044
) {
2128-
if (startAttrName) {
2129-
directive = inherit(directive, {
2130-
$$start: startAttrName,
2131-
$$end: endAttrName,
2132-
});
2133-
}
21342045
if (!directive.$$bindings) {
21352046
const bindings = (directive.$$bindings = parseDirectiveBindings(
21362047
directive,

0 commit comments

Comments
 (0)
Please sign in to comment.