From 78e1e32019617d957eb8c4133aafd84bc63fa60d Mon Sep 17 00:00:00 2001 From: Marko Lahma Date: Sun, 26 Jul 2026 20:53:06 +0300 Subject: [PATCH] Do not abandon a type's remaining properties after a method-like one `SetNormalProperties` walks the declared properties of a type and registers each of them on the prototype. A property carrying `[DomAccessor(Accessors.Method)]` is registered as a method instead - and then the loop `return`s, so every property declared after it on the same type is silently never registered. The intent was clearly "this property is done, move on"; use `continue`. Whether anything is lost today depends on the order `DeclaredProperties` happens to return members in, which is not specified. With the current AngleSharp DOM the only affected type is `INode` (`hasChildNodes` is followed by one property with no `[DomName]`), so this is a latent defect rather than an observable one - but `INode` is in the type tree of every node prototype, and the next attributed property added after a method-like one would silently disappear from the DOM. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_0179sA2T7HuRfRfSc2JirFik --- src/AngleSharp.Js/Proxies/DomPrototypeInstance.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/AngleSharp.Js/Proxies/DomPrototypeInstance.cs b/src/AngleSharp.Js/Proxies/DomPrototypeInstance.cs index df226b9..55ef966 100644 --- a/src/AngleSharp.Js/Proxies/DomPrototypeInstance.cs +++ b/src/AngleSharp.Js/Proxies/DomPrototypeInstance.cs @@ -169,8 +169,8 @@ private void SetNormalProperties(IEnumerable properties) SetMethod(name, property.GetMethod); } - // methods were set, so finish processing - return; + // methods were set, so continue with the next property + continue; } if (accessor == Accessors.Getter || accessor == Accessors.Setter || Array.Exists(names, m => m.Is("item")))