From 26d2d0f7d8abb0f77a8a7b3da6f59bc8f9638bba Mon Sep 17 00:00:00 2001 From: Leo Ring <59373587+leo030303@users.noreply.github.com> Date: Mon, 4 Aug 2025 12:41:53 +0100 Subject: [PATCH] Add can_gc to HTMLDocument NamedGetter (#38455) Just fixing something missed on my last PR https://github.com/servo/servo/pull/38433#discussion_r2250744925 Signed-off-by: Leo Ring --- components/script/dom/htmldocument.rs | 4 ++-- components/script_bindings/codegen/Bindings.conf | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/components/script/dom/htmldocument.rs b/components/script/dom/htmldocument.rs index 91f112d19c3..0aa1813b61b 100644 --- a/components/script/dom/htmldocument.rs +++ b/components/script/dom/htmldocument.rs @@ -30,7 +30,7 @@ impl HTMLDocumentMethods for HTMLDocument { } /// - fn NamedGetter(&self, name: DOMString) -> Option { - self.document.NamedGetter(name, CanGc::note()) + fn NamedGetter(&self, name: DOMString, can_gc: CanGc) -> Option { + self.document.NamedGetter(name, can_gc) } } diff --git a/components/script_bindings/codegen/Bindings.conf b/components/script_bindings/codegen/Bindings.conf index e356cb52b53..fcaed3eb84d 100644 --- a/components/script_bindings/codegen/Bindings.conf +++ b/components/script_bindings/codegen/Bindings.conf @@ -361,6 +361,10 @@ DOMInterfaces = { 'canGc': ['Close', 'Show'], }, +'HTMLDocument': { + 'canGc': ['NamedGetter'], +}, + 'HTMLElement': { 'canGc': ['AttachInternals', 'Focus', 'Blur', 'Click', 'SetInnerText', 'SetOuterText', "SetTranslate", 'SetAutofocus', 'GetOffsetParent', 'OffsetTop', 'OffsetLeft', 'OffsetWidth', 'OffsetHeight', 'InnerText', 'GetOuterText', 'GetOnerror', 'GetOnload', 'GetOnblur', 'GetOnfocus', 'GetOnresize', 'GetOnscroll', 'Style', 'Dataset'], },