(table, input, start, end)
| 4551 | * @returns {string} lowercased name |
| 4552 | */ |
| 4553 | const internLowerName = (table, input, start, end) => { |
| 4554 | let h = end - start; |
| 4555 | for (let i = start; i < end; i++) { |
| 4556 | let c = input.charCodeAt(i); |
| 4557 | if (c >= 0x41 && c <= 0x5a) c += 0x20; |
| 4558 | h = ((h << 5) - h + c) | 0; |
| 4559 | } |
| 4560 | const hit = table.get(h); |
| 4561 | if (hit !== undefined) { |
| 4562 | if (typeof hit === "string") { |
| 4563 | if (rangeEqualsLower(input, start, end, hit)) return hit; |
| 4564 | } else { |
| 4565 | for (let i = 0; i < hit.length; i++) { |
| 4566 | if (rangeEqualsLower(input, start, end, hit[i])) return hit[i]; |
| 4567 | } |
| 4568 | } |
| 4569 | } |
| 4570 | // Unknown name (custom element, data-* attribute, non-ASCII, …). |
| 4571 | return input.slice(start, end).toLowerCase(); |
| 4572 | }; |
| 4573 | |
| 4574 | // Every tag name the tree builder compares against (the sets above already |
| 4575 | // cover most of the spec), plus the remaining standard/foreign names so |
no test coverage detected