8 Commits

Author SHA1 Message Date
Jaime Burgos 6f9a6bea50 fix(platform-browser): disallow event handler attributes in Meta
Prevent arbitrary MetaDefinition properties from writing on* handlers directly to meta elements. Browser events can execute these handlers, including on meta elements rendered in the document body.
2026-08-17 14:59:50 -07:00
arturovt 1cb3d606bf fix(platform-browser): throw a descriptive error when insertBefore reference node is missing
Angular's internal LView/TNode bookkeeping can get out of sync with the
real DOM: manual DOM manipulation, a browser extension, or an edge case in
Angular's own view-insertion/reordering code can all leave Angular believing
a node is still attached at a given position when it isn't. The next time
Angular's renderer calls `insertBefore` relative to that stale reference
node, the native DOM API throws an opaque `NotFoundError` with no indication
of which node or component was involved, making these errors effectively
undebuggable in production:

    NotFoundError: Failed to execute 'insertBefore' on 'Node': The node
    before which the new node is to be inserted is not a child of this node.
        at Node.insertBefore (native)
        at DefaultDomRenderer2.insertBefore (packages/platform-browser/src/dom/dom_renderer.ts)
        at nativeInsertBefore (packages/core/src/render3/dom_node_manipulation.ts)
        at nativeAppendOrInsertBefore (packages/core/src/render3/dom_node_manipulation.ts)
        ... (called while Angular inserts or moves a view during change detection)

Check the reference node's actual parent against the expected parent before
calling the native `insertBefore`, and throw a descriptive `RuntimeError`
(NG05106) instead, following the same pattern already used for hydration
node mismatches.
2026-08-14 08:29:59 -07:00
arturovt 806a3ada26 docs: add NG05200 error reference page for SANITIZATION_UNSAFE_SCRIPT
Adds a reference page for `NG05200`, thrown by `DomSanitizer` when a value is bound to a `<script>` element without being marked trusted via `bypassSecurityTrustScript`. Covers why Angular rejects script content outright, how to reproduce the error, the escape hatch, and the XSS caveat.
2026-07-07 09:09:49 -07:00
arturovt ea177257e9 docs: add error guide for NG05102
Adds an error reference page for NG05102 (UNSUPPORTED_EVENT_TARGET) explaining
what triggers it and how to fix it. Also marks the error code as negative (-5102)
so that in dev mode the error message automatically links to the new guide page
on angular.dev/errors, consistent with other documented runtime errors.
2026-06-24 10:58:27 -04:00
arturovt dead64fbdb docs: add error guide for NG05101
Adds a new error reference page for NG05101 (NO_PLUGIN_FOR_EVENT),
which is thrown when no registered EventManagerPlugin supports the
event name passed to addEventListener. The page covers the two common
causes: a typo in the event binding and a missing plugin provider.
2026-06-23 11:25:48 -04:00
Joey Perrott 23d58777b4 build: migrate to new toolchain usage for api goldens (#62688)
Migrate api golden usage to be based on rules_js toolchain implementation

PR Close #62688
2025-07-17 18:13:42 -04:00
SkyZeroZx 44a203916a refactor(platform-browser): use RuntimeError for hydration feature conflicts (#62414)
Replace generic Error with RuntimeError

PR Close #62414
2025-07-03 08:08:07 +00:00
Kristiyan Kostadinov fb351300c3 build: update to latest dev infra code (#56128)
Updates the repo to the latest dev infra code which involves updating a patch and renaming all the golden files to end with `.api.md`.

PR Close #56128
2024-05-28 14:42:31 +02:00