script: Pass &mut JSContext to Location (#43481)

Part of #42638

Testing: It compiles

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
This commit is contained in:
Tim van der Lippe
2026-03-20 13:54:38 +01:00
committed by GitHub
parent ffae45327c
commit dc9e442b17
9 changed files with 151 additions and 164 deletions

View File

@@ -3,6 +3,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use dom_struct::dom_struct;
use js::context::JSContext;
use script_bindings::codegen::GenericBindings::DocumentBinding::DocumentMethods;
use script_bindings::codegen::GenericBindings::HTMLDocumentBinding::HTMLDocumentMethods;
use script_bindings::root::DomRoot;
@@ -20,8 +21,8 @@ pub(crate) struct HTMLDocument {
impl HTMLDocumentMethods<crate::DomTypeHolder> for HTMLDocument {
/// <https://html.spec.whatwg.org/multipage/#dom-document-location>
fn GetLocation(&self) -> Option<DomRoot<Location>> {
self.document.GetLocation()
fn GetLocation(&self, cx: &mut JSContext) -> Option<DomRoot<Location>> {
self.document.GetLocation(cx)
}
/// <https://html.spec.whatwg.org/multipage/#dom-tree-accessors:supported-property-names>