(fromElement, toElement)
| 2944 | return false; |
| 2945 | } |
| 2946 | function overlayAttributes(fromElement, toElement) { |
| 2947 | const explicitlyAllowed = toElement.hasAttribute("data-l10n-attrs") ? toElement.getAttribute("data-l10n-attrs").split(",").map(i => i.trim()) : null; |
| 2948 | for (const attr of Array.from(toElement.attributes)) { |
| 2949 | if (isAttrNameLocalizable(attr.name, toElement, explicitlyAllowed) && !hasAttribute(fromElement.attributes, attr.name)) { |
| 2950 | toElement.removeAttribute(attr.name); |
| 2951 | } |
| 2952 | } |
| 2953 | if (!fromElement.attributes) { |
| 2954 | return; |
| 2955 | } |
| 2956 | for (const attr of Array.from(fromElement.attributes)) { |
| 2957 | if (isAttrNameLocalizable(attr.name, toElement, explicitlyAllowed) && toElement.getAttribute(attr.name) !== attr.value) { |
| 2958 | toElement.setAttribute(attr.name, attr.value); |
| 2959 | } |
| 2960 | } |
| 2961 | } |
| 2962 | function getNodeForNamedElement(sourceElement, translatedChild) { |
| 2963 | const childName = translatedChild.getAttribute("data-l10n-name"); |
| 2964 | const sourceChild = sourceElement.querySelector(`[data-l10n-name="${childName}"]`); |
no test coverage detected