Commit ab9154a
fix(compiler): normalize tag names with custom namespaces in DomElementSchemaRegistry (#68868)
Custom XML/XHTML namespaced elements (e.g., <xhtml:a>) fall back to the standard HTML namespace during element creation at compile-time/runtime. However, their property and security context lookups inside the schema registry were incorrectly performed using the full namespaced tag name (e.g., :xhtml:a), which bypassed the default a|href sanitization registry and incorrectly returned SecurityContext.NONE instead of SecurityContext.URL.
This commit introduces tag name normalization inside DomElementSchemaRegistry for custom namespaces (other than the built-in svg and math namespaces). Custom namespaced tag names are now normalized to their simple HTML element counterparts for all registry queries, ensuring that correct property schema validation and dynamic security sanitization rules (such as URL sanitization) are enforced at runtime.
PR Close #688681 parent 6ff620a commit ab9154a
3 files changed
Lines changed: 85 additions & 13 deletions
File tree
- packages
- compiler
- src/schema
- test/schema
- core/test/linker
Lines changed: 34 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
20 | 39 | | |
21 | 40 | | |
22 | 41 | | |
| |||
388 | 407 | | |
389 | 408 | | |
390 | 409 | | |
391 | | - | |
392 | | - | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
393 | 413 | | |
394 | 414 | | |
395 | 415 | | |
| |||
400 | 420 | | |
401 | 421 | | |
402 | 422 | | |
403 | | - | |
404 | | - | |
| 423 | + | |
405 | 424 | | |
406 | 425 | | |
407 | 426 | | |
| |||
410 | 429 | | |
411 | 430 | | |
412 | 431 | | |
413 | | - | |
414 | | - | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
415 | 435 | | |
416 | 436 | | |
417 | 437 | | |
| |||
421 | 441 | | |
422 | 442 | | |
423 | 443 | | |
424 | | - | |
| 444 | + | |
425 | 445 | | |
426 | 446 | | |
427 | 447 | | |
| |||
444 | 464 | | |
445 | 465 | | |
446 | 466 | | |
447 | | - | |
| 467 | + | |
448 | 468 | | |
449 | 469 | | |
450 | 470 | | |
451 | 471 | | |
452 | | - | |
| 472 | + | |
453 | 473 | | |
454 | 474 | | |
455 | 475 | | |
| |||
493 | 513 | | |
494 | 514 | | |
495 | 515 | | |
496 | | - | |
497 | | - | |
| 516 | + | |
| 517 | + | |
498 | 518 | | |
499 | 519 | | |
500 | 520 | | |
501 | 521 | | |
502 | 522 | | |
503 | | - | |
| 523 | + | |
| 524 | + | |
504 | 525 | | |
505 | 526 | | |
506 | 527 | | |
| |||
Lines changed: 23 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
207 | 230 | | |
208 | 231 | | |
209 | 232 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
212 | 228 | | |
213 | 229 | | |
214 | 230 | | |
| |||
348 | 364 | | |
349 | 365 | | |
350 | 366 | | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
351 | 379 | | |
352 | 380 | | |
353 | 381 | | |
| |||
0 commit comments