Move various reflector types and traits to script_bindings (#35279)

* script: Move Reflector to script_bindings.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Extract global() helper from DomObject into new trait. Move DomObject and related traits to script_bindings.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
Josh Matthews 2025-02-04 01:58:08 -05:00 committed by GitHub
parent 0d51578cc3
commit c94ac5bccb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
212 changed files with 357 additions and 319 deletions

View file

@ -14,7 +14,7 @@ use super::bindings::codegen::Bindings::FunctionBinding::Function;
use super::bindings::codegen::Bindings::QueuingStrategyBinding::{
ByteLengthQueuingStrategyMethods, QueuingStrategyInit,
};
use super::bindings::import::module::{DomObject, DomRoot, Fallible, Reflector};
use super::bindings::import::module::{DomGlobal, DomRoot, Fallible, Reflector};
use super::bindings::reflector::reflect_dom_object_with_proto;
use super::types::GlobalScope;
use crate::dom::bindings::import::module::get_dictionary_property;
@ -62,7 +62,7 @@ impl ByteLengthQueuingStrategyMethods<crate::DomTypeHolder> for ByteLengthQueuin
/// <https://streams.spec.whatwg.org/#blqs-size>
fn GetSize(&self) -> Fallible<Rc<Function>> {
let global = self.reflector_.global();
let global = self.global();
// Return this's relevant global object's byte length queuing strategy
// size function.
if let Some(fun) = global.get_byte_length_queuing_strategy_size() {